4 # include <mln/core/image2d.hh>
5 # include <mln/value/rgb8.hh>
9 using mln::value::rgb8
;
11 /// Load a color image from \a path.
12 image2d
<rgb8
> load (const char* path
);
13 /// Save a gray-level stretched image \a img to \a path.
14 void save (const image2d
<float>& img
, const char* path
);
16 /// Compute the energy in \a img using the norm of the gradient.
17 image2d
<float> get_nrg (const image2d
<rgb8
>& img
);
18 /// Compute the entropy in \a img using a 9x9 window.
19 image2d
<float> get_entropy (const image2d
<rgb8
>& img
);
21 /** Find a vertical seam in the image. The process only relies on the
22 * energy in the image.
23 * \param nrg The energy in the image.
24 * \return A vector with the points in the seam. Let \c c be the \c r th
25 * value in the vector. This means that the seam passes by the point
26 * (r, c) in the image.
29 find_vertical_seam (const image2d
<float> nrg
);
31 /** Carve a seam out of an image.
32 * \param img Image to modify.
33 * \param path Path of the seam to carve.
34 * \return \a img with the seam \a path carved out.
38 carve_vertical_seam (const image2d
<T
> img
, const std::vector
<unsigned>& path
);
41 uncarve_vertical_seam (const image2d
<rgb8
> img
, const std::vector
<unsigned>& path
);