$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doc/examples/tuto3/colorize.cc
1 #include <mln/core/image/image2d.hh>
2 #include <mln/make/image2d.hh>
3 #include <mln/value/int_u8.hh>
4 #include <mln/labeling/colorize.hh>
5 #include <doc/tools/sample_utils.hh>
6 
7 int main()
8 {
9  using namespace mln;
10  using namespace mln::value;
11 
12  // \{
13  int_u8 vals[25] = { 100, 100, 200, 200, 230,
14  100, 100, 200, 230, 230,
15  140, 140, 140, 0, 0,
16  65, 186, 65, 127, 127,
17  65, 65, 65, 127, 127 };
18 
19  image2d<int_u8> ima = make::image2d(vals);
20  image2d<rgb8> ima_color = labeling::colorize(rgb8(), ima, 230);
21  // \}
22 
23  doc::pgmsave(ima, "tuto3_colorize");
24  doc::ppmsave(ima_color, "tuto3_colorize");
25 }