This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch green-regional-maxima has been updated
discards 9ea8474bbe3fbdcfdeba74a7cf2ea602687768ab (commit)
discards 861abf27dc8e90c590b515c5cf0f05111a696220 (commit)
discards 57573abae5803df09f5af2c5fcb15ad4d5a7a397 (commit)
discards 0a1cbd3506e4153a104682280e0bb12d5042613c (commit)
discards 7bc32d5ed6f18ffd43b8512b5a7de4cc26a358ff (commit)
discards a502be9d78730bac9e286324386f0ae4b5f11b88 (commit)
discards ddb6f8cfa75d114ac584c5eabbee8c722fda54d8 (commit)
discards 72bad6e9e8187ee9870f40286db8d4fe4e453425 (commit)
discards 20909f49c35d22b79de8df44915aacca06e71ae0 (commit)
discards 49aaec032034188ccf7694494cddb425bcc352d2 (commit)
discards 110656234b315d15df8617333019265340089d34 (commit)
discards c920529afe338d1120cbc9043394f827a328c368 (commit)
discards 36d40e5b46524d05cfe9d6b8d328cbae09c7e779 (commit)
discards 8c049974295cee70d9d2f235c069f9ed01df30ca (commit)
discards b70dff23b7d1974e60b22b3cb7a196acc3d84946 (commit)
discards 1086f4ed0bec9037a9cff4176b18e49d218bfa6e (commit)
discards d3e640b6eba0ee6d8c52ae1e433ebe7c0be3b15e (commit)
discards 9028f28f51a0a9133e5006917253d386df93ef66 (commit)
discards 34f317bf7800516d03ba9d5cea0f224cca3b9668 (commit)
discards f628029dbf93d9ac7490ea499a64b9794a8168a3 (commit)
discards 8959d2ae95c16fbb28b2a4e98788bdb6463add0f (commit)
discards fe69f742dba2a232cb2f49807ba2879e2325c3b2 (commit)
discards fc278a9509a401b2f9275fa6f39092e77315acd0 (commit)
discards 7af9ecdc4c1b1ed33122c4146f05c55d33e4c5c0 (commit)
discards c6ff97e1bc8ef0e059e1228a3004690f13e2bd56 (commit)
discards d0783cebdffb4c8d8fbcf934bae458684639e325 (commit)
discards 047c90824ecef770ebe8553606bcd2f265c2fa9e (commit)
discards 45cefb4a2e0dd60490e558ca9d04ecac98b2a615 (commit)
discards b5caa8de0eeed69a23d459663fa6dbe0a45980b1 (commit)
discards 7abe6d3e6ecd5341f8b613c072213f454398086c (commit)
discards f2adc9125d01a421487347e72d387488c50fcfce (commit)
discards 988bdbbdf6fe96847ebd00dcced6f8cd4e5682bc (commit)
discards 4e56a00784e19e8e7a2a984aab4f809ec6aee220 (commit)
discards 03c3d97828462c3a070ebb51acc56cded2809b29 (commit)
discards 0c4e1cb4947d09f720a2134c0f8a8702e2bfcd49 (commit)
discards c121636371613a2edb38cb1073e9992833ac5009 (commit)
discards 9e772c65245f643261142cdb7987ed346bfc1a46 (commit)
discards fd0947d2453d62e92681d4a1f0026b42fd5c8024 (commit)
discards 2c3f552813a8b6a51692e8ef4c40a4f8dba933bf (commit)
discards 8c92a3be8ae8f2738b584580b4e39031d6243bcf (commit)
discards 4ee2f2a9467f7ed2ca24c68ac5ef35e12f4faf86 (commit)
via 67b295ee221ad90e1abc475854375a7bc06d7954 (commit)
via 2cfa144eb3d4bb1b1f12655c2e4708771138d23b (commit)
via c670b7e781b64e3e8b4d0b17b5d6fef31d6a8bc6 (commit)
via 49b8dc22e8f9664f7f385496080c06ab80096171 (commit)
via d4f2e4917b95cb92762f0fc82498050789ead89c (commit)
via e9328a0605c308aea46d70abbb73402593b9eb65 (commit)
via 485f8dec942fd56ba950c33c539f7803dfa281d0 (commit)
via 1d23bfaf3e648f96ca2321da52bfc4e7b6f8420c (commit)
via 2c26e604d0e939535f7dff1bfdf0925825b9f307 (commit)
via 174b91703414bb8df7c9fb0922c51aef32c38cb2 (commit)
via ba99cc211570e5854fc6b910a3a634f6d15f1f86 (commit)
via acb2f3dbabfa00da20a7e8e1160fbbd051a1b652 (commit)
via a85f46a9568f5085ca32662e59a545675b70905c (commit)
via a2d33697a1ffc22679540af9cdf899bebf0e5167 (commit)
via 18d1a4203f6577a0602e4c4578dbae57a11a0f02 (commit)
via 3849ff557b11d1542cc38263fae5ea5163899678 (commit)
via 1dff8cf61b25a32a64186ea346ceb14c97f3f63a (commit)
via 40063b84e2132755bb7982fb86f6cd8527399ebd (commit)
via fdf0f76c54e847f00553092d355f752d10a1b835 (commit)
via a3cbabff4529a013fa40dddebbfc63d2eb3667aa (commit)
via 88906972b5285dbd4bff41f6645d09fb182aed1b (commit)
via 444245a639e02fd0ebdfb083c8c551b459a56fb1 (commit)
via 16fbbef7db27689c3728436e7035a5a6549826de (commit)
via 1835af00071ea4e14e1641cb87d118d3ba511f4b (commit)
via 0625137ef6694e51353ea04db9cb62365188c67c (commit)
via c325629baf82f376924de68f8d43133e77c934c1 (commit)
via 1a823f73b8f232149a0e953624d895a29f706a2d (commit)
via 58801223f73cb532e43fac2ca8065a43c8fa6985 (commit)
via 607075682b6992513805c0f5cafd95ded370efab (commit)
via 60307833a3b3ff5e7b5da1e9b333a8404c0040f2 (commit)
via 31f0f731e35d208e89a812ebadddcfcf90ebc667 (commit)
via 6c0fa46bdaaf8619358568aabfcf8a20c6c21ee1 (commit)
via cadda529593468fcd00d0750fda70d4648d3badd (commit)
via 256de5f3eed935fc8229a3800be8cb71937b70ee (commit)
via 00ab9ddbdd78e06f7ebd01c57f5e6f490254fa2c (commit)
via 19825009a7bc9c638226dd2963f1a56679d31757 (commit)
via b6641d4b0fe6550d26d15b837ba65e7279f2298b (commit)
via b1afad461fa1621d1b6c98ae81bcbfc23248f6dd (commit)
via 7404579567f626734d6de94fb6cb62072d97553b (commit)
via 00da4238932f0410315ed16fb7be6869f4d0b381 (commit)
via 59ebeab82ed59260c238a59478a79c30c090584b (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (9ea8474bbe3fbdcfdeba74a7cf2ea602687768ab)
\
N -- N -- N (67b295ee221ad90e1abc475854375a7bc06d7954)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
67b295e Simple integration test.
2cfa144 Fix the way to convert unsigned to float.
c670b7e Add milena library components.
49b8dc2 Work on Millet value descriptor.
d4f2e49 Work on Millet saturation descriptor.
e9328a0 Work on Millet saturation descriptor.
485f8de Work on Millet hsv descriptors.
1d23bfa Work on histograms view as density.
2c26e60 Test error quantification as a color descriptor in our database.
174b917 Benchmark few descriptors.
ba99cc2 Test on image database the achromatism descriptor.
acb2f3d Turn around Millet 2008 hsv descriptors.
a85f46a Delete BUG image file in milena/img.
a2d3369 Save Theo's exhaustive demonstration results.
18d1a42 Fix bugs in the histogram visualization tools.
3849ff5 Fix last details in the image processing chain.
1dff8cf Extend the histogram visualization tools for new projection concept.
40063b8 Build translation table between number of pixels and percentage of
fdf0f76 Split the regional maxima binary in small atomic binaries.
a3cbabf Write the opening volume thresholds for the scribo image mp00082c.ppm.
8890697 Experiment various quantifications on regional maxima labeling.
444245a Experiment variation on regional maxima labeling.
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
Olena, a generic and efficient image processing platform
* green/mln/accu/stat/histo1d.hh: New header component.
* green/mln/fun/p2b/achromatic.hh: New header component.
* green/mln/fun/p2b/component_equals.hh: New header component.
* green/mln/fun/v2v/achromatism.hh: New header component.
* green/mln/fun/v2v/hue_concentration.hh: New header component.
* green/mln/fun/v2v/rgb_to_achromatism_map.hh: New header component.
* green/mln/fun/v2v/rgb_to_hsv.hh: New header component.
* green/mln/fun/v2v/rgb_to_hue_map.hh: New header component.
* green/mln/fun/v2v/rgb_to_saturation_map.hh: New header component.
* green/mln/fun/v2v/rgb_to_value_map.hh: New header component.
* green/mln/img_path.hh: New header component.
* green/mln/math/ceil.hh: New header component.
* green/mln/math/floor.hh: New header component.
* green/mln/math/hsv.hh: New header component.
---
milena/sandbox/ChangeLog | 32 ++-
milena/sandbox/green/mln/accu/stat/histo1d.hh | 66 ++--
milena/sandbox/green/mln/fun/p2b/achromatic.hh | 112 +++++
.../sandbox/green/mln/fun/p2b/component_equals.hh | 99 +++++
milena/sandbox/green/mln/fun/v2v/achromatism.hh | 64 +++
.../sandbox/green/mln/fun/v2v/hue_concentration.hh | 100 +++++
.../green/mln/fun/v2v/rgb_to_achromatism_map.hh | 77 ++++
milena/sandbox/green/mln/fun/v2v/rgb_to_hsv.hh | 149 +++++++
milena/sandbox/green/mln/fun/v2v/rgb_to_hue_map.hh | 96 +++++
.../green/mln/fun/v2v/rgb_to_saturation_map.hh | 83 ++++
.../sandbox/green/mln/fun/v2v/rgb_to_value_map.hh | 75 ++++
milena/sandbox/green/mln/img_path.hh | 227 +++++++++--
milena/sandbox/green/mln/math/ceil.hh | 64 +++
milena/sandbox/green/mln/math/floor.hh | 64 +++
milena/sandbox/green/mln/value/hsv.hh | 424 ++++++++++++++++++++
15 files changed, 1670 insertions(+), 62 deletions(-)
create mode 100644 milena/sandbox/green/mln/fun/p2b/achromatic.hh
create mode 100644 milena/sandbox/green/mln/fun/p2b/component_equals.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/achromatism.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/hue_concentration.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/rgb_to_achromatism_map.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/rgb_to_hsv.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/rgb_to_hue_map.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/rgb_to_saturation_map.hh
create mode 100644 milena/sandbox/green/mln/fun/v2v/rgb_to_value_map.hh
create mode 100644 milena/sandbox/green/mln/math/ceil.hh
create mode 100644 milena/sandbox/green/mln/math/floor.hh
create mode 100644 milena/sandbox/green/mln/value/hsv.hh
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index c41ef7c..62c6e21 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,6 +1,36 @@
2010-06-21 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
- Work on Millet saturation descriptor.
+ Add milena library components.
+
+ * green/mln/accu/stat/histo1d.hh: New header component.
+ * green/mln/fun/p2b/achromatic.hh: New header component.
+ * green/mln/fun/p2b/component_equals.hh: New header component.
+ * green/mln/fun/v2v/achromatism.hh: New header component.
+ * green/mln/fun/v2v/hue_concentration.hh: New header component.
+ * green/mln/fun/v2v/rgb_to_achromatism_map.hh: New header component.
+ * green/mln/fun/v2v/rgb_to_hsv.hh: New header component.
+ * green/mln/fun/v2v/rgb_to_hue_map.hh: New header component.
+ * green/mln/fun/v2v/rgb_to_saturation_map.hh: New header component.
+ * green/mln/fun/v2v/rgb_to_value_map.hh: New header component.
+ * green/mln/img_path.hh: New header component.
+ * green/mln/math/ceil.hh: New header component.
+ * green/mln/math/floor.hh: New header component.
+ * green/mln/math/hsv.hh: New header component.
+
+2010-06-21 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
+
+ Work on Millet value descriptor.
+
+ * green/exp/annotating/value: New directory.
+ * green/exp/annotating/value/Makefile.am: New Makefile.
+ * green/exp/annotating/value/value.cc: New source file.
+ * green/exp/annotating/value/text-color.txt: New image class.
+ * green/exp/annotating/value/text-img.txt: New image class.
+ * green/exp/annotating/value/text-only.txt: New image class.
+
+2010-06-21 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
+
+ Work on Millet hue descriptor.
* green/exp/annotating/hue: New directory.
* green/exp/annotating/hue/Makefile.am: New Makefile.
diff --git a/milena/sandbox/green/mln/accu/stat/histo1d.hh b/milena/sandbox/green/mln/accu/stat/histo1d.hh
index 807f3bd..57d6103 100644
--- a/milena/sandbox/green/mln/accu/stat/histo1d.hh
+++ b/milena/sandbox/green/mln/accu/stat/histo1d.hh
@@ -76,26 +76,26 @@
namespace mln
{
-
+
namespace accu
{
-
+
namespace stat
{
-
+
// Forward declaration
template <typename V>
struct histo1d;
} // end of namespace mln::accu::stat
-
+
namespace meta
{
-
+
namespace stat
{
-
+
struct histo1d : public Meta_Accumulator<histo1d>
{
template <typename V>
@@ -104,16 +104,16 @@ namespace mln
typedef accu::stat::histo1d<V> ret;
};
};
-
+
} // end of namespace mln::accu::meta::stat
-
+
} // end of namespace mln::accu::meta
-
+
} // end of namespace mln::accu
namespace trait
{
-
+
template <typename V>
struct accumulator_< mln::accu::stat::histo1d<V> >
{
@@ -124,34 +124,34 @@ namespace mln
};
template <typename V>
- struct set_precise_binary_<op::eq,
+ struct set_precise_binary_<op::eq,
accu::stat::histo1d<V>,
accu::stat::histo1d<V> >
{
typedef bool ret;
};
-
+
} // end of namespace mln::trait
namespace accu
{
-
+
namespace stat
- {
+ {
- /// \brief Define an histogram which returns an image1d .
+ /// \brief Define an histogram which returns an image1d .
///
/// Param V defines the space in which we count the values.
/// For instance, this histogram works with image2d<int_u8> or with
/// image1d<int_u<14> >. The histogram count the occurrence of each value.
/// The number of bins depends of the graylevel values, for 8 bits there
- /// is 256 bins, for 14 bits there is 16384 bins. Note that over
+ /// is 256 bins, for 14 bits there is 16384 bins. Note that over
/// quantification works too (up to 14 bits).
///
/// \ingroup modaccuvalues
template <typename V>
- struct histo1d :
+ struct histo1d :
public mln::accu::internal::base<image1d<unsigned>, histo1d<V> >
{
typedef V argument;
@@ -162,22 +162,22 @@ namespace mln
/// \{
/// \brief Initialize the size of the resulting image1d.
///
- /// Initialize the size the resulting image from the theorical dynamic
+ /// Initialize the size the resulting image from the theorical dynamic
/// of the graylevel values (Use V to manage it).
histo1d();
/// \}
-
+
/// Manipulators.
/// \{
/// \brief Initialize the histogram with zero value.
///
- /// This method must be called just before starting the use of the
- /// histogram. If it's not, resulting values won't converge to the
+ /// This method must be called just before starting the use of the
+ /// histogram. If it's not, resulting values won't converge to the
/// density.
void init();
-
+
/// \brief Update the histogram with the graylevel of the pixel t.
/// \param[in] t a graylevel pixel of type V.
///
@@ -189,7 +189,7 @@ namespace mln
/// \brief Update the histogram with an other histogram.
/// \param[in] other the other histogram.
///
- /// The end user shouldn't call this method. This is part of
+ /// The end user shouldn't call this method. This is part of
/// data compute interface mechanism.
void take(const histo1d<V>& other);
@@ -234,7 +234,7 @@ namespace mln
typedef mln_trait_value_comp(V,0) comp;
typedef point<grid::tick, V> v_point1d;
typedef box<v_point1d> v_box1d;
-
+
// comp keep a trace of the dimension of the theorical image.
// mln_min(comp) --> 0
// mln_max(comp) --> 2^(n-1) [127 for n=7][255 for n=8] ...
@@ -242,8 +242,8 @@ namespace mln
count_.init_(box1d(point1d(mln_min(comp)),
point1d(mln_max(comp))));
- // std::cout << "min : " << mln_min(comp) << std::endl;
- // std::cout << "max : " << mln_max(comp) << std::endl;
+// std::cout << "min : " << mln_min(comp) << std::endl;
+// std::cout << "max : " << mln_max(comp) << std::endl;
trace::exiting("mln::accu::stat::histo1d<V>::histo1d");
}
@@ -264,14 +264,14 @@ namespace mln
{
trace::entering("mln::accu::stat::histo1d<V>::take");
- // Just convert a graylevel value (int_u8 like) to a position for an
+ // Just convert a graylevel value (int_u8 like) to a position for an
// iterator on the resulting image.
++count_(point1d(t));
trace::exiting("mln::accu::stat::histo1d<V>::take");
}
-
+
template <typename V>
inline
void histo1d<V>::take(const histo1d<V>& other)
@@ -282,7 +282,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo1d<V>::take");
}
-
+
template <typename V>
inline
typename histo1d<V>::result histo1d<V>::to_result() const
@@ -292,7 +292,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo1d<V>::to_result");
return count_;
}
-
+
template <typename V>
inline
histo1d<V>::operator result() const
@@ -301,7 +301,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo1d<V>::operator result");
return count_;
- }
+ }
template <typename V>
inline
@@ -309,7 +309,7 @@ namespace mln
{
trace::entering("mln::accu::stat::histo1d<V>::is_valid");
bool result = count_.is_valid();
-
+
trace::exiting("mln::accu::stat::histo1d<V>::is_valid");
return result;
}
@@ -322,7 +322,7 @@ namespace mln
bool result = true;
const image1d<unsigned>& res1 = histo1.to_result();
const image1d<unsigned>& res2 = histo2.to_result();
-
+
mln_precondition(res1.is_valid());
mln_precondition(res2.is_valid());
diff --git a/milena/sandbox/green/mln/fun/p2b/achromatic.hh b/milena/sandbox/green/mln/fun/p2b/achromatic.hh
new file mode 100644
index 0000000..1f45b2d
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/p2b/achromatic.hh
@@ -0,0 +1,112 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_P2B_ACHROMATIC_HH
+# define MLN_FUN_P2B_ACHROMATIC_HH
+
+/// \file
+///
+/// In the vectorial image context (as RGB, HSL, HSV), compare one component
+/// to a specific value.
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/core/concept/function.hh>
+# include <mln/trait/value/comp.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace p2b
+ {
+ /// \brief Functor that compare the i-th component of a value.
+ // V is for the type of the value received
+ // i is the ith component to select
+ template <typename T_rgb>
+ struct achromatic : public Function_v2b< achromatic<T_rgb> >
+ {
+ typedef bool result;
+ bool operator()(const point2d& p) const;
+
+ achromatic(const image2d<T_rgb>& img, const float threshold);
+
+ const float threshold_;
+ const image2d<T_rgb>& img_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T_rgb>
+ achromatic<T_rgb>::achromatic(const image2d<T_rgb>& img,
+ const float threshold)
+ : threshold_(threshold), img_(img)
+ {
+ }
+
+ template <typename T_rgb>
+ bool achromatic<T_rgb>::operator()(const point2d& p) const
+ {
+ typedef typename T_rgb::red_t t_red;
+ typedef typename T_rgb::green_t t_green;
+ typedef typename T_rgb::blue_t t_blue;
+
+ const T_rgb rgb = img_(p);
+
+ // To obtain red between 0 and 1
+ const float max_red = mln_max(t_red);
+ const float min_red = mln_min(t_red);
+ const float red = (rgb.red() - min_red)/(max_red - min_red);
+
+ // To obtain green between 0 and 1
+ const float max_green = mln_max(t_green);
+ const float min_green = mln_min(t_green);
+ const float green = (rgb.green()-min_green)/(max_green-min_green);
+
+ // To obtain blue between 0 and 1
+ const float max_blue = mln_max(t_blue);
+ const float min_blue = mln_min(t_blue);
+ const float blue = (rgb.blue()-min_blue)/(max_blue-min_blue);
+
+ bool result = (threshold_ > math::abs(red - green) &&
+ threshold_ > math::abs(red - blue) &&
+ threshold_ > math::abs(green - blue));
+
+ return result;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::fun::p2b
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_P2B_ACHROMATIC_HH
diff --git a/milena/sandbox/green/mln/fun/p2b/component_equals.hh b/milena/sandbox/green/mln/fun/p2b/component_equals.hh
new file mode 100644
index 0000000..2a4c62c
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/p2b/component_equals.hh
@@ -0,0 +1,99 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_P2B_COMPONENT_EQUALS_HH
+# define MLN_FUN_P2B_COMPONENT_EQUALS_HH
+
+/// \file
+///
+/// In the vectorial image context (as RGB, HSL, HSV), compare one component
+/// to a specific value.
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/core/concept/function.hh>
+# include <mln/trait/value/comp.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace p2b
+ {
+
+ /// \brief Functor that compare the i-th component of a value.
+ // V is for the type of the value received
+ // i is the ith component to select
+ template <typename I, unsigned i>
+ struct component_equals : public Function_v2b< component_equals<I,i> >
+ {
+ typedef bool result;
+ bool operator()(const point2d& p) const;
+
+ component_equals(const I& img,
+ const mln_trait_value_comp(mln_value(I),i)& ref);
+
+ const mln_trait_value_comp(mln_value(I),i) _ref;
+ const I& _img;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I, unsigned i>
+ inline
+ component_equals<I,i>::
+ component_equals(const I& img,
+ const mln_trait_value_comp(mln_value(I),i)& ref)
+ : _ref(ref), _img(img)
+ {
+ }
+
+ template <typename I, unsigned i>
+ inline
+ bool
+ component_equals<I,i>::operator()(const point2d& p) const
+ {
+ typedef mln_value(I) t_value;
+ typedef mln_trait_value_comp(t_value,i) mln_value_comp;
+
+ t_value v = _img(p);
+ mln_value_comp c = trait::value::internal::comp<t_value,i>::on(v);
+
+ return (c == _ref);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::fun::p2b
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_P2B_COMPONENT_EQUALS_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/achromatism.hh b/milena/sandbox/green/mln/fun/v2v/achromatism.hh
new file mode 100644
index 0000000..72b545c
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/achromatism.hh
@@ -0,0 +1,64 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_ACHROMATISM_HH
+# define MLN_FUN_V2V_ACHROMATISM_HH
+
+# include <mln/value/rgb8.hh>
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ struct achromatism : public Function_v2v< achromatism >
+ {
+ typedef float result;
+
+ float operator()(const value::rgb8 rgb) const;
+ };
+
+# ifndef MLN_INCLUDE_ONLY
+
+ float achromatism::operator()(const value::rgb8 rgb) const
+ {
+ return (math::abs(rgb.red() - rgb.green())
+ + math::abs(rgb.red() - rgb.blue())
+ + math::abs(rgb.green() - rgb.blue()))/3.0;
+ }
+
+# endif // !MLN_INCLUDE_ONLY
+
+ } // end of namespace fun::v2v
+
+ } // end of namespace fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_ACHROMATISM_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/hue_concentration.hh b/milena/sandbox/green/mln/fun/v2v/hue_concentration.hh
new file mode 100644
index 0000000..84d26c8
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/hue_concentration.hh
@@ -0,0 +1,100 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_HUE_CONCENTRATION_HH
+# define MLN_FUN_V2V_HUE_CONCENTRATION_HH
+
+# include <mln/core/image/image1d.hh>
+# include <mln/math/abs.hh>
+# include <mln/opt/at.hh>
+# include <mln/value/hsv.hh>
+# include <mln/value/rgb8.hh>
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ unsigned peak_histo(const mln::image1d<unsigned>& hue_histo);
+
+ struct hue_concentration : public Function_v2v< hue_concentration >
+ {
+ typedef float result;
+
+ float operator()(const float hue) const;
+
+ hue_concentration(const mln::image1d<unsigned>& hue_histo)
+ {
+ peak = peak_histo(hue_histo);
+ }
+
+ unsigned peak;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ unsigned peak_histo(const mln::image1d<unsigned>& hue_histo)
+ {
+ mln_precondition(hue_histo.is_valid());
+
+ // Find the peak of the histogram
+ unsigned v_max = mln::opt::at(hue_histo, 0);
+ short p_max = 0;
+
+ mln_piter_(mln::image1d<unsigned>) p(hue_histo.domain());
+
+ for_all(p)
+ {
+ if (v_max < hue_histo(p))
+ {
+ v_max = hue_histo(p);
+ p_max = p.ind();
+ }
+ }
+
+ return p_max;
+ }
+
+
+ float hue_concentration::operator()(float hue) const
+ {
+ return mln::math::abs(peak - hue);
+ }
+
+# endif // !MLN_INCLUDE_ONLY
+
+ } // end of namespace fun::v2v
+
+ } // end of namespace fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_HUE_CONCENTRATION_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/rgb_to_achromatism_map.hh b/milena/sandbox/green/mln/fun/v2v/rgb_to_achromatism_map.hh
new file mode 100644
index 0000000..6de63ec
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/rgb_to_achromatism_map.hh
@@ -0,0 +1,77 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_RGB_TO_ACHROMATISM_MAP_HH
+# define MLN_FUN_V2V_RGB_TO_ACHROMATISM_MAP_HH
+
+# include <mln/math/abs.hh>
+# include <mln/math/max.hh>
+
+# include <mln/value/rgb.hh>
+
+
+/// \file
+///
+/// \brief Convert rgb value to achromatism map.
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ /// \brief Convert rgb value to achromatism map.
+ ///
+ /// \ingroup modfunv2v
+
+ template <unsigned n>
+ struct rgb_to_achromatism_map :
+ Function_v2v< rgb_to_achromatism_map<n> >
+ {
+ typedef value::rgb<n> argument;
+ typedef value::int_u<n> result;
+
+ result operator()(const argument& v) const
+ {
+ result max = math::max(math::max(v.red(),v.green()),v.blue());
+ result min = math::min(math::min(v.red(),v.green()),v.blue());
+ result ret = max - min;
+
+ return ret;
+ }
+ };
+
+ } // end of namespace mln::fun::v2v
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_RGB_TO_ACHROMATISM_MAP_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/rgb_to_hsv.hh b/milena/sandbox/green/mln/fun/v2v/rgb_to_hsv.hh
new file mode 100644
index 0000000..3dd8eb0
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/rgb_to_hsv.hh
@@ -0,0 +1,149 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_RGB_TO_HSV_HH
+# define MLN_FUN_V2V_RGB_TO_HSV_HH
+
+#include <mln/math/max.hh>
+#include <mln/math/min.hh>
+
+#include <mln/trait/promote.hh>
+
+#include <mln/value/hsv.hh>
+#include <mln/value/rgb.hh>
+
+namespace mln
+{
+
+ namespace value
+ {
+ template <typename H, typename S, typename V> class hsv_;
+ typedef hsv_<float, float, float> hsv_f;
+ typedef hsv_<double, double, double> hsv_d;
+ template <unsigned n> struct rgb;
+ }
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ template <typename T_hsv>
+ struct f_rgb_to_hsv_ : public Function_v2v< f_rgb_to_hsv_<T_hsv> >
+ {
+ typedef T_hsv result;
+
+
+ /// HSV implementation from millet.2008.phd.pdf p67
+ template <typename T_rgb>
+ T_hsv operator()(const T_rgb& rgb) const;
+
+ };
+
+ typedef f_rgb_to_hsv_<value::hsv_f> f_rgb_to_hsv_f_t;
+
+ extern f_rgb_to_hsv_f_t f_rgb_to_hsv_f;
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ /// Global variables.
+ /// \{
+ f_rgb_to_hsv_f_t f_rgb_to_hsv_f;
+ /// \}
+
+
+ template <typename T_hsv>
+ template <typename T_rgb>
+ inline
+ T_hsv
+ f_rgb_to_hsv_<T_hsv>::operator()(const T_rgb& rgb) const
+ {
+ typedef typename T_rgb::red_t t_red;
+ typedef typename T_rgb::green_t t_green;
+ typedef typename T_rgb::blue_t t_blue;
+ typedef typename T_hsv::h_type t_hue;
+ typedef typename T_hsv::s_type t_sat;
+ typedef typename T_hsv::v_type t_val;
+ typedef mln_trait_promote(t_hue, t_sat) t_max_hue_sat;
+ typedef mln_trait_promote(t_max_hue_sat, t_val) t_max_hsv;
+
+ // To obtain red between 0 and 1
+ const t_max_hsv max_red = mln_max(t_red);
+ const t_max_hsv min_red = mln_min(t_red);
+ const t_max_hsv red = (rgb.red() - min_red)/(max_red - min_red);
+
+ // To obtain green between 0 and 1
+ const t_max_hsv max_green = mln_max(t_green);
+ const t_max_hsv min_green = mln_min(t_green);
+ const t_max_hsv green =(rgb.green()-min_green)/(max_green-min_green);
+
+ // To obtain blue between 0 and 1
+ const t_max_hsv max_blue = mln_max(t_blue);
+ const t_max_hsv min_blue = mln_min(t_blue);
+ const t_max_hsv blue = (rgb.blue()-min_blue)/(max_blue-min_blue);
+
+ const t_max_hsv max = math::max(red, math::max(green, blue));
+ const t_max_hsv min = math::min(red, math::min(green, blue));
+ const t_max_hsv max_minus_min = max-min;
+ const t_max_hsv s = 0.03;
+
+ // Locals.
+ T_hsv hsv;
+
+ // SPECIFIC CASE WHEN PIXEL IS ACHROMATIC
+ if (s > math::abs(red - blue) &&
+ s > math::abs(blue - red) &&
+ s > math::abs(red - green))
+ {
+ hsv.val() = (red + green + blue)/3.0;
+ hsv.sat() = 0.0;
+ hsv.hue() = -1.0;
+ }
+ else
+ {
+ hsv.val() = max;
+ hsv.sat() = max_minus_min / max;
+ if (max == red)
+ hsv.hue() = 60 * ((green - blue) / max_minus_min);
+ else if (max == green)
+ hsv.hue() = 60 * (2 + (blue - red) / max_minus_min);
+ else // (max == blue)
+ hsv.hue() = 60 * (4 + (red - green) / max_minus_min);
+ }
+ return hsv;
+ }
+
+
+# endif // !MLN_INCLUDE_ONLY
+
+ } // end of namespace fun::v2v
+
+ } // end of namespace fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_RGB_TO_HSV_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/rgb_to_hue_map.hh b/milena/sandbox/green/mln/fun/v2v/rgb_to_hue_map.hh
new file mode 100644
index 0000000..8b228e0
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/rgb_to_hue_map.hh
@@ -0,0 +1,96 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_RGB_TO_HUE_MAP_HH
+# define MLN_FUN_V2V_RGB_TO_HUE_MAP_HH
+
+# include <mln/math/abs.hh>
+# include <mln/math/max.hh>
+
+# include <mln/value/rgb.hh>
+
+
+/// \file
+///
+/// \brief Convert rgb value to hue map.
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ /// \brief Convert rgb value to hue map.
+ ///
+ /// \ingroup modfunv2v
+
+ template <unsigned n>
+ struct rgb_to_hue_map :
+ Function_v2v< rgb_to_hue_map<n> >
+ {
+ typedef value::rgb<n> argument;
+ typedef value::int_u<n> result;
+
+ result operator()(const argument& v) const
+ {
+ const float max = math::max(math::max(v.red(), v.green()), v.blue());
+ const float min = math::min(math::min(v.red(), v.green()), v.blue());
+ const float diff = max - min;
+ float hue = 0;
+
+ if (0 != diff)
+ {
+ if (v.red() == max)
+ {
+ hue = 60 * ((v.green() - v.blue()) / diff);
+
+ if (0 < hue)
+ hue = 360.0 + hue;
+ }
+ else if (v.green() == max)
+ hue = 60 * (2 + (v.blue() - v.red()) / diff);
+ else // (v.blue() == max)
+ hue = 60 * (4 + (v.red() - v.green()) / diff);
+ }
+
+ const result ret = (hue/360.0) * (mln_max(result) - mln_min(result))
+ + mln_min(result);
+
+ return ret;
+ }
+ };
+
+ } // end of namespace mln::fun::v2v
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_RGB_TO_HUE_MAP_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/rgb_to_saturation_map.hh b/milena/sandbox/green/mln/fun/v2v/rgb_to_saturation_map.hh
new file mode 100644
index 0000000..a8847a0
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/rgb_to_saturation_map.hh
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_RGB_TO_SATURATION_MAP_HH
+# define MLN_FUN_V2V_RGB_TO_SATURATION_MAP_HH
+
+# include <mln/math/abs.hh>
+# include <mln/math/max.hh>
+
+# include <mln/value/rgb.hh>
+
+
+/// \file
+///
+/// \brief Convert rgb value to saturation map.
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ /// \brief Convert rgb value to saturation map.
+ ///
+ /// \ingroup modfunv2v
+
+ template <unsigned n>
+ struct rgb_to_saturation_map :
+ Function_v2v< rgb_to_saturation_map<n> >
+ {
+ typedef value::rgb<n> argument;
+ typedef value::int_u<n> result;
+
+ result operator()(const argument& v) const
+ {
+ const float max = math::max(math::max(v.red(), v.green()), v.blue());
+ const float min = math::min(math::min(v.red(), v.green()), v.blue());
+ float sat = 0.0;
+
+ if (0 != max)
+ sat = (1 - (float)min/max);
+
+ const result ret = sat * (mln_max(result) - mln_min(result))
+ + mln_min(result);
+
+ return ret;
+ }
+ };
+
+ } // end of namespace mln::fun::v2v
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_RGB_TO_SATURATION_MAP_HH
diff --git a/milena/sandbox/green/mln/fun/v2v/rgb_to_value_map.hh b/milena/sandbox/green/mln/fun/v2v/rgb_to_value_map.hh
new file mode 100644
index 0000000..12ac1db
--- /dev/null
+++ b/milena/sandbox/green/mln/fun/v2v/rgb_to_value_map.hh
@@ -0,0 +1,75 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_FUN_V2V_RGB_TO_VALUE_MAP_HH
+# define MLN_FUN_V2V_RGB_TO_VALUE_MAP_HH
+
+# include <mln/math/abs.hh>
+# include <mln/math/max.hh>
+
+# include <mln/value/rgb.hh>
+
+
+/// \file
+///
+/// \brief Convert rgb value to value map.
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2v
+ {
+
+ /// \brief Convert rgb value to value map.
+ ///
+ /// \ingroup modfunv2v
+
+ template <unsigned n>
+ struct rgb_to_value_map :
+ Function_v2v< rgb_to_value_map<n> >
+ {
+ typedef value::rgb<n> argument;
+ typedef value::int_u<n> result;
+
+ result operator()(const argument& v) const
+ {
+ const result ret = math::max(math::max(v.red(), v.green()), v.blue());
+
+ return ret;
+ }
+ };
+
+ } // end of namespace mln::fun::v2v
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+#endif // ! MLN_FUN_V2V_RGB_TO_VALUE_MAP_HH
diff --git a/milena/sandbox/green/mln/img_path.hh b/milena/sandbox/green/mln/img_path.hh
index 7368c22..d205e1f 100644
--- a/milena/sandbox/green/mln/img_path.hh
+++ b/milena/sandbox/green/mln/img_path.hh
@@ -28,41 +28,212 @@
#ifndef MLN_IMG_PATH_HH
# define MLN_IMG_PATH_HH
-# define IMG_PATH "/home/green/svn/oln/trunk/milena/sandbox/green/img"
-# define RESULT_PATH "/home/green/svn/oln/trunk/milena/sandbox/green/result"
+# define IMG_PATH "/home/green/git/img"
+# define RET_PATH "/home/green/git/result"
# define INIM_IMG_PATH IMG_PATH"/inim"
-# define INIM_FG_BG_IMG_PATH INIM_IMG_PATH"/fg_bg"
+# define INIM_BG_IMG_PATH INIM_IMG_PATH"/bg"
+# define INIM_FG_IMG_PATH INIM_IMG_PATH"/fg"
# define INIM_IN_IMG_PATH INIM_IMG_PATH"/in"
# define OLENA_IMG_PATH IMG_PATH"/olena"
-# define SCRIBO_IMG_PATH IMG_PATH"/scribo"
-# define SCRIBO_JPG_IMG_PATH SCRIBO_IMG_PATH"/jpg_50p"
-# define SCRIBO_PGM_IMG_PATH SCRIBO_IMG_PATH"/pgm_50p"
-# define SCRIBO_PPM_IMG_PATH SCRIBO_IMG_PATH"/ppm_50p"
-
-# define ANNOTATING_IMG_PATH IMG_PATH"/annotating"
-# define ANNOTATING_BILL_IMG_PATH ANNOTATING_IMG_PATH"/bill"
-# define ANNOTATING_FAX_IMG_PATH ANNOTATING_IMG_PATH"/fax"
-# define ANNOTATING_HANDWRITTEN_IMG_PATH ANNOTATING_IMG_PATH"/handwritten"
-# define ANNOTATING_LOGO_IMG_PATH ANNOTATING_IMG_PATH"/logo"
-# define ANNOTATING_MAP_IMG_PATH ANNOTATING_IMG_PATH"/map"
-# define ANNOTATING_SCREENSHOT_IMG_PATH ANNOTATING_IMG_PATH"/screenshot"
-# define ANNOTATING_SLIDE_IMG_PATH ANNOTATING_IMG_PATH"/slide"
-# define ANNOTATING_TYPED_IMG_PATH ANNOTATING_IMG_PATH"/typed"
-# define ANNOTATING_PHOTO_IMG_PATH ANNOTATING_IMG_PATH"/photo"
+# define ICDAR_IMG_PATH IMG_PATH"/icdar"
+# define ICDAR_100P_IMG_PATH ICDAR_IMG_PATH"/100p"
+# define ICDAR_100P_PPM_IMG_PATH ICDAR_100P_IMG_PATH"/ppm"
+# define ICDAR_100P_PGM_IMG_PATH ICDAR_100P_IMG_PATH"/pgm"
+# define ICDAR_100P_PBM_IMG_PATH ICDAR_100P_IMG_PATH"/pbm"
+# define ICDAR_100P_THICK_IMG_PATH ICDAR_100P_IMG_PATH"/gradient_thick"
+# define ICDAR_100P_THIN_IMG_PATH ICDAR_100P_IMG_PATH"/gradient_thin"
+
+# define ICDAR_50P_IMG_PATH ICDAR_IMG_PATH"/50p"
+# define ICDAR_50P_PPM_IMG_PATH ICDAR_50P_IMG_PATH"/ppm"
+# define ICDAR_50P_PGM_IMG_PATH ICDAR_50P_IMG_PATH"/pgm"
+# define ICDAR_50P_PBM_IMG_PATH ICDAR_50P_IMG_PATH"/pbm"
+
+# define ICDAR_20P_IMG_PATH ICDAR_IMG_PATH"/20p"
+# define ICDAR_20P_TEXT_ONLY_IMG_PATH ICDAR_20P_IMG_PATH"/text-only"
+# define ICDAR_20P_TEXT_COLOR_IMG_PATH ICDAR_20P_IMG_PATH"/text-color"
+# define ICDAR_20P_TEXT_PHOTO_IMG_PATH ICDAR_20P_IMG_PATH"/text-photo"
+# define ICDAR_20P_GMP30_IMG_PATH ICDAR_20P_IMG_PATH"/gimp-pal-30"
+# define ICDAR_20P_MGK30_IMG_PATH ICDAR_20P_IMG_PATH"/magick-pal-30"
+# define ICDAR_20P_GMP20_IMG_PATH ICDAR_20P_IMG_PATH"/gimp-pal-20"
+# define ICDAR_20P_MGK20_IMG_PATH ICDAR_20P_IMG_PATH"/magick-pal-20"
+# define ICDAR_20P_GMP10_IMG_PATH ICDAR_20P_IMG_PATH"/gimp-pal-10"
+# define ICDAR_20P_MGK10_IMG_PATH ICDAR_20P_IMG_PATH"/magick-pal-10"
+# define ICDAR_20P_INPUT_IMG_PATH ICDAR_20P_IMG_PATH"/ppm"
+# define ICDAR_20P_CROP_IMG_PATH ICDAR_20P_IMG_PATH"/crop"
+# define ICDAR_20P_PGM_IMG_PATH ICDAR_20P_IMG_PATH"/pgm"
+# define ICDAR_20P_PPM_IMG_PATH ICDAR_20P_IMG_PATH"/ppm"
+# define ICDAR_20P_PBM_IMG_PATH ICDAR_20P_IMG_PATH"/pbm"
+
+# define AFP_IMG_PATH IMG_PATH"/afp"
+# define AFP_GMP30_IMG_PATH AFP_IMG_PATH"/gimp-pal-30"
+# define AFP_GMP20_IMG_PATH AFP_IMG_PATH"/gimp-pal-20"
+# define AFP_GMP10_IMG_PATH AFP_IMG_PATH"/gimp-pal-10"
+# define AFP_MGK30_IMG_PATH AFP_IMG_PATH"/magick-pal-30"
+# define AFP_MGK20_IMG_PATH AFP_IMG_PATH"/magick-pal-20"
+# define AFP_MGK10_IMG_PATH AFP_IMG_PATH"/magick-pal-10"
+# define AFP_INPUT_IMG_PATH AFP_IMG_PATH"/ppm"
+# define AFP_PPM_IMG_PATH AFP_IMG_PATH"/ppm"
+# define AFP_JPG_IMG_PATH AFP_IMG_PATH"/jpg"
+
+# define ANNOTATING_1_IMG_PATH IMG_PATH"/annotating-1"
+# define ANNOTATING_1_BILL_IMG_PATH ANNOTATING_1_IMG_PATH"/bill"
+# define ANNOTATING_1_FAX_IMG_PATH ANNOTATING_1_IMG_PATH"/fax"
+# define ANNOTATING_1_HANDWRITTEN_IMG_PATH ANNOTATING_1_IMG_PATH"/handwritten"
+# define ANNOTATING_1_LOGO_IMG_PATH ANNOTATING_1_IMG_PATH"/logo"
+# define ANNOTATING_1_MAP_IMG_PATH ANNOTATING_1_IMG_PATH"/map"
+# define ANNOTATING_1_SCREENSHOT_IMG_PATH ANNOTATING_1_IMG_PATH"/screenshot"
+# define ANNOTATING_1_SLIDE_IMG_PATH ANNOTATING_1_IMG_PATH"/slide"
+# define ANNOTATING_1_TYPED_IMG_PATH ANNOTATING_1_IMG_PATH"/typed"
+# define ANNOTATING_1_PHOTO_IMG_PATH ANNOTATING_1_IMG_PATH"/photo"
+
+# define ANNOTATING_2_IMG_PATH IMG_PATH"/annotating-2"
+# define ANNOTATING_2_BILL_IMG_PATH ANNOTATING_2_IMG_PATH"/bill"
+# define ANNOTATING_2_FAX_IMG_PATH ANNOTATING_2_IMG_PATH"/fax"
+# define ANNOTATING_2_HANDWRITTEN_IMG_PATH ANNOTATING_2_IMG_PATH"/handwritten"
+# define ANNOTATING_2_LOGO_IMG_PATH ANNOTATING_2_IMG_PATH"/logo"
+# define ANNOTATING_2_MAP_IMG_PATH ANNOTATING_2_IMG_PATH"/map"
+# define ANNOTATING_2_SCREENSHOT_IMG_PATH ANNOTATING_2_IMG_PATH"/screenshot"
+# define ANNOTATING_2_SLIDE_IMG_PATH ANNOTATING_2_IMG_PATH"/slide"
+# define ANNOTATING_2_TYPED_IMG_PATH ANNOTATING_2_IMG_PATH"/typed"
+# define ANNOTATING_2_PHOTO_IMG_PATH ANNOTATING_2_IMG_PATH"/photo"
// result directories
-# define RESULT_ANNOTATING_PATH RESULT_PATH"/annotating"
-# define RESULT_ANNOTATING_BILL_PATH RESULT_ANNOTATING_PATH"/bill"
-# define RESULT_ANNOTATING_FAX_PATH RESULT_ANNOTATING_PATH"/fax"
-# define RESULT_ANNOTATING_HANDWRITTEN_PATH RESULT_ANNOTATING_PATH"/handwritten"
-# define RESULT_ANNOTATING_LOGO_PATH RESULT_ANNOTATING_PATH"/logo"
-# define RESULT_ANNOTATING_MAP_PATH RESULT_ANNOTATING_PATH"/map"
-# define RESULT_ANNOTATING_SCREENSHOT_PATH RESULT_ANNOTATING_PATH"/screenshot"
-# define RESULT_ANNOTATING_SLIDE_PATH RESULT_ANNOTATING_PATH"/slide"
-# define RESULT_ANNOTATING_TYPED_PATH RESULT_ANNOTATING_PATH"/typed"
-# define RESULT_ANNOTATING_PHOTO_PATH RESULT_ANNOTATING_PATH"/photo"
+# define ANNOTATING_RET_PATH RET_PATH"/annotating"
+
+# define ANNOTATING_ICDAR_RET_PATH ANNOTATING_RET_PATH"/icdar"
+
+# define ANNOTATING_ICDAR_INPUT_RET_PATH ANNOTATING_ICDAR_RET_PATH"/input"
+# define ANNOTATING_ICDAR_H_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_INPUT_RET_PATH ANNOTATING_ICDAR_INPUT_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_GMP30_RET_PATH ANNOTATING_ICDAR_RET_PATH"/gimp-pal-30"
+# define ANNOTATING_ICDAR_H_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_GMP30_RET_PATH ANNOTATING_ICDAR_GMP30_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_GMP20_RET_PATH ANNOTATING_ICDAR_RET_PATH"/gimp-pal-20"
+# define ANNOTATING_ICDAR_H_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_GMP20_RET_PATH ANNOTATING_ICDAR_GMP20_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_GMP10_RET_PATH ANNOTATING_ICDAR_RET_PATH"/gimp-pal-10"
+# define ANNOTATING_ICDAR_H_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_GMP10_RET_PATH ANNOTATING_ICDAR_GMP10_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_MGK30_RET_PATH ANNOTATING_ICDAR_RET_PATH"/magick-pal-30"
+# define ANNOTATING_ICDAR_H_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_MGK30_RET_PATH ANNOTATING_ICDAR_MGK30_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_MGK20_RET_PATH ANNOTATING_ICDAR_RET_PATH"/magick-pal-20"
+# define ANNOTATING_ICDAR_H_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_MGK20_RET_PATH ANNOTATING_ICDAR_MGK20_RET_PATH"/b"
+
+# define ANNOTATING_ICDAR_MGK10_RET_PATH ANNOTATING_ICDAR_RET_PATH"/magick-pal-10"
+# define ANNOTATING_ICDAR_H_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/h"
+# define ANNOTATING_ICDAR_S_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/s"
+# define ANNOTATING_ICDAR_V_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/v"
+# define ANNOTATING_ICDAR_R_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/r"
+# define ANNOTATING_ICDAR_G_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/g"
+# define ANNOTATING_ICDAR_B_MGK10_RET_PATH ANNOTATING_ICDAR_MGK10_RET_PATH"/b"
+
+
+
+
+# define ANNOTATING_AFP_RET_PATH ANNOTATING_RET_PATH"/afp"
+
+# define ANNOTATING_AFP_INPUT_RET_PATH ANNOTATING_AFP_RET_PATH"/input"
+# define ANNOTATING_AFP_H_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/h"
+# define ANNOTATING_AFP_S_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/s"
+# define ANNOTATING_AFP_V_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/v"
+# define ANNOTATING_AFP_R_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/r"
+# define ANNOTATING_AFP_G_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/g"
+# define ANNOTATING_AFP_B_INPUT_RET_PATH ANNOTATING_AFP_INPUT_RET_PATH"/b"
+
+# define ANNOTATING_AFP_GMP30_RET_PATH ANNOTATING_AFP_RET_PATH"/gimp-pal-30"
+# define ANNOTATING_AFP_H_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/h"
+# define ANNOTATING_AFP_S_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/s"
+# define ANNOTATING_AFP_V_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/v"
+# define ANNOTATING_AFP_R_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/r"
+# define ANNOTATING_AFP_G_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/g"
+# define ANNOTATING_AFP_B_GMP30_RET_PATH ANNOTATING_AFP_GMP30_RET_PATH"/b"
+
+# define ANNOTATING_AFP_GMP20_RET_PATH ANNOTATING_AFP_RET_PATH"/gimp-pal-20"
+# define ANNOTATING_AFP_H_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/h"
+# define ANNOTATING_AFP_S_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/s"
+# define ANNOTATING_AFP_V_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/v"
+# define ANNOTATING_AFP_R_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/r"
+# define ANNOTATING_AFP_G_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/g"
+# define ANNOTATING_AFP_B_GMP20_RET_PATH ANNOTATING_AFP_GMP20_RET_PATH"/b"
+
+# define ANNOTATING_AFP_GMP10_RET_PATH ANNOTATING_AFP_RET_PATH"/gimp-pal-10"
+# define ANNOTATING_AFP_H_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/h"
+# define ANNOTATING_AFP_S_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/s"
+# define ANNOTATING_AFP_V_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/v"
+# define ANNOTATING_AFP_R_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/r"
+# define ANNOTATING_AFP_G_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/g"
+# define ANNOTATING_AFP_B_GMP10_RET_PATH ANNOTATING_AFP_GMP10_RET_PATH"/b"
+
+# define ANNOTATING_AFP_MGK30_RET_PATH ANNOTATING_AFP_RET_PATH"/magick-pal-30"
+# define ANNOTATING_AFP_H_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/h"
+# define ANNOTATING_AFP_S_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/s"
+# define ANNOTATING_AFP_V_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/v"
+# define ANNOTATING_AFP_R_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/r"
+# define ANNOTATING_AFP_G_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/g"
+# define ANNOTATING_AFP_B_MGK30_RET_PATH ANNOTATING_AFP_MGK30_RET_PATH"/b"
+
+# define ANNOTATING_AFP_MGK20_RET_PATH ANNOTATING_AFP_RET_PATH"/magick-pal-20"
+# define ANNOTATING_AFP_H_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/h"
+# define ANNOTATING_AFP_S_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/s"
+# define ANNOTATING_AFP_V_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/v"
+# define ANNOTATING_AFP_R_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/r"
+# define ANNOTATING_AFP_G_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/g"
+# define ANNOTATING_AFP_B_MGK20_RET_PATH ANNOTATING_AFP_MGK20_RET_PATH"/b"
+
+# define ANNOTATING_AFP_MGK10_RET_PATH ANNOTATING_AFP_RET_PATH"/magick-pal-10"
+# define ANNOTATING_AFP_H_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/h"
+# define ANNOTATING_AFP_S_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/s"
+# define ANNOTATING_AFP_V_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/v"
+# define ANNOTATING_AFP_R_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/r"
+# define ANNOTATING_AFP_G_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/g"
+# define ANNOTATING_AFP_B_MGK10_RET_PATH ANNOTATING_AFP_MGK10_RET_PATH"/b"
+
+
+# define ANNOTATING_BILL_RET_PATH ANNOTATING_RET_PATH"/bill"
+# define ANNOTATING_FAX_RET_PATH ANNOTATING_RET_PATH"/fax"
+# define ANNOTATING_HANDWRITTEN_RET_PATH ANNOTATING_RET_PATH"/handwritten"
+# define ANNOTATING_LOGO_RET_PATH ANNOTATING_RET_PATH"/logo"
+# define ANNOTATING_MAP_RET_PATH ANNOTATING_RET_PATH"/map"
+# define ANNOTATING_SCREENSHOT_RET_PATH ANNOTATING_RET_PATH"/screenshot"
+# define ANNOTATING_SLIDE_RET_PATH ANNOTATING_RET_PATH"/slide"
+# define ANNOTATING_TYPED_RET_PATH ANNOTATING_RET_PATH"/typed"
+# define ANNOTATING_PHOTO_RET_PATH ANNOTATING_RET_PATH"/photo"
+
+# define ANNOTATING_ICDAR_ACHROMATISM_RET_PATH ANNOTATING_ICDAR_RET_PATH"/achromatism"
+
#endif // ! MLN_IMG_PATH_HH
diff --git a/milena/sandbox/green/mln/math/ceil.hh b/milena/sandbox/green/mln/math/ceil.hh
new file mode 100644
index 0000000..6fc08c8
--- /dev/null
+++ b/milena/sandbox/green/mln/math/ceil.hh
@@ -0,0 +1,64 @@
+// Copyright (C) 2007, 2008, 2009, 2010
+// EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_MATH_CEIL_HH
+# define MLN_MATH_CEIL_HH
+
+/*! \file
+ *
+ * \brief Define the ceil (ceil) routine.
+ */
+
+# include <cmath>
+
+
+namespace mln
+{
+
+ namespace math
+ {
+
+ template <typename T>
+ T ceil(const T& v);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T>
+ inline
+ T ceil(const T& v)
+ {
+ return std::ceil(v);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::math
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MATH_FLOOR_HH
diff --git a/milena/sandbox/green/mln/math/floor.hh b/milena/sandbox/green/mln/math/floor.hh
new file mode 100644
index 0000000..97e63bd
--- /dev/null
+++ b/milena/sandbox/green/mln/math/floor.hh
@@ -0,0 +1,64 @@
+// Copyright (C) 2007, 2008, 2009, 2010
+// EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_MATH_FLOOR_HH
+# define MLN_MATH_FLOOR_HH
+
+/*! \file
+ *
+ * \brief Define the floor (floor) routine.
+ */
+
+# include <cmath>
+
+
+namespace mln
+{
+
+ namespace math
+ {
+
+ template <typename T>
+ T floor(const T& v);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T>
+ inline
+ T floor(const T& v)
+ {
+ return std::floor(v);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::math
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MATH_FLOOR_HH
diff --git a/milena/sandbox/green/mln/value/hsv.hh b/milena/sandbox/green/mln/value/hsv.hh
new file mode 100644
index 0000000..69948d9
--- /dev/null
+++ b/milena/sandbox/green/mln/value/hsv.hh
@@ -0,0 +1,424 @@
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_VALUE_HSV_HH
+# define MLN_VALUE_HSV_HH
+
+#include <mln/value/ops.hh>
+
+#include <mln/value/concept/vectorial.hh>
+#include <mln/value/int_u.hh>
+// #include <mln/algebra/vec.hh>
+
+// Used in from_to
+// #include <mln/fun/v2v/rgb_to_hsv.hh>
+
+
+namespace mln
+{
+
+ // Forward declarations.
+ namespace value
+ {
+
+ template <typename H, typename S, typename V>
+ class hsv_;
+
+ }
+
+
+/*
+ namespace convert
+ {
+
+ namespace over_load
+ {
+
+ // rgb to hsv_
+ void
+ from_to_(const value::rgb<16>& from, value::hsv_<float,float,float>& to);
+
+ // rgb to hsv_
+ void
+ from_to_(const value::rgb<8>& from, value::hsv_<float,float,float>& to);
+
+ } // end of namespace mln::convert::over_load
+
+ } // end of namespace mln::convert
+*/
+
+
+ namespace trait
+ {
+
+ template <typename H, typename S, typename V>
+ struct set_precise_binary_< op::plus, mln::value::hsv_<H,S,V>,
+ mln::value::hsv_<H,S,V> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+ template <typename H, typename S, typename V>
+ struct set_precise_binary_< op::minus, mln::value::hsv_<H,S,V>,
+ mln::value::hsv_<H,S,V> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+ template <typename H, typename S, typename V, typename S2>
+ struct set_precise_binary_< op::times, mln::value::hsv_<H,S,V>,
+ mln::value::scalar_<S2> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+ template <typename H, typename S, typename V, typename S2>
+ struct set_precise_binary_< op::div, mln::value::hsv_<H,S,V>,
+ mln::value::scalar_<S2> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+
+ // FIXME : Is there any way more generic? a way to factor
+ // set_precise_binary_< op::div, mln::value::hsv_<H,S,V>, mln::value::scalar_<S> >
+ // and
+ // set_precise_binary_< op::div, mln::value::hsv_<H,S,V>, mln::value::int_u<m> >
+ // as for op::times.
+
+ template <typename H, typename S, typename V, unsigned m>
+ struct set_precise_binary_< op::times, mln::value::hsv_<H,S,V>,
+ mln::value::int_u<m> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+ template <typename H, typename S, typename V, unsigned m>
+ struct set_precise_binary_< op::div, mln::value::hsv_<H,S,V>,
+ mln::value::int_u<m> >
+ {
+ typedef mln::value::hsv_<H,S,V> ret;
+ };
+
+ template <typename H, typename S, typename V>
+ struct value_< mln::value::hsv_<H,S,V> >
+ {
+ enum {
+ dim = 3,
+ nbits = (sizeof (H) + sizeof (S) + sizeof (V)) * 8,
+ card = mln_value_card_from_(nbits)
+ };
+
+ typedef trait::value::nature::vectorial nature;
+ typedef trait::value::kind::color kind;
+ typedef mln_value_quant_from_(card) quant;
+
+ typedef void comp;
+ typedef H comp_0;
+ typedef S comp_1;
+ typedef V comp_2;
+
+ template <typename VAL>
+ static comp_0 get_comp_0(const VAL& v) { return v.hue(); }
+
+ template <typename VAL>
+ static comp_1 get_comp_1(const VAL& v) { return v.sat(); }
+
+ template <typename VAL>
+ static comp_2 get_comp_2(const VAL& v) { return v.val(); }
+
+ typedef mln::value::hsv_<H,S,V> sum;
+ };
+
+ } // end of namespace trait
+
+
+ namespace value
+ {
+
+ template <typename E>
+ struct HSV : Object<E>
+ {
+ };
+
+ template <typename H, typename S, typename V>
+ class hsv_ : public HSV< hsv_<H,S,V> >
+ {
+ public:
+
+ typedef H h_type;
+ typedef S s_type;
+ typedef V v_type;
+
+ /// Constructor without argument.
+ hsv_()
+ {
+ }
+
+ hsv_(const literal::zero_t&)
+ : hue_(0),
+ sat_(0),
+ val_(0)
+ {
+ }
+
+ /// Constructor from component values.
+ hsv_(const H& hue, const S& sat, const V& val)
+ : hue_(hue),
+ sat_(sat),
+ val_(val)
+ {
+ }
+
+ /// Read-only access to the hue component.
+ const H& hue() const;
+ const S& sat() const;
+ const V& val() const;
+
+ /// Read-write access to the hue component.
+ H& hue();
+ S& sat();
+ V& val();
+
+ private:
+ //FIXME: Don't we want to store these values in a vector?
+ H hue_;
+ S sat_;
+ V val_;
+ };
+
+
+ typedef hsv_<float, float, float> hsv_f;
+ typedef hsv_<double, double, double> hsv_d;
+
+
+ /// Print an hsv \p c into the output stream \p ostr.
+ ///
+ /// \param[in,out] ostr An output stream.
+ /// \param[in] c An rgb.
+ ///
+ /// \return The modified output stream \p ostr.
+ template <typename H, typename S, typename V>
+ std::ostream& operator<<(std::ostream& ostr, const hsv_<H,S,V>& c);
+
+
+ /// Addition.
+ /// {
+ template <typename H, typename S, typename V>
+ hsv_<H,S,V>
+ operator+(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs);
+ /// \}
+
+ /// Subtraction.
+ /// \{
+ template <typename H, typename S, typename V>
+ hsv_<H,S,V>
+ operator-(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs);
+ /// \}
+
+ /// Product.
+ /// \{
+ template <typename H, typename S, typename V, typename S2>
+ hsv_<H,S,V>
+ operator*(const hsv_<H,S,V>& lhs, const mln::value::scalar_<S2>& s);
+ /// \}
+
+ /// Division.
+ /// \{
+ template <typename H, typename S, typename V, typename S2>
+ hsv_<H,S,V>
+ operator/(const hsv_<H,S,V>& lhs, const mln::value::scalar_<S2>& s);
+ /// \}
+
+ /// Comparison.
+ /// \{
+ template <typename H, typename S, typename V>
+ bool
+ operator==(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs);
+ /// \}
+
+ } // end of namespace mln::value
+
+
+
+ // More forward declarations
+ namespace fun
+ {
+ namespace v2v
+ {
+
+ template <typename T_hsv>
+ struct f_rgb_to_hsv_;
+
+ typedef f_rgb_to_hsv_<value::hsv_f> f_rgb_to_hsv_f_t;
+
+ extern f_rgb_to_hsv_f_t f_rgb_to_hsv_f;
+
+ }
+
+ }
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ namespace value
+ {
+
+ template <typename H, typename S, typename V>
+ const H&
+ hsv_<H,S,V>::hue() const
+ {
+ return this->hue_;
+ }
+
+ template <typename H, typename S, typename V>
+ const S&
+ hsv_<H,S,V>::sat() const
+ {
+ return this->sat_;
+ }
+
+ template <typename H, typename S, typename V>
+ const V&
+ hsv_<H,S,V>::val() const
+ {
+ return this->val_;
+ }
+
+ template <typename H, typename S, typename V>
+ H&
+ hsv_<H,S,V>::hue()
+ {
+ return this->hue_;
+ }
+
+ template <typename H, typename S, typename V>
+ S&
+ hsv_<H,S,V>::sat()
+ {
+ return this->sat_;
+ }
+
+ template <typename H, typename S, typename V>
+ V&
+ hsv_<H,S,V>::val()
+ {
+ return this->val_;
+ }
+
+
+ template <typename H, typename S, typename V>
+ inline
+ std::ostream& operator<<(std::ostream& ostr, const hsv_<H,S,V>& v)
+ {
+ return ostr << '(' << debug::format(v.hue())
+ << ',' << debug::format(v.sat())
+ << ',' << debug::format(v.val())
+ << ')';
+ }
+
+
+ template <typename H, typename S, typename V>
+ hsv_<H,S,V>
+ operator+(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs)
+ {
+ return hsv_<H,S,V>(lhs.hue() + rhs.hue(),
+ lhs.sat() + rhs.sat(),
+ lhs.val() + rhs.val());
+ }
+
+
+ template <typename H, typename S, typename V>
+ hsv_<H,S,V>
+ operator-(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs)
+ {
+ return hsv_<H,S,V>(lhs.hue() - rhs.hue(),
+ lhs.sat() - rhs.sat(),
+ lhs.val() - rhs.val());
+ }
+
+
+ template <typename H, typename S, typename V, typename S2>
+ hsv_<H,S,V>
+ operator*(const hsv_<H,S,V>& lhs, const mln::value::scalar_<S2>& s)
+ {
+ return hsv_<H,S,V>(lhs.hue() * s,
+ lhs.sat() * s,
+ lhs.val() * s);
+ }
+
+
+ template <typename H, typename S, typename V, typename S2>
+ hsv_<H,S,V>
+ operator/(const hsv_<H,S,V>& lhs, const mln::value::scalar_<S2>& s)
+ {
+ return hsv_<H,S,V>(lhs.hue() / s,
+ lhs.sat() / s,
+ lhs.val() / s);
+ }
+
+ template <typename H, typename S, typename V>
+ bool
+ operator==(const hsv_<H,S,V>& lhs, const hsv_<H,S,V>& rhs)
+ {
+ return lhs.hue() == rhs.hue()
+ && lhs.sat() == rhs.sat()
+ && lhs.val() == rhs.val();
+ }
+
+ } // end of namespace mln::value
+
+/*
+ namespace convert
+ {
+
+ namespace over_load
+ {
+
+ inline
+ void
+ from_to_(const value::rgb<16>& from, value::hsv_<float,float,float>& to)
+ {
+ to = fun::v2v::f_rgb_to_hsv_f(from);
+ }
+
+ inline
+ void
+ from_to_(const value::rgb<8>& from, value::hsv_<float,float,float>& to)
+ {
+ to = fun::v2v::f_rgb_to_hsv_f(from);
+ }
+
+ } // end of namespace mln::convert::over_load
+
+ } // end of namespace mln::convert
+*/
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+} // end of namespace mln
+
+#endif // ! MLN_VALUE_HSV_HH
--
1.5.6.5