* filter/all.hh: Update includes.
* filter/large_objects.hh,
* filter/small_object_groups.hh,
* filter/small_objects.hh,
* filter/thick_objects.hh,
* filter/thin_objects.hh
* fun/v2b/small_objects_filter.hh: Move ...
* filter/object_groups_small.hh,
* filter/objects_large.hh,
* filter/objects_small.hh,
* filter/objects_thick.hh,
* filter/objects_thin.hh,
* fun/v2b/objects_small_filter.hh: ... here.
* src/filter/large_objects.cc,
* src/filter/small_objects.cc,
* src/filter/thick_objects.cc,
* src/filter/thin_objects.cc,
* src/preprocess.cc,
* src/recognition.cc,
* src/text/grouping/group_from_double_link.cc,
* src/text/grouping/group_from_double_several_links.cc,
* src/text/grouping/group_from_rag.cc,
* src/text_in_photo.cc,
* src/thin_bboxes.cc,
* tests/filter/small_and_large_bboxes.cc: Update function calls
and includes.
---
scribo/ChangeLog | 34 ++++++++++++++++++++
scribo/filter/all.hh | 9 +++--
...all_object_groups.hh => object_groups_small.hh} | 10 +++---
.../filter/{large_objects.hh => objects_large.hh} | 32 +++++++++---------
.../filter/{small_objects.hh => objects_small.hh} | 28 ++++++++--------
.../filter/{thick_objects.hh => objects_thick.hh} | 22 ++++++------
scribo/filter/{thin_objects.hh => objects_thin.hh} | 32 +++++++++---------
...l_objects_filter.hh => objects_small_filter.hh} | 16 +++++-----
scribo/src/filter/large_objects.cc | 4 +-
scribo/src/filter/small_objects.cc | 4 +-
scribo/src/filter/thick_objects.cc | 4 +-
scribo/src/filter/thin_objects.cc | 4 +-
scribo/src/preprocess.cc | 8 ++--
scribo/src/recognition.cc | 8 ++--
scribo/src/text/grouping/group_from_double_link.cc | 4 +-
.../grouping/group_from_double_several_links.cc | 4 +-
scribo/src/text/grouping/group_from_rag.cc | 14 ++++----
scribo/src/text_in_photo.cc | 16 +++++-----
scribo/src/thin_bboxes.cc | 6 ++--
scribo/tests/filter/small_and_large_bboxes.cc | 4 +-
20 files changed, 149 insertions(+), 114 deletions(-)
rename scribo/filter/{small_object_groups.hh => object_groups_small.hh} (90%)
rename scribo/filter/{large_objects.hh => objects_large.hh} (85%)
rename scribo/filter/{small_objects.hh => objects_small.hh} (84%)
rename scribo/filter/{thick_objects.hh => objects_thick.hh} (89%)
rename scribo/filter/{thin_objects.hh => objects_thin.hh} (85%)
rename scribo/fun/v2b/{small_objects_filter.hh => objects_small_filter.hh} (87%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 03925b6..a7cd378 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,39 @@
2009-08-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Rename filters.
+
+ * filter/all.hh: Update includes.
+
+ * filter/large_objects.hh,
+ * filter/small_object_groups.hh,
+ * filter/small_objects.hh,
+ * filter/thick_objects.hh,
+ * filter/thin_objects.hh
+ * fun/v2b/small_objects_filter.hh: Move ...
+
+ * filter/object_groups_small.hh,
+ * filter/objects_large.hh,
+ * filter/objects_small.hh,
+ * filter/objects_thick.hh,
+ * filter/objects_thin.hh,
+ * fun/v2b/objects_small_filter.hh: ... here.
+
+ * src/filter/large_objects.cc,
+ * src/filter/small_objects.cc,
+ * src/filter/thick_objects.cc,
+ * src/filter/thin_objects.cc,
+ * src/preprocess.cc,
+ * src/recognition.cc,
+ * src/text/grouping/group_from_double_link.cc,
+ * src/text/grouping/group_from_double_several_links.cc,
+ * src/text/grouping/group_from_rag.cc,
+ * src/text_in_photo.cc,
+ * src/thin_bboxes.cc,
+ * tests/filter/small_and_large_bboxes.cc: Update function calls
+ and includes.
+
+2009-08-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Mass renaming/cleanup in Scribo.
* extract/primitive/canvas.hh,
diff --git a/scribo/filter/all.hh b/scribo/filter/all.hh
index 9a1eed5..0b5bc11 100644
--- a/scribo/filter/all.hh
+++ b/scribo/filter/all.hh
@@ -41,9 +41,10 @@ namespace scribo
} // end of namespace scribo
-# include <scribo/filter/large_objects.hh>
-# include <scribo/filter/small_objects.hh>
-# include <scribo/filter/thick_objects.hh>
-# include <scribo/filter/thin_objects.hh>
+# include <scribo/filter/object_groups_small.hh>
+# include <scribo/filter/objects_large.hh>
+# include <scribo/filter/objects_small.hh>
+# include <scribo/filter/objects_thick.hh>
+# include <scribo/filter/objects_thin.hh>
#endif // ! SCRIBO_FILTER_ALL_HH
diff --git a/scribo/filter/small_object_groups.hh b/scribo/filter/object_groups_small.hh
similarity index 90%
rename from scribo/filter/small_object_groups.hh
rename to scribo/filter/object_groups_small.hh
index 5fa5ee3..fdfec6a 100644
--- a/scribo/filter/small_object_groups.hh
+++ b/scribo/filter/object_groups_small.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_SMALL_OBJECT_GROUPS_HH
-# define SCRIBO_FILTER_SMALL_OBJECT_GROUPS_HH
+#ifndef SCRIBO_FILTER_OBJECT_GROUPS_SMALL_HH
+# define SCRIBO_FILTER_OBJECT_GROUPS_SMALL_HH
/// \file
///
@@ -56,7 +56,7 @@ namespace scribo
*/
template <typename L>
mln::util::array<bool>
- small_object_groups(const object_groups<L>& groups,
+ object_groups_small(const object_groups<L>& groups,
unsigned n_links);
@@ -66,7 +66,7 @@ namespace scribo
template <typename L>
inline
mln::util::array<bool>
- small_object_groups(const object_groups<L>& parent_link,
+ object_groups_small(const object_groups<L>& parent_link,
unsigned n_links)
{
// Counting the number of objects per group.
@@ -89,5 +89,5 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_SMALL_OBJECT_GROUPS_HH
+#endif // ! SCRIBO_FILTER_OBJECT_GROUPS_SMALL_HH
diff --git a/scribo/filter/large_objects.hh b/scribo/filter/objects_large.hh
similarity index 85%
rename from scribo/filter/large_objects.hh
rename to scribo/filter/objects_large.hh
index 4494965..dfef95c 100644
--- a/scribo/filter/large_objects.hh
+++ b/scribo/filter/objects_large.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_LARGE_OBJECTS_HH
-# define SCRIBO_FILTER_LARGE_OBJECTS_HH
+#ifndef SCRIBO_FILTER_OBJECTS_LARGE_HH
+# define SCRIBO_FILTER_OBJECTS_LARGE_HH
/// \file
///
@@ -65,7 +65,7 @@ namespace scribo
/// \return A binary image without large objects.
template <typename I, typename N, typename V>
mln_concrete(I)
- large_objects(const Image<I>& input_,
+ objects_large(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_size);
@@ -78,7 +78,7 @@ namespace scribo
/// \return updated text data.
template <typename L>
object_image(L)
- large_objects(const object_image(L)& objects,
+ objects_large(const object_image(L)& objects,
unsigned max_size);
@@ -93,8 +93,8 @@ namespace scribo
/// Filter Functor.
/// Return false for all objects which are too large.
template <typename L>
- struct large_objects_filter
- : Function_v2b< large_objects_filter<L> >
+ struct objects_large_filter
+ : Function_v2b< objects_large_filter<L> >
{
typedef accu::math::count<mln_psite(L)> card_t;
@@ -103,7 +103,7 @@ namespace scribo
///
/// \param[in] compbboxes Component bounding boxes.
/// \param[in] max_size Maximum object size.
- large_objects_filter(const object_image(L)& objects,
+ objects_large_filter(const object_image(L)& objects,
unsigned max_size)
{
card_ = labeling::compute(card_t(), objects, objects.nlabels());
@@ -139,12 +139,12 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- large_objects(const Image<I>& input_,
+ objects_large(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_size)
{
- trace::entering("scribo::filter::large_objects");
+ trace::entering("scribo::filter::objects_large");
const I& input = exact(input_);
const N& nbh = exact(nbh_);
@@ -156,14 +156,14 @@ namespace scribo
typedef object_image(mln_ch_value(I,V)) lbl_t;
lbl_t lbl = primitive::extract::objects(input, nbh, nlabels);
- typedef internal::large_objects_filter<lbl_t> func_t;
+ typedef internal::objects_large_filter<lbl_t> func_t;
func_t fv2b(lbl, max_size);
labeling::relabel_inplace(lbl, nlabels, fv2b);
mln_concrete(I) output = duplicate(input);
data::fill((output | pw::value(lbl) == literal::zero).rw(), false);
- trace::exiting("scribo::filter::large_objects");
+ trace::exiting("scribo::filter::objects_large");
return output;
}
@@ -171,20 +171,20 @@ namespace scribo
template <typename L>
inline
object_image(L)
- large_objects(const object_image(L)& objects,
+ objects_large(const object_image(L)& objects,
unsigned max_size)
{
- trace::entering("scribo::filter::large_objects");
+ trace::entering("scribo::filter::objects_large");
mln_precondition(objects.is_valid());
- internal::large_objects_filter<L> f(objects, max_size);
+ internal::objects_large_filter<L> f(objects, max_size);
object_image(L) output;
output.init_from_(objects);
output.relabel(f);
- trace::exiting("scribo::filter::large_objects");
+ trace::exiting("scribo::filter::objects_large");
return output;
}
@@ -195,4 +195,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_LARGE_OBJECTS_HH
+#endif // ! SCRIBO_FILTER_OBJECTS_LARGE_HH
diff --git a/scribo/filter/small_objects.hh b/scribo/filter/objects_small.hh
similarity index 84%
rename from scribo/filter/small_objects.hh
rename to scribo/filter/objects_small.hh
index d6d7113..cb65136 100644
--- a/scribo/filter/small_objects.hh
+++ b/scribo/filter/objects_small.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_SMALL_OBJECTS_HH
-# define SCRIBO_FILTER_SMALL_OBJECTS_HH
+#ifndef SCRIBO_FILTER_OBJECTS_SMALL_HH
+# define SCRIBO_FILTER_OBJECTS_SMALL_HH
/// \file
///
@@ -50,7 +50,7 @@
# include <scribo/core/object_image.hh>
-# include <scribo/fun/v2b/small_objects_filter.hh>
+# include <scribo/fun/v2b/objects_small_filter.hh>
# include <scribo/primitive/extract/objects.hh>
@@ -74,7 +74,7 @@ namespace scribo
/// \return A binary image without small objects.
template <typename I, typename N, typename V>
mln_concrete(I)
- small_objects(const Image<I>& input_,
+ objects_small(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned min_size);
@@ -88,7 +88,7 @@ namespace scribo
/// \return An object image without small objects.
template <typename L>
object_image(L)
- small_objects(const object_image(L)& objects,
+ objects_small(const object_image(L)& objects,
unsigned min_size);
@@ -98,12 +98,12 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- small_objects(const Image<I>& input_,
+ objects_small(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned min_size)
{
- trace::entering("scribo::filter::small_objects");
+ trace::entering("scribo::filter::objects_small");
const I& input = exact(input_);
const N& nbh = exact(nbh_);
@@ -115,7 +115,7 @@ namespace scribo
typedef mln_ch_value(I,V) lbl_t;
object_image(lbl_t) lbl = primitive::extract::objects(input, nbh, nlabels);
- typedef fun::v2b::small_objects_filter<mln_ch_value(I,V)> func_t;
+ typedef fun::v2b::objects_small_filter<mln_ch_value(I,V)> func_t;
func_t fv2b(lbl, min_size);
lbl.relabel(fv2b);
@@ -123,7 +123,7 @@ namespace scribo
data::fill((output | pw::value(lbl) == pw::cst(literal::zero)).rw(),
false);
- trace::exiting("scribo::filter::small_objects");
+ trace::exiting("scribo::filter::objects_small");
return output;
}
@@ -131,20 +131,20 @@ namespace scribo
template <typename L>
inline
object_image(L)
- small_objects(const object_image(L)& objects,
+ objects_small(const object_image(L)& objects,
unsigned min_size)
{
- trace::entering("scribo::filter::small_objects");
+ trace::entering("scribo::filter::objects_small");
mln_precondition(objects.is_valid());
- fun::v2b::small_objects_filter<L> f(objects, min_size);
+ fun::v2b::objects_small_filter<L> f(objects, min_size);
object_image(L) output;
output.init_from_(objects);
output.relabel(f);
- trace::exiting("scribo::filter::small_objects");
+ trace::exiting("scribo::filter::objects_small");
return output;
}
@@ -155,4 +155,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_SMALL_OBJECTS_HH
+#endif // ! SCRIBO_FILTER_OBJECTS_SMALL_HH
diff --git a/scribo/filter/thick_objects.hh b/scribo/filter/objects_thick.hh
similarity index 89%
rename from scribo/filter/thick_objects.hh
rename to scribo/filter/objects_thick.hh
index 2cb1f30..519bd8c 100644
--- a/scribo/filter/thick_objects.hh
+++ b/scribo/filter/objects_thick.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_THICK_OBJECTS_HH
-# define SCRIBO_FILTER_THICK_OBJECTS_HH
+#ifndef SCRIBO_FILTER_OBJECTS_THICK_HH
+# define SCRIBO_FILTER_OBJECTS_THICK_HH
/// \file
///
@@ -60,7 +60,7 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- thick_objects(const Image<I>& input_,
+ objects_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_thickness);
@@ -76,7 +76,7 @@ namespace scribo
template <typename L>
inline
object_image(L)
- thick_objects(const object_image(L)& objects,
+ objects_thick(const object_image(L)& objects,
unsigned max_thickness);
@@ -130,12 +130,12 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- thick_objects(const Image<I>& input_,
+ objects_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_thickness)
{
- trace::entering("scribo::filter::thick_objects");
+ trace::entering("scribo::filter::objects_thick");
const I& input = exact(input_);
const N& nbh = exact(nbh_);
@@ -155,7 +155,7 @@ namespace scribo
mln_concrete(I) output = duplicate(input);
data::fill((output | pw::value(objects) == literal::zero).rw(), false);
- trace::exiting("scribo::filter::thick_objects");
+ trace::exiting("scribo::filter::objects_thick");
return output;
}
@@ -163,10 +163,10 @@ namespace scribo
template <typename L>
inline
object_image(L)
- thick_objects(const object_image(L)& objects,
+ objects_thick(const object_image(L)& objects,
unsigned max_thickness)
{
- trace::entering("scribo::filter::thick_objects");
+ trace::entering("scribo::filter::objects_thick");
mln_precondition(objects.is_valid());
@@ -177,7 +177,7 @@ namespace scribo
output.init_from_(objects);
output.relabel(is_not_too_thick);
- trace::exiting("scribo::filter::thick_objects");
+ trace::exiting("scribo::filter::objects_thick");
return output;
}
@@ -188,4 +188,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_THICK_OBJECTS_HH
+#endif // ! SCRIBO_FILTER_OBJECTS_THICK_HH
diff --git a/scribo/filter/thin_objects.hh b/scribo/filter/objects_thin.hh
similarity index 85%
rename from scribo/filter/thin_objects.hh
rename to scribo/filter/objects_thin.hh
index 2149a38..510a64f 100644
--- a/scribo/filter/thin_objects.hh
+++ b/scribo/filter/objects_thin.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_THIN_OBJECTS_HH
-# define SCRIBO_FILTER_THIN_OBJECTS_HH
+#ifndef SCRIBO_FILTER_OBJECTS_THIN_HH
+# define SCRIBO_FILTER_OBJECTS_THIN_HH
/// \file
///
@@ -58,7 +58,7 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- thin_objects(const Image<I>& input_,
+ objects_thin(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned min_thickness);
@@ -73,7 +73,7 @@ namespace scribo
template <typename L>
inline
object_image(L)
- thin_objects(const object_image(L)& text,
+ objects_thin(const object_image(L)& text,
unsigned min_thickness);
@@ -86,8 +86,8 @@ namespace scribo
/// Filter Functor.
/// Return false for all objects which are too large.
template <typename L>
- struct thin_objects_filter
- : Function_v2b< thin_objects_filter<L> >
+ struct objects_thin_filter
+ : Function_v2b< objects_thin_filter<L> >
{
typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
@@ -95,7 +95,7 @@ namespace scribo
///
/// \param[in] objects object bounding boxes.
/// \param[in] min_thickness the minimum thickness allowed.
- thin_objects_filter(const object_image(L)& objects,
+ objects_thin_filter(const object_image(L)& objects,
unsigned min_thickness)
: objects_(objects), min_thickness_(min_thickness)
{
@@ -128,12 +128,12 @@ namespace scribo
template <typename I, typename N, typename V>
inline
mln_concrete(I)
- thin_objects(const Image<I>& input_,
+ objects_thin(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned min_thickness)
{
- trace::entering("scribo::filter::thin_objects");
+ trace::entering("scribo::filter::objects_thin");
const I& input = exact(input_);
const N& nbh = exact(nbh_);
@@ -146,7 +146,7 @@ namespace scribo
object_image(lbl_t) objects
= primitive::extract::objects(input, nbh, nlabels);
- typedef internal::thin_objects_filter<lbl_t> func_t;
+ typedef internal::objects_thin_filter<lbl_t> func_t;
func_t fv2b(objects, min_thickness);
objects.relabel(fv2b);
@@ -154,7 +154,7 @@ namespace scribo
data::fill((output | pw::value(objects) == pw::cst(literal::zero)).rw(),
false);
- trace::exiting("scribo::filter::thin_objects");
+ trace::exiting("scribo::filter::objects_thin");
return output;
}
@@ -162,21 +162,21 @@ namespace scribo
template <typename L>
inline
object_image(L)
- thin_objects(const object_image(L)& objects,
+ objects_thin(const object_image(L)& objects,
unsigned min_thickness)
{
- trace::entering("scribo::filter::thin_objects");
+ trace::entering("scribo::filter::objects_thin");
mln_precondition(objects.is_valid());
- typedef internal::thin_objects_filter<L> func_t;
+ typedef internal::objects_thin_filter<L> func_t;
func_t is_not_too_thin(objects, min_thickness);
object_image(L) output;
output.init_from_(objects);
output.relabel(is_not_too_thin);
- trace::exiting("scribo::filter::thin_objects");
+ trace::exiting("scribo::filter::objects_thin");
return output;
}
@@ -187,4 +187,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_THIN_OBJECTS_HH
+#endif // ! SCRIBO_FILTER_OBJECTS_THIN_HH
diff --git a/scribo/fun/v2b/small_objects_filter.hh
b/scribo/fun/v2b/objects_small_filter.hh
similarity index 87%
rename from scribo/fun/v2b/small_objects_filter.hh
rename to scribo/fun/v2b/objects_small_filter.hh
index 477bd47..1ccac12 100644
--- a/scribo/fun/v2b/small_objects_filter.hh
+++ b/scribo/fun/v2b/objects_small_filter.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FUN_V2B_SMALL_OBJECTS_FILTER_HH
-# define SCRIBO_FUN_V2B_SMALL_OBJECTS_FILTER_HH
+#ifndef SCRIBO_FUN_V2B_OBJECTS_SMALL_FILTER_HH
+# define SCRIBO_FUN_V2B_OBJECTS_SMALL_FILTER_HH
/// \file
///
@@ -58,8 +58,8 @@ namespace scribo
/// Filter Functor.
/// Return false for all objects which are too small.
template <typename L>
- struct small_objects_filter
- : Function_v2b< small_objects_filter<L> >
+ struct objects_small_filter
+ : Function_v2b< objects_small_filter<L> >
{
typedef accu::math::count<mln_psite(L)> card_t;
@@ -68,7 +68,7 @@ namespace scribo
/// \param[in] objects Component bounding boxes.
/// \param[in] min_size Minimum component size.
//
- small_objects_filter(const object_image(L)& objects,
+ objects_small_filter(const object_image(L)& objects,
unsigned min_size);
@@ -96,7 +96,7 @@ namespace scribo
template <typename L>
inline
- small_objects_filter<L>::small_objects_filter(
+ objects_small_filter<L>::objects_small_filter(
const object_image(L)& objects,
unsigned min_size)
{
@@ -109,7 +109,7 @@ namespace scribo
template <typename L>
inline
bool
- small_objects_filter<L>::operator()(const mln_value(L)& l) const
+ objects_small_filter<L>::operator()(const mln_value(L)& l) const
{
if (l == literal::zero)
return true;
@@ -126,4 +126,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_SMALL_OBJECTS_HH
+#endif // ! SCRIBO_FUN_V2B_OBJECTS_SMALL_FILTER_HH
diff --git a/scribo/src/filter/large_objects.cc b/scribo/src/filter/large_objects.cc
index d2e91c5..a665032 100644
--- a/scribo/src/filter/large_objects.cc
+++ b/scribo/src/filter/large_objects.cc
@@ -30,7 +30,7 @@
#include <mln/value/label_16.hh>
-#include <scribo/filter/large_objects.hh>
+#include <scribo/filter/objects_large.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
obj_ima_t objects
= scribo::primitive::extract::objects(input, c8(), nobjects);
- obj_ima_t filtered = scribo::filter::large_objects(objects, atoi(argv[2]));
+ obj_ima_t filtered = scribo::filter::objects_large(objects, atoi(argv[2]));
io::pbm::save(data::convert(bool(), filtered), argv[3]);
trace::exiting("main");
diff --git a/scribo/src/filter/small_objects.cc b/scribo/src/filter/small_objects.cc
index f9a318e..ce57f00 100644
--- a/scribo/src/filter/small_objects.cc
+++ b/scribo/src/filter/small_objects.cc
@@ -29,7 +29,7 @@
#include <mln/io/pbm/all.hh>
#include <mln/value/label_16.hh>
-#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/objects_small.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
obj_ima_t objects
= scribo::primitive::extract::objects(input, c8(), nobjects);
- obj_ima_t filtered = scribo::filter::small_objects(objects, atoi(argv[2]));
+ obj_ima_t filtered = scribo::filter::objects_small(objects, atoi(argv[2]));
io::pbm::save(data::convert(bool(), filtered), argv[3]);
trace::exiting("main");
diff --git a/scribo/src/filter/thick_objects.cc b/scribo/src/filter/thick_objects.cc
index 91fba14..495c9e0 100644
--- a/scribo/src/filter/thick_objects.cc
+++ b/scribo/src/filter/thick_objects.cc
@@ -29,7 +29,7 @@
#include <mln/io/pbm/all.hh>
#include <mln/value/label_16.hh>
-#include <scribo/filter/thick_objects.hh>
+#include <scribo/filter/objects_thick.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
obj_ima_t objects
= scribo::primitive::extract::objects(input, c8(), nobjects);
- obj_ima_t filtered = scribo::filter::thick_objects(objects, atoi(argv[2]));
+ obj_ima_t filtered = scribo::filter::objects_thick(objects, atoi(argv[2]));
io::pbm::save(data::convert(bool(), filtered), argv[3]);
trace::exiting("main");
diff --git a/scribo/src/filter/thin_objects.cc b/scribo/src/filter/thin_objects.cc
index 9da3981..d1be415 100644
--- a/scribo/src/filter/thin_objects.cc
+++ b/scribo/src/filter/thin_objects.cc
@@ -29,7 +29,7 @@
#include <mln/io/pbm/all.hh>
#include <mln/value/label_16.hh>
-#include <scribo/filter/thin_objects.hh>
+#include <scribo/filter/objects_thin.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
obj_ima_t objects
= scribo::primitive::extract::objects(input, c8(), nobjects);
- obj_ima_t filtered = scribo::filter::thin_objects(objects, atoi(argv[2]));
+ obj_ima_t filtered = scribo::filter::objects_thin(objects, atoi(argv[2]));
io::pbm::save(data::convert(bool(), filtered), argv[3]);
trace::exiting("main");
diff --git a/scribo/src/preprocess.cc b/scribo/src/preprocess.cc
index 57a0fb7..8c34930 100644
--- a/scribo/src/preprocess.cc
+++ b/scribo/src/preprocess.cc
@@ -35,8 +35,8 @@
#include <scribo/binarization/simple.hh>
#include <scribo/preprocessing/unskew.hh>
-#include <scribo/filter/small_objects.hh>
-#include <scribo/filter/thin_objects.hh>
+#include <scribo/filter/objects_small.hh>
+#include <scribo/filter/objects_thin.hh>
#include <scribo/debug/usage.hh>
@@ -65,8 +65,8 @@ int main(int argc, char *argv[])
image2d<bool> input_bw = scribo::binarization::simple(input);
logical::not_inplace(input_bw);
- input_bw = scribo::filter::small_objects(input_bw, c8(), value::label_16(), 3);
- input_bw = scribo::filter::thin_objects(input_bw, c8(), value::label_16(), 1);
+ input_bw = scribo::filter::objects_small(input_bw, c8(), value::label_16(), 3);
+ input_bw = scribo::filter::objects_thin(input_bw, c8(), value::label_16(), 1);
input_bw = scribo::preprocessing::unskew(input_bw).first();
diff --git a/scribo/src/recognition.cc b/scribo/src/recognition.cc
index f9ea901..de5cafa 100644
--- a/scribo/src/recognition.cc
+++ b/scribo/src/recognition.cc
@@ -42,8 +42,8 @@
#include <scribo/primitive/link/with_several_left_links.hh>
#include <scribo/primitive/link/with_several_right_links.hh>
#include <scribo/primitive/group/from_double_link.hh>
-#include <scribo/filter/small_objects.hh>
-#include <scribo/filter/thin_objects.hh>
+#include <scribo/filter/objects_small.hh>
+#include <scribo/filter/objects_thin.hh>
#include <scribo/text/recognition.hh>
#include <scribo/debug/usage.hh>
@@ -82,8 +82,8 @@ int main(int argc, char* argv[])
objects = scribo::primitive::extract::objects(input, c8(), nbboxes);
/// Filter non interesting objects
- objects = filter::small_objects(objects, 4);
- objects = filter::thin_objects<L>(objects, 2);
+ objects = filter::objects_small(objects, 4);
+ objects = filter::objects_thin<L>(objects, 2);
/// Group objects.
object_links<L> left_link
diff --git a/scribo/src/text/grouping/group_from_double_link.cc
b/scribo/src/text/grouping/group_from_double_link.cc
index bcd768f..9e8a6b3 100644
--- a/scribo/src/text/grouping/group_from_double_link.cc
+++ b/scribo/src/text/grouping/group_from_double_link.cc
@@ -43,7 +43,7 @@
#include <scribo/primitive/link/with_single_right_link.hh>
#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/primitive/group/from_double_link.hh>
-#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/objects_small.hh>
#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
typedef object_image(L) text_t;
text_t text = primitive::extract::objects(input, c8(), nbboxes);
- text = filter::small_objects(text, 4);
+ text = filter::objects_small(text, 4);
object_links<L> left_link
= primitive::link::with_single_left_link(text, atoi(argv[2]));
diff --git a/scribo/src/text/grouping/group_from_double_several_links.cc
b/scribo/src/text/grouping/group_from_double_several_links.cc
index de9eb20..5b591c2 100644
--- a/scribo/src/text/grouping/group_from_double_several_links.cc
+++ b/scribo/src/text/grouping/group_from_double_several_links.cc
@@ -42,7 +42,7 @@
#include <scribo/primitive/link/with_several_right_links.hh>
#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/primitive/group/from_double_link.hh>
-#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/objects_small.hh>
#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
std::cout << "Remove small components" << std::endl;
- text = filter::small_objects(text,4);
+ text = filter::objects_small(text,4);
std::cout << "Group with left link" << std::endl;
object_links<L> left_link
diff --git a/scribo/src/text/grouping/group_from_rag.cc
b/scribo/src/text/grouping/group_from_rag.cc
index 5bc8b86..8b3d5fd 100644
--- a/scribo/src/text/grouping/group_from_rag.cc
+++ b/scribo/src/text/grouping/group_from_rag.cc
@@ -48,12 +48,12 @@
#include <scribo/primitive/link/with_rag.hh>
//#include <scribo/primitive/group/from_rag.hh>
-#include <scribo/filter/small_objects.hh>
-#include <scribo/filter/thin_objects.hh>
-#include <scribo/filter/thick_objects.hh>
+#include <scribo/filter/objects_small.hh>
+#include <scribo/filter/objects_thin.hh>
+#include <scribo/filter/objects_thick.hh>
-#include <scribo/fun/v2b/small_objects_filter.hh>
+#include <scribo/fun/v2b/objects_small_filter.hh>
#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
@@ -177,13 +177,13 @@ int main(int argc, char* argv[])
/// First filtering.
objects_t filtered_objects
- = scribo::filter::small_objects(objects, 6);
+ = scribo::filter::objects_small(objects, 6);
filtered_objects
- = scribo::filter::thin_objects(filtered_objects, 3);
+ = scribo::filter::objects_thin(filtered_objects, 3);
filtered_objects
- = scribo::filter::thick_objects(filtered_objects,
+ = scribo::filter::objects_thick(filtered_objects,
math::min(input.ncols(), input.nrows()) / 6);
diff --git a/scribo/src/text_in_photo.cc b/scribo/src/text_in_photo.cc
index b18825e..1cf90b5 100644
--- a/scribo/src/text_in_photo.cc
+++ b/scribo/src/text_in_photo.cc
@@ -48,10 +48,10 @@
#include <scribo/primitive/link/with_single_right_link.hh>
#include <scribo/primitive/group/from_double_link.hh>
#include <scribo/primitive/group/from_single_link.hh>
-#include <scribo/filter/small_objects.hh>
-#include <scribo/filter/thin_objects.hh>
-#include <scribo/filter/thick_objects.hh>
-#include <scribo/filter/small_object_groups.hh>
+#include <scribo/filter/objects_small.hh>
+#include <scribo/filter/objects_thin.hh>
+#include <scribo/filter/objects_thick.hh>
+#include <scribo/filter/object_groups_small.hh>
#include <scribo/make/debug_filename.hh>
#include <scribo/debug/save_bboxes_image.hh>
@@ -97,13 +97,13 @@ highlighted.");
/// First filtering.
object_image(L) filtered_objects
- = scribo::filter::small_objects(objects, 6);
+ = scribo::filter::objects_small(objects, 6);
filtered_objects
- = scribo::filter::thin_objects(filtered_objects, 1);
+ = scribo::filter::objects_thin(filtered_objects, 1);
filtered_objects
- = scribo::filter::thick_objects(filtered_objects,
+ = scribo::filter::objects_thick(filtered_objects,
math::min(input.ncols(), input.nrows()) / 5);
/// Grouping potential objects
@@ -131,7 +131,7 @@ highlighted.");
// Remove objects part of groups with less than 3 objects.
mln::util::array<bool>
- to_be_kept = filter::small_object_groups(groups, 3);
+ to_be_kept = filter::object_groups_small(groups, 3);
// FOR DEBUGGING PURPOSE.
diff --git a/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc
index db4dfcf..39c658a 100644
--- a/scribo/src/thin_bboxes.cc
+++ b/scribo/src/thin_bboxes.cc
@@ -34,7 +34,7 @@
#include <scribo/text/extract_lines.hh>
-#include <scribo/filter/thin_objects.hh>
+#include <scribo/filter/objects_thin.hh>
int usage(const char *name)
{
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
if (argc < 1)
return usage(argv[0]);
- scribo::make::internal::debug_filename_prefix = "thin_objects";
+ scribo::make::internal::debug_filename_prefix = "objects_thin";
image2d<bool> input;
io::pbm::load(input, argv[1]);
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
typedef object_image(image2d<value::label_16>) text_t;
text_t lines = scribo::text::extract_lines(input, c8(), nlines);
- text_t filtered_lines = scribo::filter::thin_objects(lines, 5);
+ text_t filtered_lines = scribo::filter::objects_thin(lines, 5);
scribo::debug::save_bboxes_image(input, filtered_lines.bboxes(),
literal::red,
diff --git a/scribo/tests/filter/small_and_large_bboxes.cc
b/scribo/tests/filter/small_and_large_bboxes.cc
index 2d765df..0b10cfe 100644
--- a/scribo/tests/filter/small_and_large_bboxes.cc
+++ b/scribo/tests/filter/small_and_large_bboxes.cc
@@ -38,7 +38,7 @@
#include <scribo/primitive/group/apply.hh>
#include <scribo/primitive/link/with_graph.hh>
#include <scribo/primitive/group/from_graph.hh>
-#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/objects_small.hh>
#include <scribo/util/text.hh>
#include <scribo/make/debug_filename.hh>
@@ -99,7 +99,7 @@ int main(int argc, char* argv[])
mln_assertion(grouped_text.nlabels() == 6u);
text_t
- filtered_text = scribo::filter::small_objects(grouped_text, 20);
+ filtered_text = scribo::filter::objects_small(grouped_text, 20);
mln_assertion(filtered_text.nlabels() == 2u);
--
1.5.6.5