4 #include <boost/foreach.hpp>
6 #include <mln/io/ppm/save.hh>
7 #include <mln/literal/colors.hh>
12 using namespace mln::value
;
15 carve_vertical_seam (const image2d
<float> img
);
17 int main (int argc
, char** argv
)
21 std::cerr
<< "usage: " << *argv
<< " in.ppm out.ppm\n";
25 image2d
<rgb8
> img
= load (argv
[1]);
26 image2d
<float> nrg
= get_nrg (img
);
27 std::vector
<unsigned> seam_path
= carve_vertical_seam (nrg
);
29 BOOST_FOREACH (unsigned col
, seam_path
)
31 img
.at (row
, col
) = literal::red
;
34 io::ppm::save (img
, argv
[2]);