---
milena/ChangeLog | 5 ++
milena/mln/labeling/{value.hh => values.hh} | 55 ++++++++++++--------------
2 files changed, 30 insertions(+), 30 deletions(-)
copy milena/mln/labeling/{value.hh => values.hh} (70%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index edf3a65..fa11e51 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/labeling/values.hh: Labeling algorithm for gray-level
+ images.
+
2013-04-17 Guillaume Lazzara <z(a)lrde.epita.fr>
* doc/mln/convert.dox: Fix from_to_ module name.
diff --git a/milena/mln/labeling/value.hh b/milena/mln/labeling/values.hh
similarity index 70%
copy from milena/mln/labeling/value.hh
copy to milena/mln/labeling/values.hh
index 6a60ee5..b5e74cb 100644
--- a/milena/mln/labeling/value.hh
+++ b/milena/mln/labeling/values.hh
@@ -1,5 +1,4 @@
-// Copyright (C) 2007, 2008, 2009, 2010, 2013 EPITA Research and
-// Development Laboratory (LRDE)
+// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_LABELING_VALUE_HH
-# define MLN_LABELING_VALUE_HH
+#ifndef MLN_LABELING_VALUES_HH
+# define MLN_LABELING_VALUES_HH
/// \file
///
@@ -45,20 +44,19 @@ namespace mln
{
/*! \brief Connected component labeling of the image sites at a
- given value.
+ given values.
- \param[in] input The input image.
- \param[in] val The value to consider.
- \param[in] nbh The connectivity of components.
- \param[out] nlabels The number of labels.
- \return The label image.
+ \param[in] input The input image.
+ \param[in] nbh The connectivity of components.
+ \param[out] nlabels The number of labels.
+ \return The label image.
- \ingroup labeling
+ \ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- value(const Image<I>& input, const mln_value(I)& val,
- const Neighborhood<N>& nbh, L& nlabels);
+ values(const Image<I>& input,
+ const Neighborhood<N>& nbh, L& nlabels);
# ifndef MLN_INCLUDE_ONLY
@@ -71,14 +69,13 @@ namespace mln
template <typename I, typename N, typename L>
void
- value_tests(const Image<I>& input, const mln_value(I)& val, const
Neighborhood<N>& nbh,
+ values_tests(const Image<I>& input, const Neighborhood<N>&
nbh,
L& nlabels)
{
mln_precondition(exact(input).is_valid());
mln_precondition(exact(nbh).is_valid());
(void) input;
- (void) val;
(void) nbh;
(void) nlabels;
}
@@ -93,12 +90,11 @@ namespace mln
// Generic functor.
template <typename I, typename L>
- struct value_functor
+ struct values_functor
{
typedef mln_psite(I) P;
const I& input;
- const mln_value(I)& val;
// Requirements from mln::canvas::labeling.
@@ -107,8 +103,8 @@ namespace mln
// Generic implementation
void init() {}
- bool handles(const P& p) const { return input(p) == val; }
- bool equiv(const P& n, const P&) const { return input(n) == val; }
+ bool handles(const P& p) const { return true; }
+ bool equiv(const P& n, const P& p) const { return input(n) == input(p); }
bool labels(const P&) const { return true; }
void do_no_union(const P&, const P&) {}
void init_attr(const P&) {}
@@ -120,8 +116,8 @@ namespace mln
// Fastest implementation
void init_() {}
- bool handles_(unsigned p) const { return input.element(p) == val; }
- bool equiv_(unsigned n, unsigned) const { return input.element(n) == val; }
+ bool handles_(unsigned p) const { return true; }
+ bool equiv_(unsigned n, unsigned p) const { return input.element(n) == input.element(p);
}
bool labels_(unsigned) const { return true; }
void do_no_union_(unsigned, unsigned) {}
void init_attr_(unsigned) {}
@@ -132,9 +128,8 @@ namespace mln
// end of Requirements.
- value_functor(const Image<I>& input_, const mln_value(I)& val)
- : input(exact(input_)),
- val(val)
+ values_functor(const Image<I>& input_)
+ : input(exact(input_))
{
}
};
@@ -148,15 +143,15 @@ namespace mln
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- value(const Image<I>& input, const mln_value(I)& val,
- const Neighborhood<N>& nbh, L& nlabels)
+ values(const Image<I>& input,
+ const Neighborhood<N>& nbh, L& nlabels)
{
- mln_trace("labeling::value");
+ mln_trace("labeling::values");
- internal::value_tests(input, val, nbh, nlabels);
+ internal::values_tests(input, nbh, nlabels);
mln_ch_value(I, L) output;
- impl::value_functor<I,L> f(input, val);
+ impl::values_functor<I,L> f(input);
output = canvas::labeling::video(input, nbh, nlabels, f);
return output;
@@ -169,4 +164,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_LABELING_VALUE_HH
+#endif // ! MLN_LABELING_VALUES_HH
--
1.7.2.5