Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2009
- 9 participants
- 188 discussions
* filter/objects_h_thin.hh,
* filter/objects_v_thin.hh: New objects filters.
---
scribo/ChangeLog | 7 ++
scribo/filter/objects_h_thin.hh | 192 +++++++++++++++++++++++++++++++++++++++
scribo/filter/objects_v_thin.hh | 192 +++++++++++++++++++++++++++++++++++++++
3 files changed, 391 insertions(+), 0 deletions(-)
create mode 100644 scribo/filter/objects_h_thin.hh
create mode 100644 scribo/filter/objects_v_thin.hh
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 226b82d..ffd15fa 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2009-09-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Add new filters in Scribo.
+
+ * filter/objects_h_thin.hh,
+ * filter/objects_v_thin.hh: New objects filters.
+
+2009-09-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Small fixes in Scribo.
* binarization/sauvola.hh: Fix an invalid precondition.
diff --git a/scribo/filter/objects_h_thin.hh b/scribo/filter/objects_h_thin.hh
new file mode 100644
index 0000000..2b098ac
--- /dev/null
+++ b/scribo/filter/objects_h_thin.hh
@@ -0,0 +1,192 @@
+// 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 SCRIBO_FILTER_OBJECTS_H_THIN_HH
+# define SCRIBO_FILTER_OBJECTS_H_THIN_HH
+
+/// \file
+///
+/// Remove too thin objects.
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+
+# include <mln/util/array.hh>
+
+# include <scribo/core/object_image.hh>
+# include <scribo/primitive/extract/objects.hh>
+
+namespace scribo
+{
+
+ namespace filter
+ {
+
+ using namespace mln;
+
+ /// Remove objects thinner or equal to \p min_thickness.
+ ///
+ /// \param[in] input_ a binary image.
+ /// \param[in] nbh_ a neighborhood used in labeling algorithms.
+ /// \param[in] label_type the label type used for labeling.
+ /// \param[in] min_thickness the minimum thickness value.
+ ///
+ /// \result A binary image without h_thin objects.
+ //
+ template <typename I, typename N, typename V>
+ inline
+ mln_concrete(I)
+ objects_h_thin(const Image<I>& input_,
+ const Neighborhood<N>& nbh_,
+ const V& label_type,
+ unsigned min_thickness);
+
+ /// Remove lines of text thinner or equal to \p min_thickness.
+ ///
+ /// \param[in] objects An object image.
+ /// \param[in] min_thickness the minimum thickness value.
+ ///
+ /// \result An object image without too thin vertical objects.
+ //
+ template <typename L>
+ inline
+ object_image(L)
+ objects_h_thin(const object_image(L)& text,
+ unsigned min_thickness);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+
+ /// Filter Functor.
+ /// Return false for all objects which are too large.
+ template <typename L>
+ struct objects_h_thin_filter
+ : Function_v2b< objects_h_thin_filter<L> >
+ {
+ typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
+
+ /// Constructor
+ ///
+ /// \param[in] objects object bounding boxes.
+ /// \param[in] min_thickness the minimum of vertical thickness
+ /// allowed.
+ //
+ objects_h_thin_filter(const object_image(L)& objects,
+ unsigned min_thickness)
+ : objects_(objects), min_thickness_(min_thickness)
+ {
+ }
+
+
+ /// Return false if the objects is thinner than
+ /// \p min_thickness_.
+ ///
+ /// \param[in] l An image value.
+ //
+ bool operator()(const mln_value(L)& l) const
+ {
+ if (l == literal::zero)
+ return true;
+ return objects_.bbox(l).ncols() > min_thickness_;
+ }
+
+ /// Component bounding boxes.
+ object_image(L) objects_;
+
+ /// The minimum vertical thickness.
+ unsigned min_thickness_;
+ };
+
+
+ } // end of namespace scribo::filter::internal
+
+
+ template <typename I, typename N, typename V>
+ inline
+ mln_concrete(I)
+ objects_h_thin(const Image<I>& input_,
+ const Neighborhood<N>& nbh_,
+ const V& label_type,
+ unsigned min_thickness)
+ {
+ trace::entering("scribo::filter::objects_h_thin");
+
+ const I& input = exact(input_);
+ const N& nbh = exact(nbh_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(nbh.is_valid());
+
+ V nlabels;
+ typedef mln_ch_value(I,V) lbl_t;
+ object_image(lbl_t) objects
+ = primitive::extract::objects(input, nbh, nlabels);
+
+ typedef internal::objects_h_thin_filter<lbl_t> func_t;
+ func_t fv2b(objects, min_thickness);
+ objects.relabel(fv2b);
+
+ mln_concrete(I) output = duplicate(input);
+ data::fill((output | pw::value(objects) == pw::cst(literal::zero)).rw(),
+ false);
+
+ trace::exiting("scribo::filter::objects_h_thin");
+ return output;
+ }
+
+
+ template <typename L>
+ inline
+ object_image(L)
+ objects_h_thin(const object_image(L)& objects,
+ unsigned min_thickness)
+ {
+ trace::entering("scribo::filter::objects_h_thin");
+
+ mln_precondition(objects.is_valid());
+
+ typedef internal::objects_h_thin_filter<L> func_t;
+ func_t is_not_too_h_thin(objects, min_thickness);
+
+ object_image(L) output;
+ output.init_from_(objects);
+ output.relabel(is_not_too_h_thin);
+
+ trace::exiting("scribo::filter::objects_h_thin");
+ return output;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::filter
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_FILTER_OBJECTS_H_THIN_HH
diff --git a/scribo/filter/objects_v_thin.hh b/scribo/filter/objects_v_thin.hh
new file mode 100644
index 0000000..bcf6726
--- /dev/null
+++ b/scribo/filter/objects_v_thin.hh
@@ -0,0 +1,192 @@
+// 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 SCRIBO_FILTER_OBJECTS_V_THIN_HH
+# define SCRIBO_FILTER_OBJECTS_V_THIN_HH
+
+/// \file
+///
+/// Remove too thin objects.
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+
+# include <mln/util/array.hh>
+
+# include <scribo/core/object_image.hh>
+# include <scribo/primitive/extract/objects.hh>
+
+namespace scribo
+{
+
+ namespace filter
+ {
+
+ using namespace mln;
+
+ /// Remove objects thinner or equal to \p min_thickness.
+ ///
+ /// \param[in] input_ a binary image.
+ /// \param[in] nbh_ a neighborhood used in labeling algorithms.
+ /// \param[in] label_type the label type used for labeling.
+ /// \param[in] min_thickness the minimum thickness value.
+ ///
+ /// \result A binary image without v_thin objects.
+ //
+ template <typename I, typename N, typename V>
+ inline
+ mln_concrete(I)
+ objects_v_thin(const Image<I>& input_,
+ const Neighborhood<N>& nbh_,
+ const V& label_type,
+ unsigned min_thickness);
+
+ /// Remove lines of text thinner or equal to \p min_thickness.
+ ///
+ /// \param[in] objects An object image.
+ /// \param[in] min_thickness the minimum thickness value.
+ ///
+ /// \result An object image without too thin vertical objects.
+ //
+ template <typename L>
+ inline
+ object_image(L)
+ objects_v_thin(const object_image(L)& text,
+ unsigned min_thickness);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+
+ /// Filter Functor.
+ /// Return false for all objects which are too large.
+ template <typename L>
+ struct objects_v_thin_filter
+ : Function_v2b< objects_v_thin_filter<L> >
+ {
+ typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
+
+ /// Constructor
+ ///
+ /// \param[in] objects object bounding boxes.
+ /// \param[in] min_thickness the minimum of vertical thickness
+ /// allowed.
+ //
+ objects_v_thin_filter(const object_image(L)& objects,
+ unsigned min_thickness)
+ : objects_(objects), min_thickness_(min_thickness)
+ {
+ }
+
+
+ /// Return false if the objects is thinner than
+ /// \p min_thickness_.
+ ///
+ /// \param[in] l An image value.
+ //
+ bool operator()(const mln_value(L)& l) const
+ {
+ if (l == literal::zero)
+ return true;
+ return objects_.bbox(l).nrows() > min_thickness_;
+ }
+
+ /// Component bounding boxes.
+ object_image(L) objects_;
+
+ /// The minimum vertical thickness.
+ unsigned min_thickness_;
+ };
+
+
+ } // end of namespace scribo::filter::internal
+
+
+ template <typename I, typename N, typename V>
+ inline
+ mln_concrete(I)
+ objects_v_thin(const Image<I>& input_,
+ const Neighborhood<N>& nbh_,
+ const V& label_type,
+ unsigned min_thickness)
+ {
+ trace::entering("scribo::filter::objects_v_thin");
+
+ const I& input = exact(input_);
+ const N& nbh = exact(nbh_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(nbh.is_valid());
+
+ V nlabels;
+ typedef mln_ch_value(I,V) lbl_t;
+ object_image(lbl_t) objects
+ = primitive::extract::objects(input, nbh, nlabels);
+
+ typedef internal::objects_v_thin_filter<lbl_t> func_t;
+ func_t fv2b(objects, min_thickness);
+ objects.relabel(fv2b);
+
+ mln_concrete(I) output = duplicate(input);
+ data::fill((output | pw::value(objects) == pw::cst(literal::zero)).rw(),
+ false);
+
+ trace::exiting("scribo::filter::objects_v_thin");
+ return output;
+ }
+
+
+ template <typename L>
+ inline
+ object_image(L)
+ objects_v_thin(const object_image(L)& objects,
+ unsigned min_thickness)
+ {
+ trace::entering("scribo::filter::objects_v_thin");
+
+ mln_precondition(objects.is_valid());
+
+ typedef internal::objects_v_thin_filter<L> func_t;
+ func_t is_not_too_v_thin(objects, min_thickness);
+
+ object_image(L) output;
+ output.init_from_(objects);
+ output.relabel(is_not_too_v_thin);
+
+ trace::exiting("scribo::filter::objects_v_thin");
+ return output;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::filter
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_FILTER_OBJECTS_V_THIN_HH
--
1.5.6.5
1
0
* binarization/sauvola.hh: Fix an invalid precondition.
* filter/objects_size_ratio.hh: Add a "using namespace".
* primitive/extract/lines_h_pattern.hh,
* primitive/extract/lines_v_pattern.hh: Add a parameter.
* primitive/extract/lines_pattern.hh: Add a todo.
* tests/unit_test/unit-tests.mk: Regen.
---
scribo/ChangeLog | 15 +++++++++++
scribo/binarization/sauvola.hh | 2 +-
scribo/filter/objects_size_ratio.hh | 2 +-
scribo/primitive/extract/lines_h_pattern.hh | 37 +++++++++++++++++---------
scribo/primitive/extract/lines_pattern.hh | 2 +
scribo/primitive/extract/lines_v_pattern.hh | 21 +++++++++++----
scribo/tests/unit_test/unit-tests.mk | 8 ++++++
7 files changed, 66 insertions(+), 21 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 5a27a1e..226b82d 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,18 @@
+2009-09-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes in Scribo.
+
+ * binarization/sauvola.hh: Fix an invalid precondition.
+
+ * filter/objects_size_ratio.hh: Add a "using namespace".
+
+ * primitive/extract/lines_h_pattern.hh,
+ * primitive/extract/lines_v_pattern.hh: Add a parameter.
+
+ * primitive/extract/lines_pattern.hh: Add a todo.
+
+ * tests/unit_test/unit-tests.mk: Regen.
+
2009-09-28 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix typo.
diff --git a/scribo/binarization/sauvola.hh b/scribo/binarization/sauvola.hh
index 9b719e1..b9f78f8 100644
--- a/scribo/binarization/sauvola.hh
+++ b/scribo/binarization/sauvola.hh
@@ -310,7 +310,7 @@ namespace scribo
{
trace::entering("scribo::binarization::sauvola");
- mln_precondition(I::dim == 2);
+ mln_precondition(mln_site_(I)::dim == 2);
mln_precondition(exact(input).is_valid());
typedef mln_value(I) value_t;
diff --git a/scribo/filter/objects_size_ratio.hh b/scribo/filter/objects_size_ratio.hh
index 7a68f7f..cd12b2e 100644
--- a/scribo/filter/objects_size_ratio.hh
+++ b/scribo/filter/objects_size_ratio.hh
@@ -40,7 +40,7 @@ namespace scribo
namespace filter
{
-
+ using namespace mln;
template <typename L>
object_image(L)
diff --git a/scribo/primitive/extract/lines_h_pattern.hh b/scribo/primitive/extract/lines_h_pattern.hh
index 7716ac5..fa1823d 100644
--- a/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/primitive/extract/lines_h_pattern.hh
@@ -54,37 +54,48 @@ namespace scribo
///
/// \param[in] input A binary image.
/// \param[in] length The minimum line length.
+ /// \param[in] delta Distance between the object pixel and the
+ /// background pixel.
///
/// \result An image of horizontal lines.
//
template <typename I>
mln_concrete(I)
- lines_h_pattern(const Image<I>& input, unsigned length);
+ lines_h_pattern(const Image<I>& input, unsigned length, unsigned delta);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
mln_concrete(I)
- lines_h_pattern(const Image<I>& input, unsigned length)
+ lines_h_pattern(const Image<I>& input, unsigned length, unsigned delta)
{
mlc_is(mln_value(I), bool)::check();
mln_precondition(exact(input).is_valid());
mln_precondition(length % 2 == 1);
- bool win_def[7][1] = { {1},
- {0},
- {0},
- {0},
- {0},
- {0},
- {1} };
-
- window2d win;
- convert::from_to(win_def, win);
+// bool win_def[7][1] = { {1},
+// {0},
+// {0},
+// {0},
+// {0},
+// {0},
+// {1} };
+
+// window2d win;
+// convert::from_to(win_def, win);
+
+ // FIXME: not generic.
+ window2d win;
+ mln_deduce(I, site, dpsite)
+ dp1(-delta, 0),
+ dp2( delta, 0);
+ win.insert(dp1);
+ win.insert(dp2);
//FIXME: Add reconstruction instead of this arbitrary dilation.
- win::hline2d hwin(length/2 + 2);
+ win::hline2d hwin(length/2 + 2);
+// win::hline2d hwin(length);
return morpho::dilation(lines_pattern(input, length, 1, win), hwin);
// return lines_pattern(input, length, 1, win);
}
diff --git a/scribo/primitive/extract/lines_pattern.hh b/scribo/primitive/extract/lines_pattern.hh
index cd2b558..6a69a4a 100644
--- a/scribo/primitive/extract/lines_pattern.hh
+++ b/scribo/primitive/extract/lines_pattern.hh
@@ -29,6 +29,8 @@
/// \file
///
/// Extract lines matching a specific pattern.
+///
+/// \todo Make a more generic canvas.
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
diff --git a/scribo/primitive/extract/lines_v_pattern.hh b/scribo/primitive/extract/lines_v_pattern.hh
index 29f4a54..ccd21c5 100644
--- a/scribo/primitive/extract/lines_v_pattern.hh
+++ b/scribo/primitive/extract/lines_v_pattern.hh
@@ -60,7 +60,7 @@ namespace scribo
//
template <typename I>
mln_concrete(I)
- lines_v_pattern(const Image<I>& input, unsigned length);
+ lines_v_pattern(const Image<I>& input, unsigned length, unsigned delta);
# ifndef MLN_INCLUDE_ONLY
@@ -68,17 +68,26 @@ namespace scribo
template <typename I>
mln_concrete(I)
- lines_v_pattern(const Image<I>& input, unsigned length)
+ lines_v_pattern(const Image<I>& input, unsigned length, unsigned delta)
{
mln_precondition(length % 2 == 1);
- bool win_def[1][7] = { { 1, 0, 0, 0, 0, 0, 1 } };
+// bool win_def[1][7] = { { 1, 0, 0, 0, 0, 0, 1 } };
- window2d win;
- convert::from_to(win_def, win);
+// window2d win;
+// convert::from_to(win_def, win);
+
+ // FIXME: not generic.
+ window2d win;
+ mln_deduce(I, site, dpsite)
+ dp1(0, -delta),
+ dp2(0, delta);
+ win.insert(dp1);
+ win.insert(dp2);
//FIXME: Add reconstruction instead of this arbitrary dilation.
- win::vline2d vwin(length/2 + 2);
+ win::vline2d vwin(length/2 + 2);
+// win::vline2d vwin(length);
return morpho::dilation(lines_pattern(input, length, 0, win), vwin);
// return lines_pattern(input, length, 0, win);
}
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 6b44ef9..953f02a 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -26,6 +26,7 @@ scribo_filter_all \
scribo_filter_common_object_groups_photo \
scribo_filter_common_object_links_photo \
scribo_filter_common_objects_photo \
+scribo_filter_object_groups_size_ratio \
scribo_filter_object_groups_small \
scribo_filter_object_groups_v_thickness \
scribo_filter_object_links_bbox_h_ratio \
@@ -37,10 +38,13 @@ scribo_filter_object_links_non_aligned \
scribo_filter_object_links_non_aligned_simple \
scribo_filter_object_links_non_h_aligned \
scribo_filter_object_links_non_v_aligned \
+scribo_filter_objects_h_thin \
scribo_filter_objects_large \
+scribo_filter_objects_size_ratio \
scribo_filter_objects_small \
scribo_filter_objects_thick \
scribo_filter_objects_thin \
+scribo_filter_objects_v_thin \
scribo_fun_v2b_objects_small_filter \
scribo_make_all \
scribo_make_debug_filename \
@@ -136,6 +140,7 @@ scribo_filter_all_SOURCES = scribo_filter_all.cc
scribo_filter_common_object_groups_photo_SOURCES = scribo_filter_common_object_groups_photo.cc
scribo_filter_common_object_links_photo_SOURCES = scribo_filter_common_object_links_photo.cc
scribo_filter_common_objects_photo_SOURCES = scribo_filter_common_objects_photo.cc
+scribo_filter_object_groups_size_ratio_SOURCES = scribo_filter_object_groups_size_ratio.cc
scribo_filter_object_groups_small_SOURCES = scribo_filter_object_groups_small.cc
scribo_filter_object_groups_v_thickness_SOURCES = scribo_filter_object_groups_v_thickness.cc
scribo_filter_object_links_bbox_h_ratio_SOURCES = scribo_filter_object_links_bbox_h_ratio.cc
@@ -147,10 +152,13 @@ scribo_filter_object_links_non_aligned_SOURCES = scribo_filter_object_links_non_
scribo_filter_object_links_non_aligned_simple_SOURCES = scribo_filter_object_links_non_aligned_simple.cc
scribo_filter_object_links_non_h_aligned_SOURCES = scribo_filter_object_links_non_h_aligned.cc
scribo_filter_object_links_non_v_aligned_SOURCES = scribo_filter_object_links_non_v_aligned.cc
+scribo_filter_objects_h_thin_SOURCES = scribo_filter_objects_h_thin.cc
scribo_filter_objects_large_SOURCES = scribo_filter_objects_large.cc
+scribo_filter_objects_size_ratio_SOURCES = scribo_filter_objects_size_ratio.cc
scribo_filter_objects_small_SOURCES = scribo_filter_objects_small.cc
scribo_filter_objects_thick_SOURCES = scribo_filter_objects_thick.cc
scribo_filter_objects_thin_SOURCES = scribo_filter_objects_thin.cc
+scribo_filter_objects_v_thin_SOURCES = scribo_filter_objects_v_thin.cc
scribo_fun_v2b_objects_small_filter_SOURCES = scribo_fun_v2b_objects_small_filter.cc
scribo_make_all_SOURCES = scribo_make_all.cc
scribo_make_debug_filename_SOURCES = scribo_make_debug_filename.cc
--
1.5.6.5
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/scribo
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix typo.
* text/recognition.hh (recognition): Fix typo in commentary.
recognition.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: text/recognition.hh
--- text/recognition.hh (revision 4555)
+++ text/recognition.hh (working copy)
@@ -142,7 +142,7 @@
/// Improve text quality.
- /// text_ima_cleand domain is larger than text_ima's.
+ /// text_ima_cleaned domain is larger than text_ima's.
I text_ima_cleaned = text::clean(text_ima, dmap_win);
// Setting objects to 'True'
1
0
25 Sep '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-09-25 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Add test for dual input and fix p_transformed test.
* core/site_set/p_transformed.cc: Add inverse and typedefs.
* morpho/tree/Makefile.am,
* morpho/tree/dual_input_tree.cc,
Add dual input tree tests.
* morpho/tree/filter/filter.cc: Minor changes.
---
core/site_set/p_transformed.cc | 7 +
morpho/tree/Makefile.am | 2
morpho/tree/dual_input_tree.cc | 173 +++++++++++++++++++++++++++++++++++++++++
morpho/tree/filter/filter.cc | 6 -
4 files changed, 184 insertions(+), 4 deletions(-)
Index: trunk/milena/tests/core/site_set/p_transformed.cc
===================================================================
--- trunk/milena/tests/core/site_set/p_transformed.cc (revision 4554)
+++ trunk/milena/tests/core/site_set/p_transformed.cc (revision 4555)
@@ -33,10 +33,17 @@
struct wrap : mln::Function_v2v< wrap >
{
typedef mln::point2d result;
+ typedef mln::point2d argument;
+
result operator()(const result& p) const
{
return result(p.row() + 5, p.col() + 1);
}
+
+ result inverse(const result& p) const
+ {
+ return result(p.row() - 5, p.col() - 1);
+ }
};
Index: trunk/milena/tests/morpho/tree/filter/filter.cc
===================================================================
--- trunk/milena/tests/morpho/tree/filter/filter.cc (revision 4554)
+++ trunk/milena/tests/morpho/tree/filter/filter.cc (revision 4555)
@@ -32,8 +32,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/data/sort_psites.hh>
-#include <mln/morpho/tree/data.hh>
+#include <mln/morpho/tree/component_tree.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/morpho/attribute/card.hh>
@@ -59,8 +58,7 @@
typedef p_array< mln_site_(I) > S;
typedef morpho::tree::data<I,S> tree_t;
- S sorted_sites = data::sort_psites_decreasing(input);
- tree_t tree(input, sorted_sites, c4());
+ tree_t tree = morpho::tree::min_tree(input, c4());
// Test with increasing attribute -> area closing.
{
Index: trunk/milena/tests/morpho/tree/dual_input_tree.cc
===================================================================
--- trunk/milena/tests/morpho/tree/dual_input_tree.cc (revision 0)
+++ trunk/milena/tests/morpho/tree/dual_input_tree.cc (revision 4555)
@@ -0,0 +1,173 @@
+// 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.
+
+#include <mln/core/image/image1d.hh>
+#include <mln/core/alias/neighb1d.hh>
+#include <mln/value/int_u8.hh>
+
+#include <mln/make/image.hh>
+#include <mln/morpho/tree/dual_input_tree.hh>
+
+template <typename V, unsigned dim, unsigned dim2>
+void test(V (&f_)[dim], V (&m_)[dim], V (&points_)[dim2], V (&p_)[dim2])
+{
+ using namespace mln;
+ typedef image1d<V> I;
+ typedef p_array< mln_psite(I) > S;
+ typedef morpho::tree::data<I,S> tree_t;
+
+
+ I f = make::image(f_);
+ I m = make::image(m_);
+
+
+ tree_t tree = morpho::tree::dual_input_max_tree(f, m, c2());
+
+ mln_dn_site_piter(tree_t) p(tree);
+ p.start();
+ for (unsigned i = 0; i < dim2; ++i, p.next())
+ {
+ mln_assertion(p.is_valid());
+ mln_assertion(p == point1d(points_[i]));
+ mln_assertion(tree.parent(p) == point1d(p_[i]));
+ }
+ mln_assertion(! p.is_valid());
+}
+
+
+
+int main()
+{
+
+ using namespace mln;
+
+ typedef value::int_u8 V;
+
+ //V f_[] = {10, 10, 20, 20, 30, 30, 40, 40, 30, 30, 20, 20, 30, 30, 20, 20, 10, 20, 20, 10};
+ //V m_[] = {10, 10, 20, 20, 30, 30, 40, 40, 30, 30, 30, 30, 30, 30, 20, 20, 15, 15, 15, 15};
+
+
+ //V f_[] = {15, 15, 10, 10, 05, 05, 8, 8, 5, 5, 10, 10, 15, 15};
+ //V m_[] = {20, 20, 18, 18, 25, 25, 8, 8, 5, 5, 10, 10, 15, 15};
+
+ {
+ V f[] = {15, 15, 15};
+ V m[] = {20, 20, 20};
+ V s[] = {0, 1, 2};
+ V p[] = {0, 0, 0};
+ test(f, m, s, p);
+ }
+
+ {
+ V f[] = {15, 17, 17, 19, 16};
+ V m[] = {15, 17, 17, 19, 16};
+ V s[] = {0, 4, 1, 2, 3};
+ V p[] = {0, 0, 4, 1, 1};
+
+
+ test(f, m, s, p);
+ }
+
+ {
+ V f[] = {15, 17, 17, 15, 18, 19};
+ V m[] = {15, 17, 17, 15, 18, 19};
+ V s[] = {0, 3, 1, 2, 4, 5};
+ V p[] = {0, 0, 0, 1, 0, 4};
+ test(f, m, s, p);
+ }
+
+ // Clustering: simple connection
+ {
+ V f[] = {15, 17, 17, 15, 18, 19};
+ V m[] = {15, 18, 18, 18, 18, 19};
+ V s[] = {0, 3, 1, 2, 4, 5};
+ V p[] = {0, 0, 0, 1, 1, 4};
+ test(f, m, s, p);
+ }
+
+ // Clustering: merge two nodes
+ {
+ V f[] = {15, 18, 18, 15, 18, 19};
+ V m[] = {15, 18, 18, 18, 18, 19};
+ V s[] = {0, 3, 1, 2, 4, 5};
+ V p[] = {0, 0, 0, 1, 1, 1};
+ test(f, m, s, p);
+ }
+
+ // Clustering: create new node
+ {
+ V f[] = {18, 15, 18};
+ V m[] = {18, 17, 18};
+ V s[] = {1, 4, 0, 2};
+ V p[] = {1, 1, 4, 4};
+ test(f, m, s, p);
+ }
+
+ // Clustering: create new node
+ {
+ V f[] = {10, 10, 12, 12};
+ V m[] = {11, 11, 13, 13};
+ V s[] = {0, 1, 4, 2, 3};
+ V p[] = {0, 0, 0, 4, 2};
+ test(f, m, s, p);
+ }
+
+ // Segmentation: simple (no node creation)
+ {
+ V f[] = {8, 10, 10, 12, 12};
+ V m[] = {8, 8, 8, 12, 12};
+ V s[] = {0, 1, 2, 3, 4};
+ V p[] = {0, 0, 0, 0, 3};
+ test(f, m, s, p);
+ }
+
+ // Segmentation: simple (no node creation)
+ {
+ V f[] = {8, 10, 10, 8};
+ V m[] = {8, 8, 8, 8};
+ V s[] = {0, 3, 1, 2};
+ V p[] = {0, 0, 0, 0};
+ test(f, m, s, p);
+ }
+
+ // Segmentation: create node
+ {
+ V f[] = {8, 10, 10, 8};
+ V m[] = {8, 9, 9, 8};
+ V s[] = {0, 3, 5, 1, 2};
+ V p[] = {0, 0, 0, 5, 5};
+ test(f, m, s, p);
+ }
+
+ // Segmentation: create a root node
+ {
+ V f[] = {8, 10, 10, 8};
+ V m[] = {8, 5, 9, 8};
+ V s[] = {5, 0, 3, 1, 6, 2}; // Or {5, 0, 3, 6, 1, 2} for a strict sort
+ V p[] = {5, 5, 5, 5, 3, 6};
+ test(f, m, s, p);
+ }
+
+}
Index: trunk/milena/tests/morpho/tree/Makefile.am
===================================================================
--- trunk/milena/tests/morpho/tree/Makefile.am (revision 4554)
+++ trunk/milena/tests/morpho/tree/Makefile.am (revision 4555)
@@ -22,11 +22,13 @@
check_PROGRAMS = \
compute_attribute_image \
compute_parent \
+ dual_input_tree \
data \
max
compute_attribute_image_SOURCES = compute_attribute_image.cc
compute_parent_SOURCES = compute_parent.cc
+dual_input_tree_SOURCES = dual_input_tree.cc
data_SOURCES = data.cc
max_SOURCES = max.cc
1
0
milena r4554: Add fast version of dual input max tree computation and fix
by Edwin Carlinet 25 Sep '09
by Edwin Carlinet 25 Sep '09
25 Sep '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-09-25 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Add fast version of dual input max tree computation and fix.
* morpho/tree/all.hh: Update.
* morpho/tree/compute_parent_dual_input.hh: Remove.
* morpho/tree/data.hh: Fix constructors.
* morpho/tree/dual_input_tree.hh: Add dispatches for
generic / low quantized algorithms.
* morpho/tree/impl/dual_hqueue.hh: New.
* morpho/tree/impl/dual_union_find.hh: New.
* morpho/tree/impl: New.
---
all.hh | 1
data.hh | 105 ++++--------
dual_input_tree.hh | 75 +++++++-
impl/dual_hqueue.hh | 408 ++++++++++++++++++++++++++++++++++++++++++++++++
impl/dual_union_find.hh | 361 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 874 insertions(+), 76 deletions(-)
Index: trunk/milena/mln/morpho/tree/compute_parent_dual_input.hh (deleted)
===================================================================
Index: trunk/milena/mln/morpho/tree/dual_input_tree.hh
===================================================================
--- trunk/milena/mln/morpho/tree/dual_input_tree.hh (revision 4553)
+++ trunk/milena/mln/morpho/tree/dual_input_tree.hh (revision 4554)
@@ -25,14 +25,16 @@
/// \file
///
-/// Compute a canonized (parenthood) component tree from a dual input.
-
+/// Compute a canonized component tree from a dual input.
#ifndef MLN_MORPHO_TREE_DUAL_INPUT_TREE_HH
# define MLN_MORPHO_TREE_DUAL_INPUT_TREE_HH
# include <mln/data/sort_psites.hh>
+
# include <mln/morpho/tree/data.hh>
+# include <mln/morpho/tree/impl/dual_union_find.hh>
+# include <mln/morpho/tree/impl/dual_hqueue.hh>
namespace mln
{
@@ -43,44 +45,95 @@
namespace tree
{
- template <typename I, typename M, typename N>
+ /// Compute the dual input max tree using mask-based connectivity.
+ ///
+ /// \param[in] f The original image.
+ /// \param[in] m The connectivity mask.
+ /// \param[in] nbh The neighborhood of the mask.
+ ///
+ /// \return The computed tree.
+ ///
+ template <typename I, typename N>
inline
- morpho::tree::data< I, p_array<mln_psite(I)> >
+ data< I, p_array<mln_psite(I)> >
dual_input_max_tree(const Image<I>& f,
- const Image<M>& m,
+ const Image<I>& m,
const Neighborhood<N>& nbh);
# ifndef MLN_INCLUDE_ONLY
- template <typename I, typename M, typename N>
+ namespace internal
+ {
+
+ template <typename I, typename N>
+ inline
+ data< I, p_array<mln_psite(I)> >
+ dual_input_max_tree_dispatch(trait::image::quant::any,
+ const I& f,
+ const I& m,
+ const N& nbh)
+ {
+ typedef p_array<mln_psite(I)> S;
+ typedef data<I,S> tree_t;
+
+ S s_f = mln::data::sort_psites_increasing(f);
+ S s_m = mln::data::sort_psites_increasing(m);
+
+ tree_t tree = impl::generic::dual_union_find(f, m, s_f, s_m, nbh);
+ return tree;
+ }
+
+ template <typename I, typename N>
+ inline
+ data< I, p_array<mln_psite(I)> >
+ dual_input_max_tree_dispatch(trait::image::quant::low,
+ const I& f,
+ const I& m,
+ const N& nbh)
+ {
+ typedef p_array<mln_psite(I)> S;
+ typedef data<I,S> tree_t;
+
+ tree_t tree = impl::dual_hqueue(f, m, nbh);
+ return tree;
+ }
+
+ } // end of namespace mln::morpho::tree::internal
+
+
+ // Facades.
+ template <typename I, typename N>
inline
morpho::tree::data< I, p_array<mln_psite(I)> >
dual_input_max_tree(const Image<I>& f_,
- const Image<M>& m_,
+ const Image<I>& m_,
const Neighborhood<N>& nbh_)
{
trace::entering("morpho::tree::dual_input_max_tree");
const I& f = exact(f_);
- const M& m = exact(m_);
+ const I& m = exact(m_);
const N& nbh = exact(nbh_);
mln_precondition(f.is_valid());
mln_precondition(m.is_valid());
mln_precondition(nbh.is_valid());
+ mln_precondition(f.domain() == m.domain());
typedef p_array<mln_psite(I)> S;
typedef data<I,S> tree_t;
- S s_f = mln::data::sort_psites_increasing(f);
- S s_m = mln::data::sort_psites_increasing(m);
- tree_t tree(f, m, s_f, s_m, nbh);
+ tree_t tree = internal::dual_input_max_tree_dispatch(mln_trait_image_quant(I)(), f, m, nbh);
trace::exiting("morpho::tree::dual_input_max_tree");
return tree;
}
+
+
+
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree
Index: trunk/milena/mln/morpho/tree/impl/dual_hqueue.hh
===================================================================
--- trunk/milena/mln/morpho/tree/impl/dual_hqueue.hh (revision 0)
+++ trunk/milena/mln/morpho/tree/impl/dual_hqueue.hh (revision 4554)
@@ -0,0 +1,408 @@
+// 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_MORPHO_TREE_IMPL_COMPUTE_PARENT_DUAL_HQUEUE_HH
+# define MLN_MORPHO_TREE_IMPL_COMPUTE_PARENT_DUAL_HQUEUE_HH
+
+///
+/// \brief The dual input tree algorithm specialized for low quantized image.
+///
+/// This implementation is based on P. Salembier algorithm using
+/// hierachical queues. This implies a low-quantized input image so
+/// that the number of queues is limited.
+///
+/// TODO: Think about how to extend f domain in a more
+/// generic way. The actual implementation doubles the size of the
+/// first dimension. It implies a boxed domain.
+///
+/// TODO: Use the less functor. The actual implementation is for max-tree.
+///
+/// TODO: During the canonization pass, we build the tree site set
+/// from the sorted site set of f, so that we compute twice f
+/// histogram (can be avoided).
+
+# include <mln/data/sort_psites.hh>
+# include <mln/data/fill.hh>
+
+# include <mln/geom/nsites.hh>
+# include <mln/geom/translate.hh>
+
+# include <mln/morpho/tree/data.hh>
+
+# include <mln/util/hqueues.hh>
+# include <mln/util/ord.hh>
+
+# include <mln/value/value_array.hh>
+# include <mln/value/set.hh>
+
+# include <mln/util/timer.hh>
+
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace impl
+ {
+
+ /// Compute a tree using hqueues.
+ ///
+ /// \param f The original image.
+ /// \param m The connectivity mask.
+ /// \param nbh The neighborhood of the mask.
+ ///
+ /// \return The tree structure.
+ ///
+ template <typename I, typename N>
+ inline
+ data<I, p_array<mln_psite(I)> >
+ dual_hqueue(const Image<I>& f,
+ const Image<I>& m,
+ const Neighborhood<N>& nbh);
+
+ } // end of namespace mln::morpho::tree::impl
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ template <typename I, typename N, class E>
+ struct shared_flood_args
+ {
+ typedef mln_psite(I) P;
+ typedef mln_value(I) V;
+ typedef p_array<P> S;
+
+ const I& f;
+ const I& m;
+ const N& nbh;
+ mln_ch_value(I, P)& parent;
+
+ // Aux data
+ util::hqueues<P, V>& hqueues;
+ const E& extend; // site -> site functor.
+ value::value_array<V, bool> is_node_at_level;
+ value::value_array<V, P> node_at_level;
+ mln_ch_value(I, bool) deja_vu;
+ const value::set<V>& vset;
+
+ shared_flood_args(const I& f_,
+ const I& m_,
+ const N& neigb_,
+ mln_ch_value(I, P)& parent_,
+ util::hqueues<mln_psite(I), V>& hqueues_,
+ const E& extend_)
+ : f (f_),
+ m (m_),
+ nbh (neigb_),
+ parent (parent_),
+ hqueues (hqueues_),
+ extend (extend_),
+ is_node_at_level (false),
+ vset (hqueues.vset())
+ {
+ initialize(deja_vu, f);
+ mln::data::fill(deja_vu, false);
+ }
+ };
+
+ template <typename I>
+ inline
+ histo::array<mln_value(I)>
+ compute_histo(const I& f, const I& m, mln_value(I)& hmin, mln_psite(I)& pmin)
+ {
+ histo::array<mln_value(I)> hm = histo::compute(m);
+ const histo::array<mln_value(I)> hf = histo::compute(f);
+
+ { // Retrieve hmin.
+ unsigned i = 0;
+ while (hm[i] == 0)
+ ++i;
+ hmin = hm.vset()[i];
+ }
+
+ // Merge histograms.
+ for (unsigned i = 0; i < hm.nvalues(); ++i)
+ hm[i] += hf[i];
+
+ // Retrieve pmin.
+ mln_piter(I) p(m.domain());
+ for (p.start(); m(p) != hmin; p.next())
+ ;
+ mln_assertion(p.is_valid());
+ pmin = p;
+
+ return hm;
+ }
+
+ // Site -> site functor: give for all p in Domain(f), its
+ // equivalence in the extended domain.
+ // TODO: make it generic. It works only on boxed domain.
+ template <typename I>
+ struct extend
+ {
+ extend(const mln_psite(I)::delta& dp)
+ : dp_ (dp)
+ {
+ }
+
+ mln_psite(I) operator() (const mln_psite(I)& p) const
+ {
+ return p + dp_;
+ }
+
+ private:
+ const mln_psite(I)::delta dp_;
+ };
+
+ } // end of namespace mln::morpho::tree::internal
+
+ namespace impl
+ {
+
+ template <typename I, typename N, typename E>
+ unsigned
+ flood(internal::shared_flood_args<I, N, E>& args, const unsigned h_idx)
+ {
+ mln_assertion(args.is_node_at_level[h_idx]);
+
+ while (!args.hqueues[h_idx].empty())
+ {
+ mln_psite(I) p = args.hqueues[h_idx].pop_front();
+ unsigned p_idx = args.vset.index_of(args.f(p));
+
+ if (p_idx != h_idx)
+ { // Intensity mismatch: irregular case.
+ mln_psite(I) pext = args.extend(p);
+ args.parent(pext) = args.node_at_level[h_idx];
+
+ if (p_idx > h_idx) // Singleton with parent at h.
+ args.parent(p) = args.node_at_level[h_idx];
+ else
+ {
+ if (!args.is_node_at_level[p_idx])
+ {
+ args.is_node_at_level[p_idx] = true;
+ args.node_at_level[p_idx] = p;
+ }
+ }
+ }
+
+ if (p_idx <= h_idx)
+ {
+ if (!args.f.domain().has(args.node_at_level[p_idx]) ||
+ util::ord_strict(p, args.node_at_level[p_idx]))
+ { // Regular case but a representative provided by the extension.
+ args.parent(args.node_at_level[p_idx]) = p;
+ args.node_at_level[p_idx] = p;
+ //args.parent(p) = p;
+ }
+ args.parent(p) = args.node_at_level[p_idx];
+ }
+
+
+ // Process the neighbors
+ mln_niter(N) n(args.nbh, p);
+ for_all(n)
+ if (args.f.domain().has(n) && !args.deja_vu(n))
+ {
+ unsigned mn = args.vset.index_of(args.m(n));
+ unsigned fn = args.vset.index_of(args.f(n));
+ args.hqueues[mn].push(n);
+ args.deja_vu(n) = true;
+
+ mln_psite(I) ext = args.extend(n);
+ // Create a node at c.
+ {
+ mln_psite(I) node = (fn == mn) ? n : ext;
+ if (!args.is_node_at_level[mn])
+ {
+ args.is_node_at_level[mn] = true;
+ args.node_at_level[mn] = node;
+ }
+ }
+
+ while (mn > h_idx)
+ mn = flood(args, mn);
+ }
+ }
+
+ // Retrieve dad.
+ args.is_node_at_level[h_idx] = false;
+ unsigned c = h_idx;
+ while (c > 0 && !args.is_node_at_level[c])
+ --c;
+
+ mln_psite(I) x = args.node_at_level[h_idx];
+ if (c > 0)
+ args.parent(x) = args.node_at_level[c];
+ else
+ args.parent(x) = x;
+
+ return c;
+ }
+
+ template <typename I, typename N>
+ inline
+ data< I, p_array<mln_psite(I)> >
+ dual_hqueue(const Image<I>& f_,
+ const Image<I>& m_,
+ const Neighborhood<N>& neibh_)
+ {
+ trace::entering("mln::morpho::tree::impl::dual_hqueue");
+
+ const I& f = exact(f_);
+ const I& m = exact(m_);
+ const N& nbh = exact(neibh_);
+
+ typedef mln_psite(I) P;
+ typedef p_array<mln_psite(I)> S;
+
+ util::timer tm;
+ tm.start();
+
+ // Histo.
+ mln_psite(I) pmin;
+ mln_value(I) hmin;
+ const histo::array<mln_value(I)> histo = internal::compute_histo(f, m, hmin, pmin);
+ util::hqueues<P, mln_value(I)> hqueues(histo);
+
+ mln_psite(I)::delta dp(literal::zero);
+ mln_domain(I) d_ext = f.domain();
+ mln_domain(I) d = f.domain();
+
+ // Extend the domain.
+ dp[0] = d.pmax()[0] - d.pmin()[0] + 1;
+ d.pmax() += dp;
+ d_ext.pmin() += dp;
+ d_ext.pmax() += dp;
+
+ // Data.
+ mln_concrete(I) fext;
+ mln_ch_value(I, P) parent;
+ p_array<mln_psite(I)> s;
+
+ // Initialization.
+ fext = geom::translate(m, dp.to_vec(), f, d);
+ initialize(parent, fext);
+ s.reserve(geom::nsites(fext));
+
+ // Process.
+ internal::extend<I> extend(dp);
+ internal::shared_flood_args< I, N, internal::extend<I> >
+ args(f, m, nbh, parent, hqueues, extend);
+
+ unsigned r = args.vset.index_of(hmin);
+ args.deja_vu(pmin) = true;
+ args.hqueues[r].push(pmin);
+ args.node_at_level[r] = (f(pmin) == hmin) ? pmin : extend(pmin);
+ args.is_node_at_level[r] = true;
+ flood(args, r);
+
+ // Attach the nodes under hmin.
+ unsigned i = r;
+ do
+ {
+ if (args.is_node_at_level[i])
+ {
+ parent(args.node_at_level[r]) = args.node_at_level[i];
+ r = i;
+ }
+ }
+ while (i-- > 0);
+ parent(args.node_at_level[r]) = args.node_at_level[r]; //root
+
+ // Canonization and make tree site set.
+ {
+ mln_ch_value(I, bool) deja_vu(d_ext);
+ mln::data::fill(deja_vu, false);
+
+ p_array<mln_psite(I)> s_f = mln::data::sort_psites_increasing(f);
+ mln_fwd_piter(S) p(s_f); // Forward.
+ for_all(p)
+ {
+ P x = p;
+ P q = parent(p);
+
+ // Case: l: m <---- m <---- f
+ // Or
+ // Case l1: m <----- f impossible.
+ // |
+ // l2: m
+ mln_assertion(!(d_ext.has(q) && fext(p) == fext(q) && d_ext.has(parent(q)) && q != parent(q)));
+
+ while (d_ext.has(q) && !deja_vu(q) && (fext(q) != fext(parent(q)) || q == parent(q)))
+ {
+ s.append(q);
+ deja_vu(q) = true;
+ x = q;
+ q = parent(q);
+ }
+
+ if (d_ext.has(q) && fext(q) == fext(parent(q)) && q != parent(q))
+ {
+ q = (parent(x) = parent(q));
+ mln_assertion(f.domain().has(q));
+ }
+
+ if (fext(q) == fext(parent(q)))
+ parent(x) = parent(q);
+
+ s.append(p);
+
+ mln_assertion((q = parent(p)) == parent(q) || fext(q) != fext(parent(q)));
+ }
+
+ }
+
+ std::cout << "Construction de l'arbre en " << tm << " s." << std::endl;
+
+ data<I, S> tree(fext, parent, s);
+
+ trace::exiting("mln::morpho::tree::impl::dual_hqueue");
+
+ return tree;
+ }
+
+ } // end of namespace mln::morpho::tree::impl
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::morpho::tree
+
+ } // end of namespace mln::morpho
+
+} // end of namespace mln
+
+#endif // !MLN_MORPHO_TREE_COMPUTE_PARENT_DUAL_HQUEUE_HH
+
+
+
Index: trunk/milena/mln/morpho/tree/impl/dual_union_find.hh
===================================================================
--- trunk/milena/mln/morpho/tree/impl/dual_union_find.hh (revision 0)
+++ trunk/milena/mln/morpho/tree/impl/dual_union_find.hh (revision 4554)
@@ -0,0 +1,361 @@
+// 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_MORPHO_TREE_IMLP_DUAL_UNION_FIND_HH
+# define MLN_MORPHO_TREE_IMLP_DUAL_UNION_FIND_HH
+
+///
+/// \brief The generic dual input tree algorithm for high quantized image.
+///
+/// This implementation is based on tarjan's union method, so that
+/// image quantization does not impact on the computation time.
+///
+/// TODO: Think about how to extend f domain in a more
+/// generic way. The actual implementation doubles the size of the
+/// first dimension. It implies a boxed domain.
+///
+/// TODO: Use the less functor. The actual implementation is for max-tree.
+
+# include <mln/data/fill.hh>
+
+# include <mln/geom/nsites.hh>
+# include <mln/geom/translate.hh>
+
+# include <mln/morpho/tree/data.hh>
+
+# include <mln/util/timer.hh>
+
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ /// Compute a tree using union-find method.
+ ///
+ /// \param f The original image.
+ /// \param m The connectivity mask.
+ /// \param s_f The sorted site set of \p f
+ /// \param s_m The sorted site set of \p m.
+ /// \param nbh The neighborhood of the mask.
+ ///
+ /// \return The tree structure.
+ ///
+ template <typename I, typename S, typename N>
+ data< I, p_array<mln_psite(I)> >
+ dual_union_find(const Image<I>& f,
+ const Image<I>& m,
+ const Site_Set<S>& s_f,
+ const Site_Set<S>& s_m,
+ const Neighborhood<N>& nbh);
+
+ } // end of namespace mln::morpho::tree::impl::generic
+
+ } // end of namespace mln::morpho::tree::impl
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+ // For benchmark purpose. More than 50% of the time is spent
+ // in find_root function.
+ static util::timer t_prop;
+
+
+ template <typename I>
+ inline
+ mln_psite(I) find_root(I& zpar,
+ const mln_psite(I)& p)
+ {
+ if (zpar(p) == p)
+ return p;
+
+ t_prop.resume();
+ mln_psite(I) x = zpar(p);
+ while (zpar(x) != x)
+ x = zpar(x);
+
+ mln_psite(I) tmp;
+ for (mln_psite(I) y = p; y != x; y = tmp)
+ {
+ tmp = zpar(y);
+ zpar(y) = x;
+ }
+ t_prop.stop();
+
+ return x;
+ }
+
+ template <typename I>
+ inline
+ void
+ update_m_parent(const I& f,
+ mln_ch_value(I, mln_psite(I))& parent,
+ mln_ch_value(I, bool)& deja_vu,
+ p_array< mln_psite(I) >& sset,
+ const mln_domain(I)& d_ext,
+ const mln_psite(I)& p)
+ {
+ typedef mln_psite(I) P;
+
+ P q = parent(p);
+ P x = parent(q);
+
+ mln_assertion(d_ext.has(q));
+
+ while (d_ext.has(x) && f(q) == f(x) && q != x)
+ {
+ q = x;
+ x = parent(q);
+ }
+
+ if (!d_ext.has(x))
+ {
+ if (f(x) == f(parent(x)))
+ x = (parent(q) = parent(x));
+ if (f(q) != f(x))
+ {
+ x = q;
+ if (!deja_vu(q))
+ {
+ deja_vu(q) = true;
+ sset.append(q);
+ }
+ }
+
+ }
+ else
+ {
+ if (x != q)
+ {
+ update_m_parent(f, parent, deja_vu, sset, d_ext, q);
+ x = q;
+ }
+ if (!deja_vu(q))
+ {
+ deja_vu(q) = true;
+ sset.append(q);
+ }
+ }
+
+ for (P i = p, tmp = parent(i); i != q; i = tmp, tmp = parent(i))
+ parent(i) = x;
+ }
+
+ } // end of namespace mln::morpho::tree::internal
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+
+ template <typename I, typename S, typename N>
+ data< I, p_array<mln_psite(I)> >
+ dual_union_find(const Image<I>& f_,
+ const Image<I>& m_,
+ const Site_Set<S>& s_f_,
+ const Site_Set<S>& s_m_,
+ const Neighborhood<N>& nbh_)
+ {
+ trace::entering("morpho::tree::impl::generic::dual_union_find");
+
+ util::timer tm;
+ tm.start();
+ internal::t_prop.reset();
+
+ typedef mln_psite(I) P;
+ typedef unsigned L;
+
+ const I& f = exact(f_);
+ const I& m = exact(m_);
+ const S& s_f = exact(s_f_);
+ const S& s_m = exact(s_m_);
+ const N& nbh = exact(nbh_);
+
+ // Aux data.
+ mln_psite(I)::delta dp(literal::zero);
+ mln_domain(I) d_f = f.domain();
+ mln_domain(I) d_ext = f.domain(); // translate dp
+ mln_domain(I) d = f.domain();
+
+ // Extend the domain.
+ dp[0] = d.pmax()[0] - d.pmin()[0] + 1;
+ d.pmax() += dp;
+ d_ext.pmin() += dp;
+ d_ext.pmax() += dp;
+
+ // Data.
+ mln_concrete(I) fext;
+ mln_ch_value(I, P) parent;
+ p_array<mln_psite(I)> s;
+
+ // Initialization.
+ fext = geom::translate(m, dp.to_vec(), f, d);
+ initialize(parent, fext);
+ s.reserve(geom::nsites(fext));
+
+ //Process
+ {
+ // Aux data.
+ mln_ch_value(I, bool) deja_vu;
+ mln_ch_value(I, P) zpar;
+
+ initialize(deja_vu, fext);
+ initialize(zpar, fext);
+ mln::data::fill(deja_vu, false);
+
+ mln_bkd_piter(S) p_f(s_f); // Backward.
+ mln_bkd_piter(S) p_m(s_m); // Backward.
+ p_f.start();
+ p_m.start();
+
+ // Main loop.
+ while (p_m.is_valid() || p_f.is_valid())
+ {
+ mln_bkd_piter(S)& it = (!p_f.is_valid() || (p_m.is_valid() && f(p_f) <= m(p_m))) ? p_m : p_f;
+
+ P p = it;
+ P ext = p + dp;
+
+ // std::cout << "-------------------" << std::endl;
+ // std::cout << "Take " << p << " of value " << (&it == &p_m ? m(p) : f(p))
+ // << " from " << (&it == &p_m ? "mask" : "f") << std::endl;
+ // debug::println("Parent: ", parent);
+ // debug::println("Zpar: ", zpar);
+
+ mln_assertion(!(deja_vu(p) && deja_vu(ext)));
+ if (deja_vu(ext)) // Seen by mask before f.
+ {
+ mln_assertion(m(p) >= f(p));
+ // Make set.
+ parent(p) = p;
+ zpar(p) = p;
+
+ P r = internal::find_root(zpar, ext);
+ zpar(r) = p;
+ parent(r) = p;
+
+ deja_vu(p) = true;
+ }
+ else if (deja_vu(p)) // Seen by f before mask.
+ {
+ mln_assertion(f(p) > m(p));
+ parent(p) = ext;
+ zpar(p) = ext;
+ parent(ext) = ext;
+ zpar(ext) = ext;
+
+ mln_niter(N) n(nbh, ext);
+ for_all(n)
+ if (d_ext.has(n) && deja_vu(n))
+ {
+ P r = internal::find_root(zpar, n);
+ //std::cout << "Root: " << r << std::endl;
+ if (r != ext)
+ {
+ parent(r) = ext;
+ zpar(r) = ext;
+ }
+ }
+ deja_vu(ext) = true;
+ }
+ else if (f(p) <= m(p)) // First time p encountered.
+ {
+ zpar(ext) = ext;
+ mln_niter(N) n(nbh, ext);
+ for_all(n)
+ if (d_ext.has(n) && deja_vu(n))
+ {
+ P r = internal::find_root(zpar, n);
+ if (r != ext)
+ {
+ zpar(r) = ext;
+ parent(r) = ext;
+ }
+ }
+ deja_vu(ext) = true;
+ }
+ else
+ {
+ deja_vu(p) = true;
+ }
+ it.next();
+ }
+ }
+ std::cout << ">> MAJ zpar: " << internal::t_prop << " s" << std::endl;
+ std::cout << "Parent construction: " << tm << " s" << std::endl;
+ tm.restart();
+
+ // Canonization
+ {
+ mln_ch_value(I, bool) deja_vu(d_ext);
+ mln::data::fill(deja_vu, false);
+ mln_fwd_piter(S) p(s_f); // Forward.
+ for_all(p)
+ {
+ P q = parent(p);
+ if (!f.domain().has(q))
+ internal::update_m_parent(fext, parent, deja_vu, s, d_ext, p);
+ else if (fext(parent(q)) == f(q))
+ parent(p) = parent(q);
+ s.append(p);
+
+ mln_assertion((q = parent(p)) == parent(q) || fext(q) != fext(parent(q)));
+ }
+ }
+ std::cout << "Canonization: " << tm << " s" << std::endl;
+
+ //mln_postcondition(internal::compute_parent_postconditions(fext, s, parent));
+
+ tree::data<I, p_array<mln_psite(I)> > tree(fext, parent, s);
+ trace::exiting("morpho::tree::impl::generic::dual_union_find");
+
+ return tree;
+ }
+
+ } // end of namespace mln::morpho::tree::impl::generic
+
+ } // end of namespace mln::morpho::tree::impl
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::morpho::tree
+
+ } // end of namespace mln::morpho
+
+} // end of namespace mln
+
+#endif // !MLN_MORPHO_TREE_IMLP_DUAL_UNION_FIND_HH
Index: trunk/milena/mln/morpho/tree/all.hh
===================================================================
--- trunk/milena/mln/morpho/tree/all.hh (revision 4553)
+++ trunk/milena/mln/morpho/tree/all.hh (revision 4554)
@@ -48,6 +48,7 @@
# include <mln/morpho/tree/compute_attribute_image.hh>
# include <mln/morpho/tree/compute_parent.hh>
+# include <mln/morpho/tree/dual_input_tree.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/max.hh>
# include <mln/morpho/tree/utils.hh>
Index: trunk/milena/mln/morpho/tree/data.hh
===================================================================
--- trunk/milena/mln/morpho/tree/data.hh (revision 4553)
+++ trunk/milena/mln/morpho/tree/data.hh (revision 4554)
@@ -32,7 +32,6 @@
/// of S container iterator) to go faster.
# include <mln/morpho/tree/compute_parent.hh>
-# include <mln/morpho/tree/compute_parent_dual_input.hh>
# include <mln/core/site_set/p_array.hh>
# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/internal/piter_identity.hh>
@@ -138,18 +137,18 @@
typedef mln::morpho::tree::depth1st_piter<self_> depth1st_piter;
- /// Constructor.
+ /// Standard constructor.
template <typename N>
- data(const Image<I>& f, const Site_Set<S>& s, const Neighborhood<N>& nbh);
-
- /// Constructor.
- template <typename N, typename M>
data(const Image<I>& f,
- const Image<M>& m,
- const Site_Set<S>& s_f,
- const Site_Set<S>& s_m,
+ const Site_Set<S>& s,
const Neighborhood<N>& nbh);
+ /// Special constructor where the parent computation has
+ /// delegated to an external function. (To handle special case
+ /// of connectivity for example).
+ data(const Image<I>& f,
+ const parent_t& parent,
+ const Site_Set<S>& s);
/// \{ Base function-related materials
@@ -205,13 +204,18 @@
unsigned nroots() const;
protected:
- const function& f_;
- const sites_t s_;
+ void compute_children_();
+
+ protected:
mln_ch_value(I, mln_psite(I)) parent_; // Parent image.
mln_ch_value(I, nodes_t) children_; // Children image.
- nodes_t nodes_;
- leaves_t leaves_;
- unsigned nroots_;
+
+ function f_; // f image containing values of the tree nodes.
+ sites_t s_; // Sorted site set of the tree sites. (domain(f_) includes s_).
+
+ nodes_t nodes_; // Sorted node set.
+ leaves_t leaves_; // Sorted leaf set.
+ unsigned nroots_; // For non-contigous domain image purpose.
};
@@ -403,43 +407,15 @@
{
template <typename I, typename S>
- template <typename N, typename M>
inline
data<I, S>::data(const Image<I>& f,
- const Image<M>& m,
- const Site_Set<S>& s_f,
- const Site_Set<S>& s_m,
- const Neighborhood<N>& nbh)
- : f_(exact(f)),
- s_(exact(s_f))
- {
- const N& nbh_ = exact(nbh);
-
- // Compute parent image.
- parent_ = morpho::tree::compute_parent_dual_input(f_, m, nbh_, s_, s_m);
- initialize(children_, f);
-
- // Store tree nodes.
- nroots_ = 0;
- mln_bkd_piter(S) p(s_);
- for_all(p)
- {
- if (f_(parent_(p)) != f_(p))
- {
- nodes_.insert(p);
- children_(parent_(p)).insert(p);
- if (is_a_leaf(p))
- leaves_.insert(p);
- }
- else if (parent_(p) == p) //it's a root.
+ const mln_ch_value(I, mln_psite(I))& parent,
+ const Site_Set<S>& s)
+ : parent_ (parent),
+ f_ (exact(f)),
+ s_ (exact(s))
{
- nodes_.insert(p);
- if (is_a_leaf(p)) // One pixel image...
- leaves_.insert(p);
- ++nroots_;
- }
- }
- mln_assertion(leaves_.nsites() > 0);
+ compute_children_();
}
@@ -447,15 +423,25 @@
template <typename I, typename S>
template <typename N>
inline
- data<I,S>::data(const Image<I>& f, const Site_Set<S>& s, const Neighborhood<N>& nbh)
+ data<I,S>::data(const Image<I>& f,
+ const Site_Set<S>& s,
+ const Neighborhood<N>& nbh)
: f_(exact(f)),
s_(exact(s))
{
- const N& nbh_ = exact(nbh);
-
// Compute parent image.
+ const N& nbh_ = exact(nbh);
parent_ = morpho::tree::compute_parent(f_, nbh_, s_);
- initialize(children_, f);
+
+ compute_children_();
+ }
+
+ template <typename I, typename S>
+ inline
+ void
+ data<I, S>::compute_children_()
+ {
+ initialize(children_, f_);
// Store tree nodes.
nroots_ = 0;
@@ -480,24 +466,13 @@
mln_assertion(leaves_.nsites() > 0);
}
+
template <typename I, typename S>
inline
mln_rvalue_(mln_ch_value(I, mln_psite(I)))
data<I,S>::parent(const mln_psite(I)& p) const
{
- // HERE
-
-// mln_precondition(is_valid());
-// mln_rvalue(parent_t) tmp;
-// if (! parent_.domain().has(p))
-// {
-// std::cout << "KO next" << std::endl;
-// std::cout << p << std::endl;
-// std::cout << parent_.domain() << std::endl;
-// }
-// else
-// std::cout << "ok next" << std::endl;
-// mln_precondition(parent_.domain().has(p));
+ mln_precondition(parent_.domain().has(p));
return parent_(p);
}
1
0
milena r4553: Fix non generic stuff in translation function and fix transform morpher
by Edwin Carlinet 25 Sep '09
by Edwin Carlinet 25 Sep '09
25 Sep '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-09-25 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Fix non generic stuff in translation function and fix transform morpher.
* core/image/imorph/tr_image.hh,
* core/site_set/p_transformed.hh,
* core/site_set/p_transformed_piter.hh:
Make them less strict with function return type. Allow
functions having values that can be converted in the requested
site. (ex: vector<1, u> -> point1d).
* fun/p2p/translation.hh: Add argument type definition.
* fun/x2x/translation.hh: Add inverse function.
* geom/translate.hh: Fix non generic stuff and bug.
---
core/image/imorph/tr_image.hh | 4 ++--
core/site_set/p_transformed.hh | 8 +++++---
core/site_set/p_transformed_piter.hh | 5 +++--
fun/p2p/translation.hh | 1 +
fun/x2x/translation.hh | 10 ++++++++++
geom/translate.hh | 26 +++++++++++++-------------
6 files changed, 34 insertions(+), 20 deletions(-)
Index: trunk/milena/mln/core/site_set/p_transformed.hh
===================================================================
--- trunk/milena/mln/core/site_set/p_transformed.hh (revision 4552)
+++ trunk/milena/mln/core/site_set/p_transformed.hh (revision 4553)
@@ -33,7 +33,7 @@
# include <mln/core/internal/site_set_base.hh>
# include <mln/core/concept/function.hh>
-
+# include <mln/convert/from_to.hh>
namespace mln
{
@@ -81,7 +81,7 @@
template <typename S, typename F>
class p_transformed
: public internal::site_set_base_< mln_psite(S), p_transformed<S,F> >,
- private metal::equal< mln_result(F), mln_psite(S) >::check_t
+ private mlc_converts_to(mln_result(F), mln_psite(S))::check_t
{
typedef p_transformed<S,F> self_;
typedef internal::site_set_base_<mln_result(F), self_> super_;
@@ -171,7 +171,9 @@
bool
p_transformed<S,F>::has(const psite& p) const
{
- return s_.has(f_(p));
+ mln_argument(F) arg;
+ convert::from_to(p, arg);
+ return s_.has(f_.inverse(arg));
}
template <typename S, typename F>
Index: trunk/milena/mln/core/site_set/p_transformed_piter.hh
===================================================================
--- trunk/milena/mln/core/site_set/p_transformed_piter.hh (revision 4552)
+++ trunk/milena/mln/core/site_set/p_transformed_piter.hh (revision 4553)
@@ -32,6 +32,7 @@
# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/site_set/p_transformed.hh>
+# include <mln/convert/to.hh>
namespace mln
@@ -123,7 +124,7 @@
{
pi_.start();
if (pi_.is_valid())
- p_ = s_->function()(pi_);
+ p_ = s_->function()(convert::to<mln_argument(F)>(pi_));
}
template <typename Pi, typename S, typename F>
@@ -133,7 +134,7 @@
{
pi_.next();
if (pi_.is_valid())
- p_ = s_->function()(pi_);
+ p_ = s_->function()(convert::to<mln_argument(F)>(pi_));
}
template <typename Pi, typename S, typename F>
Index: trunk/milena/mln/core/image/imorph/tr_image.hh
===================================================================
--- trunk/milena/mln/core/image/imorph/tr_image.hh (revision 4552)
+++ trunk/milena/mln/core/image/imorph/tr_image.hh (revision 4553)
@@ -81,12 +81,12 @@
//
template <typename S, typename I, typename T>
struct tr_image :
- public mln::internal::image_identity< I, mln_domain(I), tr_image<S,I,T> >
+ public mln::internal::image_identity< I, S, tr_image<S,I,T> >
{
/// Super type.
typedef
- mln::internal::image_identity< I, mln_domain(I), tr_image<S,I,T> > super_;
+ mln::internal::image_identity< I, S, tr_image<S,I,T> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: trunk/milena/mln/geom/translate.hh
===================================================================
--- trunk/milena/mln/geom/translate.hh (revision 4552)
+++ trunk/milena/mln/geom/translate.hh (revision 4553)
@@ -35,10 +35,10 @@
# include <mln/core/concept/box.hh>
# include <mln/core/routine/extend.hh>
-
+# include <mln/core/site_set/p_transformed.hh>
# include <mln/core/image/imorph/tr_image.hh>
-# include <mln/data/paste.hh>
+# include <mln/data/fill.hh>
# include <mln/fun/x2x/translation.hh>
@@ -105,22 +105,22 @@
const I& input = exact(input_);
const S& output_domain = exact(output_domain_);
const mln_exact(Ext)& extension = exact(extension_);
- mlc_converts_to(mln_exact(Ext), mln_value(I))::check();
+ //mlc_converts_to(mln_exact(Ext), mln_value(I))::check();
mln_precondition(input.is_valid());
mln_precondition(output_domain.is_valid());
- point2d c = geom::bbox(input).center();
- typedef fun::x2x::translation<2,double> trans_t;
- trans_t
- t(ref);
-
- tr_image<S,I,trans_t> tr_ima(output_domain, input, t);
-
- mln_concrete(I) output;
- initialize(output, tr_ima);
+ //mln_psite(I) c = geom::bbox(input).center();
+ typedef fun::x2x::translation<mln_site_(I)::dim, V> trans_t;
+ typedef p_transformed<mln_domain(I), trans_t> trans_domain_t;
+ typedef tr_image<trans_domain_t, I, trans_t> tr_ima_t;
+
+ trans_t t(ref);
+ trans_domain_t d(input.domain(), t);
+ tr_ima_t tr_ima(d, input, t);
- data::paste(extend(tr_ima, extension), output);
+ mln_concrete(I) output(output_domain);
+ data::fill(output, extend(tr_ima, extension) | output_domain);
trace::exiting("geom::translate");
return output;
Index: trunk/milena/mln/fun/p2p/translation.hh
===================================================================
--- trunk/milena/mln/fun/p2p/translation.hh (revision 4552)
+++ trunk/milena/mln/fun/p2p/translation.hh (revision 4553)
@@ -47,6 +47,7 @@
struct translation_t : public Function_v2v< translation_t<P> >
{
typedef P result;
+ typedef P argument;
translation_t(const mln_delta(P)& dp);
Index: trunk/milena/mln/fun/x2x/translation.hh
===================================================================
--- trunk/milena/mln/fun/x2x/translation.hh (revision 4552)
+++ trunk/milena/mln/fun/x2x/translation.hh (revision 4553)
@@ -66,6 +66,8 @@
/// Perform the translation of the given vector
algebra::vec<n,C> operator()(const algebra::vec<n,C>& v) const;
+ algebra::vec<n,C> inverse(const algebra::vec<n,C>& v) const;
+
/// Set a net translation vector.
void set_t(const algebra::vec<n,C>& t);
@@ -106,6 +108,14 @@
template <unsigned n, typename C>
inline
+ algebra::vec<n,C>
+ translation<n,C>::inverse(const algebra::vec<n,C>& v) const
+ {
+ return v - t_;
+ }
+
+ template <unsigned n, typename C>
+ inline
translation<n,C>
translation<n,C>::inv() const
{
1
0
25 Sep '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-09-25 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Add hierarchical queues for Salembier's algorithm.
* core/site_set/p_queue_fast.hh: Add empty method.
* util/all.hh: Update.
* util/hqueues.hh: New.
* value/all.hh: Update.
* value/value_array.hh: New. Create an array indexed by
a given type. (Similar to histo::array but the
values are not limited to unsigned type).
---
core/site_set/p_queue_fast.hh | 11 ++
util/all.hh | 1
util/hqueues.hh | 159 ++++++++++++++++++++++++++++++++++++
value/all.hh | 2
value/value_array.hh | 184 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 356 insertions(+), 1 deletion(-)
Index: trunk/milena/mln/core/site_set/p_queue_fast.hh
===================================================================
--- trunk/milena/mln/core/site_set/p_queue_fast.hh (revision 4551)
+++ trunk/milena/mln/core/site_set/p_queue_fast.hh (revision 4552)
@@ -111,6 +111,8 @@
/// Give the number of sites.
unsigned nsites() const;
+ /// Test if the queue is empty.
+ bool empty() const;
/// Push a site \p p in the queue.
void push(const P& p);
@@ -244,6 +246,15 @@
template <typename P>
inline
+ bool
+ p_queue_fast<P>::empty() const
+ {
+ mln_invariant(end_ >= begin_);
+ return end_ == begin_;
+ }
+
+ template <typename P>
+ inline
void
p_queue_fast<P>::push(const P& p)
{
Index: trunk/milena/mln/value/all.hh
===================================================================
--- trunk/milena/mln/value/all.hh (revision 4551)
+++ trunk/milena/mln/value/all.hh (revision 4552)
@@ -53,7 +53,7 @@
# include <mln/value/interval.hh>
# include <mln/value/label.hh>
# include <mln/value/proxy.hh>
-
+# include <mln/value/value_array.hh>
// FIXME: that includes concept/image.hh!
Index: trunk/milena/mln/value/value_array.hh
===================================================================
--- trunk/milena/mln/value/value_array.hh (revision 0)
+++ trunk/milena/mln/value/value_array.hh (revision 4552)
@@ -0,0 +1,184 @@
+// 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_VALUE_VALUE_ARRAY_HH
+# define MLN_VALUE_VALUE_ARRAY_HH
+
+/// \file
+///
+/// Define a generic array indexed by an iterable type.
+
+# include <mln/value/set.hh>
+
+
+namespace mln
+{
+
+ namespace value
+ {
+
+
+ /// Generic array class over indexed by a value set with type \c T.
+ template <typename T, typename V>
+ struct value_array
+ {
+ enum {
+ nvalues = mln_card(T)
+ };
+
+ /// Constructors.
+ /// {
+ value_array();
+ value_array(const V& v);
+ value_array(const value_array<T, V>& other);
+ value_array& operator=(const value_array<T, V>& other);
+ /// }
+
+ /// Access elements through a value of \p T.
+ /// {
+ const V& operator()(const T& v) const;
+ V& operator()(const T& v);
+ /// }
+
+ /// Access elements through array indexes.
+ /// {
+ const V& operator[](unsigned i) const;
+ V& operator[](unsigned i);
+ /// }
+
+ /// Reference to the set of \p T.
+ const mln::value::set<T>& vset() const;
+
+ protected:
+
+ const mln::value::set<T>& s_;
+ V v_[nvalues];
+ };
+
+
+ template <typename T, typename V>
+ std::ostream& operator<<(std::ostream& ostr, const value_array<T, V>& a);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T, typename V>
+ inline
+ value_array<T,V>::value_array()
+ : s_ (mln::value::set<T>::the())
+ {
+ typedef value::internal::iterable_set< T, set<T> > U;
+ mlc_is(set<T>, U)::check();
+ }
+
+ template <typename T, typename V>
+ inline
+ value_array<T,V>::value_array(const V& v)
+ : s_(mln::value::set<T>::the())
+ {
+ typedef value::internal::iterable_set< T, set<T> > U;
+ mlc_is(set<T>, U)::check();
+
+ memset(v_, v, nvalues * sizeof(V));
+ }
+
+ template <typename T, typename V>
+ inline
+ value_array<T,V>::value_array(const value_array<T, V>& other)
+ : s_(other.s_)
+ {
+ memcpy(v_, other.v_, nvalues * sizeof(V));
+ }
+
+ template <typename T, typename V>
+ inline
+ value_array<T,V>&
+ value_array<T,V>::operator=(const value_array<T, V>& other)
+ {
+ if (&other != this)
+ memcpy(v_, other.v_, nvalues * sizeof(V));
+ return *this;
+ }
+
+ template <typename T, typename V>
+ inline
+ const V&
+ value_array<T,V>::operator()(const T& v) const
+ {
+ return v_[s_.index_of(v)];
+ }
+
+ template <typename T, typename V>
+ inline
+ V&
+ value_array<T,V>::operator()(const T& v)
+ {
+ return v_[s_.index_of(v)];
+ }
+
+ template <typename T, typename V>
+ inline
+ const mln::value::set<T>&
+ value_array<T,V>::vset() const
+ {
+ return s_;
+ }
+
+ template <typename T, typename V>
+ inline
+ const V&
+ value_array<T,V>::operator[](unsigned i) const
+ {
+ mln_precondition(i < nvalues);
+ return v_[i];
+ }
+
+ template <typename T, typename V>
+ inline
+ V&
+ value_array<T,V>::operator[](unsigned i)
+ {
+ mln_precondition(i < nvalues);
+ return v_[i];
+ }
+
+ template <typename T, typename V>
+ inline
+ std::ostream& operator<<(std::ostream& ostr, const value_array<T,V>& a)
+ {
+ mln_viter(mln::value::set<T>) v(a.vset());
+ for_all(v)
+ ostr << v << ':' << h(v) << ' ';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_VALUE_ARRAY_HH
Index: trunk/milena/mln/util/all.hh
===================================================================
--- trunk/milena/mln/util/all.hh (revision 4551)
+++ trunk/milena/mln/util/all.hh (revision 4552)
@@ -51,6 +51,7 @@
# include <mln/util/dindex.hh>
# include <mln/util/eat.hh>
# include <mln/util/edge.hh>
+# include <mln/util/hqueues.hh>
# include <mln/util/graph.hh>
# include <mln/util/greater_point.hh>
# include <mln/util/greater_psite.hh>
Index: trunk/milena/mln/util/hqueues.hh
===================================================================
--- trunk/milena/mln/util/hqueues.hh (revision 0)
+++ trunk/milena/mln/util/hqueues.hh (revision 4552)
@@ -0,0 +1,159 @@
+// 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_UTIL_HQUEUES_HH
+# define MLN_UTIL_HQUEUES_HH
+
+///
+/// \brief Generic class for hierarchical queues.
+///
+/// Hierarchical queues are often used with connected operators
+/// (P. Salemebier's max tree algorithm relies on these queues). To be
+/// efficient, the hiererachy is a static array and each are
+/// preallocated using an histogram.
+///
+/// FIXME: consider hqueues as a site set ?
+
+
+# include <mln/core/site_set/p_queue_fast.hh>
+# include <mln/histo/array.hh>
+# include <mln/value/set.hh>
+
+
+namespace mln
+{
+
+ namespace util
+ {
+
+ template <typename P, typename T>
+ struct hqueues
+ {
+ enum {
+ nvalues = mln_card(T)
+ };
+
+ hqueues(const histo::array<T>& h);
+
+ const p_queue_fast<P>& operator[](unsigned i) const;
+ p_queue_fast<P>& operator[](unsigned i);
+
+ const p_queue_fast<P>& operator()(const T& v) const;
+ p_queue_fast<P>& operator()(const T& v);
+
+ const mln::value::set<T>& vset() const;
+
+ protected:
+ void pre_allocate_(unsigned i);
+
+ const histo::array<T>& h_;
+ const mln::value::set<T>& s_;
+ std::vector<bool> allocated_;
+ std::vector< p_queue_fast<P> >queues_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename P, typename T>
+ inline
+ hqueues<P,T>::hqueues(const histo::array<T>& h)
+ : h_ (h),
+ s_ (mln::value::set<T>::the()),
+ allocated_ (nvalues, false),
+ queues_ (nvalues)
+ {
+ }
+
+ template <typename P, typename T>
+ inline
+ void
+ hqueues<P,T>::pre_allocate_(unsigned i)
+ {
+ mln_precondition(i < nvalues);
+ if (!allocated_[i])
+ {
+ queues_[i].reserve(h_[i]);
+ allocated_[i] = true;
+ }
+ }
+
+
+ template <typename P, typename T>
+ inline
+ const p_queue_fast<P>&
+ hqueues<P,T>::operator[](unsigned i) const
+ {
+ mln_precondition(i < nvalues);
+ pre_allocate_(i);
+ return queues_[i];
+ }
+
+ template <typename P, typename T>
+ inline
+ p_queue_fast<P>&
+ hqueues<P,T>::operator[](unsigned i)
+ {
+ mln_precondition(i < nvalues);
+ pre_allocate_(i);
+ return queues_[i];
+ }
+
+ template <typename P, typename T>
+ inline
+ const p_queue_fast<P>&
+ hqueues<P,T>::operator()(const T& v) const
+ {
+ unsigned i = s_.index_of(v);
+ pre_allocate_(i);
+ return queues_[i];
+ }
+
+ template <typename P, typename T>
+ inline
+ p_queue_fast<P>&
+ hqueues<P,T>::operator()(const T& v)
+ {
+ unsigned i = s_.index_of(v);
+ pre_allocate_(i);
+ return queues_[i];
+ }
+
+
+ template <typename P, typename T>
+ inline
+ const mln::value::set<T>&
+ hqueues<P,T>::vset() const
+ {
+ return s_;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::util
+
+} // end of namespace mln
+
+#endif // !MLN_UTIL_HQUEUES_HH
1
0
---
milena/ChangeLog | 96 ++++----
milena/sandbox/ChangeLog | 663 +++++++++++++++++++++++-----------------------
2 files changed, 378 insertions(+), 381 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1881b78..5f5994c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -13,7 +13,7 @@
2009-09-24 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add correct reference for HSL to RGB conversion.
- * mln/fun/v2v/hsl_to_rgb.hh: Add correct reference for HSL
+ * mln/fun/v2v/hsl_to_rgb.hh: Add correct reference for HSL
to RGB conversion.
2009-09-24 Roland Levillain <roland(a)lrde.epita.fr>
@@ -143,13 +143,13 @@
2009-09-22 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix HSL values in test.
- * tests/fun/v2v/hsl_to_rgb.cc: Fix HSL values.
+ * tests/fun/v2v/hsl_to_rgb.cc: Fix HSL values.
2009-09-21 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add new algorithm for conversion HSL to RGB.
- * mln/fun/v2v/hsl_to_rgb.hh: Add new algorithm for conversion.
- * mln/value/rgb.hh: Enable convertion to HSL.
+ * mln/fun/v2v/hsl_to_rgb.hh: Add new algorithm for conversion.
+ * mln/value/rgb.hh: Enable convertion to HSL.
2009-09-21 Roland Levillain <roland(a)lrde.epita.fr>
@@ -333,25 +333,25 @@
2009-09-15 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
- Fix ISO C++ compilation problem : L101.
+ Fix ISO C++ compilation problem: L101.
- * mln/io/plot/load.hh (load) : Update source file.
+ * mln/io/plot/load.hh (load): Update source file.
2009-09-14 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Disable tiled2d image support (still experimental).
- * mln/io/magick/save.hh: Disable tiled2d image support.
+ * mln/io/magick/save.hh: Disable tiled2d image support.
2009-09-14 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Update RGB to HSL test, correct luminance values with fractions.
- * tests/fun/v2v/rgb_to_hsl.cc: Update luminance values with fractions.
+ * tests/fun/v2v/rgb_to_hsl.cc: Update luminance values with fractions.
2009-09-14 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Disable tiled2d image support (still experimental).
- * mln/io/magick/load.hh: Disable tiled2d image support.
- * tests/fun/v2v/rgb_to_hsl.cc: Update test for luminance value.
+ * mln/io/magick/load.hh: Disable tiled2d image support.
+ * tests/fun/v2v/rgb_to_hsl.cc: Update test for luminance value.
2009-09-10 Roland Levillain <roland(a)lrde.epita.fr>
@@ -428,10 +428,10 @@
2009-09-10 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix luminance value computation for RGB to HSL.
- * mln/fun/v2v/rgb_to_hsl.hh: Fix luminance value computation
+ * mln/fun/v2v/rgb_to_hsl.hh: Fix luminance value computation
to fit in [0,1].
- * mln/io/magick/load.hh: Minor update.
- * mln/io/magick/save.hh: Minor update.
+ * mln/io/magick/load.hh: Minor update.
+ * mln/io/magick/save.hh: Minor update.
2009-09-09 Roland Levillain <roland(a)lrde.epita.fr>
@@ -446,14 +446,14 @@
2009-09-09 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Add mask-based max tree computation based on union-find algorithm.
- * morpho/tree/component_tree.hh: Some shortcuts to compute max
+ * morpho/tree/component_tree.hh: Some shortcuts to compute max
and min tree.
- * morpho/tree/compute_parent_dual_input.hh: New. Union-find based
+ * morpho/tree/compute_parent_dual_input.hh: New. Union-find based
algorithm for computing the dual input max tree.
- * morpho/tree/data.hh:
+ * morpho/tree/data.hh:
Comment debug instructions related to tree/graph usage.
Improve the tree diplay method.
- * morpho/tree/dual_input_tree.hh: Some shortcuts to compute
+ * morpho/tree/dual_input_tree.hh: Some shortcuts to compute
dual-input max and min tree.
2009-09-08 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
@@ -802,8 +802,8 @@
2009-08-17 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Fix rvalue for tree methods and other minor fixes..
- * morpho/tree/compute_attribute_image.hh: Supress warning.
- * morpho/tree/data.hh: Fix rvalue and overload operator << for tree.
+ * morpho/tree/compute_attribute_image.hh: Supress warning.
+ * morpho/tree/data.hh: Fix rvalue and overload operator << for tree.
2009-08-17 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
@@ -1189,7 +1189,7 @@
Fix compilation issues with icc and meta accumulators.
- * mln/core/concept/meta_accumulator.hh: introduce a helper to help
+ * mln/core/concept/meta_accumulator.hh: introduce a helper to help
icc resolving routine return types.
2009-07-06 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
@@ -30176,7 +30176,7 @@
* mln/canvas/browsing/snake_vert.hh: New, snake vert browsing
canvas. This canvas browse all the point of an image 'input' like
- this :
+ this:
1 4 5
|| /\ ||
|| || ||
@@ -32399,7 +32399,7 @@
2008-09-05 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Minor fix : Translation Rotation.
+ Minor fix: Translation Rotation.
* mln/fun/x2x/translation.hh,
* mln/fun/x2x/rotation.hh: Fix wrong namespaces.
@@ -37218,7 +37218,7 @@
2008-04-03 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
- A fast point2d set : p_image2d.
+ A fast point2d set: p_image2d.
* mln/core/p_image2d.hh: The new set.
* mln/core/p_image2d_piter.hh: To iter on it.
@@ -37646,7 +37646,7 @@
2008-03-19 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Icp : n dim, refactored, uses p_array, vec -> rounded point proc.
+ Icp: n dim, refactored, uses p_array, vec -> rounded point proc.
* mln/core/point.hh: Fix convertion to vec.
* mln/algebra/quat.hh: Fix namespace.
@@ -38289,7 +38289,7 @@
Binarization.
* mln/level/threshold.hh: Remove.
- * mln/fun/v2b: New directory : value to bool function.
+ * mln/fun/v2b: New directory: value to bool function.
* mln/fun/v2b/threshold.hh: value to bool threshold.
* mln/fun/v2v/threshold.hh: Remove.
* mln/binarization: New directory.
@@ -39023,7 +39023,7 @@
2008-01-17 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update graph.
- * mln/util/graph.hh: Fix : ordpair replace unsigned for edge.
+ * mln/util/graph.hh: Fix: ordpair replace unsigned for edge.
* mln/draw/mesh.hh: Apply this modification.
* mln/make/voronoi.hh: Fix comment.
@@ -39899,7 +39899,7 @@
2007-12-12 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Add traits for rgb. Fix the test rgb_full.
- * mln/value/rgb.hh: Add traits :
+ * mln/value/rgb.hh: Add traits:
rgb<n> + rgb<n> -> rgb<n>
rgb<n> - rgb<n> -> rgb<n>
rgb<n> * scalar_ -> rgb<n>
@@ -41078,7 +41078,7 @@
* mln/value/int_u.hh: Replace argument type by (unsigned int)
when it was (int).
- (value_integer_::max()) : Replace card - 1 by mln_max(enc_) to avoid
+ (value_integer_::max()): Replace card - 1 by mln_max(enc_) to avoid
returning -1 for high quantized values.
* tests/io/ppm/ppm16.cc,
@@ -41091,7 +41091,7 @@
* mln/io/fits/load.hh: Remove debug.
* mln/io/pfm/load.hh,
- * mln/io/pfm/save.hh: Fix a bug : the last line wasn't read/written.
+ * mln/io/pfm/save.hh: Fix a bug: the last line wasn't read/written.
* tests/io/fits/Makefile.am: Remove spaces.
@@ -42210,7 +42210,7 @@
2008-01-17 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update graph.
- * mln/util/graph.hh: Fix : ordpair replace unsigned for edge.
+ * mln/util/graph.hh: Fix: ordpair replace unsigned for edge.
* mln/draw/mesh.hh: Apply this modification.
* mln/make/voronoi.hh: Fix comment.
@@ -43086,7 +43086,7 @@
2007-12-12 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Add traits for rgb. Fix the test rgb_full.
- * mln/value/rgb.hh: Add traits :
+ * mln/value/rgb.hh: Add traits:
rgb<n> + rgb<n> -> rgb<n>
rgb<n> - rgb<n> -> rgb<n>
rgb<n> * scalar_ -> rgb<n>
@@ -44265,7 +44265,7 @@
* mln/value/int_u.hh: Replace argument type by (unsigned int)
when it was (int).
- (value_integer_::max()) : Replace card - 1 by mln_max(enc_) to avoid
+ (value_integer_::max()): Replace card - 1 by mln_max(enc_) to avoid
returning -1 for high quantized values.
* tests/io/ppm/ppm16.cc,
@@ -44278,7 +44278,7 @@
* mln/io/fits/load.hh: Remove debug.
* mln/io/pfm/load.hh,
- * mln/io/pfm/save.hh: Fix a bug : the last line wasn't read/written.
+ * mln/io/pfm/save.hh: Fix a bug: the last line wasn't read/written.
* tests/io/fits/Makefile.am: Remove spaces.
@@ -45039,7 +45039,7 @@
Review the mln/geom directory.
* mln/geom/seeds2tiling.hh: Clean dead code, update doc. Fixme for
- guillaume : Review the documentation.
+ guillaume: Review the documentation.
* mln/geom/seeds2tiling_with_chamfer.hh: likewise.
Add unit tests.
@@ -45374,7 +45374,7 @@
2007-11-13 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
- Fix queue : rename empty in is_empty and add method pop_front.
+ Fix queue: rename empty in is_empty and add method pop_front.
Rename empty in is_empty and add method pop_front, which
return the front element and pop the queue.
@@ -45540,7 +45540,7 @@
Desactivate set_of::operator<<.
* mln/core/internal/set_of.hh: (operator<<) Desactivate due to
- an ambiguity with Point_set::operator<<. QUESTION for theo : Can I
+ an ambiguity with Point_set::operator<<. QUESTION for theo: Can I
remove it?
2007-11-06 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
@@ -45669,7 +45669,7 @@
Add functon which display a binary image from a FLLT branch.
* mln/util/tree_to_image.hh:
- (display_branch(const Image<J>& ima_, node<I>* node)) :
+ (display_branch(const Image<J>& ima_, node<I>* node)):
Take a node and compute its binary image from set_p of FLLT
and display this image.
@@ -45734,8 +45734,8 @@
Add debug display tools for fllt.
- * mln/util/tree_to_image.hh: Add functions :
- (display_set(const Image<J>& ima_, set_p<P>& s)) :
+ * mln/util/tree_to_image.hh: Add functions:
+ (display_set(const Image<J>& ima_, set_p<P>& s)):
display set_p with ima_ domain into a binary image.
(display_tree_rec(const Image<J>& ima_, node<T>* node, int level))
Recursive function of ...
@@ -46795,7 +46795,7 @@
* mln/core/point.hh: Fix to respect homogeneous vector handling.
* mln/fun/internal/x2x_impl.hh: Rename as ...
* mln/fun/internal/x2x_linear_impl.hh: ...this
- (operator()) : Take vec and return vec.
+ (operator()): Take vec and return vec.
2007-10-12 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
@@ -46891,7 +46891,7 @@
* mln/value/graylevel.hh: Re add operator=(int)
* tests/value_int_u8.cc: More tests.
- * tests/value_graylevel.cc: Likewise. FIXME : to augment.
+ * tests/value_graylevel.cc: Likewise. FIXME: to augment.
2007-10-11 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
@@ -47287,7 +47287,7 @@
2007-10-09 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
- Improve hexagonal images. Fixme : doesn't work properly now.
+ Improve hexagonal images. Fixme: doesn't work properly now.
* mln/debug/println.hh: Println for hexa images.
@@ -47310,7 +47310,7 @@
2007-10-09 Simon Nivault <simon.nivault(a)lrde.epita.fr>
- Refactoring : move mln/core/win to mln/win.
+ Refactoring: move mln/core/win to mln/win.
* mln/core/win/backdiag2d.hh,
* mln/core/win/cube3d.hh,
* mln/core/win/diag2d.hh,
@@ -47614,7 +47614,7 @@
2007-10-08 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
- Move color_sub from sandbox into color_pretty in a new folder : display.
+ Move color_sub from sandbox into color_pretty in a new folder: display.
* mln/display/color_pretty.hh: New.
* mln/display: New folder for display.
@@ -47638,7 +47638,7 @@
* mln/make/box2d_h.hh: New.
* mln/make/dpoint2d_h.hh: New.
* mln/make/point2d_h.hh: New.
- * tests/hexa.cc: New, Fixme : write more tests.
+ * tests/hexa.cc: New, Fixme: write more tests.
2007-10-08 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
@@ -48846,8 +48846,8 @@
2007-09-26 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
- Add plain image. FIXME : doesn't compile because of a error in init (called by
- clone).
+ Add plain image. FIXME: doesn't compile because of a error in
+ init (called by clone).
* mln/core/plain.hh: New.
* tests/plain.cc: New.
@@ -49619,7 +49619,7 @@
loading of ppm 8/16 bits format done
* mln/value/rgb.hh:
- To fix : we can't apply level:transform on rgb images
+ To fix: we can't apply level:transform on rgb images
convert_< rgb8 > could be one part of the problem.
* mln/value/rgb16.hh:
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 6c9c7d3..797fa7b 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,15 +1,15 @@
2009-09-24 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add benchmark for disk-mapped image and work for color types.
- * fabien/igr/color/find_color.cc: Find green color in an image.
- * fabien/mln/core/image/disk_ima.hh: Implement disk-mapped image.
- * fabien/mln/io/pnm/load_disk_ima.hh: Implement loading of disk-
+ * fabien/igr/color/find_color.cc: Find green color in an image.
+ * fabien/mln/core/image/disk_ima.hh: Implement disk-mapped image.
+ * fabien/mln/io/pnm/load_disk_ima.hh: Implement loading of disk-
mapped image from a PNM file.
- * fabien/tests/core/image/bench.sh: New script for benchmarking
+ * fabien/tests/core/image/bench.sh: New script for benchmarking
disk-mapped image and tiled image.
- * fabien/mln/test/conversion.hh: Implement test for evaluation of
+ * fabien/mln/test/conversion.hh: Implement test for evaluation of
type conversion.
- * fabien/tests/test/conversion.cc: Test evalution of type conversion.
+ * fabien/tests/test/conversion.cc: Test evalution of type conversion.
2009-09-24 Roland Levillain <roland(a)lrde.epita.fr>
@@ -52,67 +52,64 @@
Prepare demo for theo and questions for guillaume.
Rename fraction directory into frac directory.
-
- * green/doc/examples/fraction/frac.cc : Delete.
- * green/doc/examples/fraction/frac.hh : Delete.
- * green/doc/examples/fraction/gcd.hh : Delete
- * green/doc/examples/fraction/sign_prod.hh : Delete.
-
- * green/doc/examples/frac/frac.cc : New.
- * green/doc/examples/frac/frac.hh : New.
- * green/doc/examples/frac/gcd.hh : New.
- * green/doc/examples/frac/sign_prod.hh : New.
- * green/doc/examples/frac/Makefile.am : New.
+
+ * green/doc/examples/fraction/frac.cc: Delete.
+ * green/doc/examples/fraction/frac.hh: Delete.
+ * green/doc/examples/fraction/gcd.hh: Delete
+ * green/doc/examples/fraction/sign_prod.hh: Delete.
+
+ * green/doc/examples/frac/frac.cc: New.
+ * green/doc/examples/frac/frac.hh: New.
+ * green/doc/examples/frac/gcd.hh: New.
+ * green/doc/examples/frac/sign_prod.hh: New.
+ * green/doc/examples/frac/Makefile.am: New.
Collect some tmp results.
-
+
* green/mln/io/plot/save_histo_sh.hh
- (save_histo_sh<2d>) : Comment method.
- * green/mln/mln/accu/stat/histo1d.hh
- : Update documentation.
- * green/mln/mln/accu/stat/histo3d_rgb.hh
- : Update documentation.
- * green/mln/mln/accu/stat/histo3d_hsl.hh
- : Update documentation.
+ (save_histo_sh<2d>): Comment method.
+ * green/mln/mln/accu/stat/histo1d.hh: Update documentation.
+ * green/mln/mln/accu/stat/histo3d_rgb.hh: Update documentation.
+ * green/mln/mln/accu/stat/histo3d_hsl.hh: Update documentation.
* green/mln/tests/accu/stat/histo1d/histo1d.cc
- (test_8bits_integration, main) : Comment unused code, save tmp results.
- (test_8bits_operator_equal) : Test infer "!=" operator.
+ (test_8bits_integration, main): Comment unused code, save tmp results.
+ (test_8bits_operator_equal): Test infer "!=" operator.
* green/mln/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc
- (test_integration, main) : Comment unused code, save tmp results.
+ (test_integration, main): Comment unused code, save tmp results.
* green/mln/tests/accu/stat/histo3d_hsl/histo3d_hsl.cc
- (test_integration, main) : Comment unused code, save tmp results.
+ (test_integration, main): Comment unused code, save tmp results.
2009-09-22 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Adapt styles. Need some 2d code.
-
- * green/mln/io/plot/save_histo_sh.hh (save_histo_sh<2d>) : New func.
+
+ * green/mln/io/plot/save_histo_sh.hh (save_histo_sh<2d>): New func.
2009-09-22 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Fix bug in histo3d_hsl count method.
-
- * green/mln/accu/stat/histo3d_hsl.hh (take) : Fix bug.
+
+ * green/mln/accu/stat/histo3d_hsl.hh (take): Fix bug.
* green/tests/accu/stat/histo3d_hsl/histo3d_hsl.cc
(count_histo, mean_histo, var_histo, test_integration): Fix bug.
2009-09-22 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Put the basis of a general gnuplot shell export function.
-
- * green/mln/io/plot/save_image_sh.hh : New library file.
- * green/tests/io/plot/save_image_sh : New directory.
- * green/tests/io/plot/save_image_sh/Makefile : New Makefile.
- * green/tests/io/plot/save_image_sh/save_image_sh.cc : New unit tests.
+
+ * green/mln/io/plot/save_image_sh.hh: New library file.
+ * green/tests/io/plot/save_image_sh: New directory.
+ * green/tests/io/plot/save_image_sh/Makefile: New Makefile.
+ * green/tests/io/plot/save_image_sh/save_image_sh.cc: New unit tests.
2009-09-21 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add disk_ima test, improve HSL operations.
- * fabien/igr/color/find_color.cc: Add operations on HSL values.
- * fabien/mln/core/image/disk_ima.hh: Implement an image directly
+ * fabien/igr/color/find_color.cc: Add operations on HSL values.
+ * fabien/mln/core/image/disk_ima.hh: Implement an image directly
mapped on disk.
- * fabien/tests/core/image/Makefile: Add `disk_ima' target.
- * fabien/tests/core/image/disk_ima.cc: New test file for the
+ * fabien/tests/core/image/Makefile: Add `disk_ima' target.
+ * fabien/tests/core/image/disk_ima.cc: New test file for the
disk_ima class.
2009-09-18 Roland Levillain <roland(a)lrde.epita.fr>
@@ -132,24 +129,24 @@
2009-09-17 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix index value bug.
- * fabien/mln/core/image/cache.hh: Fix index value bug.
- * fabien/tests/core/image/tiled2d.cc: Minor update.
+ * fabien/mln/core/image/cache.hh: Fix index value bug.
+ * fabien/tests/core/image/tiled2d.cc: Minor update.
2009-09-16 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Implement basic LRU cache algorithm.
- * fabien/mln/core/image/cache.hh: Implement basic LRU cache
+ * fabien/mln/core/image/cache.hh: Implement basic LRU cache
algorithm.
- * fabien/tests/core/image/tiled2d.cc: Minor update.
+ * fabien/tests/core/image/tiled2d.cc: Minor update.
2009-09-16 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add experimental cache support in 2D tiled image.
- * fabien/mln/core/image/cache.hh: Implement cache management.
- * fabien/mln/core/image/page.hh: Implement page management.
- * fabien/mln/core/image/tiled2d.hh: Add cache management.
- * fabien/tests/core/image/Makefile: Minor update.
- * fabien/tests/core/image/tiled2d.cc: Minor update.
+ * fabien/mln/core/image/cache.hh: Implement cache management.
+ * fabien/mln/core/image/page.hh: Implement page management.
+ * fabien/mln/core/image/tiled2d.hh: Add cache management.
+ * fabien/tests/core/image/Makefile: Minor update.
+ * fabien/tests/core/image/tiled2d.cc: Minor update.
2009-09-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
@@ -164,31 +161,31 @@
2009-09-14 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Fix bug in histo3d_rgb (parameters'order in Point's constructor)
-
+
* green/mln/accu/stat/histo3d_rgb.hh
- (take) : Fix point's call.
+ (take): Fix point's call.
* green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc
- (conv) : Delete func.
+ (conv): Delete func.
* green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc
- (mean_histo, var_histo2) : Update func.
+ (mean_histo, var_histo2): Update func.
2009-09-14 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Move stats directory in doc/examples.
-
- * green/doc/examples/stats : New directory.
- * green/doc/examples/stats/Makefile.am : Copy makefile.
- * green/doc/examples/stats/stats.cc : Copy source file.
-
- * green/stats/stats.cc : Remove source file.
- * green/stats/Makefile.am : Remove makefile.
- * green/stats : Remove directory.
+
+ * green/doc/examples/stats: New directory.
+ * green/doc/examples/stats/Makefile.am: Copy makefile.
+ * green/doc/examples/stats/stats.cc: Copy source file.
+
+ * green/stats/stats.cc: Remove source file.
+ * green/stats/Makefile.am: Remove makefile.
+ * green/stats: Remove directory.
2009-09-13 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Save work in progress for histo and hsl. Everything is updated.
- * green/mln/accu/stat/histo3d_hsl.hh :Update library file.
+ * green/mln/accu/stat/histo3d_hsl.hh:Update library file.
* green/tests/accu/stat/histo3d_hsl/histo3d_hsl.cc:Update unitary test.
@@ -196,213 +193,213 @@
Delete obsolete sources.
- * green/mln/fun/x2v/sampler.hh : Delete obsolete library file.
- * green/mln/fun/x2v : Delete directory.
+ * green/mln/fun/x2v/sampler.hh: Delete obsolete library file.
+ * green/mln/fun/x2v: Delete directory.
2009-09-11 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Save work in progress for histo and hsl (interpolation part).
- * green/mln/fun/x2v : New directory.
- * green/mln/fun/x2v/sampler.hh : New library file.
+ * green/mln/fun/x2v: New directory.
+ * green/mln/fun/x2v/sampler.hh: New library file.
2009-09-11 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Save work in progress for histo and hsl.
- * green/mln/accu/stat/histo3d_hsl.hh : New library file.
+ * green/mln/accu/stat/histo3d_hsl.hh: New library file.
- * green/tests/accu/stat/histo3d_hsl : New directory.
- * green/tests/accu/stat/histo3d_hsl/Makefile.am : New makefile.
- * green/tests/accu/stat/histo3d_hsl/histo3d_hsl.cc : New source file.
+ * green/tests/accu/stat/histo3d_hsl: New directory.
+ * green/tests/accu/stat/histo3d_hsl/Makefile.am: New makefile.
+ * green/tests/accu/stat/histo3d_hsl/histo3d_hsl.cc: New source file.
2009-09-11 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Do some refactoring in green's sandbox.
- * green/doc/examples : New directory.
+ * green/doc/examples: New directory.
Move hello_world directory in doc/examples.
- * green/doc/examples/hello_world : New directory.
- * green/doc/examples/hello_world/Makefile.am : Copy makefile.
- * green/doc/examples/hello_world/hellow_world.cc : Copy source file.
- * green/doc/examples/hello_world/print.cc : Copy source file.
+ * green/doc/examples/hello_world: New directory.
+ * green/doc/examples/hello_world/Makefile.am: Copy makefile.
+ * green/doc/examples/hello_world/hellow_world.cc: Copy source file.
+ * green/doc/examples/hello_world/print.cc: Copy source file.
- * green/hello_world/hello_world.cc : Remove source file.
- * green/hello_world/print.cc : Remove source file.
- * green/hello_world/Makefile.am : Remove makefile.
- * green/hello_world : Remove directory.
+ * green/hello_world/hello_world.cc: Remove source file.
+ * green/hello_world/print.cc: Remove source file.
+ * green/hello_world/Makefile.am: Remove makefile.
+ * green/hello_world: Remove directory.
Move hello_milena directory in doc/examples.
- * green/doc/exampleshello_milena : New directory.
- * green/doc/exampleshello_milena/Makefile.am : Copy makefile.
- * green/doc/examples/hello_milena/hello_milena.cc : Copy source file.
+ * green/doc/exampleshello_milena: New directory.
+ * green/doc/exampleshello_milena/Makefile.am: Copy makefile.
+ * green/doc/examples/hello_milena/hello_milena.cc: Copy source file.
- * green/hello_milena/hello_milena.cc : Remove source file.
- * green/hello_milena/Makefile.am : Remove makefile.
- * green/hello_milena : Remove directory.
+ * green/hello_milena/hello_milena.cc: Remove source file.
+ * green/hello_milena/Makefile.am: Remove makefile.
+ * green/hello_milena: Remove directory.
Move learn_milena directory in doc/examples.
- * green/doc/examples/learn_milena : New directory.
- * green/doc/examples/learn_milena/Makefile.am : Copy makefile.
- * green/doc/examples/learn_milena/learn_milena.cc : Copy source file.
+ * green/doc/examples/learn_milena: New directory.
+ * green/doc/examples/learn_milena/Makefile.am: Copy makefile.
+ * green/doc/examples/learn_milena/learn_milena.cc: Copy source file.
- * green/learn_milena/learn_milena.cc : Remove source file.
- * green/learn_milena/Makefile.am : Remove makefile.
- * green/learn_milena : Remove directory.
+ * green/learn_milena/learn_milena.cc: Remove source file.
+ * green/learn_milena/Makefile.am: Remove makefile.
+ * green/learn_milena: Remove directory.
Move otsu directory in doc/examples.
- * green/doc/examples/otsu : New directory.
- * green/doc/examples/otsu/Makefile.am : Copy makefile.
- * green/doc/examples/otsu/otsu.cc : Copy source file.
+ * green/doc/examples/otsu: New directory.
+ * green/doc/examples/otsu/Makefile.am: Copy makefile.
+ * green/doc/examples/otsu/otsu.cc: Copy source file.
- * green/otsu/otsu.cc : Remove source file.
- * green/otsu/Makefile.am : Remove makefile.
- * green/otsu : Remove directory.
+ * green/otsu/otsu.cc: Remove source file.
+ * green/otsu/Makefile.am: Remove makefile.
+ * green/otsu: Remove directory.
Move fraction directory in doc/examples.
- * green/doc/examples/fraction : Remove directory.
- * green/doc/examples/fraction/Makefile.am : Remove makefile.
- * green/doc/examples/fraction/frac.cc : Remove source file.
- * green/doc/examples/fraction/frac.hh : Remove source file.
- * green/doc/examples/fraction/sign_prod.hh : Remove source file.
- * green/doc/examples/fraction/gcd.hh : Remove source file.
+ * green/doc/examples/fraction: Remove directory.
+ * green/doc/examples/fraction/Makefile.am: Remove makefile.
+ * green/doc/examples/fraction/frac.cc: Remove source file.
+ * green/doc/examples/fraction/frac.hh: Remove source file.
+ * green/doc/examples/fraction/sign_prod.hh: Remove source file.
+ * green/doc/examples/fraction/gcd.hh: Remove source file.
- * green/fraction/frac.cc : Remove source file.
- * green/fraction/frac.hh : Remove source file.
- * green/fraction/sign_prod.hh : Remove source file.
- * green/fraction/gcd.hh : Remove source file.
- * green/fraction/Makefile.am : Remove makefile.
- * green/fraction : Remove directory.
+ * green/fraction/frac.cc: Remove source file.
+ * green/fraction/frac.hh: Remove source file.
+ * green/fraction/sign_prod.hh: Remove source file.
+ * green/fraction/gcd.hh: Remove source file.
+ * green/fraction/Makefile.am: Remove makefile.
+ * green/fraction: Remove directory.
Add A new example in doc/examples.
- * green/doc/examples/accu_color : New directory.
- * green/doc/examples/accu_color/accu_color.cc : New source file.
+ * green/doc/examples/accu_color: New directory.
+ * green/doc/examples/accu_color/accu_color.cc: New source file.
2009-09-11 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Remove trailing spaces.
- * green/doc/formulae/formulae.tex : Correct file.
+ * green/doc/formulae/formulae.tex: Correct file.
2009-09-11 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Correct english writing in the documentation file.
- * green/doc/formulae/formulae.tex : Correct file.
+ * green/doc/formulae/formulae.tex: Correct file.
2009-09-10 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Try to fix order problem between points and vectors.
* green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc
- (var_histo, mean_histo) : Comment p.to_vec code.
+ (var_histo, mean_histo): Comment p.to_vec code.
2009-09-10 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Write down the basis of the quick tour summary documentation.
- * green/doc/quick_tour : New specific directory.
- * green/doc/quick_tour/quick_tour.tex : New documentation work.
+ * green/doc/quick_tour: New specific directory.
+ * green/doc/quick_tour/quick_tour.tex: New documentation work.
2009-09-10 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Write down 3d currently used formulaes.
- * green/doc : New documentation directory.
- * green/doc/formulae : New specific directory.
- * green/doc/formulae/formulae.tex : New recipe of 3d formulae.
+ * green/doc: New documentation directory.
+ * green/doc/formulae: New specific directory.
+ * green/doc/formulae/formulae.tex: New recipe of 3d formulae.
2009-09-09 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Fix bugs an compilation problem on histo3d_rgb source code.
* green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc
- (test_integration) : Manage conversion between rgb and vector.
+ (test_integration): Manage conversion between rgb and vector.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Work with histogram as image 3d on rgb color space.
- * green/tests/accu/stat/histo3d_rgb : New directory.
- * green/tests/accu/stat/histo3d_rgb/Makefile.am : New makefile.
- * green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc : New unitary tests.
- * green/mln/accu/stat/histo3d_rgb/histo3d_rgb.hh : New library code.
- * green/mln/fun/v2v/rgb8_to_rgbn.hh : New converting fun.
+ * green/tests/accu/stat/histo3d_rgb: New directory.
+ * green/tests/accu/stat/histo3d_rgb/Makefile.am: New makefile.
+ * green/tests/accu/stat/histo3d_rgb/histo3d_rgb.cc: New unitary tests.
+ * green/mln/accu/stat/histo3d_rgb/histo3d_rgb.hh: New library code.
+ * green/mln/fun/v2v/rgb8_to_rgbn.hh: New converting fun.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Prepare unitary test with histogram 2d.
- * green/tests/accu/stat/histo2d : New directory.
- * green/tests/accu/stat/histo2d/Makefile.am : New makefile.
- * green/tests/accu/stat/histo2d/gaussian2d.sh : New calibrating tool.
+ * green/tests/accu/stat/histo2d: New directory.
+ * green/tests/accu/stat/histo2d/Makefile.am: New makefile.
+ * green/tests/accu/stat/histo2d/gaussian2d.sh: New calibrating tool.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Make some test on 14 bits grayscale image.
- * green/mln/accu/stat/histo1d/histo1d.hh : Improve documentation.
+ * green/mln/accu/stat/histo1d/histo1d.hh: Improve documentation.
* green/tests/accu/stat/histo1d/histo1d.cc
- (test_14bits_classifying) : Test gausian filtering.
- * green/mln/io/plot/save_histo_sh.hh : Test new gnuplot style.
+ (test_14bits_classifying): Test gausian filtering.
+ * green/mln/io/plot/save_histo_sh.hh: Test new gnuplot style.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Improve histo1d testing with 14 bits grayscale image.
- * green/mln/fun : New directory.
- * green/mln/fun/v2v : New directory.
- * green/mln/fun/v2v/int_u16_to_int_u14.hh : New subsampling function.
- * green/tests/accu/stat/histo1d/histo1d.cc : Improve unitary tests.
+ * green/mln/fun: New directory.
+ * green/mln/fun/v2v: New directory.
+ * green/mln/fun/v2v/int_u16_to_int_u14.hh: New subsampling function.
+ * green/tests/accu/stat/histo1d/histo1d.cc: Improve unitary tests.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Delete old k_mean source location.
- * green/k_mean/Makefile.am : Remove old makefile.
- * green/k_mean/k_mean.hh : Remove old library code.
- * green/k_mean/k_mean.cc : Remove old unitary tests.
- * green/k_mean : Remove old directory.
+ * green/k_mean/Makefile.am: Remove old makefile.
+ * green/k_mean/k_mean.hh: Remove old library code.
+ * green/k_mean/k_mean.cc: Remove old unitary tests.
+ * green/k_mean: Remove old directory.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Delete old histo1d source location.
- * green/histo1d/Makefile.am : Remove old makefile.
- * green/histo1d/gaussian.sh : Remove old tools.
- * green/histo1d/histo1d.hh : Remove old library code.
- * green/histo1d/histo1d.cc : Remove old unitary tests.
- * green/histo1d/mp00082c_50p.pgm : Remove old image.
- * green/histo1d/save_sh.hh : Remove old library code.
- * green/histo1d : Remove old directory.
+ * green/histo1d/Makefile.am: Remove old makefile.
+ * green/histo1d/gaussian.sh: Remove old tools.
+ * green/histo1d/histo1d.hh: Remove old library code.
+ * green/histo1d/histo1d.cc: Remove old unitary tests.
+ * green/histo1d/mp00082c_50p.pgm: Remove old image.
+ * green/histo1d/save_sh.hh: Remove old library code.
+ * green/histo1d: Remove old directory.
2009-09-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Do some refactoring for best future olena integration.
- * green/mln : New dev directory.
- * green/mln/accu : New directory.
- * green/mln/accu/stat : New directory.
- * green/mln/accu/stat/histo1d.hh : New histo1d location.
- * green/mln/img_path.hh : New image path defines.
- * green/mln/io : New directory.
- * green/mln/io/plot : New directory.
- * green/mln/io/plot/save_histo_sh : New saving func for histo.
- * green/tests : New unitary test directory.
- * green/tests/accu : New directory.
- * green/tests/accu/stat : New directory.
- * green/tests/accu/stat/histo1d : New histo1d test directory.
+ * green/mln: New dev directory.
+ * green/mln/accu: New directory.
+ * green/mln/accu/stat: New directory.
+ * green/mln/accu/stat/histo1d.hh: New histo1d location.
+ * green/mln/img_path.hh: New image path defines.
+ * green/mln/io: New directory.
+ * green/mln/io/plot: New directory.
+ * green/mln/io/plot/save_histo_sh: New saving func for histo.
+ * green/tests: New unitary test directory.
+ * green/tests/accu: New directory.
+ * green/tests/accu/stat: New directory.
+ * green/tests/accu/stat/histo1d: New histo1d test directory.
* green/tests/accu/stat/histo1d/Makefile.am: New makefle.
- * green/tests/accu/stat/histo1d/histo1d.cc : New unit tests location.
+ * green/tests/accu/stat/histo1d/histo1d.cc: New unit tests location.
* green/tests/accu/stat/histo1d/gaussian.sh: New tools to test filter.
@@ -410,39 +407,39 @@
Do some refactoring for best future olena integration.
- * green/mln : New dev directory.
- * green/mln/clustering : New directory.
- * green/mln/clustering/k_mean.hh : New k_mean source location.
- * green/tests : New unitary test directory.
- * green/tests/clustering : New directory.
- * green/tests/clustering/k_mean : New k_mean test directory.
+ * green/mln: New dev directory.
+ * green/mln/clustering: New directory.
+ * green/mln/clustering/k_mean.hh: New k_mean source location.
+ * green/tests: New unitary test directory.
+ * green/tests/clustering: New directory.
+ * green/tests/clustering/k_mean: New k_mean test directory.
* green/tests/clustering/k_mean/Makefile.am: New makefle.
- * green/tests/clustering/k_mean/k_mean.cc : New unit tests location.
+ * green/tests/clustering/k_mean/k_mean.cc: New unit tests location.
2009-09-07 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix output dimensions.
- * fabien/mln/upsampling/hq4x.hh: Fix output dimensions.
+ * fabien/mln/upsampling/hq4x.hh: Fix output dimensions.
2009-09-07 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add HQ4x algorithm, change license and add credit to original author.
- * fabien/mln/upsampling/hq2x.hh: Change license and add credit to
+ * fabien/mln/upsampling/hq2x.hh: Change license and add credit to
original author.
- * fabien/mln/upsampling/hq3x.hh: Change license and add credit to
+ * fabien/mln/upsampling/hq3x.hh: Change license and add credit to
original author.
- * fabien/mln/upsampling/hq4x.hh: Implement HQ4x algorithm, still
+ * fabien/mln/upsampling/hq4x.hh: Implement HQ4x algorithm, still
not working properly.
- * fabien/tests/upsampling/Makefile: Add target `hq4x'.
- * fabien/tests/upsampling/hq4x.cc: New test file for hq4x().
+ * fabien/tests/upsampling/Makefile: Add target `hq4x'.
+ * fabien/tests/upsampling/hq4x.cc: New test file for hq4x().
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Implement HQ2x upscaling algorithm.
- * fabien/mln/upsampling/hq2x.hh: Implement HQ2x algorithm.
- * fabien/mln/upsampling/hq3x.hh: Remove dead code.
- * fabien/tests/upsampling/Makefile: Add `hq2x' target.
- * fabien/tests/upsampling/hq2x.cc: New test file for HQ2x.
+ * fabien/mln/upsampling/hq2x.hh: Implement HQ2x algorithm.
+ * fabien/mln/upsampling/hq3x.hh: Remove dead code.
+ * fabien/tests/upsampling/Makefile: Add `hq2x' target.
+ * fabien/tests/upsampling/hq2x.cc: New test file for HQ2x.
2009-09-04 Roland Levillain <roland(a)lrde.epita.fr>
@@ -498,19 +495,19 @@
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix red component bug.
- * fabien/mln/upsampling/hq3x.hh: Fix red component bug, still not
+ * fabien/mln/upsampling/hq3x.hh: Fix red component bug, still not
working properly because of blue artifacts.
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add implementation of HQ3x algorithm.
- * fabien/mln/core/image/magick_tiled2d.hh: Small update.
- * fabien/mln/core/image/tiled2d.hh: Small update.
- * fabien/mln/upsampling/hq3x.hh: Implement HQ3x algorithm, not working
+ * fabien/mln/core/image/magick_tiled2d.hh: Small update.
+ * fabien/mln/core/image/tiled2d.hh: Small update.
+ * fabien/mln/upsampling/hq3x.hh: Implement HQ3x algorithm, not working
properly with colors.
- * fabien/tests/core/image/tiled2d.cc: Update test.
- * fabien/tests/upsampling/Makefile: New Makefile for target hq3x.
- * fabien/tests/upsampling/hq3x.cc: New test for algorithm HQ3x.
+ * fabien/tests/core/image/tiled2d.cc: Update test.
+ * fabien/tests/upsampling/Makefile: New Makefile for target hq3x.
+ * fabien/tests/upsampling/hq3x.cc: New test for algorithm HQ3x.
2009-08-31 Roland Levillain <roland(a)lrde.epita.fr>
@@ -523,59 +520,59 @@
Write the kmean main loop.
- * green/k_mean/k_mean.hh (update_variance) : Fix bug.
- * green/k_mean/k_mean.hh (update_center) : Fix bug.
- * green/k_mean/k_mean.hh (min_row) : New min func.
- * green/k_mean/k_mean.hh (min) : Remove old min func.
- * green/k_mean/k_mean.hh (loop) : New main func.
- * green/k_mean/k_mean.hh : Refactoring.
- * green/k_mean/k_mean.cc (test_loop) : New unitary test.
- * green/k_mean/k_mean.cc (main) : New test calls.
+ * green/k_mean/k_mean.hh (update_variance): Fix bug.
+ * green/k_mean/k_mean.hh (update_center): Fix bug.
+ * green/k_mean/k_mean.hh (min_row): New min func.
+ * green/k_mean/k_mean.hh (min): Remove old min func.
+ * green/k_mean/k_mean.hh (loop): New main func.
+ * green/k_mean/k_mean.hh: Refactoring.
+ * green/k_mean/k_mean.cc (test_loop): New unitary test.
+ * green/k_mean/k_mean.cc (main): New test calls.
2009-08-28 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Improve and continue testing the kmean clustering code.
- * green/k_mean/k_mean.hh (get_distance) : New accessor method.
- * green/k_mean/k_mean.hh (get_group) : New accessor method.
- * green/k_mean/k_mean.hh (get_variance) : New accessor method.
- * green/k_mean/k_mean.hh (update_variance) : New compute method.
- * green/k_mean/k_mean.hh (div_col) : New tool method.
- * green/k_mean/k_mean.hh (sum_row) : New tool method.
- * green/k_mean/k_mean.hh (k_mean) : Add variance code.
- * green/k_mean/k_mean.hh (~k_mean) : Add variance code.
- * green/k_mean/k_mean.hh (update_center) : Fix bugs.
- * green/k_mean/k_mean.hh (update_distance) : New debugging code.
- * green/k_mean/k_mean.cc (#define) : New macros.
- * green/k_mean/k_mean.cc (rgb8_to_4colors) : Comment debugging code.
- * green/k_mean/k_mean.cc (is_equivalent) : Adapt the signature.
- * green/k_mean/k_mean.cc (test_init_point) : Adapt the k_mean call.
- * green/k_mean/k_mean.cc (is_equal) : Remove old function.
- * green/k_mean/k_mean.cc (set_point) : New assignment func.
- * green/k_mean/k_mean.cc (fake_init_point) : New initializat° func.
- * green/k_mean/k_mean.cc (is_equal) : New predicate.
- * green/k_mean/k_mean.cc (test_init_center) : New unitary test.
- * green/k_mean/k_mean.cc (set_center) : New assignment func.
- * green/k_mean/k_mean.cc (fake_init_center) : New initializat° func.
- * green/k_mean/k_mean.cc (dist) : New distance function.
+ * green/k_mean/k_mean.hh (get_distance): New accessor method.
+ * green/k_mean/k_mean.hh (get_group): New accessor method.
+ * green/k_mean/k_mean.hh (get_variance): New accessor method.
+ * green/k_mean/k_mean.hh (update_variance): New compute method.
+ * green/k_mean/k_mean.hh (div_col): New tool method.
+ * green/k_mean/k_mean.hh (sum_row): New tool method.
+ * green/k_mean/k_mean.hh (k_mean): Add variance code.
+ * green/k_mean/k_mean.hh (~k_mean): Add variance code.
+ * green/k_mean/k_mean.hh (update_center): Fix bugs.
+ * green/k_mean/k_mean.hh (update_distance): New debugging code.
+ * green/k_mean/k_mean.cc (#define): New macros.
+ * green/k_mean/k_mean.cc (rgb8_to_4colors): Comment debugging code.
+ * green/k_mean/k_mean.cc (is_equivalent): Adapt the signature.
+ * green/k_mean/k_mean.cc (test_init_point): Adapt the k_mean call.
+ * green/k_mean/k_mean.cc (is_equal): Remove old function.
+ * green/k_mean/k_mean.cc (set_point) : New assignment func.
+ * green/k_mean/k_mean.cc (fake_init_point): New initializat° func.
+ * green/k_mean/k_mean.cc (is_equal): New predicate.
+ * green/k_mean/k_mean.cc (test_init_center): New unitary test.
+ * green/k_mean/k_mean.cc (set_center): New assignment func.
+ * green/k_mean/k_mean.cc (fake_init_center): New initializat° func.
+ * green/k_mean/k_mean.cc (dist): New distance function.
* green/k_mean/k_mean.cc (test_update_distance): New unitary test.
- * green/k_mean/k_mean.cc (set_distance) : New assignment func.
- * green/k_mean/k_mean.cc (fake_init_distance) : New initializat° func.
- * green/k_mean/k_mean.cc (test_update_group) : New unitary test.
- * green/k_mean/k_mean.cc (set_group) : New assignment func.
- * green/k_mean/k_mean.cc (fake_update_group) : New initializat° func.
- * green/k_mean/k_mean.cc (test_update_center) : New unitary test.
- * green/k_mean/k_mean.cc (test_row) : Remove old function.
- * green/k_mean/k_mean.cc (test_col) : Remove old function.
- * green/k_mean/k_mean.cc (test_update_var) : New unitary test.
- * green/k_mean/k_mean.cc (main) : New test calls.
+ * green/k_mean/k_mean.cc (set_distance): New assignment func.
+ * green/k_mean/k_mean.cc (fake_init_distance): New initializat° func.
+ * green/k_mean/k_mean.cc (test_update_group): New unitary test.
+ * green/k_mean/k_mean.cc (set_group): New assignment func.
+ * green/k_mean/k_mean.cc (fake_update_group): New initializat° func.
+ * green/k_mean/k_mean.cc (test_update_center): New unitary test.
+ * green/k_mean/k_mean.cc (test_row): Remove old function.
+ * green/k_mean/k_mean.cc (test_col): Remove old function.
+ * green/k_mean/k_mean.cc (test_update_var): New unitary test.
+ * green/k_mean/k_mean.cc (main): New test calls.
2009-08-27 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Improve and test the kmean clustering code.
- * green/k_mean/k_mean.hh (get_center, get_point) : New accessors.
+ * green/k_mean/k_mean.hh (get_center, get_point): New accessors.
* green/k_mean/k_mean.cc (rgb8_to_4colors),
(print_color),
(fill_image_with_4colors),
@@ -583,22 +580,22 @@
(test_init_point),
(is_equal),
(is_center_initialized),
- (test_init_center) : New test functions.
+ (test_init_center): New test functions.
2009-08-26 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
New kmean clustering code.
- * green/k_mean : New directory.
- * green/k_mean/k_mean.hh : New source.
- * green/k_mean/k_mean.cc : New test file.
- * green/k_mean/Makefile.am : New makefile.
+ * green/k_mean: New directory.
+ * green/k_mean/k_mean.hh: New source.
+ * green/k_mean/k_mean.cc: New test file.
+ * green/k_mean/Makefile.am: New makefile.
2009-08-17 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Improve documentation.
- * green/histo1d/histo1d.hh : Improve documentation aspect.
+ * green/histo1d/histo1d.hh: Improve documentation aspect.
2009-08-17 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
@@ -609,9 +606,9 @@
2009-08-17 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Some tries with segmentation using graph (still segfault)..
- * edwin/exec/score.hh: New.
- * edwin/exec/zi.cc,
- * edwin/exec/zi.hh:
+ * edwin/exec/score.hh: New.
+ * edwin/exec/zi.cc,
+ * edwin/exec/zi.hh:
Use min-tree based method instead of WST to group components.
2009-08-17 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
@@ -654,25 +651,25 @@
Test more accurately the histo1d class in image processing chain.
Try to isolate the background color of mp000082c_50p.pgm.
- * green/histo1d/Makefile.am : Update minor settings in Makefile.
- * green/histo1d/histo1d.hh : New C++ type.
- * green/histo1d/gaussian.sh : New GNUPLOT script to calibrate
+ * green/histo1d/Makefile.am: Update minor settings in Makefile.
+ * green/histo1d/histo1d.hh: New C++ type.
+ * green/histo1d/gaussian.sh: New GNUPLOT script to calibrate
gaussian filter.
* green/histo1d/save_sh.hh
- (save_sh) : Update some GNUPLOT style.
+ (save_sh): Update some GNUPLOT style.
* green/histo1d/histo1d.cc
- (test_classify) : New function.
- * green/histo1d/mp00082c_50p.pgm : New test scribo image.
+ (test_classify): New function.
+ * green/histo1d/mp00082c_50p.pgm: New test scribo image.
2009-08-12 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Write an histogram accumulator which the result is an image1d.
- * green/histo1d : New directory.
- * green/histo1d/Makefile.am : New Makefile.
- * green/histo1d/histo1d.hh : New C++ type.
- * green/histo1d/save_sh.hh : New gnuplot export routines.
- * green/histo1d/histo1d.cc : New unitary tests.
+ * green/histo1d: New directory.
+ * green/histo1d/Makefile.am: New Makefile.
+ * green/histo1d/histo1d.hh: New C++ type.
+ * green/histo1d/save_sh.hh: New gnuplot export routines.
+ * green/histo1d/histo1d.cc: New unitary tests.
2009-08-12 Fabien Freling <fabien.freling(a)lrde.epita.fr>
@@ -696,81 +693,81 @@
Integrate LRDE code writting rules in the Stats code.
- * green/Stats/Makefile.am : Remove Makefile.
- * green/Stats/Stats.cc : Remove source.
- * green/Stats : Remove directory.
+ * green/Stats/Makefile.am: Remove Makefile.
+ * green/Stats/Stats.cc: Remove source.
+ * green/Stats: Remove directory.
- * green/stats : New directory.
- * green/stats/Makefile.am : New Makefile.
- * green/stats/stats.cc : New source.
+ * green/stats: New directory.
+ * green/stats/Makefile.am: New Makefile.
+ * green/stats/stats.cc: New source.
2009-08-04 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Integrate LRDE code writting rules in the HelloMilena code.
- * green/LearnMilena/Makefile.am : Remove Makefile.
- * green/LearnMilena/LearnMilena.cc : Remove source.
- * green/LearnMilena : Remove directory.
+ * green/LearnMilena/Makefile.am: Remove Makefile.
+ * green/LearnMilena/LearnMilena.cc: Remove source.
+ * green/LearnMilena: Remove directory.
- * green/learn_milena : New directory.
- * green/learn_milena/Makefile.am : New Makefile.
- * green/learn_milena/learn_milena.cc : New source.
+ * green/learn_milena: New directory.
+ * green/learn_milena/Makefile.am: New Makefile.
+ * green/learn_milena/learn_milena.cc: New source.
2009-08-04 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Integrate LRDE code writting rules in the HelloMilena code.
- * green/HelloMilena/Makefile.am : Remove Makefile.
- * green/HelloMilena/HelloMilena.cc : Remove source.
- * green/HelloMilena : Remove directory.
+ * green/HelloMilena/Makefile.am: Remove Makefile.
+ * green/HelloMilena/HelloMilena.cc: Remove source.
+ * green/HelloMilena: Remove directory.
- * green/hello_milena : New directory.
- * green/hello_milena/Makefile.am : New Makefile.
- * green/hello_milena/hello_milena.cc : New source.
+ * green/hello_milena: New directory.
+ * green/hello_milena/Makefile.am: New Makefile.
+ * green/hello_milena/hello_milena.cc: New source.
2009-08-04 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Integrate LRDE code writting rules in the HelloWorld code.
- * green/HelloWorld/Makefile.am : Remove Makefile.
- * green/HelloWorld/HelloWorld.cc : Remove source.
- * green/HelloWorld/Print.cc : Remove source.
- * green/HelloWorld : Remove directory.
+ * green/HelloWorld/Makefile.am: Remove Makefile.
+ * green/HelloWorld/HelloWorld.cc: Remove source.
+ * green/HelloWorld/Print.cc: Remove source.
+ * green/HelloWorld: Remove directory.
- * green/hello_world : New directory.
- * green/hello_world/Makefile.am : New Makefile.
- * green/hello_world/hello_world.cc : New source.
- * green/hello_world/print.cc : New source.
+ * green/hello_world: New directory.
+ * green/hello_world/Makefile.am: New Makefile.
+ * green/hello_world/hello_world.cc: New source.
+ * green/hello_world/print.cc: New source.
2009-08-04 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Integrate LRDE code writting rules in my own otsu code.
- * green/Otsu/Makefile.am : Remove Makefile.
- * green/Otsu/Otsu.cc : Remove source.
- * green/Otsu : Remove directory.
+ * green/Otsu/Makefile.am: Remove Makefile.
+ * green/Otsu/Otsu.cc: Remove source.
+ * green/Otsu: Remove directory.
- * green/otsu : New directory.
- * green/otsu/Makefile.am : New Makefile.
- * green/otsu/otsu.cc : New source (substituate float by double).
+ * green/otsu: New directory.
+ * green/otsu/Makefile.am: New Makefile.
+ * green/otsu/otsu.cc: New source (substituate float by double).
2009-08-04 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Integrate LRDE code writting rules in the fraction c++ type.
- * green/Fraction/Makefile.am : Remove Makefile.
- * green/Fraction/main.cc : Remove source.
- * green/Fraction/frac.hh : Remove source.
- * green/Fraction/frac.cc : Remove source.
- * green/Fraction : Remove directory.
+ * green/Fraction/Makefile.am: Remove Makefile.
+ * green/Fraction/main.cc: Remove source.
+ * green/Fraction/frac.hh: Remove source.
+ * green/Fraction/frac.cc: Remove source.
+ * green/Fraction: Remove directory.
- * green/fraction : New directory.
- * green/fraction/Makefile.am : New Makefile.
- * green/fraction/sign_prod.hh : New source.
- * green/fraction/gcd.hh : New source.
- * green/fraction/frac.hh : New source.
- * green/fraction/frac.cc : New source.
+ * green/fraction: New directory.
+ * green/fraction/Makefile.am: New Makefile.
+ * green/fraction/sign_prod.hh: New source.
+ * green/fraction/gcd.hh: New source.
+ * green/fraction/frac.hh: New source.
+ * green/fraction/frac.cc: New source.
2009-08-03 Fabien Freling <fabien.freling(a)lrde.epita.fr>
@@ -800,16 +797,16 @@
Integration of the fraction type in the accumulators.
- * green/Fraction/frac.cc : Complete unary tests.
- * green/Fraction/frac.hh : Complete fraction type.
+ * green/Fraction/frac.cc: Complete unary tests.
+ * green/Fraction/frac.hh: Complete fraction type.
2009-07-28 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Learn how creating new types in milena (Fraction).
- * green/Fraction/Makefile.am : New Makefile.
- * green/Fraction/main.cc : New Unitary Tests.
- * green/Fraction/frac.hh : New Fraction type.
+ * green/Fraction/Makefile.am: New Makefile.
+ * green/Fraction/main.cc: New Unitary Tests.
+ * green/Fraction/frac.hh: New Fraction type.
2009-07-27 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
@@ -838,22 +835,22 @@
Correct warning on previous software
- * green/LearnMilena/LearnMilena.cc : Add () around operator |.
- * green/Otsu/Otsu.cc : Evict mln_VAR macro.
+ * green/LearnMilena/LearnMilena.cc: Add () around operator |.
+ * green/Otsu/Otsu.cc: Evict mln_VAR macro.
2009-07-23 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Learn to compute image statistics
- * green/Stats/Makefile.am : New.
- * green/Stats/Stats.cc : Compute histogram, variance and max.
+ * green/Stats/Makefile.am: New.
+ * green/Stats/Stats.cc: Compute histogram, variance and max.
2009-07-23 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Learn to reduce image domain while filling the image
- * green/LearnMilena/Makefile.am : New.
- * green/LearnMilena/LearnMilena.cc : Filling operator.
+ * green/LearnMilena/Makefile.am: New.
+ * green/LearnMilena/LearnMilena.cc: Filling operator.
2009-07-23 Edwin Carlinet <carlinet(a)lrde.epita.fr>
@@ -865,8 +862,8 @@
Small Demo with milena, it produces an HelloWorld pbm image.
- * green/HelloMilena/Makefile.am : New.
- * green/HelloMilena/HelloMilena.cc : Creating and saving image.
+ * green/HelloMilena/Makefile.am: New.
+ * green/HelloMilena/HelloMilena.cc: Creating and saving image.
2009-07-22 Edwin Carlinet <carlinet(a)lrde.epita.fr>
@@ -912,9 +909,9 @@
First test with git, test c++ install with HelloWorld program
- * green/HelloWorld/Makefile.am : Bypass .gitignore, New
+ * green/HelloWorld/Makefile.am: Bypass .gitignore, New
* green/HelloWorld/HelloWorld.cc: Write "HelloWorld" on CRT.
- * green/HelloWorld/Print.cc : Deported cout call
+ * green/HelloWorld/Print.cc: Deported cout call
2009-07-16 Edwin Carlinet <carlinet(a)lrde.epita.fr>
@@ -5952,7 +5949,7 @@
2008-12-06 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Add n_cmpt4 : version without util::set.
+ Add n_cmpt4: version without util::set.
* jardonnet/n_cmpt/n_cmpt3.hh: Minor fix for test.
* jardonnet/n_cmpt/n_cmpt3.cc: Add 1d test.
@@ -6598,7 +6595,7 @@
Add co-occurence matrix computing.
* nature/co_occurence.hh: New
- (mln::co_occurence) : compute co-occurence matrix.
+ (mln::co_occurence): compute co-occurence matrix.
* nature/mco.cc: New
Dummy test.
@@ -6654,7 +6651,7 @@
exactly one connected component of the object, and only one connected
component of the background
- Examples : ( | == object, - = background)
+ Examples: ( | == object, - = background)
- - |
| P | Here P is simple in the c4 and c8 case.
@@ -6687,17 +6684,17 @@
2008-10-29 Alexandre Abraham <abraham(a)lrde.epita.fr>
- INIM : nature filters and little bug fixes.
+ INIM: nature filters and little bug fixes.
* abraham/mln/trait: New.
* abraham/mln/trait/images.hh: New
- (mln::trait::default_image_morpher) : Adjust quant according
+ (mln::trait::default_image_morpher): Adjust quant according
to new value quant..
* abraham/mln/morpho/hit_or_miss.hh: New
- (mln::morpho::hit_or_miss) : First implementation of hit or
+ (mln::morpho::hit_or_miss): First implementation of hit or
miss algorithm.
* abraham/mln/level/transform.hh: New
- (mln::level::transform) : Add procedure.
+ (mln::level::transform): Add procedure.
* abraham/mln/core/image/thru.hh:
Temporary trait modification.
* abraham/mln/core/image/shell.hh:
@@ -6825,7 +6822,7 @@
* abraham/mln/core/image/thru.hh: .
* abraham/mln/core/image/shell.hh: Fix result value.
* abraham/mln/core/concept/meta_fun.hh:
- (mln::meta::impl) : now templated by return type (necessary to
+ (mln::meta::impl): now templated by return type (necessary to
typedef result).
* abraham/mln/fun/meta/red.hh: .
@@ -6886,7 +6883,7 @@
Clean.
* abraham/tests/fun/meta: New.
* abraham/tests/fun/meta/red.cc: New
- (mln::meta::red) : meta function to access red in rgb.
+ (mln::meta::red): meta function to access red in rgb.
* abraham/tests/core/image/thru_norm.cc: New
test for norm functor.
* abraham/tests/core/image/thru_v2v.cc: New
@@ -7325,7 +7322,7 @@
2008-09-17 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Sandbox : Update test on virtually transformed image.
+ Sandbox: Update test on virtually transformed image.
* jardonnet/virtual/access.hh: Update test.
* jardonnet/virtual/lena.pgm: Add test image.
@@ -7657,7 +7654,7 @@
Sandbox: ICP: Make icp stop if e_k < d_k (errors).
* jardonnet/test/icp_ref.cc: Fix p_array initialisation.
- * jardonnet/registration/icp_ref.hh (impl::icp) : Update :
+ * jardonnet/registration/icp_ref.hh (impl::icp): Update:
Stop if e_k < d_k.
2008-06-06 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
@@ -8033,9 +8030,9 @@
Add results about final_qk.
fun_k_cn_xn.ppm
- fun : final_qk v1 or v2
- k : nstddev == k * stdddev
- cn,xn : images from img/
+ fun: final_qk v1 or v2
+ k: nstddev == k * stdddev
+ cn,xn: images from img/
* jardonnet/test/final/final_qk_1.ppm: .
* jardonnet/test/final/final_qk_3.ppm: New.
@@ -8045,7 +8042,7 @@
2008-05-16 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
- * geraud/fllt.cc: FLLT : Finalize merge.
+ * geraud/fllt.cc: FLLT: Finalize merge.
2008-05-16 Etienne FOLIO <folio(a)lrde.epita.fr>
@@ -8067,7 +8064,7 @@
Add few results about final_qk.
- bunch of results : _1 and _2 means using stddev 1 or 2 times.
+ bunch of results: _1 and _2 means using stddev 1 or 2 times.
* jardonnet/test/final: New.
* jardonnet/test/final/final_qk_1.ppm: New.
@@ -8081,7 +8078,7 @@
2008-05-16 Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
- Add functions on box : enlarge and bigger.
+ Add functions on box: enlarge and bigger.
* jardonnet/registration/tools.hh (enlarge,bigger): Add.
* jardonnet/test/icp.cc: Update: use enlarge and bigger.
@@ -8642,7 +8639,7 @@
Add red getter.
* vigouroux/cmy/fun.hh, vigouroux/hsi/fun.hh,
- * vigouroux/yiq/fun.hh, vigouroux/yuv/fun.hh :
+ * vigouroux/yiq/fun.hh, vigouroux/yuv/fun.hh:
New red getter.
* vigouroux/cmy/my_cmy.hh,
* vigouroux/hsi/my_hsi.hh,
@@ -8655,7 +8652,7 @@
* vigouroux/yuv/rgb_to_yuv.hh:
Added inheritance from function_v2v.
* vigouroux/cmy/test.cc, vigouroux/yiq/test.cc,
- * vigouroux/yuv/test.cc : New test.
+ * vigouroux/yuv/test.cc: New test.
* vigouroux/cmy/testfun.cc,
* vigouroux/yiq/testfun.cc,
* vigouroux/yuv/testfun.cc: New test.
@@ -8807,7 +8804,7 @@
2008-04-03 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Sandboc : ICP: Update check script (gprof).
+ Sandboc: ICP: Update check script (gprof).
* jardonnet/test/bench: Add info.
* jardonnet/test/icp_check.sh: Update testes.
@@ -8931,7 +8928,7 @@
2008-03-29 Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
- Sandbox: ICP : projection::memo.
+ Sandbox: ICP: projection::memo.
* jardonnet/test/icp.cc: Update.
* jardonnet/test/check: Test projection techniques.
@@ -9019,7 +9016,7 @@
* garrigues/tiled_image2d/tiled_image2d.cc: Test the type with
a big image.
* garrigues/tiled_image2d/tiled_image2d.hh: Allocate enough
- space for the image. Fixme : some debug will be removed later.
+ space for the image. Fixme: some debug will be removed later.
2008-03-21 Michel Pellegrin <pellegrin(a)lrde.epita.fr>
@@ -9063,7 +9060,7 @@
2008-03-19 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
- Icp : n dim, refactored, uses p_array, vec -> rounded point proc.
+ Icp: n dim, refactored, uses p_array, vec -> rounded point proc.
* jardonnet/test/icp.cc,
* jardonnet/registration/quat7.hh,
@@ -9874,7 +9871,7 @@
the upper tree's one and the lower tree's one in order to keep the
good values of the input image.
(fllt) add a second call to merge_trees to test the contrast
- invariant of the algorithm. FIXME : In some test, we get a segv when
+ invariant of the algorithm. FIXME: In some test, we get a segv when
calling merge_trees swapping the upper_tree and lower_tree
arguments. Add some debug too.
@@ -10001,7 +9998,7 @@
Update fllt.
- * garrigues/fllt.hh: More output. FIXME : optimize.
+ * garrigues/fllt.hh: More output. FIXME: optimize.
2007-10-26 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
@@ -10178,13 +10175,13 @@
Add translate image in sandbox.
* duhamel/translate_image.cc: New test for translate image.
- * duhamel/translate_image.hh: New image : translate image.
+ * duhamel/translate_image.hh: New image: translate image.
* duhamel/color_sub.cc: Update.
2007-10-09 Simon Nivault <simon.nivault(a)lrde.epita.fr>
- Refactoring : move mln/core/win to mln/win.
+ Refactoring: move mln/core/win to mln/win.
* nivault/dyn_line.hh,
* nivault/median.hh,
@@ -10248,7 +10245,7 @@
* duhamel/color_sub.cc: .
- * duhamel/color_sub.hh: New : split ols version.
+ * duhamel/color_sub.hh: New: split ols version.
* duhamel/labeling_algo.cc: .
* duhamel/labeling_level_fast.cc: .
@@ -10308,7 +10305,7 @@
2007-10-01 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add graph_labeling in sandbox.
- * duhamel/graph_labeling.hh: New make_graph : convert a labeled image
+ * duhamel/graph_labeling.hh: New make_graph: convert a labeled image
into mesh_p.
* duhamel/graph_labeling.cc: New test for graph labeling.
* duhamel/graph_labeling2.cc: New test for graph labeling.
--
1.6.3.1
1
0
* src/extract/primitive/Makefile.am,
* src/preprocessing/Makefile.am: Add new examples as target.
* src/extract/primitive/find_pattern_lines.cc,
* src/preprocessing/split_bg_fg.cc: New examples.
---
scribo/ChangeLog | 10 +++
scribo/src/extract/primitive/Makefile.am | 2 +
scribo/src/extract/primitive/find_pattern_lines.cc | 75 ++++++++++++++++++++
scribo/src/preprocessing/Makefile.am | 4 +-
scribo/src/preprocessing/split_bg_fg.cc | 67 +++++++++++++++++
5 files changed, 157 insertions(+), 1 deletions(-)
create mode 100644 scribo/src/extract/primitive/find_pattern_lines.cc
create mode 100644 scribo/src/preprocessing/split_bg_fg.cc
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index fd7af50..c4e7c1f 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,15 @@
2009-09-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Add new examples in Scribo.
+
+ * src/extract/primitive/Makefile.am,
+ * src/preprocessing/Makefile.am: Add new examples as target.
+
+ * src/extract/primitive/find_pattern_lines.cc,
+ * src/preprocessing/split_bg_fg.cc: New examples.
+
+2009-09-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Add new filters in Scribo.
* filter/object_groups_size_ratio.hh,
diff --git a/scribo/src/extract/primitive/Makefile.am b/scribo/src/extract/primitive/Makefile.am
index 51850f6..c4ebeaf 100644
--- a/scribo/src/extract/primitive/Makefile.am
+++ b/scribo/src/extract/primitive/Makefile.am
@@ -27,6 +27,7 @@ bin_PROGRAMS = \
extract_thick_vlines \
extract_thick_hlines \
find_discontinued_lines \
+ find_pattern_lines \
find_single_lines \
find_thick_lines \
find_thick_and_single_lines
@@ -37,6 +38,7 @@ extract_discontinued_hlines_SOURCES = extract_discontinued_hlines.cc
extract_thick_vlines_SOURCES = extract_thick_vlines.cc
extract_thick_hlines_SOURCES = extract_thick_hlines.cc
find_discontinued_lines_SOURCES = find_discontinued_lines.cc
+find_pattern_lines_SOURCES = find_pattern_lines.cc
find_single_lines_SOURCES = find_single_lines.cc
find_thick_lines_SOURCES = find_thick_lines.cc
find_thick_and_single_lines_SOURCES = find_thick_and_single_lines.cc
diff --git a/scribo/src/extract/primitive/find_pattern_lines.cc b/scribo/src/extract/primitive/find_pattern_lines.cc
new file mode 100644
index 0000000..eaf2d59
--- /dev/null
+++ b/scribo/src/extract/primitive/find_pattern_lines.cc
@@ -0,0 +1,75 @@
+// 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.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/value/label_16.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/io/pbm/all.hh>
+#include <mln/io/ppm/save.hh>
+#include <mln/data/convert.hh>
+#include <mln/debug/superpose.hh>
+
+#include <scribo/debug/usage.hh>
+
+#include <scribo/core/object_image.hh>
+#include <scribo/primitive/extract/lines_h_pattern.hh>
+#include <scribo/primitive/extract/lines_v_pattern.hh>
+
+const char *args_desc[][2] =
+{
+ { "input.pbm", "A binary image." },
+ { "length", " Minimum line length." },
+ {0, 0}
+};
+
+
+int main(int argc, char *argv[])
+{
+ using namespace mln;
+
+ if (argc != 4)
+ return scribo::debug::usage(argv,
+ "Extract discontinued horizontal and vertical lines",
+ "input.pbm length output.ppm",
+ args_desc,
+ "A color image. Horizontal lines are in red and vertical lines in green.");
+
+ trace::entering("main");
+
+ typedef image2d<bool> I;
+ I input;
+ io::pbm::load(input, argv[1]);
+
+ I hlines = scribo::primitive::extract::lines_h_pattern(input, atoi(argv[2]));
+ I vlines = scribo::primitive::extract::lines_v_pattern(input, atoi(argv[2]));
+
+ image2d<value::rgb8> out = debug::superpose(input, hlines, literal::red);
+ out = debug::superpose(out, vlines, literal::green);
+
+ io::ppm::save(out, argv[3]);
+
+ trace::exiting("main");
+}
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index f6d877c..af6db48 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -20,6 +20,8 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
+ split_bg_fg \
unskew
-unskew_SOURCES = unskew.cc
+split_bg_fg_SOURCES = split_bg_fg.cc
+unskew_SOURCES = unskew.cc
diff --git a/scribo/src/preprocessing/split_bg_fg.cc b/scribo/src/preprocessing/split_bg_fg.cc
new file mode 100644
index 0000000..a1aab52
--- /dev/null
+++ b/scribo/src/preprocessing/split_bg_fg.cc
@@ -0,0 +1,67 @@
+// 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.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/io/ppm/all.hh>
+
+#include <scribo/preprocessing/split_bg_fg.hh>
+#include <scribo/debug/usage.hh>
+
+
+const char *args_desc[][2] =
+{
+ { "input.pbm", "A color image." },
+ { "lambda", "Lambda value. (FIX Description)" },
+ { "delta", "Delta value. (FIX Description)" },
+ { "bg.ppm", "The background image (2nd output)." },
+ {0, 0}
+};
+
+
+
+int main(int argc, char *argv[])
+{
+ mln::trace::entering("main");
+ using namespace mln;
+
+ if (argc != 6)
+ return scribo::debug::usage(argv,
+ "Split background and foreground.",
+ "input.pbm bg.ppm fg.ppm",
+ args_desc, "The foreground image.");
+
+ typedef image2d<value::rgb8> I;
+ I input;
+ io::ppm::load(input, argv[1]);
+
+ util::couple<I,I>
+ bg_fg = scribo::preprocessing::split_bg_fg(input,
+ atoi(argv[2]),
+ atoi(argv[3]));
+ io::ppm::save(bg_fg.first(), argv[4]);
+ io::ppm::save(bg_fg.second(), argv[5]);
+
+ mln::trace::exiting("main");
+}
--
1.5.6.5
1
0
* filter/object_groups_size_ratio.hh,
* filter/objects_size_ratio.hh: New filters.
---
scribo/ChangeLog | 7 ++
scribo/filter/object_groups_size_ratio.hh | 104 +++++++++++++++++++++++++
scribo/filter/objects_size_ratio.hh | 120 +++++++++++++++++++++++++++++
3 files changed, 231 insertions(+), 0 deletions(-)
create mode 100644 scribo/filter/object_groups_size_ratio.hh
create mode 100644 scribo/filter/objects_size_ratio.hh
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0a7f625..fd7af50 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2009-09-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Add new filters in Scribo.
+
+ * filter/object_groups_size_ratio.hh,
+ * filter/objects_size_ratio.hh: New filters.
+
+2009-09-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Small fixes in Scribo.
* demo/src/mainwindow.cc: Do not always resize pics.
diff --git a/scribo/filter/object_groups_size_ratio.hh b/scribo/filter/object_groups_size_ratio.hh
new file mode 100644
index 0000000..b52c30d
--- /dev/null
+++ b/scribo/filter/object_groups_size_ratio.hh
@@ -0,0 +1,104 @@
+// 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 SCRIBO_FILTER_OBJECT_GROUPS_SIZE_RATIO_HH
+# define SCRIBO_FILTER_OBJECT_GROUPS_SIZE_RATIO_HH
+
+/// \file
+///
+
+
+# include <mln/util/array.hh>
+
+# include <scribo/core/macros.hh>
+# include <scribo/core/object_groups.hh>
+# include <scribo/core/object_image.hh>
+
+namespace scribo
+{
+
+ namespace filter
+ {
+
+ using namespace mln;
+
+ template <typename L>
+ object_groups<L>
+ object_groups_size_ratio(const object_groups<L>& groups,
+ float max_size_ratio,
+ float max_invalid_ratio_per_group);
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename L>
+ object_groups<L>
+ object_groups_size_ratio(const object_groups<L>& groups,
+ float max_size_ratio,
+ float max_invalid_ratio_per_group)
+ {
+ trace::entering("scribo::filter::object_groups_size_ratio");
+
+ mln_precondition(groups.is_valid());
+
+ const object_image(L)& objects = groups.object_image_();
+
+ // FIXME: estimating the group size should be removed once
+ // available in the object_group structure.
+ // Counting the number of objects per group with a size ratio >
+ // max_ratio.
+ mln::util::array<unsigned>
+ group_size(groups.size(), 0),
+ invalid_object_in_group(groups.size(), 0);
+
+ for_all_ncomponents(i, objects.nlabels())
+ {
+ if ((objects.bbox(i).nrows() / objects.bbox(i).ncols())
+ >= max_size_ratio)
+ ++invalid_object_in_group[groups[i]];
+
+ ++group_size[groups[i]];
+ }
+
+ object_groups<L> output(groups);
+ output(0) = 0;
+ for (unsigned i = 1; i < output.size(); ++i)
+ if ((invalid_object_in_group[groups[i]] / static_cast<float>(group_size[groups[i]])) >= max_invalid_ratio_per_group)
+ output(i) = 0;
+
+ trace::exiting("scribo::filter::object_groups_size_ratio");
+ return output;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace scribo::filter
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_FILTER_OBJECT_GROUPS_SIZE_RATIO_HH
diff --git a/scribo/filter/objects_size_ratio.hh b/scribo/filter/objects_size_ratio.hh
new file mode 100644
index 0000000..7a68f7f
--- /dev/null
+++ b/scribo/filter/objects_size_ratio.hh
@@ -0,0 +1,120 @@
+// 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 SCRIBO_FILTER_OBJECTS_SIZE_RATIO_HH
+# define SCRIBO_FILTER_OBJECTS_SIZE_RATIO_HH
+
+/// \file
+///
+///
+
+# include <mln/core/concept/function.hh>
+# include <scribo/core/object_image.hh>
+
+
+
+namespace scribo
+{
+
+ namespace filter
+ {
+
+
+ template <typename L>
+ object_image(L)
+ objects_size_ratio(const object_image(L)& objects,
+ float size_ratio);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ namespace internal
+ {
+
+
+ /// Filter Functor.
+ /// Return false for all objects which have a bad ratio.
+ template <typename L>
+ struct objects_size_ratio_filter
+ : Function_v2b< objects_size_ratio_filter<L> >
+ {
+ typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
+
+ objects_size_ratio_filter(const object_image(L)& objects,
+ float ratio)
+ : objects_(objects), ratio_(ratio)
+ {
+ }
+
+ bool operator()(const mln_value(L)& l) const
+ {
+ if (l == literal::zero)
+ return true;
+ return (objects_.bbox(l).nrows() / static_cast<float>(objects_.bbox(l).ncols())) < ratio_;
+ }
+
+ /// Component bounding boxes.
+ object_image(L) objects_;
+
+ /// The maximum size ratio.
+ float ratio_;
+ };
+
+
+ } // end of namespace scribo::filter::internal
+
+
+
+ template <typename L>
+ object_image(L)
+ objects_size_ratio(const object_image(L)& objects,
+ float size_ratio)
+ {
+
+ trace::entering("scribo::primitive::objects_size_ratio");
+
+ mln_precondition(objects.is_valid());
+
+ typedef internal::objects_size_ratio_filter<L> func_t;
+ func_t has_bad_ratio(objects, size_ratio);
+
+ object_image(L) output;
+ output.init_from_(objects);
+ output.relabel(has_bad_ratio);
+
+ trace::exiting("scribo::primitive::objects_size_ratio");
+ return output;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::filter
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_FILTER_OBJECTs_SIZE_RATIO_HH
--
1.5.6.5
1
0