* scribo/primitive/extract/horizontal_separators.hh,
* scribo/primitive/extract/lines_discontinued.hh,
* scribo/primitive/extract/lines_h_discontinued.hh,
* scribo/primitive/extract/lines_h_pattern.hh,
* scribo/primitive/extract/lines_h_single.hh,
* scribo/primitive/extract/lines_h_thick.hh,
* scribo/primitive/extract/lines_h_thick_and_single.hh,
* scribo/primitive/extract/lines_h_thick_and_thin.hh,
* scribo/primitive/extract/lines_pattern.hh,
* scribo/primitive/extract/lines_thick.hh,
* scribo/primitive/extract/lines_v_discontinued.hh,
* scribo/primitive/extract/lines_v_pattern.hh,
* scribo/primitive/extract/lines_v_single.hh,
* scribo/primitive/extract/lines_v_thick.hh,
* scribo/primitive/extract/lines_v_thick_and_single.hh,
* scribo/primitive/extract/separators.hh,
* scribo/primitive/extract/separators_nonvisible.hh,
* scribo/primitive/extract/vertical_separators.hh,
* scribo/text/extract_lines.hh,
* scribo/text/extract_lines_with_features.hh,
* scribo/text/extract_lines_wo_merge.hh,
* scribo/text/extract_paragraphs.hh,
* scribo/text/extract_paragraphs_hdoc.hh,
* scribo/text/link_lines.hh,
* scribo/text/merging.hh,
* scribo/text/merging_hdoc.hh,
* scribo/text/recognition.hh: Here.
---
scribo/ChangeLog | 32 +++++++++++++++++++
.../primitive/extract/horizontal_separators.hh | 6 ++-
.../scribo/primitive/extract/lines_discontinued.hh | 6 ++-
.../primitive/extract/lines_h_discontinued.hh | 6 ++-
scribo/scribo/primitive/extract/lines_h_pattern.hh | 3 +-
scribo/scribo/primitive/extract/lines_h_single.hh | 6 +++-
scribo/scribo/primitive/extract/lines_h_thick.hh | 5 ++-
.../primitive/extract/lines_h_thick_and_single.hh | 4 ++-
.../primitive/extract/lines_h_thick_and_thin.hh | 6 +++-
scribo/scribo/primitive/extract/lines_pattern.hh | 25 ++++++++-------
scribo/scribo/primitive/extract/lines_thick.hh | 8 +++--
.../primitive/extract/lines_v_discontinued.hh | 10 +++--
scribo/scribo/primitive/extract/lines_v_pattern.hh | 22 +++++++------
scribo/scribo/primitive/extract/lines_v_single.hh | 6 +++-
scribo/scribo/primitive/extract/lines_v_thick.hh | 10 +++--
.../primitive/extract/lines_v_thick_and_single.hh | 4 ++-
scribo/scribo/primitive/extract/separators.hh | 10 +++--
.../primitive/extract/separators_nonvisible.hh | 12 ++++---
.../primitive/extract/vertical_separators.hh | 9 +++--
scribo/scribo/text/extract_lines.hh | 26 +++++++++------
scribo/scribo/text/extract_lines_with_features.hh | 27 +++++++++------
scribo/scribo/text/extract_lines_wo_merge.hh | 33 ++++++++++++-------
scribo/scribo/text/extract_paragraphs.hh | 13 ++++++-
scribo/scribo/text/extract_paragraphs_hdoc.hh | 7 +++-
scribo/scribo/text/link_lines.hh | 6 +++-
scribo/scribo/text/merging.hh | 26 +++++++++------
scribo/scribo/text/merging_hdoc.hh | 27 +++++++++-------
scribo/scribo/text/recognition.hh | 32 +++++++++++--------
28 files changed, 254 insertions(+), 133 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 5b3540d..8457101 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,37 @@
2012-02-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add algorithms to documentation groups.
+
+ * scribo/primitive/extract/horizontal_separators.hh,
+ * scribo/primitive/extract/lines_discontinued.hh,
+ * scribo/primitive/extract/lines_h_discontinued.hh,
+ * scribo/primitive/extract/lines_h_pattern.hh,
+ * scribo/primitive/extract/lines_h_single.hh,
+ * scribo/primitive/extract/lines_h_thick.hh,
+ * scribo/primitive/extract/lines_h_thick_and_single.hh,
+ * scribo/primitive/extract/lines_h_thick_and_thin.hh,
+ * scribo/primitive/extract/lines_pattern.hh,
+ * scribo/primitive/extract/lines_thick.hh,
+ * scribo/primitive/extract/lines_v_discontinued.hh,
+ * scribo/primitive/extract/lines_v_pattern.hh,
+ * scribo/primitive/extract/lines_v_single.hh,
+ * scribo/primitive/extract/lines_v_thick.hh,
+ * scribo/primitive/extract/lines_v_thick_and_single.hh,
+ * scribo/primitive/extract/separators.hh,
+ * scribo/primitive/extract/separators_nonvisible.hh,
+ * scribo/primitive/extract/vertical_separators.hh,
+ * scribo/text/extract_lines.hh,
+ * scribo/text/extract_lines_with_features.hh,
+ * scribo/text/extract_lines_wo_merge.hh,
+ * scribo/text/extract_paragraphs.hh,
+ * scribo/text/extract_paragraphs_hdoc.hh,
+ * scribo/text/link_lines.hh,
+ * scribo/text/merging.hh,
+ * scribo/text/merging_hdoc.hh,
+ * scribo/text/recognition.hh: Here.
+
+2012-02-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* doc/scribo/binarization/sauvola.dox: Fix documentation.
2012-02-27 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/scribo/primitive/extract/horizontal_separators.hh b/scribo/scribo/primitive/extract/horizontal_separators.hh
index 95db09e..ff46419 100644
--- a/scribo/scribo/primitive/extract/horizontal_separators.hh
+++ b/scribo/scribo/primitive/extract/horizontal_separators.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -57,6 +57,8 @@ namespace scribo
* \return A binary image were separators are set to 'True'.
*
* \sa primitive::remove::separators
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I>
mln_concrete(I)
diff --git a/scribo/scribo/primitive/extract/lines_discontinued.hh b/scribo/scribo/primitive/extract/lines_discontinued.hh
index 63953ac..2266003 100644
--- a/scribo/scribo/primitive/extract/lines_discontinued.hh
+++ b/scribo/scribo/primitive/extract/lines_discontinued.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -68,6 +68,8 @@ namespace scribo
* \param[in] rank_k Rank used for filtering.
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V, typename W>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_h_discontinued.hh b/scribo/scribo/primitive/extract/lines_h_discontinued.hh
index f1deb98..b54f184 100644
--- a/scribo/scribo/primitive/extract/lines_h_discontinued.hh
+++ b/scribo/scribo/primitive/extract/lines_h_discontinued.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -61,6 +61,8 @@ namespace scribo
*
* \result An image in which lines are labeled with a value different
* from 0.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_h_pattern.hh b/scribo/scribo/primitive/extract/lines_h_pattern.hh
index 3cedf53..d45f824 100644
--- a/scribo/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_h_pattern.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -79,6 +79,7 @@ namespace scribo
Using a delta of 0 is equivalent to the use of a c2_row
neighborhood.
+ \ingroup extractprimitiveseps
*/
template <typename I>
mln_concrete(I)
diff --git a/scribo/scribo/primitive/extract/lines_h_single.hh b/scribo/scribo/primitive/extract/lines_h_single.hh
index 7c9e556..6970e3e 100644
--- a/scribo/scribo/primitive/extract/lines_h_single.hh
+++ b/scribo/scribo/primitive/extract/lines_h_single.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -66,6 +66,8 @@ namespace scribo
*
* \return An image in which only horizontal single lines are
* labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
@@ -88,6 +90,8 @@ namespace scribo
*
* \return An image in which only horizontal single lines are
* labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename L>
component_set<L>
diff --git a/scribo/scribo/primitive/extract/lines_h_thick.hh b/scribo/scribo/primitive/extract/lines_h_thick.hh
index b1dfcfd..68bae43 100644
--- a/scribo/scribo/primitive/extract/lines_h_thick.hh
+++ b/scribo/scribo/primitive/extract/lines_h_thick.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -59,6 +60,8 @@ namespace scribo
* \param[in] line_length The minimum line length.
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V, typename W>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_h_thick_and_single.hh b/scribo/scribo/primitive/extract/lines_h_thick_and_single.hh
index d0db15d..c7ed4bd 100644
--- a/scribo/scribo/primitive/extract/lines_h_thick_and_single.hh
+++ b/scribo/scribo/primitive/extract/lines_h_thick_and_single.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -73,6 +73,8 @@ namespace scribo
* object as a single line.
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_h_thick_and_thin.hh b/scribo/scribo/primitive/extract/lines_h_thick_and_thin.hh
index 45b2ad3..a80c36a 100644
--- a/scribo/scribo/primitive/extract/lines_h_thick_and_thin.hh
+++ b/scribo/scribo/primitive/extract/lines_h_thick_and_thin.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -77,6 +78,9 @@ namespace scribo
{
using namespace mln;
+ /*! \brief Extract both thick and thin horizontal lines.
+ * \ingroup extractprimitiveseps
+ */
template <typename I>
mln_concrete(I)
lines_h_thick_and_thin(const Image<I>& binary_image,
diff --git a/scribo/scribo/primitive/extract/lines_pattern.hh b/scribo/scribo/primitive/extract/lines_pattern.hh
index ec24d4f..b7c84d4 100644
--- a/scribo/scribo/primitive/extract/lines_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_pattern.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -58,16 +58,17 @@ namespace scribo
using namespace mln;
- /// Extract lines with a specific pattern
- ///
- /// \param[in] input_ A binary image.
- /// \param[in] length The minimum line length.
- /// \param[in] dir The direction of the lines.
- /// \param[in] win_ A window corresponding to the line pattern.
- ///
- /// \return A image with lines of direction \p dir.
- ///
- //
+ /*! \brief Extract lines with a specific pattern
+
+ \param[in] input_ A binary image.
+ \param[in] length The minimum line length.
+ \param[in] dir The direction of the lines.
+ \param[in] win_ A window corresponding to the line pattern.
+
+ \return A image with lines of direction \p dir.
+
+ \ingroup extractprimitiveseps
+ */
template <typename I, typename W>
mln_concrete(I)
lines_pattern(const Image<I>& input_, unsigned length,
diff --git a/scribo/scribo/primitive/extract/lines_thick.hh b/scribo/scribo/primitive/extract/lines_thick.hh
index 726dab4..530243f 100644
--- a/scribo/scribo/primitive/extract/lines_thick.hh
+++ b/scribo/scribo/primitive/extract/lines_thick.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -52,8 +53,7 @@ namespace scribo
using namespace mln;
- /// Extract thick lines in a binary image.
- /*!
+ /*! \brief Extract thick lines in a binary image.
* Only non discontinued lines are correctly extracted with this routine.
*
* \param[in] input_ A binary image.
@@ -63,6 +63,8 @@ namespace scribo
* \param[in] win_ Window used to extract the lines
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V, typename W>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_v_discontinued.hh b/scribo/scribo/primitive/extract/lines_v_discontinued.hh
index c0e8b92..f067251 100644
--- a/scribo/scribo/primitive/extract/lines_v_discontinued.hh
+++ b/scribo/scribo/primitive/extract/lines_v_discontinued.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -48,8 +48,8 @@ namespace scribo
{
- /// Extract vertical discontinued lines.
- /*!
+ /*! \brief Extract vertical discontinued lines.
+ *
* \param[in] input A binary image.
* \param[in] nbh A neighborhood used to label lines.
* \param[in,out] nlines The number of lines found.
@@ -59,6 +59,8 @@ namespace scribo
*
* \result An image in which lines are labeled with a value different
* from 0.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_v_pattern.hh b/scribo/scribo/primitive/extract/lines_v_pattern.hh
index bf0b1c0..c65eb4b 100644
--- a/scribo/scribo/primitive/extract/lines_v_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_v_pattern.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -56,15 +56,17 @@ namespace scribo
using namespace mln;
- /// \brief Extract vertical lines matching a specific pattern.
- ///
- /// \param[in] input A binary image.
- /// \param[in] length The minimum line length.
- /// \param[in] delta space between the first background pixels
- /// and the line pixels (usually 2 or 3).
- ///
- /// \result An image of vertical lines.
- //
+ /*! \brief Extract vertical lines matching a specific pattern.
+
+ \param[in] input A binary image.
+ \param[in] length The minimum line length.
+ \param[in] delta space between the first background pixels
+ and the line pixels (usually 2 or 3).
+
+ \result An image of vertical lines.
+
+ \ingroup extractprimitiveseps
+ */
template <typename I>
mln_concrete(I)
lines_v_pattern(const Image<I>& input, unsigned length, unsigned delta);
diff --git a/scribo/scribo/primitive/extract/lines_v_single.hh b/scribo/scribo/primitive/extract/lines_v_single.hh
index 317bf22..94bfe43 100644
--- a/scribo/scribo/primitive/extract/lines_v_single.hh
+++ b/scribo/scribo/primitive/extract/lines_v_single.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -65,6 +65,8 @@ namespace scribo
*
* \return An image in which only vertical single lines are
* labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
@@ -87,6 +89,8 @@ namespace scribo
*
* \return An image in which only vertical single lines are
* labeled.
+ *
+ *\ingroup extractprimitiveseps
*/
template <typename L>
component_set<L>
diff --git a/scribo/scribo/primitive/extract/lines_v_thick.hh b/scribo/scribo/primitive/extract/lines_v_thick.hh
index 8b8a656..08ec328 100644
--- a/scribo/scribo/primitive/extract/lines_v_thick.hh
+++ b/scribo/scribo/primitive/extract/lines_v_thick.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -48,8 +48,8 @@ namespace scribo
using namespace mln;
- /// Extract thick lines in a binary image.
- /*!
+ /*! \brief Extract thick lines in a binary image.
+ *
* Only non discontinued lines are correctly extracted with this routine.
*
* \param[in] input_ A binary image.
@@ -59,6 +59,8 @@ namespace scribo
* \param[in] line_length The minimum line length.
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V, typename W>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/lines_v_thick_and_single.hh b/scribo/scribo/primitive/extract/lines_v_thick_and_single.hh
index c3719cf..855e4ac 100644
--- a/scribo/scribo/primitive/extract/lines_v_thick_and_single.hh
+++ b/scribo/scribo/primitive/extract/lines_v_thick_and_single.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -71,6 +71,8 @@ namespace scribo
* object as a single line.
*
* \return An image in which lines are labeled.
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I, typename N, typename V>
component_set<mln_ch_value(I,V)>
diff --git a/scribo/scribo/primitive/extract/separators.hh b/scribo/scribo/primitive/extract/separators.hh
index 316f806..3b3fb94 100644
--- a/scribo/scribo/primitive/extract/separators.hh
+++ b/scribo/scribo/primitive/extract/separators.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -49,8 +49,8 @@ namespace scribo
using namespace mln;
- /// \brief Extract vertical and horizontal separators.
- /*!
+ /*! \brief Extract vertical and horizontal separators.
+ *
*
* \param[in] input A binary image.
* \param[in] line_length The minimum line length.
@@ -58,6 +58,8 @@ namespace scribo
* \return A binary image were separators are set to 'True'.
*
* \sa primitive::remove::separators
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I>
mln_concrete(I)
diff --git a/scribo/scribo/primitive/extract/separators_nonvisible.hh b/scribo/scribo/primitive/extract/separators_nonvisible.hh
index 998d6ec..7c8b243 100644
--- a/scribo/scribo/primitive/extract/separators_nonvisible.hh
+++ b/scribo/scribo/primitive/extract/separators_nonvisible.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -92,9 +92,11 @@ namespace scribo
using namespace scribo::debug;
- /// \brief Find non visible separators. Based on components
- /// alignments.
- //
+ /*! \brief Find non visible separators. Based on components
+ alignments.
+
+ \ingroup extractprimitiveseps
+ */
template <typename I>
mln_concrete(I)
separators_nonvisible(const Image<I>& in_);
diff --git a/scribo/scribo/primitive/extract/vertical_separators.hh b/scribo/scribo/primitive/extract/vertical_separators.hh
index 9a6ea39..8936881 100644
--- a/scribo/scribo/primitive/extract/vertical_separators.hh
+++ b/scribo/scribo/primitive/extract/vertical_separators.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -47,8 +48,8 @@ namespace scribo
using namespace mln;
- /// \brief Extract vertical separators.
- /*!
+ /*! \brief Extract vertical separators.
+ *
*
* \param[in] input A binary image.
* \param[in] line_length The minimum line length.
@@ -56,6 +57,8 @@ namespace scribo
* \return A binary image were separators are set to 'True'.
*
* \sa primitive::remove::separators
+ *
+ * \ingroup extractprimitiveseps
*/
template <typename I>
mln_concrete(I)
diff --git a/scribo/scribo/text/extract_lines.hh b/scribo/scribo/text/extract_lines.hh
index 685079c..098cc2c 100644
--- a/scribo/scribo/text/extract_lines.hh
+++ b/scribo/scribo/text/extract_lines.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -63,25 +63,31 @@ namespace scribo
using namespace mln;
/*! \brief Extract lines of text in a binary image.
- **
- ** \param[in] input A binary image.
- ** \param[in] nbh A neighborhood used for labeling.
- ** \param[in] separators A binary image with separator information.
- **
- ** \return A set of lines.
- */
+ *
+ * \param[in] input A binary image.
+ * \param[in] nbh A neighborhood used for labeling.
+ * \param[in] separators A binary image with separator information.
+ *
+ * \return A set of lines.
+ *
+ * \ingroup grptext
+ */
template <typename I, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines(const Image<I>& input, const Neighborhood<N>& nbh,
const mln_ch_value(I,bool)& separators);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename I, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines(const Image<I>& input, const Neighborhood<N>& nbh);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename L>
line_set<mln_ch_value(L,scribo::def::lbl_type)>
extract_lines(const component_set<L>& input);
diff --git a/scribo/scribo/text/extract_lines_with_features.hh b/scribo/scribo/text/extract_lines_with_features.hh
index fd413eb..79b91ec 100644
--- a/scribo/scribo/text/extract_lines_with_features.hh
+++ b/scribo/scribo/text/extract_lines_with_features.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -44,15 +45,17 @@ namespace scribo
using namespace mln;
- /// Extract lines of text in a binary image.
- /*!
- ** \param[in] input Original color image.
- ** \param[in] input_binary A binary image.
- ** \param[in] nbh A neighborhood used for labeling.
- ** \param[in] separators A binary image with separator information.
- **
- ** \return A set of lines.
- */
+ /*! \brief Extract lines of text in a binary image.
+ *
+ * \param[in] input Original color image.
+ * \param[in] input_binary A binary image.
+ * \param[in] nbh A neighborhood used for labeling.
+ * \param[in] separators A binary image with separator information.
+ *
+ * \return A set of lines.
+ *
+ * \ingroup grptext
+ */
template <typename I, typename J, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines_with_features(const Image<I>& input,
@@ -61,7 +64,9 @@ namespace scribo
const mln_ch_value(I,bool)& separators);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename I, typename J, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines_with_features(const Image<I>& input,
diff --git a/scribo/scribo/text/extract_lines_wo_merge.hh b/scribo/scribo/text/extract_lines_wo_merge.hh
index ea9e6cf..ab06395 100644
--- a/scribo/scribo/text/extract_lines_wo_merge.hh
+++ b/scribo/scribo/text/extract_lines_wo_merge.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -62,30 +63,38 @@ namespace scribo
using namespace mln;
- /// \brief Extract lines of text in a binary image.
- /*!
- ** \param[in] input A binary image.
- ** \param[in] nbh A neighborhood used for labeling.
- ** \param[in] separators A binary image with separator information.
- **
- ** \return A set of lines.
- */
+ /*! \brief Extract lines of text in a binary image.
+ *
+ * \param[in] input A binary image.
+ * \param[in] nbh A neighborhood used for labeling.
+ * \param[in] separators A binary image with separator information.
+ *
+ * \return A set of lines.
+ *
+ * \ingroup grptext
+ */
template <typename I, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines_wo_merge(const Image<I>& input, const Neighborhood<N>& nbh,
const mln_ch_value(I,bool)& separators);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename I, typename N>
line_set<mln_ch_value(I,scribo::def::lbl_type)>
extract_lines_wo_merge(const Image<I>& input, const Neighborhood<N>& nbh);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename L, typename N>
line_set<mln_ch_value(L,scribo::def::lbl_type)>
extract_lines_wo_merge(const document<L>& doc, const Neighborhood<N>& nbh);
- /// \overload
+ /*! \overload
+ \ingroup grptext
+ */
template <typename L, typename N>
line_set<mln_ch_value(L,scribo::def::lbl_type)>
extract_lines_wo_merge(const document<L>& doc, const Neighborhood<N>& nbh,
diff --git a/scribo/scribo/text/extract_paragraphs.hh b/scribo/scribo/text/extract_paragraphs.hh
index ea1025b..5ea1b43 100644
--- a/scribo/scribo/text/extract_paragraphs.hh
+++ b/scribo/scribo/text/extract_paragraphs.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -62,6 +62,15 @@ namespace scribo
namespace text
{
+ /*! \brief Extract paragraphs
+ \ingroup grptext
+ */
+ template <typename L>
+ inline
+ paragraph_set<L>
+ extract_paragraphs(line_set<L>& lines,
+ const image2d<bool>& input);
+
# ifndef MLN_INCLUDE_ONLY
diff --git a/scribo/scribo/text/extract_paragraphs_hdoc.hh b/scribo/scribo/text/extract_paragraphs_hdoc.hh
index 52f4ea0..a7ba0b8 100644
--- a/scribo/scribo/text/extract_paragraphs_hdoc.hh
+++ b/scribo/scribo/text/extract_paragraphs_hdoc.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -63,6 +63,9 @@ namespace scribo
namespace text
{
+ /*! \brief Extract paragraph in old documents.
+ \ingroup grptext
+ */
template <typename L>
inline
paragraph_set<L>
diff --git a/scribo/scribo/text/link_lines.hh b/scribo/scribo/text/link_lines.hh
index 4eab43d..a1e746e 100644
--- a/scribo/scribo/text/link_lines.hh
+++ b/scribo/scribo/text/link_lines.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -50,6 +51,9 @@ namespace scribo
using namespace mln;
+ /*! \brief Link text lines to prepare paragraph construction.
+ \ingroup grptext
+ */
template <typename L>
line_links<L>
link_lines(const line_set<L>& lines);
diff --git a/scribo/scribo/text/merging.hh b/scribo/scribo/text/merging.hh
index 791d4d0..a52fbc4 100644
--- a/scribo/scribo/text/merging.hh
+++ b/scribo/scribo/text/merging.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2012 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -69,16 +70,19 @@ namespace scribo
using namespace mln;
- /// \brief Merge text component in order to reconstruct text lines.
- ///
- /// \param[in] lines A line set.
- ///
- /// \return A new line set. Line ids are preserved and merged
- /// lines (not valid anymore) are tagged with line::Merged. The
- /// lines produced with this algorithm (valid lines) are tagged
- /// with line::None. Line type is also set either with line::Text
- /// or line::Punctuation.
- //
+ /*! \brief Merge text component in order to reconstruct text
+ lines.
+
+ \param[in] lines A line set.
+
+ \return A new line set. Line ids are preserved and merged
+ lines (not valid anymore) are tagged with line::Merged. The
+ lines produced with this algorithm (valid lines) are tagged
+ with line::None. Line type is also set either with line::Text
+ or line::Punctuation.
+
+ \ingroup grptext
+ */
template <typename L>
line_set<L>
merging(const scribo::line_set<L>& lines);
diff --git a/scribo/scribo/text/merging_hdoc.hh b/scribo/scribo/text/merging_hdoc.hh
index 6f89d2a..2cd329c 100644
--- a/scribo/scribo/text/merging_hdoc.hh
+++ b/scribo/scribo/text/merging_hdoc.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010, 2011, 2012 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -70,16 +70,19 @@ namespace scribo
using namespace mln;
- /// \brief Merge text component in order to reconstruct text lines.
- ///
- /// \param[in] lines A line set.
- ///
- /// \return A new line set. Line ids are preserved and merged
- /// lines (not valid anymore) are tagged with line::Merged. The
- /// lines produced with this algorithm (valid lines) are tagged
- /// with line::None. Line type is also set either with line::Text
- /// or line::Punctuation.
- //
+ /*! \brief Merge text component in order to reconstruct text lines
+ in old documents.
+
+ \param[in] lines A line set.
+
+ \return A new line set. Line ids are preserved and merged
+ lines (not valid anymore) are tagged with line::Merged. The
+ lines produced with this algorithm (valid lines) are tagged
+ with line::None. Line type is also set either with line::Text
+ or line::Punctuation.
+
+ \ingroup grptext
+ */
template <typename L>
line_set<L>
merging_hdoc(const scribo::line_set<L>& lines);
diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh
index 7bdcb58..759b484 100644
--- a/scribo/scribo/text/recognition.hh
+++ b/scribo/scribo/text/recognition.hh
@@ -81,25 +81,29 @@ namespace scribo
using namespace mln;
- /// \brief Passes the text bboxes to Tesseract (OCR).
- ///
- /// \param[in] lines The lines of text.
- /// \param[in] language The language which should be recognized by
- /// Tesseract. (fra, en, ...)
- //
+ /*! \brief Passes the text bboxes to Tesseract (OCR).
+
+ \param[in] lines The lines of text.
+ \param[in] language The language which should be recognized by
+ Tesseract. (fra, en, ...)
+
+ \ingroup grpocr
+ */
template <typename L>
void
recognition(line_set<L>& lines, const char *language);
- /// \brief Recognize text from an image.
- ///
- /// \param[in] line Image of text line.
- /// \param[in] language The language which should be recognized by
- /// Tesseract. (fra, en, ...)
- /// \param[in] output_file If set, store the recognized text in
- /// this file.
- //
+ /*! \brief Recognize text from an image.
+
+ \param[in] line Image of text line.
+ \param[in] language The language which should be recognized by
+ Tesseract. (fra, en, ...)
+ \param[in] output_file If set, store the recognized text in
+ this file.
+
+ \ingroup grpocr
+ */
template <typename I>
void
recognition(const Image<I>& line,
--
1.7.2.5
---
scribo/ChangeLog | 4 ++++
scribo/doc/scribo/binarization/sauvola.dox | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 6196c20..5b3540d 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2012-02-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * doc/scribo/binarization/sauvola.dox: Fix documentation.
+
+2012-02-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix path to data.
* doc/Doxyfile.in,
diff --git a/scribo/doc/scribo/binarization/sauvola.dox b/scribo/doc/scribo/binarization/sauvola.dox
index e127871..32e489b 100644
--- a/scribo/doc/scribo/binarization/sauvola.dox
+++ b/scribo/doc/scribo/binarization/sauvola.dox
@@ -23,7 +23,7 @@
computes a local threshold for each pixel.
The following formula is used:
- \f[T(p) = m(p) + [1 + k * (s(p)/R - 1)]\f]
+ \f[T(p) = m(p) + [1 + k * (\frac{s(p)}{R} - 1)]\f]
Where \a p is the central window point, \a m(p) and \a s(p) are,
respectively, the mean and the standard deviation of the window
@@ -45,9 +45,9 @@
<table border=0>
<tr>
<td>\image html input_sauvola_sharpness.png "Input image."</td>
- <td>\image html output_k_0_03.png "scribo::binarization::sauvola_ms with \a k=0.03."</td>
- <td>\image html output_k_0_34.png "scribo::binarization::sauvola_ms with \a k=0.34."</td>
- <td>\image html output_k_0_60.png "scribo::binarization::sauvola_ms with \a k=0.60."</td>
+ <td>\image html output_k_0_03.png "sauvola_ms with \a k=0.03."</td>
+ <td>\image html output_k_0_34.png "sauvola_ms with \a k=0.34."</td>
+ <td>\image html output_k_0_60.png "sauvola_ms with \a k=0.60."</td>
</tr>
</table>
</center>
--
1.7.2.5
* apps/morphers/recorder-bft.cc: New.
* apps/morphers/image2d-skel.hh: New.
* apps/morphers/Makefile.am (noinst_PROGRAMS): Add recorder-bft.
(recorder_wst_SOURCES): New.
(recorder_SOURCES, recorder_wst_SOURCES, mask_recorder_SOURCES):
Move recorder.hh...
(noinst_HEADERS): ...here (new variable).
(MOSTLYCLEANFILES): Add lena-bft??????.pbm.
---
milena/ChangeLog | 13 +++
milena/apps/morphers/Makefile.am | 11 ++-
milena/apps/morphers/image2d-skel.hh | 137 ++++++++++++++++++++++++++++++++++
milena/apps/morphers/recorder-bft.cc | 114 ++++++++++++++++++++++++++++
4 files changed, 272 insertions(+), 3 deletions(-)
create mode 100644 milena/apps/morphers/image2d-skel.hh
create mode 100644 milena/apps/morphers/recorder-bft.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2b98497..5d791e6 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-28 Roland Levillain <roland(a)lrde.epita.fr>
+
+ New morpher example: recording a breadth-first thinning.
+
+ * apps/morphers/recorder-bft.cc: New.
+ * apps/morphers/image2d-skel.hh: New.
+ * apps/morphers/Makefile.am (noinst_PROGRAMS): Add recorder-bft.
+ (recorder_wst_SOURCES): New.
+ (recorder_SOURCES, recorder_wst_SOURCES, mask_recorder_SOURCES):
+ Move recorder.hh...
+ (noinst_HEADERS): ...here (new variable).
+ (MOSTLYCLEANFILES): Add lena-bft??????.pbm.
+
2011-11-24 Roland Levillain <roland(a)lrde.epita.fr>
New morpher example: recording a watershed transform.
diff --git a/milena/apps/morphers/Makefile.am b/milena/apps/morphers/Makefile.am
index a3b9a41..8633933 100644
--- a/milena/apps/morphers/Makefile.am
+++ b/milena/apps/morphers/Makefile.am
@@ -25,17 +25,22 @@ AM_CXXFLAGS = $(APPS_CXXFLAGS)
noinst_PROGRAMS = \
mask+channel \
recorder \
+ recorder-bft \
recorder-wst \
mask+recorder
+noinst_HEADERS = recorder.hh
+
mask_channel_SOURCES = mask+channel.cc
-recorder_SOURCES = recorder.cc recorder.hh
-recorder_wst_SOURCES = recorder-wst.cc recorder.hh
-mask_recorder_SOURCES = mask+recorder.cc recorder.hh
+recorder_SOURCES = recorder.cc
+recorder_bft_SOURCES = recorder-bft.cc image2d-skel.hh
+recorder_wst_SOURCES = recorder-wst.cc
+mask_recorder_SOURCES = mask+recorder.cc
MOSTLYCLEANFILES = \
lena-mask-channel.ppm \
lena-fill??????.ppm \
+ lena-bft??????.pbm \
lena-wst??????.ppm \
lena-roi-fill??????.ppm
diff --git a/milena/apps/morphers/image2d-skel.hh b/milena/apps/morphers/image2d-skel.hh
new file mode 100644
index 0000000..392122c
--- /dev/null
+++ b/milena/apps/morphers/image2d-skel.hh
@@ -0,0 +1,137 @@
+// Copyright (C) 2010, 2011 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 APPS_MORPHERS_IMAGE2D_SKEL_HH
+# define APPS_MORPHERS_IMAGE2D_SKEL_HH
+
+/// \file
+/// \brief Definitions for a simplicity criterion and a constraint
+/// to be used in the breadth-first thinning of a 2D regular image.
+
+/* FIXME: Remove this file as soon as patches from the mesh-segm-skel
+ branch have been merged into the current branch. */
+
+# include <mln/topo/is_simple_2d.hh>
+
+
+/** \brief An equivalent (for mln::image2d) of the
+ mln::topo::is_simple_cell functor, based on the mask-based
+ criterion mln::topo::is_simple_2d.
+
+ This functor acts as an adapter, since mln::topo::is_simple_2d_t
+ does not fit (yet) in the canvas of
+ mln::topo::skeleton::breadth_first_thinning. */
+template <typename I, typename N>
+class is_simple_2d : public mln::Function_v2b< is_simple_2d<I, N> >,
+ private mln::topo::is_simple_2d_t<N>
+{
+public:
+ typedef mln::topo::is_simple_2d_t<N> super;
+
+ /// Result type of the functor.
+ typedef bool result;
+
+ /// Build a functor.
+ ///
+ /// \param nbh_fg The foreground neighborhood.
+ /// \param nbh_bg The background neighborhood.
+ is_simple_2d(const mln::Neighborhood<N>& nbh_fg)
+ : super(mln::exact(nbh_fg)),
+ ima_(0)
+ {
+ }
+
+ /// Build a functor, and assign an image to it.
+ ///
+ /// \param nbh_fg The foreground neighborhood.
+ /// \param nbh_bg The background neighborhood.
+ /// \apram ima The image.
+ is_simple_2d(const mln::Neighborhood<N>& nbh_fg,
+ const mln::Image<I>& ima)
+ : super(mln::exact(nbh_fg)),
+ ima_(mln::exact(&ima))
+ {
+ }
+
+ /// Set the underlying image.
+ void set_image(const mln::Image<I>& ima)
+ {
+ ima_ = mln::exact(&ima);
+ }
+
+ /// Based on connectivity numbers.
+ bool operator()(const mln_psite(I)& p) const
+ {
+ return check(*ima_, p);
+ }
+
+private:
+ /// The image.
+ const I* ima_;
+};
+
+
+template <typename I>
+void
+detach(const mln_psite(I)& p, mln::Image<I>& ima)
+{
+ mln::exact(ima)(p) = false;
+}
+
+
+template <typename I, typename N>
+struct is_not_end_point : public mln::Function_v2b< is_not_end_point<I, N> >
+{
+ /// Build a functor, and assign an image to it.
+ ///
+ /// \param nbh_fg The foreground neighborhood.
+ /// \apram ima The image.
+ is_not_end_point(const mln::Neighborhood<N>& nbh,
+ const mln::Image<I>& ima)
+ : nbh_(mln::exact(nbh)),
+ ima_(mln::exact(ima))
+ {
+ }
+
+ // Is \a p not a end point?
+ bool operator()(const mln_psite(I)& p) const
+ {
+ // Number of foreground neighbors pixels.
+ unsigned nneighbs = 0;
+ mln_niter(N) n(nbh_, p);
+ for_all(n)
+ if (ima_.has(n) && ima_(n))
+ ++nneighbs;
+ return nneighbs != 1;
+ }
+
+private:
+ /// The foreground neighborhood.
+ const N& nbh_;
+ /// The image.
+ const I& ima_;
+};
+
+#endif // ! APPS_MORPHERS_IMAGE2D_SKEL_HH
diff --git a/milena/apps/morphers/recorder-bft.cc b/milena/apps/morphers/recorder-bft.cc
new file mode 100644
index 0000000..5ca0e9e
--- /dev/null
+++ b/milena/apps/morphers/recorder-bft.cc
@@ -0,0 +1,114 @@
+// Copyright (C) 2011 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.
+
+/// \file
+/// \brief Exercise a morpher recording every change in the morphed
+/// image with the breadth-first thinning.
+///
+/// To produce an AVI movie from the `lena-bft*.pbm' files, use:
+///
+/// for f in lena-bft*pbm; convert $f -define png:bit-depth=8 -scale 2500% $(basename $f .pbm).png
+/// mencoder "mf://lena-bft*.png" -o lena-bft.avi -ovc lavc -lavcopts gray:vcodec=mjpeg
+///
+/// Note: the `-define png:bit-depth=8' option prevents convert from
+/// creating an image with 1-bit channels (since the image is binary)
+/// and forces it to use 8-bit channels. Indeed mencoder is unable to
+/// process PNG images with 1-bit channel(s).
+///
+/// The output `lena-bft.avi' can be embedded in a PDF file. */
+
+/* FIXME: Modernize this program as soon as patches from the
+ mesh-segm-skel branch have been merged into the current branch. */
+
+#include <string>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+
+#include <mln/win/multiple_size.hh>
+#include <mln/make/dual_neighb.hh>
+
+#include <mln/data/compare.hh>
+
+#include <mln/topo/skeleton/breadth_first_thinning.hh>
+
+#include <mln/test/predicate.hh>
+#include <mln/pw/value.hh>
+
+#include <mln/labeling/colorize.hh>
+
+#include <mln/io/pbm/load.hh>
+#include <mln/io/pbm/save.hh>
+
+#include "apps/morphers/recorder.hh"
+/* FIXME: Temporarily reuse an old file from apps/generic-skel instead
+ of newer files integrated into the library (but not merged in). */
+#include "apps/morphers/image2d-skel.hh"
+
+#include "apps/data.hh"
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef image2d<bool> I;
+ I lena = io::pbm::load(MLN_IMG_DIR "/tiny.pbm");
+ // Attach recorder to input image.
+ typedef decorated_image< I, recorder<I> > J;
+ J lena_rec = record(lena);
+
+ // Dual neighborhood.
+ typedef neighb< win::multiple_size<2, window2d, pw::value_<I> > > N;
+ N nbh = make::dual_neighb(lena, c4(), c8());
+ // Simplicity criterion functor.
+ ::is_simple_2d<J, N> is_simple(nbh);
+ // Constraint.
+ ::is_not_end_point<J, neighb2d> constraint(c4(), lena_rec);
+
+ J bft_rec = topo::skeleton::breadth_first_thinning(lena_rec, nbh,
+ is_simple, ::detach<J>,
+ constraint);
+
+ // Dump recorded frames.
+ /* FIXME: Hand-made (it partly duplicates ppm::save() (or more
+ precisely pbm::save()) for decorated_image's). We should be able
+ to process sequences of images. */
+ bool output_initialized_p = false;
+ for (size_t i = 0; i < bft_rec.decoration().sequence.size(); ++i)
+ {
+ I frame = bft_rec.decoration().sequence[i];
+
+ // Skip frames until the inital image has been seen.
+ if (frame == lena)
+ output_initialized_p = true;
+ if (!output_initialized_p)
+ continue;
+
+ std::stringstream s;
+ s << std::setfill ('0') << std::setw (6) << i;
+ io::pbm::save(frame, std::string("lena-bft") + s.str() + ".pbm");
+ }
+}
--
1.7.2.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch apps-morphers has been updated
via 3363574ac18e8b13b42f21d354a1901a511c513d (commit)
from bd2670fbf582fc5c238507bdb3d9543d5bcb0577 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
3363574 New morpher example: recording a breadth-first thinning.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 13 +++
milena/apps/morphers/Makefile.am | 11 ++-
milena/apps/morphers/image2d-skel.hh | 137 ++++++++++++++++++++++++++++++++++
milena/apps/morphers/recorder-bft.cc | 114 ++++++++++++++++++++++++++++
4 files changed, 272 insertions(+), 3 deletions(-)
create mode 100644 milena/apps/morphers/image2d-skel.hh
create mode 100644 milena/apps/morphers/recorder-bft.cc
hooks/post-receive
--
Olena, a generic and efficient image processing platform