* scribo/estim/object_groups_v_thickness.hh,
* scribo/filter/object_groups_v_thickness.hh: Rename as...
* scribo/estim/object_groups_mean_width.hh,
* scribo/filter/object_groups_mean_width.hh: ... this.
---
scribo/ChangeLog | 10 ++++++
..._v_thickness.hh => object_groups_mean_width.hh} | 26 ++++++++--------
..._v_thickness.hh => object_groups_mean_width.hh} | 32 ++++++++++----------
3 files changed, 39 insertions(+), 29 deletions(-)
rename scribo/scribo/estim/{object_groups_v_thickness.hh =>
object_groups_mean_width.hh} (75%)
rename scribo/scribo/filter/{object_groups_v_thickness.hh =>
object_groups_mean_width.hh} (68%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index e7ac031..0c785fc 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,15 @@
2011-04-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Rename few routines.
+
+ * scribo/estim/object_groups_v_thickness.hh,
+ * scribo/filter/object_groups_v_thickness.hh: Rename as...
+
+ * scribo/estim/object_groups_mean_width.hh,
+ * scribo/filter/object_groups_mean_width.hh: ... this.
+
+2011-04-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add more tests.
* tests/filter/Makefile.am: Add new targets.
diff --git a/scribo/scribo/estim/object_groups_v_thickness.hh
b/scribo/scribo/estim/object_groups_mean_width.hh
similarity index 75%
rename from scribo/scribo/estim/object_groups_v_thickness.hh
rename to scribo/scribo/estim/object_groups_mean_width.hh
index b626243..c74137a 100644
--- a/scribo/scribo/estim/object_groups_v_thickness.hh
+++ b/scribo/scribo/estim/object_groups_mean_width.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -23,13 +24,13 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_ESTIM_OBJECT_GROUPS_V_THICKNESS_HH
-# define SCRIBO_ESTIM_OBJECT_GROUPS_V_THICKNESS_HH
+#ifndef SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH
+# define SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH
/// \file
///
-/// \brief Estimate the mean object thickness for each group.
+/// \brief Estimate the mean object width for each group.
# include <mln/util/array.hh>
@@ -45,16 +46,16 @@ namespace scribo
using namespace mln;
- /*! \brief Estimate the mean object thickness for each group.
+ /*! \brief Estimate the mean object width for each group.
\param[in] groups Object groups information.
- \return An array of mean object thickness.
+ \return An array of mean object width.
*/
template <typename L>
mln::util::array<float>
- object_groups_v_thickness(const object_groups<L>& groups);
+ object_groups_mean_width(const object_groups<L>& groups);
@@ -63,9 +64,9 @@ namespace scribo
template <typename L>
util::array<float>
- object_groups_v_thickness(const object_groups<L>& groups)
+ object_groups_mean_width(const object_groups<L>& groups)
{
- trace::entering("scribo::estim::object_groups_v_thickness");
+ trace::entering("scribo::estim::object_groups_mean_width");
mln_precondition(groups.is_valid());
@@ -79,8 +80,7 @@ namespace scribo
for_all_comps(i, components)
if (components(i).is_valid())
{
- output(groups(i)) += components(i).bbox().pmax().row()
- - components(i).bbox().pmin().row();
+ output(groups(i)) += components(i).bbox().width();
++group_card(groups(i));
}
@@ -91,7 +91,7 @@ namespace scribo
else
output(i) = 0;
- trace::exiting("scribo::estim::object_groups_v_thickness");
+ trace::exiting("scribo::estim::object_groups_mean_width");
return output;
}
@@ -103,4 +103,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_ESTIM_OBJECT_GROUPS_V_THICKNESS_HH
+#endif // ! SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH
diff --git a/scribo/scribo/filter/object_groups_v_thickness.hh
b/scribo/scribo/filter/object_groups_mean_width.hh
similarity index 68%
rename from scribo/scribo/filter/object_groups_v_thickness.hh
rename to scribo/scribo/filter/object_groups_mean_width.hh
index 717b372..0668205 100644
--- a/scribo/scribo/filter/object_groups_v_thickness.hh
+++ b/scribo/scribo/filter/object_groups_mean_width.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,18 +24,18 @@
// 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_V_THICKNESS_HH
-# define SCRIBO_FILTER_OBJECT_GROUPS_V_THICKNESS_HH
+#ifndef SCRIBO_FILTER_OBJECT_GROUPS_MEAN_WIDTH_HH
+# define SCRIBO_FILTER_OBJECT_GROUPS_MEAN_WIDTH_HH
/// \file
///
-/// \brief Filter groups having their object mean thickness too low.
+/// \brief Filter groups having their object mean width too low.
# include <mln/util/array.hh>
# include <scribo/core/object_groups.hh>
-# include <scribo/estim/object_groups_v_thickness.hh>
+# include <scribo/estim/object_groups_mean_width.hh>
namespace scribo
@@ -47,10 +47,10 @@ namespace scribo
using namespace mln;
- /*! \brief Filter groups having their object mean thickness too low.
+ /*! \brief Filter groups having their object mean width too low.
\param[in] groups Object group information.
- \param[in] thickness Object group mean thickness must be greater
+ \param[in] width Object group mean width must be greater
or equal to this value.
\return Filtered object group information.
@@ -58,7 +58,7 @@ namespace scribo
*/
template <typename L>
object_groups<L>
- object_groups_v_thickness(const object_groups<L>& groups, float
thickness);
+ object_groups_mean_width(const object_groups<L>& groups, float width);
# ifndef MLN_INCLUDE_ONLY
@@ -66,24 +66,24 @@ namespace scribo
template <typename L>
object_groups<L>
- object_groups_v_thickness(const object_groups<L>& groups, float thickness)
+ object_groups_mean_width(const object_groups<L>& groups, float width)
{
- trace::entering("scribo::filter::object_groups_v_thickness");
+ trace::entering("scribo::filter::object_groups_mean_width");
mln_precondition(groups.is_valid());
- mln_precondition(thickness >= 0);
+ mln_precondition(width >= 0);
mln::util::array<float>
- group_thickness = estim::object_groups_v_thickness(groups);
+ group_width = estim::object_groups_mean_width(groups);
object_groups<L> output = groups.duplicate();
output(0) = 0;
for (unsigned i = 1; i < output.nelements(); ++i)
if (groups.components()(i).is_valid()
- && group_thickness[groups(i)] < thickness)
+ && group_width[groups(i)] < width)
output(i) = 0;
- trace::exiting("scribo::filter::object_groups_v_thickness");
+ trace::exiting("scribo::filter::object_groups_mean_width");
return output;
}
@@ -96,4 +96,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_OBJECT_GROUPS_V_THICKNESS_HH
+#endif // ! SCRIBO_FILTER_OBJECT_GROUPS_MEAN_WIDTH_HH
--
1.5.6.5