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
June 2009
- 9 participants
- 356 discussions
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-06-11 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Clean up sandbox and add routine for visualization.
* fabien/flat_zones.hh: Move to trunk.
* fabien/labeling.hh: Move to trunk.
* fabien/level.cc: Move to trunk.
* fabien/level.hh: Move to trunk.
* fabien/regional_maxima.cc: Move to trunk.
* fabien/regional_maxima.hh: Move to trunk.
* fabien/regional_minima.cc: Move to trunk.
* fabien/regional_minima.hh: Move to trunk.
* fabien/mln/world/inter_pixel/display_region.hh: Create an image for
visualization of regions [Draft, not functional].
* fabien/mln/world/inter_pixel/is_zero_face.hh: Implement zero-face.
---
display_region.hh | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
is_zero_face.hh | 90 ++++++++++++++++++++++++++++++++++
2 files changed, 230 insertions(+)
Index: trunk/milena/sandbox/fabien/regional_maxima.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/flat_zones.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/level.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/regional_minima.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/regional_maxima.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/labeling.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/level.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/regional_minima.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh (revision 0)
+++ trunk/milena/sandbox/fabien/mln/world/inter_pixel/display_region.hh (revision 4104)
@@ -0,0 +1,140 @@
+// 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_WORLD_INTER_PIXEL_DISPLAY_REGION_HH
+# define MLN_WORLD_INTER_PIXEL_DISPLAY_REGION_HH
+
+/// \file
+///
+/// Create an image for visualizing the different regions of a labeled
+/// inter_pixel image.
+
+# include <mln/core/image/image2d.hh>
+# include <mln/core/image/dmorph/image_if.hh>
+# include <mln/data/paste.hh>
+# include <mln/world/inter_pixel/is_pixel.hh>
+# include <mln/world/inter_pixel/is_separator.hh>
+# include <mln/opt/at.hh>
+# include <mln/value/rgb8.hh>
+
+# include "is_zero_face.hh"
+
+
+namespace mln
+{
+
+ namespace world
+ {
+
+ namespace inter_pixel
+ {
+
+ /// \brief FIXME
+ ///
+ /// \param[in] input The input image providing pixels values.
+ /// \param[in] wst The labeling image providing the watershed lines.
+ /// \param[in] edge_color The color (in rgb8) for the watershed line.
+ /// \return FIXME
+ ///
+ /// \pre \p wst has to be an unmorphed image.
+ /// \warning This implementation only works for 2D images.
+ ///
+ template <typename I, typename L>
+ inline
+ mln_ch_value(I, value::rgb8)
+ display_region(const I& input, const mln_ch_value(I, L)& wst, value::rbg8 edge_color);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::rgb8)
+ display_region(const I& input, const mln_ch_value(I, L)& wst, value::rbg8 edge_color)
+ {
+ mln_precondition((2 * input.bbox()) == wst.unmorph_().bbox());
+
+ mln_ch_value(I, value::rgb8) output;
+ initialize(output, wst);
+
+ // Pixel.
+ mln_piter(I) p_input(input.domain());
+ for_all(p)
+ opt::at(output, p.to_vec[0] * 2, p.to_vec[1] * 2) = input(p);
+
+ // Separator.
+ typedef image_if<const mln_ch_value(I, L)&, is_separator> separator_t;
+ separator_t edge = wst | is_separator();
+ mln_piter(edge_t) p(edge.domain());
+ for_all(p)
+ {
+ if (p.row() % 2) // horizontal edge
+ {
+ unsigned row = (p.row() / 2 + 1) * 2 - 1;
+ unsigned col = p.col();
+ opt::at(output, row, col) = input(p);
+ }
+ else // vertical edge
+ {
+ unsigned row = p.row();
+ unsigned col = (p.col() / 2 + 1) * 2 - 1;
+ opt::at(output, row, col) = input(p);
+ }
+ }
+
+ // Point (dimension 0).
+ typedef image_if<const mln_ch_value(I, L)&, is_zero_face> zero_face_t;
+ zero_face_t edge = wst | is_zero_face();
+ mln_piter(edge_t) p(edge.domain());
+ for_all(p)
+ {
+ if (p.row() % 2) // horizontal edge
+ {
+ unsigned row = (p.row() / 2 + 1) * 2 - 1;
+ unsigned col = p.col();
+ opt::at(output, row, col) = input(p);
+ }
+ else // vertical edge
+ {
+ unsigned row = p.row();
+ unsigned col = (p.col() / 2 + 1) * 2 - 1;
+ opt::at(output, row, col) = input(p);
+ }
+ }
+
+ return output;
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ }
+
+ } // end of namespace mln::world::inter_pixel
+
+ } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_INTER_PIXEL_DISPLAY_REGION_HH
+
Index: trunk/milena/sandbox/fabien/mln/world/inter_pixel/is_zero_face.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/world/inter_pixel/is_zero_face.hh (revision 0)
+++ trunk/milena/sandbox/fabien/mln/world/inter_pixel/is_zero_face.hh (revision 4104)
@@ -0,0 +1,90 @@
+// 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_WORLD_INTER_PIXEL_IS_ZERO_FACE_HH
+# define MLN_WORLD_INTER_PIXEL_IS_ZERO_FACE_HH
+
+/// \file
+///
+/// A zero-face is a point of 0 dimension. It joins elements of dimension 1
+/// such as lines.
+///
+/// \todo Make it work in n-D.
+
+# include <mln/core/concept/function.hh>
+# include <mln/core/image/dmorph/image_if.hh>
+# include <mln/core/point.hh>
+
+
+namespace mln
+{
+
+ namespace world
+ {
+
+ namespace inter_pixel
+ {
+
+ struct is_zero_face : public Function_v2b< is_zero_face >
+ {
+ typedef bool result;
+
+ template <typename P>
+ bool operator()(const Gpoint<P>& p) const;
+
+ template <typename P>
+ bool operator()(const Site_Proxy<P>& p) const;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename P>
+ inline
+ bool
+ is_zero_face::operator()(const Gpoint<P>& p_) const
+ {
+ const P& p = exact(p_);
+ return p.row() % 2 == 1 && p.col() % 2 == 1;
+ }
+
+ template <typename P>
+ inline
+ bool
+ is_zero_face::operator()(const Site_Proxy<P>& p) const
+ {
+ mlc_is_a(mln_site(P), Gpoint)::check();
+ return this->operator()(exact(p).to_site());
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::world::inter_pixel
+
+ } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_INTER_PIXEL_IS_ZERO_FACE_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-11 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Minor fixes.
* mln/accu/label_used.hh: Correct bugs linked to math namespace.
---
label_used.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: trunk/milena/mln/accu/label_used.hh
===================================================================
--- trunk/milena/mln/accu/label_used.hh (revision 4102)
+++ trunk/milena/mln/accu/label_used.hh (revision 4103)
@@ -127,7 +127,7 @@
label_used<L>::take(const label_used<L>& other)
{
unsigned
- max_size = math::max(other.to_result().size(), label_used_.size());
+ max_size = mln::math::max(other.to_result().size(), label_used_.size());
label_used_.resize(max_size, false);
for (unsigned i = 1; i < label_used_.size(); ++i)
1
0
* doc/Doxyfile.in: update example path.
* doc/doc.mk: new variables.
* doc/doxyfuns.sty: Fix a typo in a directory path.
* doc/ref_guide/Makefile.am,
* doc/tutorial/Makefile.am,
* doc/white_paper/Makefile.am,
* doc/Makefile.am: improve rules dependencies.
* doc/examples/Makefile.am:
- Compare split files to references.
- Add a rule 'data-regen'. Reference data is now generated on demand
only.
* doc/examples/split/accu-right-instanciation-1.cc,
* doc/examples/split/borderthickness-1.cc,
* doc/examples/split/box2d-bbox-1.cc,
* doc/examples/split/domain-display-1.cc,
* doc/examples/split/dpoint-1-1.cc,
* doc/examples/split/estim-sites-1.cc,
* doc/examples/split/extend-1.cc,
* doc/examples/split/extend-2.cc,
* doc/examples/split/extend-3.cc,
* doc/examples/split/extend-4.cc,
* doc/examples/split/extend-5.cc,
* doc/examples/split/extension-ignore-1.cc,
* doc/examples/split/fill-1.cc,
* doc/examples/split/fill-2.cc,
* doc/examples/split/fill-3.cc,
* doc/examples/split/fill-call-1-1.cc,
* doc/examples/split/fill-call-1-2.cc,
* doc/examples/split/fill-call-1-3.cc,
* doc/examples/split/fill-part-image-1.cc,
* doc/examples/split/fill-part-image-2.cc,
* doc/examples/split/fill-subdomain-1.cc,
* doc/examples/split/fill-subdomain-2.cc,
* doc/examples/split/fill-subdomain-3.cc,
* doc/examples/split/fill-subdomain-4.cc,
* doc/examples/split/fill-subdomain-shorter-1.cc,
* doc/examples/split/fill-subdomain-shorter-2.cc,
* doc/examples/split/fill-subimage-cfun-1.cc,
* doc/examples/split/fill-subimage-cfun-2.cc,
* doc/examples/split/fill-subimage-cfun-3.cc,
* doc/examples/split/forall-piter-1.cc,
* doc/examples/split/fun-p2v-1-1.cc,
* doc/examples/split/graph-data-1.cc,
* doc/examples/split/graph-data-2.cc,
* doc/examples/split/graph-data-3.cc,
* doc/examples/split/graph-data-4.cc,
* doc/examples/split/graph-data-5.cc,
* doc/examples/split/graph-data-6.cc,
* doc/examples/split/graph-iter-1.cc,
* doc/examples/split/graph-iter-2.cc,
* doc/examples/split/graph-iter-3.cc,
* doc/examples/split/graph-iter-4.cc,
* doc/examples/split/ima-has-1.cc,
* doc/examples/split/ima-load-1.cc,
* doc/examples/split/ima-save-1.cc,
* doc/examples/split/ima-size-1.cc,
* doc/examples/split/ima2d-1-1.cc,
* doc/examples/split/ima2d-2-1.cc,
* doc/examples/split/ima2d-3-1.cc,
* doc/examples/split/ima2d-4-1.cc,
* doc/examples/split/ima2d-5-1.cc,
* doc/examples/split/ima2d-6-clone-1.cc,
* doc/examples/split/ima2d-7-1.cc,
* doc/examples/split/ima2d-rot-1.cc,
* doc/examples/split/labeling-compute-1.cc,
* doc/examples/split/labeling-compute-2.cc,
* doc/examples/split/labeling-compute-3.cc,
* doc/examples/split/labeling-compute-4.cc,
* doc/examples/split/logical-not-1.cc,
* doc/examples/split/logical-not-2.cc,
* doc/examples/split/logical-not-3.cc,
* doc/examples/split/mln_var-1.cc,
* doc/examples/split/mln_var-2.cc,
* doc/examples/split/mln_var-3.cc,
* doc/examples/split/parray-append-1.cc,
* doc/examples/split/parray-bbox-1.cc,
* doc/examples/split/paste-1.cc,
* doc/examples/split/paste-call-1-1.cc,
* doc/examples/split/point-1-1.cc,
* doc/examples/split/predicate-1-1.cc,
* doc/examples/split/tuto2_first_image-1.cc,
* doc/examples/split/tuto2_first_image-2.cc,
* doc/examples/split/tuto2_first_image-3.cc,
* doc/examples/split/tuto2_first_image-4.cc,
* doc/examples/split/tuto3_colorize-1.cc,
* doc/examples/split/tuto3_first_routine-1.cc,
* doc/examples/split/tuto3_first_routine-2.cc,
* doc/examples/split/tuto3_first_routine-3.cc,
* doc/examples/split/tuto3_first_routine-4.cc,
* doc/examples/split/tuto3_first_routine-5.cc,
* doc/examples/split/tuto3_first_routine-6.cc,
* doc/examples/split/tuto3_first_routine-7.cc,
* doc/examples/split/tuto3_first_routine-8.cc,
* doc/examples/split/tuto3_println-1.cc,
* doc/examples/split/tuto3_println-2.cc,
* doc/examples/split/tuto3_rw_image-1.cc,
* doc/examples/split/tuto3_rw_image-2.cc,
* doc/examples/split/tuto3_rw_image-3.cc,
* doc/examples/split/tuto3_rw_image-4.cc,
* doc/examples/split/tuto3_rw_image-5.cc,
* doc/examples/split/tuto3_rw_image-6.cc,
* doc/examples/split/tuto3_rw_image-7.cc,
* doc/examples/split/tuto3_trace-1.cc,
* doc/examples/split/tuto3_trace-2.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-1.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-10.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-11.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-12.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-2.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-3.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-4.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-5.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-6.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-7.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-8.cc,
* doc/examples/split/tuto4_genericity_and_algorithms-9.cc,
* doc/examples/split/tuto4_point2d-1.cc,
* doc/examples/split/tuto4_site_set_create-1.cc,
* doc/examples/split/tuto4_site_set_create-2.cc,
* doc/examples/split/tuto4_site_set_create-3.cc,
* doc/examples/split/tuto4_site_set_create-4.cc,
* doc/examples/split/win-create-1-1.cc,
* doc/examples/split/win-create-2-1.cc,
* doc/outputs/split/graph-iter-1.txt,
* doc/outputs/split/graph-iter-2.txt,
* doc/outputs/split/graph-iter-3.txt,
* doc/outputs/split/graph-iter-4.txt,
* doc/outputs/split/tuto3_println-1.txt,
* doc/outputs/split/tuto3_println-2.txt: new reference files.
* doc/tools/split_sample.sh: fix a typo.
* doc/white_paper/white_paper.tex: fix path to figures.
---
milena/ChangeLog | 143 ++++++++++++++++++++
milena/doc/Doxyfile.in | 13 +-
milena/doc/Makefile.am | 48 ++++---
milena/doc/doc.mk | 5 +-
milena/doc/doxyfuns.sty | 4 +-
milena/doc/examples/Makefile.am | 62 +++++++--
.../examples/split/accu-right-instanciation-1.cc | 1 +
milena/doc/examples/split/borderthickness-1.cc | 13 ++
milena/doc/examples/split/box2d-bbox-1.cc | 7 +
milena/doc/examples/split/domain-display-1.cc | 7 +
milena/doc/examples/split/dpoint-1-1.cc | 4 +
milena/doc/examples/split/estim-sites-1.cc | 1 +
milena/doc/examples/split/extend-1.cc | 18 +++
milena/doc/examples/split/extend-2.cc | 5 +
milena/doc/examples/split/extend-3.cc | 1 +
milena/doc/examples/split/extend-4.cc | 1 +
milena/doc/examples/split/extend-5.cc | 1 +
milena/doc/examples/split/extension-ignore-1.cc | 1 +
milena/doc/examples/split/fill-1.cc | 7 +
milena/doc/examples/split/fill-2.cc | 2 +
milena/doc/examples/split/fill-3.cc | 1 +
milena/doc/examples/split/fill-call-1-1.cc | 1 +
milena/doc/examples/split/fill-call-1-2.cc | 1 +
milena/doc/examples/split/fill-call-1-3.cc | 1 +
milena/doc/examples/split/fill-part-image-1.cc | 9 ++
milena/doc/examples/split/fill-part-image-2.cc | 17 +++
milena/doc/examples/split/fill-subdomain-1.cc | 9 ++
milena/doc/examples/split/fill-subdomain-2.cc | 2 +
milena/doc/examples/split/fill-subdomain-3.cc | 1 +
milena/doc/examples/split/fill-subdomain-4.cc | 5 +
.../doc/examples/split/fill-subdomain-shorter-1.cc | 9 ++
.../doc/examples/split/fill-subdomain-shorter-2.cc | 8 +
milena/doc/examples/split/fill-subimage-cfun-1.cc | 4 +
milena/doc/examples/split/fill-subimage-cfun-2.cc | 9 ++
milena/doc/examples/split/fill-subimage-cfun-3.cc | 5 +
milena/doc/examples/split/forall-piter-1.cc | 5 +
milena/doc/examples/split/fun-p2v-1-1.cc | 6 +
milena/doc/examples/split/graph-data-1.cc | 21 +++
milena/doc/examples/split/graph-data-2.cc | 4 +
milena/doc/examples/split/graph-data-3.cc | 5 +
milena/doc/examples/split/graph-data-4.cc | 7 +
milena/doc/examples/split/graph-data-5.cc | 2 +
milena/doc/examples/split/graph-data-6.cc | 11 ++
milena/doc/examples/split/graph-iter-1.cc | 9 ++
milena/doc/examples/split/graph-iter-2.cc | 15 ++
milena/doc/examples/split/graph-iter-3.cc | 15 ++
milena/doc/examples/split/graph-iter-4.cc | 15 ++
milena/doc/examples/split/ima-has-1.cc | 32 +++++
milena/doc/examples/split/ima-load-1.cc | 2 +
milena/doc/examples/split/ima-save-1.cc | 1 +
milena/doc/examples/split/ima-size-1.cc | 6 +
milena/doc/examples/split/ima2d-1-1.cc | 7 +
milena/doc/examples/split/ima2d-2-1.cc | 7 +
milena/doc/examples/split/ima2d-3-1.cc | 23 +++
milena/doc/examples/split/ima2d-4-1.cc | 8 +
milena/doc/examples/split/ima2d-5-1.cc | 13 ++
milena/doc/examples/split/ima2d-6-clone-1.cc | 8 +
milena/doc/examples/split/ima2d-7-1.cc | 5 +
milena/doc/examples/split/ima2d-rot-1.cc | 34 +++++
milena/doc/examples/split/labeling-compute-1.cc | 9 ++
milena/doc/examples/split/labeling-compute-2.cc | 2 +
milena/doc/examples/split/labeling-compute-3.cc | 4 +
milena/doc/examples/split/labeling-compute-4.cc | 2 +
milena/doc/examples/split/logical-not-1.cc | 8 +
milena/doc/examples/split/logical-not-2.cc | 1 +
milena/doc/examples/split/logical-not-3.cc | 1 +
milena/doc/examples/split/mln_var-1.cc | 1 +
milena/doc/examples/split/mln_var-2.cc | 1 +
milena/doc/examples/split/mln_var-3.cc | 5 +
milena/doc/examples/split/parray-append-1.cc | 6 +
milena/doc/examples/split/parray-bbox-1.cc | 11 ++
milena/doc/examples/split/paste-1.cc | 7 +
milena/doc/examples/split/paste-call-1-1.cc | 11 ++
milena/doc/examples/split/point-1-1.cc | 14 ++
milena/doc/examples/split/predicate-1-1.cc | 7 +
milena/doc/examples/split/tuto2_first_image-1.cc | 15 ++
milena/doc/examples/split/tuto2_first_image-2.cc | 1 +
milena/doc/examples/split/tuto2_first_image-3.cc | 1 +
milena/doc/examples/split/tuto2_first_image-4.cc | 1 +
milena/doc/examples/split/tuto3_colorize-1.cc | 8 +
milena/doc/examples/split/tuto3_first_routine-1.cc | 34 +++++
milena/doc/examples/split/tuto3_first_routine-2.cc | 4 +
milena/doc/examples/split/tuto3_first_routine-3.cc | 1 +
milena/doc/examples/split/tuto3_first_routine-4.cc | 4 +
milena/doc/examples/split/tuto3_first_routine-5.cc | 5 +
milena/doc/examples/split/tuto3_first_routine-6.cc | 3 +
milena/doc/examples/split/tuto3_first_routine-7.cc | 3 +
milena/doc/examples/split/tuto3_first_routine-8.cc | 2 +
milena/doc/examples/split/tuto3_println-1.cc | 3 +
milena/doc/examples/split/tuto3_println-2.cc | 4 +
milena/doc/examples/split/tuto3_rw_image-1.cc | 1 +
milena/doc/examples/split/tuto3_rw_image-2.cc | 1 +
milena/doc/examples/split/tuto3_rw_image-3.cc | 3 +
milena/doc/examples/split/tuto3_rw_image-4.cc | 3 +
milena/doc/examples/split/tuto3_rw_image-5.cc | 2 +
milena/doc/examples/split/tuto3_rw_image-6.cc | 1 +
milena/doc/examples/split/tuto3_rw_image-7.cc | 1 +
milena/doc/examples/split/tuto3_trace-1.cc | 2 +
milena/doc/examples/split/tuto3_trace-2.cc | 6 +
.../split/tuto4_genericity_and_algorithms-1.cc | 2 +
.../split/tuto4_genericity_and_algorithms-10.cc | 1 +
.../split/tuto4_genericity_and_algorithms-11.cc | 1 +
.../split/tuto4_genericity_and_algorithms-12.cc | 2 +
.../split/tuto4_genericity_and_algorithms-2.cc | 1 +
.../split/tuto4_genericity_and_algorithms-3.cc | 1 +
.../split/tuto4_genericity_and_algorithms-4.cc | 5 +
.../split/tuto4_genericity_and_algorithms-5.cc | 4 +
.../split/tuto4_genericity_and_algorithms-6.cc | 1 +
.../split/tuto4_genericity_and_algorithms-7.cc | 6 +
.../split/tuto4_genericity_and_algorithms-8.cc | 1 +
.../split/tuto4_genericity_and_algorithms-9.cc | 3 +
milena/doc/examples/split/tuto4_point2d-1.cc | 2 +
.../doc/examples/split/tuto4_site_set_create-1.cc | 1 +
.../doc/examples/split/tuto4_site_set_create-2.cc | 3 +
.../doc/examples/split/tuto4_site_set_create-3.cc | 4 +
.../doc/examples/split/tuto4_site_set_create-4.cc | 1 +
milena/doc/examples/split/win-create-1-1.cc | 4 +
milena/doc/examples/split/win-create-2-1.cc | 10 ++
milena/doc/outputs/split/graph-iter-1.txt | 5 +
milena/doc/outputs/split/graph-iter-2.txt | 5 +
milena/doc/outputs/split/graph-iter-3.txt | 5 +
milena/doc/outputs/split/graph-iter-4.txt | 5 +
milena/doc/outputs/split/tuto3_println-1.txt | 6 +
milena/doc/outputs/split/tuto3_println-2.txt | 12 ++
milena/doc/ref_guide/Makefile.am | 14 ++-
milena/doc/tools/split_sample.sh | 2 +-
milena/doc/tutorial/Makefile.am | 14 ++-
milena/doc/white_paper/Makefile.am | 27 +++--
milena/doc/white_paper/white_paper.tex | 8 +-
129 files changed, 974 insertions(+), 68 deletions(-)
create mode 100644 milena/doc/examples/split/accu-right-instanciation-1.cc
create mode 100644 milena/doc/examples/split/borderthickness-1.cc
create mode 100644 milena/doc/examples/split/box2d-bbox-1.cc
create mode 100644 milena/doc/examples/split/domain-display-1.cc
create mode 100644 milena/doc/examples/split/dpoint-1-1.cc
create mode 100644 milena/doc/examples/split/estim-sites-1.cc
create mode 100644 milena/doc/examples/split/extend-1.cc
create mode 100644 milena/doc/examples/split/extend-2.cc
create mode 100644 milena/doc/examples/split/extend-3.cc
create mode 100644 milena/doc/examples/split/extend-4.cc
create mode 100644 milena/doc/examples/split/extend-5.cc
create mode 100644 milena/doc/examples/split/extension-ignore-1.cc
create mode 100644 milena/doc/examples/split/fill-1.cc
create mode 100644 milena/doc/examples/split/fill-2.cc
create mode 100644 milena/doc/examples/split/fill-3.cc
create mode 100644 milena/doc/examples/split/fill-call-1-1.cc
create mode 100644 milena/doc/examples/split/fill-call-1-2.cc
create mode 100644 milena/doc/examples/split/fill-call-1-3.cc
create mode 100644 milena/doc/examples/split/fill-part-image-1.cc
create mode 100644 milena/doc/examples/split/fill-part-image-2.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-1.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-2.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-3.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-4.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-shorter-1.cc
create mode 100644 milena/doc/examples/split/fill-subdomain-shorter-2.cc
create mode 100644 milena/doc/examples/split/fill-subimage-cfun-1.cc
create mode 100644 milena/doc/examples/split/fill-subimage-cfun-2.cc
create mode 100644 milena/doc/examples/split/fill-subimage-cfun-3.cc
create mode 100644 milena/doc/examples/split/forall-piter-1.cc
create mode 100644 milena/doc/examples/split/fun-p2v-1-1.cc
create mode 100644 milena/doc/examples/split/graph-data-1.cc
create mode 100644 milena/doc/examples/split/graph-data-2.cc
create mode 100644 milena/doc/examples/split/graph-data-3.cc
create mode 100644 milena/doc/examples/split/graph-data-4.cc
create mode 100644 milena/doc/examples/split/graph-data-5.cc
create mode 100644 milena/doc/examples/split/graph-data-6.cc
create mode 100644 milena/doc/examples/split/graph-iter-1.cc
create mode 100644 milena/doc/examples/split/graph-iter-2.cc
create mode 100644 milena/doc/examples/split/graph-iter-3.cc
create mode 100644 milena/doc/examples/split/graph-iter-4.cc
create mode 100644 milena/doc/examples/split/ima-has-1.cc
create mode 100644 milena/doc/examples/split/ima-load-1.cc
create mode 100644 milena/doc/examples/split/ima-save-1.cc
create mode 100644 milena/doc/examples/split/ima-size-1.cc
create mode 100644 milena/doc/examples/split/ima2d-1-1.cc
create mode 100644 milena/doc/examples/split/ima2d-2-1.cc
create mode 100644 milena/doc/examples/split/ima2d-3-1.cc
create mode 100644 milena/doc/examples/split/ima2d-4-1.cc
create mode 100644 milena/doc/examples/split/ima2d-5-1.cc
create mode 100644 milena/doc/examples/split/ima2d-6-clone-1.cc
create mode 100644 milena/doc/examples/split/ima2d-7-1.cc
create mode 100644 milena/doc/examples/split/ima2d-rot-1.cc
create mode 100644 milena/doc/examples/split/labeling-compute-1.cc
create mode 100644 milena/doc/examples/split/labeling-compute-2.cc
create mode 100644 milena/doc/examples/split/labeling-compute-3.cc
create mode 100644 milena/doc/examples/split/labeling-compute-4.cc
create mode 100644 milena/doc/examples/split/logical-not-1.cc
create mode 100644 milena/doc/examples/split/logical-not-2.cc
create mode 100644 milena/doc/examples/split/logical-not-3.cc
create mode 100644 milena/doc/examples/split/mln_var-1.cc
create mode 100644 milena/doc/examples/split/mln_var-2.cc
create mode 100644 milena/doc/examples/split/mln_var-3.cc
create mode 100644 milena/doc/examples/split/parray-append-1.cc
create mode 100644 milena/doc/examples/split/parray-bbox-1.cc
create mode 100644 milena/doc/examples/split/paste-1.cc
create mode 100644 milena/doc/examples/split/paste-call-1-1.cc
create mode 100644 milena/doc/examples/split/point-1-1.cc
create mode 100644 milena/doc/examples/split/predicate-1-1.cc
create mode 100644 milena/doc/examples/split/tuto2_first_image-1.cc
create mode 100644 milena/doc/examples/split/tuto2_first_image-2.cc
create mode 100644 milena/doc/examples/split/tuto2_first_image-3.cc
create mode 100644 milena/doc/examples/split/tuto2_first_image-4.cc
create mode 100644 milena/doc/examples/split/tuto3_colorize-1.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-1.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-2.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-3.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-4.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-5.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-6.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-7.cc
create mode 100644 milena/doc/examples/split/tuto3_first_routine-8.cc
create mode 100644 milena/doc/examples/split/tuto3_println-1.cc
create mode 100644 milena/doc/examples/split/tuto3_println-2.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-1.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-2.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-3.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-4.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-5.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-6.cc
create mode 100644 milena/doc/examples/split/tuto3_rw_image-7.cc
create mode 100644 milena/doc/examples/split/tuto3_trace-1.cc
create mode 100644 milena/doc/examples/split/tuto3_trace-2.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-1.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-10.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-11.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-12.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-2.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-3.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-4.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-5.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-6.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-7.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-8.cc
create mode 100644 milena/doc/examples/split/tuto4_genericity_and_algorithms-9.cc
create mode 100644 milena/doc/examples/split/tuto4_point2d-1.cc
create mode 100644 milena/doc/examples/split/tuto4_site_set_create-1.cc
create mode 100644 milena/doc/examples/split/tuto4_site_set_create-2.cc
create mode 100644 milena/doc/examples/split/tuto4_site_set_create-3.cc
create mode 100644 milena/doc/examples/split/tuto4_site_set_create-4.cc
create mode 100644 milena/doc/examples/split/win-create-1-1.cc
create mode 100644 milena/doc/examples/split/win-create-2-1.cc
create mode 100644 milena/doc/outputs/split/graph-iter-1.txt
create mode 100644 milena/doc/outputs/split/graph-iter-2.txt
create mode 100644 milena/doc/outputs/split/graph-iter-3.txt
create mode 100644 milena/doc/outputs/split/graph-iter-4.txt
create mode 100644 milena/doc/outputs/split/tuto3_println-1.txt
create mode 100644 milena/doc/outputs/split/tuto3_println-2.txt
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b9556cb..7049523 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,146 @@
+2009-06-11 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+
+ Fix tutorial, white_paper and ref_doc generation.
+
+ * doc/Doxyfile.in: update example path.
+
+ * doc/doc.mk: new variables.
+
+ * doc/doxyfuns.sty: Fix a typo in a directory path.
+
+ * doc/ref_guide/Makefile.am,
+ * doc/tutorial/Makefile.am,
+ * doc/white_paper/Makefile.am,
+ * doc/Makefile.am: improve rules dependencies.
+
+ * doc/examples/Makefile.am:
+ - Compare split files to references.
+ - Add a rule 'data-regen'. Reference data is now generated on demand
+ only.
+
+ * doc/examples/split/accu-right-instanciation-1.cc,
+ * doc/examples/split/borderthickness-1.cc,
+ * doc/examples/split/box2d-bbox-1.cc,
+ * doc/examples/split/domain-display-1.cc,
+ * doc/examples/split/dpoint-1-1.cc,
+ * doc/examples/split/estim-sites-1.cc,
+ * doc/examples/split/extend-1.cc,
+ * doc/examples/split/extend-2.cc,
+ * doc/examples/split/extend-3.cc,
+ * doc/examples/split/extend-4.cc,
+ * doc/examples/split/extend-5.cc,
+ * doc/examples/split/extension-ignore-1.cc,
+ * doc/examples/split/fill-1.cc,
+ * doc/examples/split/fill-2.cc,
+ * doc/examples/split/fill-3.cc,
+ * doc/examples/split/fill-call-1-1.cc,
+ * doc/examples/split/fill-call-1-2.cc,
+ * doc/examples/split/fill-call-1-3.cc,
+ * doc/examples/split/fill-part-image-1.cc,
+ * doc/examples/split/fill-part-image-2.cc,
+ * doc/examples/split/fill-subdomain-1.cc,
+ * doc/examples/split/fill-subdomain-2.cc,
+ * doc/examples/split/fill-subdomain-3.cc,
+ * doc/examples/split/fill-subdomain-4.cc,
+ * doc/examples/split/fill-subdomain-shorter-1.cc,
+ * doc/examples/split/fill-subdomain-shorter-2.cc,
+ * doc/examples/split/fill-subimage-cfun-1.cc,
+ * doc/examples/split/fill-subimage-cfun-2.cc,
+ * doc/examples/split/fill-subimage-cfun-3.cc,
+ * doc/examples/split/forall-piter-1.cc,
+ * doc/examples/split/fun-p2v-1-1.cc,
+ * doc/examples/split/graph-data-1.cc,
+ * doc/examples/split/graph-data-2.cc,
+ * doc/examples/split/graph-data-3.cc,
+ * doc/examples/split/graph-data-4.cc,
+ * doc/examples/split/graph-data-5.cc,
+ * doc/examples/split/graph-data-6.cc,
+ * doc/examples/split/graph-iter-1.cc,
+ * doc/examples/split/graph-iter-2.cc,
+ * doc/examples/split/graph-iter-3.cc,
+ * doc/examples/split/graph-iter-4.cc,
+ * doc/examples/split/ima-has-1.cc,
+ * doc/examples/split/ima-load-1.cc,
+ * doc/examples/split/ima-save-1.cc,
+ * doc/examples/split/ima-size-1.cc,
+ * doc/examples/split/ima2d-1-1.cc,
+ * doc/examples/split/ima2d-2-1.cc,
+ * doc/examples/split/ima2d-3-1.cc,
+ * doc/examples/split/ima2d-4-1.cc,
+ * doc/examples/split/ima2d-5-1.cc,
+ * doc/examples/split/ima2d-6-clone-1.cc,
+ * doc/examples/split/ima2d-7-1.cc,
+ * doc/examples/split/ima2d-rot-1.cc,
+ * doc/examples/split/labeling-compute-1.cc,
+ * doc/examples/split/labeling-compute-2.cc,
+ * doc/examples/split/labeling-compute-3.cc,
+ * doc/examples/split/labeling-compute-4.cc,
+ * doc/examples/split/logical-not-1.cc,
+ * doc/examples/split/logical-not-2.cc,
+ * doc/examples/split/logical-not-3.cc,
+ * doc/examples/split/mln_var-1.cc,
+ * doc/examples/split/mln_var-2.cc,
+ * doc/examples/split/mln_var-3.cc,
+ * doc/examples/split/parray-append-1.cc,
+ * doc/examples/split/parray-bbox-1.cc,
+ * doc/examples/split/paste-1.cc,
+ * doc/examples/split/paste-call-1-1.cc,
+ * doc/examples/split/point-1-1.cc,
+ * doc/examples/split/predicate-1-1.cc,
+ * doc/examples/split/tuto2_first_image-1.cc,
+ * doc/examples/split/tuto2_first_image-2.cc,
+ * doc/examples/split/tuto2_first_image-3.cc,
+ * doc/examples/split/tuto2_first_image-4.cc,
+ * doc/examples/split/tuto3_colorize-1.cc,
+ * doc/examples/split/tuto3_first_routine-1.cc,
+ * doc/examples/split/tuto3_first_routine-2.cc,
+ * doc/examples/split/tuto3_first_routine-3.cc,
+ * doc/examples/split/tuto3_first_routine-4.cc,
+ * doc/examples/split/tuto3_first_routine-5.cc,
+ * doc/examples/split/tuto3_first_routine-6.cc,
+ * doc/examples/split/tuto3_first_routine-7.cc,
+ * doc/examples/split/tuto3_first_routine-8.cc,
+ * doc/examples/split/tuto3_println-1.cc,
+ * doc/examples/split/tuto3_println-2.cc,
+ * doc/examples/split/tuto3_rw_image-1.cc,
+ * doc/examples/split/tuto3_rw_image-2.cc,
+ * doc/examples/split/tuto3_rw_image-3.cc,
+ * doc/examples/split/tuto3_rw_image-4.cc,
+ * doc/examples/split/tuto3_rw_image-5.cc,
+ * doc/examples/split/tuto3_rw_image-6.cc,
+ * doc/examples/split/tuto3_rw_image-7.cc,
+ * doc/examples/split/tuto3_trace-1.cc,
+ * doc/examples/split/tuto3_trace-2.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-1.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-10.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-11.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-12.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-2.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-3.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-4.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-5.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-6.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-7.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-8.cc,
+ * doc/examples/split/tuto4_genericity_and_algorithms-9.cc,
+ * doc/examples/split/tuto4_point2d-1.cc,
+ * doc/examples/split/tuto4_site_set_create-1.cc,
+ * doc/examples/split/tuto4_site_set_create-2.cc,
+ * doc/examples/split/tuto4_site_set_create-3.cc,
+ * doc/examples/split/tuto4_site_set_create-4.cc,
+ * doc/examples/split/win-create-1-1.cc,
+ * doc/examples/split/win-create-2-1.cc,
+ * doc/outputs/split/graph-iter-1.txt,
+ * doc/outputs/split/graph-iter-2.txt,
+ * doc/outputs/split/graph-iter-3.txt,
+ * doc/outputs/split/graph-iter-4.txt,
+ * doc/outputs/split/tuto3_println-1.txt,
+ * doc/outputs/split/tuto3_println-2.txt: new reference files.
+
+ * doc/tools/split_sample.sh: fix a typo.
+
+ * doc/white_paper/white_paper.tex: fix path to figures.
+
2009-06-11 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Minor fixes in tests/accu Makefile.
diff --git a/milena/doc/Doxyfile.in b/milena/doc/Doxyfile.in
index 651a2fc..4bde82f 100644
--- a/milena/doc/Doxyfile.in
+++ b/milena/doc/Doxyfile.in
@@ -85,20 +85,19 @@ RECURSIVE = YES
EXCLUDE = @top_srcdir@/milena/sandbox \
@top_srcdir@/milena/mln/core/concept/proxy.hxx \
@top_srcdir@/milena/trash \
- @top_srcdir@/milena/doc/examples/trash
+ @top_srcdir@/milena/doc/examples/trash \
+ @top_srcdir@/milena/doc/examples/split
EXCLUDE_SYMLINKS = YES
EXCLUDE_PATTERNS = *spe.hh
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @top_srcdir@/milena/doc/examples \
- @top_builddir@/milena/doc/examples \
- @top_builddir@/milena/doc/outputs \
- @top_builddir@/milena/doc/outputs/splitted \
- @top_srcdir@/milena/doc/outputs
+ @top_srcdir@/milena/doc/outputs \
+ @top_srcdir@/milena/doc/examples/split \
+ @top_srcdir@/milena/doc/outputs/split
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = @top_srcdir@/milena/doc/img \
- @top_srcdir@/milena/doc/figures \
- @top_builddir@/milena/doc/figures
+ @top_srcdir@/milena/doc/figures
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index bf1d0b1..ec89037 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+# Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -30,10 +31,10 @@ DOXYGEN = doxygen
-.PHONY: doc-all doc doc-html doc-dev doc-dev-html ref-doc-dev ref-doc-dev-html\
- ref-doc ref-doc-html tutorial tutorial-html white-paper \
- white-paper-html ref-guide ref-guide-html examples fix-refdata \
- fig-convert
+.PHONY: doc doc-pdf doc-html doc-dev-pdf doc-dev-html ref-doc-dev-pdf \
+ ref-doc-dev-html ref-doc-pdf ref-doc-html tutorial-pdf tutorial-html \
+ white-paper-pdf white-paper-html ref-guide-pdf ref-guide-html examples \
+ data-regen fix-convert
@@ -43,67 +44,71 @@ user/html: ref-doc-html
user/latex/refman.pdf: ref-doc
-doc-all: doc doc-html doc-dev doc-dev-html
+doc: doc-pdf doc-html doc-dev-pdf doc-dev-html
-doc: tutorial white-paper ref-guide ref-doc
+doc-pdf: tutorial-pdf white-paper-pdf ref-guide-pdf ref-doc-pdf
doc-html: tutorial-html white-paper-html ref-guide-html ref-doc-html
-doc-dev: tutorial ref-guide white-paper ref-doc-dev
+doc-dev-pdf: tutorial-pdf ref-guide-pdf white-paper-pdf ref-doc-dev-pdf
doc-dev-html: tutorial-html ref-guide-html white-paper-html ref-doc-dev-html
-ref-doc-dev: Doxyfile examples
+ref-doc-dev: Doxyfile fig-convert
$(DOXYGEN) Doxyfile_complete_pdf
cd complete/latex && make $(AM_MAKEFLAGS)
-ref-doc-dev-html: Doxyfile examples
+ref-doc-dev-html: Doxyfil fig-converte
$(DOXYGEN) Doxyfile_complete
-ref-doc: Doxyfile examples
+ref-doc-pdf: Doxyfile fig-convert
$(DOXYGEN) Doxyfile_user_pdf
- cd user/latex && make $(AM_MAKEFLAGS)
+ cd user/latex && make ref-doc
-ref-doc-html: Doxyfile examples
+ref-doc-html: Doxyfile fig-convert
$(DOXYGEN) Doxyfile_user
-tutorial: examples fig-convert
+tutorial-pdf: fig-convert
cd tutorial && $(MAKE) $(AM_MAKEFLAGS) $@
-tutorial-html: examples fig-convert
+tutorial-html: fig-convert
cd tutorial && $(MAKE) $(AM_MAKEFLAGS) $@
-white-paper:
+white-paper-pdf:
cd white_paper && $(MAKE) $(AM_MAKEFLAGS) $@
white-paper-html:
cd white_paper && $(MAKE) $(AM_MAKEFLAGS) $@
-ref-guide: examples
+ref-guide-pdf: fig-convert
cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
-ref-guide-html: examples
+ref-guide-html: fig-convert
cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
-examples:
+data-regen:
cd examples && $(MAKE) $(AM_MAKEFLAGS) $@
fix-refdata:
cd examples && $(MAKE) $(AM_MAKEFLAGS) $@
-fig-convert:
+
+fig-convert: $(FIGURES_BUILDDIR)/*.png
+
+$(FIGURES_BUILDDIR)/*.png:
+ test -d $(FIGURES_BUILDDIR) || mkdir $(FIGURES_BUILDDIR) \
@failcom='exit 1'; \
- list="$(FIGURES_BUILDDIR)/*.p*m"; for img in $$list; do \
+ list="$(FIGURES_SRCDIR)/*.p*m"; for img in $$list; do \
echo "Converting $$img to png"; \
name=`basename $$img` \
ext=`echo $$name | cut -d '.' -f 2`; \
@@ -111,6 +116,7 @@ fig-convert:
|| eval $$failcom; \
done;
+
edit = sed -e "s|@ID@|$$Id|" \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
diff --git a/milena/doc/doc.mk b/milena/doc/doc.mk
index 8f2bd33..7fc7584 100644
--- a/milena/doc/doc.mk
+++ b/milena/doc/doc.mk
@@ -7,12 +7,15 @@ AM_CPPFLAGS += -I$(top_srcdir)/milena/doc/tutorial/tools
DOC_SRCDIR = $(top_srcdir)/milena/doc/
OUTPUTS_SRCDIR = $(DOC_SRCDIR)/outputs
+SPLIT_OUTPUTS_SRCDIR = $(OUTPUTS_SRCDIR)/split
FIGURES_SRCDIR = $(DOC_SRCDIR)/figures
EXAMPLES_SRCDIR = $(DOC_SRCDIR)/examples
+SPLIT_EXAMPLES_SRCDIR = $(EXAMPLES_SRCDIR)/split
IMG_SRCDIR = $(DOC_SRCDIR)/img
DOC_BUILDDIR = $(top_builddir)/milena/doc/
OUTPUTS_BUILDDIR = $(DOC_BUILDDIR)/outputs
-SPLITTED_OUTPUTS_BUILDDIR = $(DOC_BUILDDIR)/outputs/splitted
+SPLIT_OUTPUTS_BUILDDIR = $(OUTPUTS_BUILDDIR)/split
FIGURES_BUILDDIR = $(DOC_BUILDDIR)/figures
EXAMPLES_BUILDDIR = $(DOC_BUILDDIR)/examples
+SPLIT_EXAMPLES_BUILDDIR = $(EXAMPLES_BUILDDIR)/split
diff --git a/milena/doc/doxyfuns.sty b/milena/doc/doxyfuns.sty
index c5db8dc..983061b 100644
--- a/milena/doc/doxyfuns.sty
+++ b/milena/doc/doxyfuns.sty
@@ -178,10 +178,10 @@ $$
\renewcommand{\doxysection}[2]{\section{#2}\label{#1}}
\renewcommand{\doxysubsection}[2]{\subsection{#2}\label{#1}}
\renewcommand{\doxysubsubsection}[2]{\subsubsection{#2}\label{#1}}
-\renewcommand{\doxycode}[2][1]{\lstinputlisting[frame=single]{examples/#2-#1.cc}}
+\renewcommand{\doxycode}[2][1]{\lstinputlisting[frame=single]{examples/split/#2-#1.cc}}
\renewcommand{\doxyrawcode}[1]{\lstinputlisting[frame=single]{examples/#1.cc.raw}}
\renewcommand{\doxyoutput}[1]{\lstinputlisting[frame=single]{outputs/#1.txt}}
-\renewcommand{\doxymoutput}[2][1]{\lstinputlisting[frame=single]{outputs/splitted/#2-#1.txt}}
+\renewcommand{\doxymoutput}[2][1]{\lstinputlisting[frame=single]{outputs/split/#2-#1.txt}}
\renewcommand{\doxyfigure}[3][1]{%
\pgfimage[width=#3]{figures/#2-#1}%
\label{#1}%
diff --git a/milena/doc/examples/Makefile.am b/milena/doc/examples/Makefile.am
index 8ce38ac..8092243 100644
--- a/milena/doc/examples/Makefile.am
+++ b/milena/doc/examples/Makefile.am
@@ -134,12 +134,16 @@ tuto3_trace_SOURCES = tuto3/trace.cc
tuto4_site_set_create_SOURCES = tuto4/site_set_create.cc
tuto4_point2d_SOURCES = tuto4/point2d.cc
-all: clean-figures
+.PHONY : run-examples examples diff-data fix-refdata split-examples \
+ split-outputs
+
+
+all:
mkdir -p $(OUTPUTS_BUILDDIR)
mkdir -p $(FIGURES_BUILDDIR)
-run-samples: all
+run-examples: all
@failcom='exit 1'; \
list='$(noinst_PROGRAMS)'; for bin in $$list; do \
echo "Running $$bin"; \
@@ -147,10 +151,10 @@ run-samples: all
done
-examples: run-samples diff-data split-samples split-outputs
+data-regen: run-examples split-examples split-outputs diff-data
-diff-data:
+diff-data: run-examples split-examples
@failcom='exit 1'; \
has_txt_diff=""; \
txtlist="$(OUTPUTS_BUILDDIR)/*.txt"; for txt in $$txtlist; do \
@@ -159,12 +163,25 @@ diff-data:
|| has_txt_diff+=" `basename $$txt`"; \
done; \
has_fig_diff=""; \
- figlist="$(FIGURES_BUILDDIR)/*"; for fig in $$figlist; do \
+ figlist="$(FIGURES_BUILDDIR)/*.p*m"; for fig in $$figlist; do \
echo "Diff `basename $$fig`"; \
diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
|| has_fig_diff+=" `basename $$fig`"; \
done; \
- (test -z "$$has_txt_diff" && test -z "$$has_fig_diff") \
+ has_split_out_diff=""; \
+ split_outlist="$(SPLIT_OUTPUTS_BUILDDIR)/*"; for split_out in $$split_outlist; do \
+ echo "Diff `basename $$split_out`"; \
+ diff $$split_out $(SPLIT_OUTPUTS_SRCDIR)/`basename $$split_out` >/dev/null 2>&1 \
+ || has_split_out_diff+=" `basename $$split_out`"; \
+ done; \
+ has_split_ex_diff=""; \
+ split_exlist="$(SPLIT_EXAMPLES_BUILDDIR)/*"; for split_ex in $$split_exlist; do \
+ echo "Diff `basename $$split_ex`"; \
+ diff $$split_ex $(SPLIT_EXAMPLES_SRCDIR)/`basename $$split_ex` >/dev/null 2>&1 \
+ || has_split_ex_diff+=" `basename $$split_ex`"; \
+ done; \
+ (test -z "$$has_txt_diff" && test -z "$$has_fig_diff" && \
+ test -z "$$has_split_out_diff" && test -z "$$has_split_ex_diff")\
|| (echo "--------"; \
echo "ERROR: please check if the tutorial needs an update.";\
echo " The following files differ from their \
@@ -180,11 +197,23 @@ reference or their reference file does not exist:"; \
echo "$$has_fig_diff"; \
echo ""; \
echo "--------"; \
+ echo "* Split outputs:"; \
+ echo ""; \
+ echo "$$has_split_out_diff"; \
+ echo ""; \
+ echo "--------"; \
+ echo "* Split examples:"; \
+ echo ""; \
+ echo "$$has_split_ex_diff"; \
+ echo ""; \
+ echo "--------"; \
echo "* Please update manually the reference files located \
in:"; \
echo ""; \
echo " $(OUTPUTS_SRCDIR)"; \
echo " $(FIGURES_SRCDIR)"; \
+ echo " $(SPLIT_EXAMPLES_SRCDIR)"; \
+ echo " $(SPLIT_OUTPUTS_SRCDIR)"; \
echo ""; \
echo "* Reference files can updated automatically with \
'make fix-refdata'"; \
@@ -204,26 +233,35 @@ fix-refdata:
diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
|| echo "Updating reference file for $$fig"; \
cp $$fig $(FIGURES_SRCDIR); \
+ done; \
+ split_outlist="$(SPLIT_OUTPUTS_BUILDDIR)/*.txt"; for split_out in $$split_outlist; do \
+ diff $$split_out $(SPLIT_OUTPUTS_SRCDIR)/`basename $$split_out` >/dev/null 2>&1 \
+ || echo "Updating reference file for $$split_out"; \
+ cp $$split_out $(SPLIT_OUTPUTS_SRCDIR); \
+ done; \
+ split_exlist="$(SPLIT_EXAMPLES_BUILDDIR)/*.cc"; for split_ex in $$split_exlist; do \
+ diff $$split_ex $(SPLIT_EXAMPLES_SRCDIR)/`basename $$split_ex` >/dev/null 2>&1 \
+ || echo "Updating reference file for $$split_ex"; \
+ cp $$split_ex $(SPLIT_EXAMPLES_SRCDIR); \
done;
-split-samples:
- mkdir -p $(EXAMPLES_BUILDDIR)
+split-examples:
+ test -d $(SPLIT_EXAMPLES_BUILDDIR) || mkdir $(SPLIT_EXAMPLES_BUILDDIR)
@failcom='exit 1'; \
list=`find $(EXAMPLES_SRCDIR) -type f -name '*.cc'`; for file in $$list; do \
- $(DOC_SRCDIR)/tools/split_sample.sh $$file cc $(EXAMPLES_BUILDDIR)\
+ $(DOC_SRCDIR)/tools/split_sample.sh $$file cc $(SPLIT_EXAMPLES_BUILDDIR)\
|| eval $$failcom; \
done
split-outputs:
- mkdir -p $(SPLITTED_OUTPUTS_BUILDDIR)
+ test -d $(SPLIT_OUTPUTS_BUILDDIR) || mkdir $(SPLIT_OUTPUTS_BUILDDIR)
@failcom='exit 1'; \
list='$(OUTPUTS_BUILDDIR)/*.txt'; for file in $$list; do \
- $(DOC_SRCDIR)/tools/split_sample.sh $$file txt $(SPLITTED_OUTPUTS_BUILDDIR)\
+ $(DOC_SRCDIR)/tools/split_sample.sh $$file txt $(SPLIT_OUTPUTS_BUILDDIR)\
|| eval $$failcom; \
done
-
clean-local: clean-figures
rm -Rf $(OUTPUTS_BUILDDIR)
rm -f $(EXAMPLES_BUILDDIR)/*.cc
diff --git a/milena/doc/examples/split/accu-right-instanciation-1.cc b/milena/doc/examples/split/accu-right-instanciation-1.cc
new file mode 100644
index 0000000..565ca8f
--- /dev/null
+++ b/milena/doc/examples/split/accu-right-instanciation-1.cc
@@ -0,0 +1 @@
+ data::compute(accu::meta::stat::max(), ima);
diff --git a/milena/doc/examples/split/borderthickness-1.cc b/milena/doc/examples/split/borderthickness-1.cc
new file mode 100644
index 0000000..2bb0406
--- /dev/null
+++ b/milena/doc/examples/split/borderthickness-1.cc
@@ -0,0 +1,13 @@
+ bool vals[3][3] = { { 0, 1, 1 },
+ { 1, 0, 0 },
+ { 1, 1, 0 } };
+
+ image2d<bool> ima_def = make::image(vals);
+ border::fill(ima_def, false);
+ debug::println_with_border(ima_def);
+
+ std::cout << "===========" << std::endl << std::endl;
+
+ border::thickness = 0;
+ image2d<bool> ima_bt0 = make::image(vals);
+ debug::println_with_border(ima_bt0);
diff --git a/milena/doc/examples/split/box2d-bbox-1.cc b/milena/doc/examples/split/box2d-bbox-1.cc
new file mode 100644
index 0000000..e6b3e0c
--- /dev/null
+++ b/milena/doc/examples/split/box2d-bbox-1.cc
@@ -0,0 +1,7 @@
+ box2d b(2,3);
+
+ // The bbox can be retrived in constant time.
+ std::cout << b.bbox() << std::endl;
+
+ // nsites can be retrieved in constant time.
+ std::cout << "nsites = " << b.nsites() << std::endl;
diff --git a/milena/doc/examples/split/domain-display-1.cc b/milena/doc/examples/split/domain-display-1.cc
new file mode 100644
index 0000000..f1d4ed6
--- /dev/null
+++ b/milena/doc/examples/split/domain-display-1.cc
@@ -0,0 +1,7 @@
+ image2d<int> ima1(5, 5);
+ image2d<int> ima2(10, 10);
+
+ std::cout << "ima1.domain() = " << ima1.domain()
+ << std::endl;
+ std::cout << "ima2.domain() = " << ima2.domain()
+ << std::endl;
diff --git a/milena/doc/examples/split/dpoint-1-1.cc b/milena/doc/examples/split/dpoint-1-1.cc
new file mode 100644
index 0000000..c0a56b7
--- /dev/null
+++ b/milena/doc/examples/split/dpoint-1-1.cc
@@ -0,0 +1,4 @@
+ dpoint2d dp(-1,0);
+ point2d p(1,1);
+
+ std::cout << p + dp << std::endl;
diff --git a/milena/doc/examples/split/estim-sites-1.cc b/milena/doc/examples/split/estim-sites-1.cc
new file mode 100644
index 0000000..d0e1f00
--- /dev/null
+++ b/milena/doc/examples/split/estim-sites-1.cc
@@ -0,0 +1 @@
+ unsigned nsites = geom::nsites(ima);
diff --git a/milena/doc/examples/split/extend-1.cc b/milena/doc/examples/split/extend-1.cc
new file mode 100644
index 0000000..4ef1a43
--- /dev/null
+++ b/milena/doc/examples/split/extend-1.cc
@@ -0,0 +1,18 @@
+namespace mln
+{
+
+ struct my_ext : public Function_v2v<my_ext>
+ {
+
+ typedef value::rgb8 result;
+
+ value::rgb8 operator()(const point2d& p) const
+ {
+ if ((p.row() + p.col()) % 20)
+ return literal::black;
+ return literal::white;
+ }
+
+ };
+
+} // end of namespace mln
diff --git a/milena/doc/examples/split/extend-2.cc b/milena/doc/examples/split/extend-2.cc
new file mode 100644
index 0000000..3708242
--- /dev/null
+++ b/milena/doc/examples/split/extend-2.cc
@@ -0,0 +1,5 @@
+ image2d<rgb8> lena;
+ io::ppm::load(lena, MLN_IMG_DIR "/small.ppm");
+ box2d bbox_enlarged = lena.domain();
+ bbox_enlarged.enlarge(border::thickness);
+ mln_VAR(ima_roi, lena | fun::p2b::big_chess<box2d>(lena.domain(), 10));
diff --git a/milena/doc/examples/split/extend-3.cc b/milena/doc/examples/split/extend-3.cc
new file mode 100644
index 0000000..3b66921
--- /dev/null
+++ b/milena/doc/examples/split/extend-3.cc
@@ -0,0 +1 @@
+ mln_VAR(ext_with_val, extended_to(extend(ima_roi, literal::blue), bbox_enlarged));
diff --git a/milena/doc/examples/split/extend-4.cc b/milena/doc/examples/split/extend-4.cc
new file mode 100644
index 0000000..c27ed3d
--- /dev/null
+++ b/milena/doc/examples/split/extend-4.cc
@@ -0,0 +1 @@
+ mln_VAR(ext_with_fun, extended_to(extend(ima_roi, my_ext()), bbox_enlarged));
diff --git a/milena/doc/examples/split/extend-5.cc b/milena/doc/examples/split/extend-5.cc
new file mode 100644
index 0000000..1eb2c8c
--- /dev/null
+++ b/milena/doc/examples/split/extend-5.cc
@@ -0,0 +1 @@
+ mln_VAR(ext_with_ima, extend(ima_roi, lena));
diff --git a/milena/doc/examples/split/extension-ignore-1.cc b/milena/doc/examples/split/extension-ignore-1.cc
new file mode 100644
index 0000000..0f6ea89
--- /dev/null
+++ b/milena/doc/examples/split/extension-ignore-1.cc
@@ -0,0 +1 @@
+ my_routine(ima | ima.domain());
diff --git a/milena/doc/examples/split/fill-1.cc b/milena/doc/examples/split/fill-1.cc
new file mode 100644
index 0000000..ec9c43d
--- /dev/null
+++ b/milena/doc/examples/split/fill-1.cc
@@ -0,0 +1,7 @@
+template <typename I>
+void fill(I& ima, mln_value(I) v)
+{
+ mln_piter(I) p(ima.domain());
+ for_all(p)
+ ima(p) = v;
+}
diff --git a/milena/doc/examples/split/fill-2.cc b/milena/doc/examples/split/fill-2.cc
new file mode 100644
index 0000000..05ae851
--- /dev/null
+++ b/milena/doc/examples/split/fill-2.cc
@@ -0,0 +1,2 @@
+ box2d b(20,20);
+ fill((ima | b).rw(), literal::green);
diff --git a/milena/doc/examples/split/fill-3.cc b/milena/doc/examples/split/fill-3.cc
new file mode 100644
index 0000000..5556f68
--- /dev/null
+++ b/milena/doc/examples/split/fill-3.cc
@@ -0,0 +1 @@
+ fill(ima, literal::green);
diff --git a/milena/doc/examples/split/fill-call-1-1.cc b/milena/doc/examples/split/fill-call-1-1.cc
new file mode 100644
index 0000000..9726d12
--- /dev/null
+++ b/milena/doc/examples/split/fill-call-1-1.cc
@@ -0,0 +1 @@
+ image2d<char> imga(5, 5);
diff --git a/milena/doc/examples/split/fill-call-1-2.cc b/milena/doc/examples/split/fill-call-1-2.cc
new file mode 100644
index 0000000..d845592
--- /dev/null
+++ b/milena/doc/examples/split/fill-call-1-2.cc
@@ -0,0 +1 @@
+ data::fill(imga, 'a');
diff --git a/milena/doc/examples/split/fill-call-1-3.cc b/milena/doc/examples/split/fill-call-1-3.cc
new file mode 100644
index 0000000..9592c1c
--- /dev/null
+++ b/milena/doc/examples/split/fill-call-1-3.cc
@@ -0,0 +1 @@
+ data::fill((imga | box2d(1,2)).rw(), 'a');
diff --git a/milena/doc/examples/split/fill-part-image-1.cc b/milena/doc/examples/split/fill-part-image-1.cc
new file mode 100644
index 0000000..6d904e7
--- /dev/null
+++ b/milena/doc/examples/split/fill-part-image-1.cc
@@ -0,0 +1,9 @@
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/fill-part-image-2.cc b/milena/doc/examples/split/fill-part-image-2.cc
new file mode 100644
index 0000000..d9486ec
--- /dev/null
+++ b/milena/doc/examples/split/fill-part-image-2.cc
@@ -0,0 +1,17 @@
+ p_array<point2d> arr;
+
+ // We add two points in the array.
+ arr.append(point2d(0, 1));
+ arr.append(point2d(4, 0));
+
+ // We restrict the image to the sites
+ // contained in arr and fill these ones
+ // with 0.
+ // We must call "rw()" here.
+ data::fill((ima | arr).rw(), 0);
+
+ debug::println((ima | arr));
+
+ mln_VAR(ima2, ima | arr);
+ // We do not need to call "rw()" here.
+ data::fill(ima2, 0);
diff --git a/milena/doc/examples/split/fill-subdomain-1.cc b/milena/doc/examples/split/fill-subdomain-1.cc
new file mode 100644
index 0000000..6d904e7
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-1.cc
@@ -0,0 +1,9 @@
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/fill-subdomain-2.cc b/milena/doc/examples/split/fill-subdomain-2.cc
new file mode 100644
index 0000000..defe5f7
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-2.cc
@@ -0,0 +1,2 @@
+ label_8 nlabels;
+ image2d<label_8> lbl = labeling::blobs(ima, c4(), nlabels);
diff --git a/milena/doc/examples/split/fill-subdomain-3.cc b/milena/doc/examples/split/fill-subdomain-3.cc
new file mode 100644
index 0000000..6aa40fb
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-3.cc
@@ -0,0 +1 @@
+ mln_VAR(lbl_2, lbl | (pw::value(lbl) == pw::cst(2u)));
diff --git a/milena/doc/examples/split/fill-subdomain-4.cc b/milena/doc/examples/split/fill-subdomain-4.cc
new file mode 100644
index 0000000..81120f7
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-4.cc
@@ -0,0 +1,5 @@
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ data::fill(ima2, literal::black);
+
+ data::fill((ima2 | lbl_2.domain()).rw(), literal::red);
diff --git a/milena/doc/examples/split/fill-subdomain-shorter-1.cc b/milena/doc/examples/split/fill-subdomain-shorter-1.cc
new file mode 100644
index 0000000..6d904e7
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-shorter-1.cc
@@ -0,0 +1,9 @@
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/fill-subdomain-shorter-2.cc b/milena/doc/examples/split/fill-subdomain-shorter-2.cc
new file mode 100644
index 0000000..eabd3ea
--- /dev/null
+++ b/milena/doc/examples/split/fill-subdomain-shorter-2.cc
@@ -0,0 +1,8 @@
+ label_8 nlabels;
+ image2d<label_8> lab = labeling::blobs(ima, c4(), nlabels);
+
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ data::fill(ima2, literal::black);
+
+ data::fill((ima2 | (pw::value(lab) == pw::cst(2u))).rw(), literal::red);
diff --git a/milena/doc/examples/split/fill-subimage-cfun-1.cc b/milena/doc/examples/split/fill-subimage-cfun-1.cc
new file mode 100644
index 0000000..0354bcb
--- /dev/null
+++ b/milena/doc/examples/split/fill-subimage-cfun-1.cc
@@ -0,0 +1,4 @@
+bool row_oddity(mln::point2d p)
+{
+ return p.row() % 2;
+}
diff --git a/milena/doc/examples/split/fill-subimage-cfun-2.cc b/milena/doc/examples/split/fill-subimage-cfun-2.cc
new file mode 100644
index 0000000..6d904e7
--- /dev/null
+++ b/milena/doc/examples/split/fill-subimage-cfun-2.cc
@@ -0,0 +1,9 @@
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/fill-subimage-cfun-3.cc b/milena/doc/examples/split/fill-subimage-cfun-3.cc
new file mode 100644
index 0000000..3c0991a
--- /dev/null
+++ b/milena/doc/examples/split/fill-subimage-cfun-3.cc
@@ -0,0 +1,5 @@
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ data::fill(ima2, literal::black);
+
+ data::fill((ima2 | row_oddity).rw(), literal::red);
diff --git a/milena/doc/examples/split/forall-piter-1.cc b/milena/doc/examples/split/forall-piter-1.cc
new file mode 100644
index 0000000..41360da
--- /dev/null
+++ b/milena/doc/examples/split/forall-piter-1.cc
@@ -0,0 +1,5 @@
+ box2d b(3, 2);
+ mln_piter_(box2d) p(b);
+
+ for_all(p)
+ std::cout << p; //prints every site coordinates.
diff --git a/milena/doc/examples/split/fun-p2v-1-1.cc b/milena/doc/examples/split/fun-p2v-1-1.cc
new file mode 100644
index 0000000..f7aea71
--- /dev/null
+++ b/milena/doc/examples/split/fun-p2v-1-1.cc
@@ -0,0 +1,6 @@
+unsigned my_values(const mln::point2d& p)
+{
+ if (p.row() == 0)
+ return 8;
+ return 9;
+}
diff --git a/milena/doc/examples/split/graph-data-1.cc b/milena/doc/examples/split/graph-data-1.cc
new file mode 100644
index 0000000..9a2ffe0
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-1.cc
@@ -0,0 +1,21 @@
+template <typename S>
+struct viota_t : public mln::Function_v2v< viota_t<S> >
+{
+ typedef unsigned result;
+
+ viota_t(unsigned size)
+ {
+ v_.resize(size);
+ for(unsigned i = 0; i < size; ++i)
+ v_[i] = 10 + i;
+ }
+
+ unsigned
+ operator()(const mln_psite(S)& p) const
+ {
+ return v_[p.v().id()];
+ }
+
+ protected:
+ std::vector<result> v_;
+};
diff --git a/milena/doc/examples/split/graph-data-2.cc b/milena/doc/examples/split/graph-data-2.cc
new file mode 100644
index 0000000..c73300e
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-2.cc
@@ -0,0 +1,4 @@
+ util::graph g;
+
+ for (unsigned i = 0; i < 5; ++i)
+ g.add_vertex(); // Add vertex 'i';
diff --git a/milena/doc/examples/split/graph-data-3.cc b/milena/doc/examples/split/graph-data-3.cc
new file mode 100644
index 0000000..0a2382f
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-3.cc
@@ -0,0 +1,5 @@
+ g.add_edge(0, 1); // Associated to edge 0.
+ g.add_edge(1, 2); // Associated to edge 1.
+ g.add_edge(1, 3); // Associated to edge 2.
+ g.add_edge(3, 4); // Associated to edge 3.
+ g.add_edge(4, 2); // Associated to edge 4.
diff --git a/milena/doc/examples/split/graph-data-4.cc b/milena/doc/examples/split/graph-data-4.cc
new file mode 100644
index 0000000..77949ae
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-4.cc
@@ -0,0 +1,7 @@
+ typedef fun::i2v::array<point2d> F;
+ F f(5); // We need to map 5 vertices.
+ f(0) = point2d(0, 0);
+ f(1) = point2d(2, 2);
+ f(2) = point2d(0, 4);
+ f(3) = point2d(4, 3);
+ f(4) = point2d(4, 4);
diff --git a/milena/doc/examples/split/graph-data-5.cc b/milena/doc/examples/split/graph-data-5.cc
new file mode 100644
index 0000000..493061a
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-5.cc
@@ -0,0 +1,2 @@
+ typedef p_vertices<util::graph, F> pv_t;
+ pv_t pv(g, f);
diff --git a/milena/doc/examples/split/graph-data-6.cc b/milena/doc/examples/split/graph-data-6.cc
new file mode 100644
index 0000000..b66db5d
--- /dev/null
+++ b/milena/doc/examples/split/graph-data-6.cc
@@ -0,0 +1,11 @@
+
+ // Constructs an image
+ viota_t<pv_t> viota(pv.nsites());
+ mln_VAR(graph_vertices_ima, viota | pv);
+
+ //Prints each vertex and its associated data.
+ mln_piter_(graph_vertices_ima_t) p(graph_vertices_ima.domain());
+ for_all(p)
+ std::cout << "graph_vertices_ima(" << p << ") = "
+ << graph_vertices_ima(p) << std::endl;
+
diff --git a/milena/doc/examples/split/graph-iter-1.cc b/milena/doc/examples/split/graph-iter-1.cc
new file mode 100644
index 0000000..5156adf
--- /dev/null
+++ b/milena/doc/examples/split/graph-iter-1.cc
@@ -0,0 +1,9 @@
+ // Function which maps sites to data.
+ viota_t viota(g.v_nmax());
+
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Prints each vertex and its associated value.
+ for_all(v)
+ std::cout << v << " : " << viota(v) << std::endl;
diff --git a/milena/doc/examples/split/graph-iter-2.cc b/milena/doc/examples/split/graph-iter-2.cc
new file mode 100644
index 0000000..67e7adc
--- /dev/null
+++ b/milena/doc/examples/split/graph-iter-2.cc
@@ -0,0 +1,15 @@
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Iterator on v's edges.
+ mln_vertex_nbh_edge_iter_(util::graph) e(v);
+
+ // Prints the graph
+ // List all edges for each vertex.
+ for_all(v)
+ {
+ std::cout << v << " : ";
+ for_all(e)
+ std::cout << e << " ";
+ std::cout << std::endl;
+ }
diff --git a/milena/doc/examples/split/graph-iter-3.cc b/milena/doc/examples/split/graph-iter-3.cc
new file mode 100644
index 0000000..cf519c6
--- /dev/null
+++ b/milena/doc/examples/split/graph-iter-3.cc
@@ -0,0 +1,15 @@
+ // Iterator on edges.
+ mln_edge_iter_(util::graph) e(g);
+
+ // Iterator on edges adjacent to e.
+ mln_edge_nbh_edge_iter_(util::graph) ne(e);
+
+ // Prints the graph
+ // List all adjacent edges for each edge.
+ for_all(e)
+ {
+ std::cout << e << " : ";
+ for_all(ne)
+ std::cout << ne << " ";
+ std::cout << std::endl;
+ }
diff --git a/milena/doc/examples/split/graph-iter-4.cc b/milena/doc/examples/split/graph-iter-4.cc
new file mode 100644
index 0000000..c9271f1
--- /dev/null
+++ b/milena/doc/examples/split/graph-iter-4.cc
@@ -0,0 +1,15 @@
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Iterator on vertices adjacent to v.
+ mln_vertex_nbh_vertex_iter_(util::graph) nv(v);
+
+ // Prints the graph
+ // List all adjacent edges for each edge.
+ for_all(v)
+ {
+ std::cout << v << " : ";
+ for_all(nv)
+ std::cout << nv << " ";
+ std::cout << std::endl;
+ }
diff --git a/milena/doc/examples/split/ima-has-1.cc b/milena/doc/examples/split/ima-has-1.cc
new file mode 100644
index 0000000..8bcf33c
--- /dev/null
+++ b/milena/doc/examples/split/ima-has-1.cc
@@ -0,0 +1,32 @@
+ // Default border size is set to 0.
+
+ // Image defined on a box2d from
+ // (0, 0) to (2, 2)
+ image2d<int> ima1(2, 3);
+
+ std::cout << "ima1.has(0, 0) : "
+ << ima1.has(point2d(0, 0)) << std::endl;
+
+ std::cout << "ima1.has(-3, 0) : "
+ << ima1.has(point2d(-3, 0)) << std::endl;
+
+ std::cout << "ima1.has(2, 5) : "
+ << ima1.has(point2d(2, 5)) << std::endl;
+
+ std::cout << "=========" << std::endl;
+
+ // Set default border size to 0.
+ border::thickness = 0;
+
+ // Image defined on a box2d from
+ // (0, 0) to (2, 2)
+ image2d<int> ima2(2, 3);
+
+ std::cout << "ima2.has(0, 0) : "
+ << ima2.has(point2d(0, 0)) << std::endl;
+
+ std::cout << "ima2.has(-3, 0) : "
+ << ima2.has(point2d(-3, 0)) << std::endl;
+
+ std::cout << "ima2.has(2, 5) : "
+ << ima2.has(point2d(2, 5)) << std::endl;
diff --git a/milena/doc/examples/split/ima-load-1.cc b/milena/doc/examples/split/ima-load-1.cc
new file mode 100644
index 0000000..3f0f30f
--- /dev/null
+++ b/milena/doc/examples/split/ima-load-1.cc
@@ -0,0 +1,2 @@
+ image2d<bool> ima;
+ io::pbm::load(ima, "my_image.pbm");
diff --git a/milena/doc/examples/split/ima-save-1.cc b/milena/doc/examples/split/ima-save-1.cc
new file mode 100644
index 0000000..331f954
--- /dev/null
+++ b/milena/doc/examples/split/ima-save-1.cc
@@ -0,0 +1 @@
+ io::pbm::save(ima, "../figures/ima_save.pbm");
diff --git a/milena/doc/examples/split/ima-size-1.cc b/milena/doc/examples/split/ima-size-1.cc
new file mode 100644
index 0000000..d3e28cb
--- /dev/null
+++ b/milena/doc/examples/split/ima-size-1.cc
@@ -0,0 +1,6 @@
+ image2d<int> ima(make::box2d(0,0, 10,12));
+
+ std::cout << "nrows = " << ima.nrows()
+ << " - "
+ << "ncols = " << ima.ncols()
+ << std::endl;
diff --git a/milena/doc/examples/split/ima2d-1-1.cc b/milena/doc/examples/split/ima2d-1-1.cc
new file mode 100644
index 0000000..8a77d3d
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-1-1.cc
@@ -0,0 +1,7 @@
+ // Define a box2d from (-2,-3) to (3,5).
+ box2d b = make::box2d(-2,-3, 3,5);
+ // Initialize an image with b as domain.
+ image2d<int> ima(b);
+
+ std::cout << "b = " << b << std::endl;
+ std::cout << "domain = " << ima.domain() << std::endl;
diff --git a/milena/doc/examples/split/ima2d-2-1.cc b/milena/doc/examples/split/ima2d-2-1.cc
new file mode 100644
index 0000000..69d97bb
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-2-1.cc
@@ -0,0 +1,7 @@
+ // Build an empty image;
+ image2d<value::int_u8> img1a;
+
+ // Build an image with 2 rows
+ // and 3 columns sites
+ image2d<value::int_u8> img1b(box2d(2, 3));
+ image2d<value::int_u8> img1c(2, 3);
diff --git a/milena/doc/examples/split/ima2d-3-1.cc b/milena/doc/examples/split/ima2d-3-1.cc
new file mode 100644
index 0000000..c88d86d
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-3-1.cc
@@ -0,0 +1,23 @@
+ box2d b(2,3);
+ image2d<value::int_u8> ima(b);
+
+ // On image2d, Site <=> point2d
+ point2d p(1, 2);
+
+ // Associate '9' as value for the site/point2d (1,2).
+ // The value is returned by reference and can be changed.
+ opt::at(ima, 1,2) = 9;
+ std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2)
+ << std::endl;
+ std::cout << "ima(p) = " << ima(p) << std::endl;
+
+ std::cout << "---" << std::endl;
+
+
+ // Associate '2' as value for the site/point2d (1,2).
+ // The value is returned by reference
+ // and can be changed as well.
+ ima(p) = 2;
+ std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2)
+ << std::endl;
+ std::cout << "ima(p) = " << ima(p) << std::endl;
diff --git a/milena/doc/examples/split/ima2d-4-1.cc b/milena/doc/examples/split/ima2d-4-1.cc
new file mode 100644
index 0000000..d27faa2
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-4-1.cc
@@ -0,0 +1,8 @@
+ point2d p(9,9);
+
+ // At (9, 9), both values change.
+ ima1(p) = 'M';
+ ima2(p) = 'W';
+
+ bool b = (ima1(p) == ima2(p));
+ std::cout << (b ? "True" : "False") << std::endl;
diff --git a/milena/doc/examples/split/ima2d-5-1.cc b/milena/doc/examples/split/ima2d-5-1.cc
new file mode 100644
index 0000000..efe7bad
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-5-1.cc
@@ -0,0 +1,13 @@
+ image2d<int> ima1(box2d(2, 3));
+ image2d<int> ima2;
+ point2d p(1,2);
+
+ ima2 = ima1; // ima1.id() == ima2.id()
+ // and both point to the same memory area.
+
+ ima2(p) = 2; // ima1 is modified as well.
+
+ // prints "2 - 2"
+ std::cout << ima2(p) << " - " << ima1(p) << std::endl;
+ // prints "true"
+ std::cout << (ima2.id_() == ima1.id_()) << std::endl;
diff --git a/milena/doc/examples/split/ima2d-6-clone-1.cc b/milena/doc/examples/split/ima2d-6-clone-1.cc
new file mode 100644
index 0000000..b8d23b5
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-6-clone-1.cc
@@ -0,0 +1,8 @@
+ image2d<int> ima1(5, 5);
+ image2d<int> ima3 = duplicate(ima1); // Makes a deep copy.
+
+ point2d p(2, 2);
+ ima3(p) = 3;
+
+ std::cout << ima3(p) << " - " << ima1(p) << std::endl;
+ std::cout << (ima3.id_() == ima1.id_()) << std::endl;
diff --git a/milena/doc/examples/split/ima2d-7-1.cc b/milena/doc/examples/split/ima2d-7-1.cc
new file mode 100644
index 0000000..2dc5d89
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-7-1.cc
@@ -0,0 +1,5 @@
+ image2d<value::int_u8> img2a(2, 3);
+ image2d<value::int_u8> img2b;
+
+ initialize(img2b, img2a);
+ data::fill(img2b, img2a);
diff --git a/milena/doc/examples/split/ima2d-rot-1.cc b/milena/doc/examples/split/ima2d-rot-1.cc
new file mode 100644
index 0000000..74125b2
--- /dev/null
+++ b/milena/doc/examples/split/ima2d-rot-1.cc
@@ -0,0 +1,34 @@
+ border::thickness = 30;
+
+ // Declare the image to be rotated.
+ image2d<value::rgb8> ima1_(220, 220);
+ data::fill(ima1_, literal::cyan);
+ border::fill(ima1_, literal::yellow);
+ // Set an infinite extension.
+ mln_VAR(ima1, extend(ima1_, pw::cst(literal::yellow)));
+
+ // Declare the output image.
+ image2d<value::rgb8> ima2(220, 220);
+ data::fill(ima2, literal::cyan);
+ border::fill(ima2, literal::yellow);
+
+ box2d extended_domain= ima1.domain();
+ extended_domain.enlarge(border::thickness);
+
+ // Draw the domain bounding box
+ draw::box(ima1, geom::bbox(ima1_), literal::red);
+ // Save the image, including its border.
+ doc::ppmsave(ima1 | extended_domain, IMA1_PPM);
+
+ // Define and apply a point-wise rotation
+ fun::x2x::rotation<2,float> rot1(0.5, literal::zero);
+ image2d<value::rgb8>::fwd_piter p(ima1.domain());
+ for_all(p)
+ {
+ algebra::vec<2,float> pv = p.to_site().to_vec();
+ algebra::vec<2,float> v = rot1.inv()(pv);
+ ima2(p) = ima1(v);
+ }
+
+ draw::box(ima2, ima2.bbox(), literal::red);
+ doc::ppmsave(extended_to(ima2, extended_domain), IMA2_PPM);
diff --git a/milena/doc/examples/split/labeling-compute-1.cc b/milena/doc/examples/split/labeling-compute-1.cc
new file mode 100644
index 0000000..6d904e7
--- /dev/null
+++ b/milena/doc/examples/split/labeling-compute-1.cc
@@ -0,0 +1,9 @@
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/labeling-compute-2.cc b/milena/doc/examples/split/labeling-compute-2.cc
new file mode 100644
index 0000000..defe5f7
--- /dev/null
+++ b/milena/doc/examples/split/labeling-compute-2.cc
@@ -0,0 +1,2 @@
+ label_8 nlabels;
+ image2d<label_8> lbl = labeling::blobs(ima, c4(), nlabels);
diff --git a/milena/doc/examples/split/labeling-compute-3.cc b/milena/doc/examples/split/labeling-compute-3.cc
new file mode 100644
index 0000000..93347d9
--- /dev/null
+++ b/milena/doc/examples/split/labeling-compute-3.cc
@@ -0,0 +1,4 @@
+ util::array<box2d> boxes =
+ labeling::compute(accu::meta::bbox(),
+ lbl,
+ nlabels);
diff --git a/milena/doc/examples/split/labeling-compute-4.cc b/milena/doc/examples/split/labeling-compute-4.cc
new file mode 100644
index 0000000..6a8e133
--- /dev/null
+++ b/milena/doc/examples/split/labeling-compute-4.cc
@@ -0,0 +1,2 @@
+ for (unsigned i = 1; i <= nlabels; ++i)
+ std::cout << boxes[i] << std::endl;
diff --git a/milena/doc/examples/split/logical-not-1.cc b/milena/doc/examples/split/logical-not-1.cc
new file mode 100644
index 0000000..8d63e86
--- /dev/null
+++ b/milena/doc/examples/split/logical-not-1.cc
@@ -0,0 +1,8 @@
+ bool vals[5][5] = {
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0}
+ };
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/logical-not-2.cc b/milena/doc/examples/split/logical-not-2.cc
new file mode 100644
index 0000000..4c493d4
--- /dev/null
+++ b/milena/doc/examples/split/logical-not-2.cc
@@ -0,0 +1 @@
+ image2d<bool> ima_neg = logical::not_(ima);
diff --git a/milena/doc/examples/split/logical-not-3.cc b/milena/doc/examples/split/logical-not-3.cc
new file mode 100644
index 0000000..77a11f9
--- /dev/null
+++ b/milena/doc/examples/split/logical-not-3.cc
@@ -0,0 +1 @@
+ logical::not_inplace(ima);
diff --git a/milena/doc/examples/split/mln_var-1.cc b/milena/doc/examples/split/mln_var-1.cc
new file mode 100644
index 0000000..04ca688
--- /dev/null
+++ b/milena/doc/examples/split/mln_var-1.cc
@@ -0,0 +1 @@
+ mln_VAR(ima, my_values | arr);
diff --git a/milena/doc/examples/split/mln_var-2.cc b/milena/doc/examples/split/mln_var-2.cc
new file mode 100644
index 0000000..edfbd6d
--- /dev/null
+++ b/milena/doc/examples/split/mln_var-2.cc
@@ -0,0 +1 @@
+ mln_VAR(imab1, ima | (pw::value(ima) == pw::cst(1u)));
diff --git a/milena/doc/examples/split/mln_var-3.cc b/milena/doc/examples/split/mln_var-3.cc
new file mode 100644
index 0000000..4075081
--- /dev/null
+++ b/milena/doc/examples/split/mln_var-3.cc
@@ -0,0 +1,5 @@
+ box2d b2(1, 2);
+//FIXME: enable these lines.
+// mln_VAR(imad, imab1 / b2);
+
+// debug::println(imad);
diff --git a/milena/doc/examples/split/parray-append-1.cc b/milena/doc/examples/split/parray-append-1.cc
new file mode 100644
index 0000000..2608700
--- /dev/null
+++ b/milena/doc/examples/split/parray-append-1.cc
@@ -0,0 +1,6 @@
+ p_array<point2d> arr;
+ arr.append(point2d(3, 6));
+ arr.append(point2d(3, 7));
+ arr.append(point2d(3, 8));
+ arr.append(point2d(4, 8));
+ arr.append(point2d(4, 9));
diff --git a/milena/doc/examples/split/parray-bbox-1.cc b/milena/doc/examples/split/parray-bbox-1.cc
new file mode 100644
index 0000000..c6d43f5
--- /dev/null
+++ b/milena/doc/examples/split/parray-bbox-1.cc
@@ -0,0 +1,11 @@
+ p_array<point2d> arr;
+ arr.insert(point2d(1,0));
+ arr.insert(point2d(1,1));
+
+ // The bbox is computed thanks to bbox() algorithm.
+ box2d box = geom::bbox(arr);
+ std::cout << box << std::endl;
+
+ // p_array provides nsites(),
+ // it can be retrieved in constant time.
+ std::cout << "nsites = " << arr.nsites() << std::endl;
diff --git a/milena/doc/examples/split/paste-1.cc b/milena/doc/examples/split/paste-1.cc
new file mode 100644
index 0000000..327b226
--- /dev/null
+++ b/milena/doc/examples/split/paste-1.cc
@@ -0,0 +1,7 @@
+template <typename I, typename J>
+void paste(const I& data, J& dest)
+{
+ mln_piter(I) p(data.domain());
+ for_all(p)
+ dest(p) = data(p);
+}
diff --git a/milena/doc/examples/split/paste-call-1-1.cc b/milena/doc/examples/split/paste-call-1-1.cc
new file mode 100644
index 0000000..a6703c7
--- /dev/null
+++ b/milena/doc/examples/split/paste-call-1-1.cc
@@ -0,0 +1,11 @@
+ image2d<unsigned char> imgb(make::box2d(5,5, 7,8));
+ // Initialize imga with the same domain as imgb.
+ image2d<unsigned char> imga(imgb.domain());
+
+ // Initialize the image values.
+ data::fill(imgb, 'b');
+
+ // Paste the content of imgb in imga.
+ data::paste(imgb, imga);
+
+ debug::println(imga);
diff --git a/milena/doc/examples/split/point-1-1.cc b/milena/doc/examples/split/point-1-1.cc
new file mode 100644
index 0000000..e7fa428
--- /dev/null
+++ b/milena/doc/examples/split/point-1-1.cc
@@ -0,0 +1,14 @@
+ // Create an image on a 2D box
+ // with 10 columns and 10 rows.
+ image2d<bool> ima(make::box2d(10, 10));
+
+ mln_site_(image2d<bool>) p1(20, 20);
+ mln_site_(image2d<bool>) p2(3, 3);
+
+ std::cout << "has(p1)? "
+ << (ima.has(p1) ? "true" : "false")
+ << std::endl;
+
+ std::cout << "has(p2)? "
+ << (ima.has(p2) ? "true" : "false")
+ << std::endl;
diff --git a/milena/doc/examples/split/predicate-1-1.cc b/milena/doc/examples/split/predicate-1-1.cc
new file mode 100644
index 0000000..6f466d7
--- /dev/null
+++ b/milena/doc/examples/split/predicate-1-1.cc
@@ -0,0 +1,7 @@
+//function_p2b
+bool my_function_p2b(mln::point2d p);
+
+//function_p2v
+//V is the value type used in the image.
+template <typename V>
+V my_function_p2v(mln::point2d p);
diff --git a/milena/doc/examples/split/tuto2_first_image-1.cc b/milena/doc/examples/split/tuto2_first_image-1.cc
new file mode 100644
index 0000000..31b4c86
--- /dev/null
+++ b/milena/doc/examples/split/tuto2_first_image-1.cc
@@ -0,0 +1,15 @@
+ bool vals[13][21] = {
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0},
+ {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ };
diff --git a/milena/doc/examples/split/tuto2_first_image-2.cc b/milena/doc/examples/split/tuto2_first_image-2.cc
new file mode 100644
index 0000000..d1288f0
--- /dev/null
+++ b/milena/doc/examples/split/tuto2_first_image-2.cc
@@ -0,0 +1 @@
+ image2d<bool> ima = make::image(vals);
diff --git a/milena/doc/examples/split/tuto2_first_image-3.cc b/milena/doc/examples/split/tuto2_first_image-3.cc
new file mode 100644
index 0000000..2f2cc40
--- /dev/null
+++ b/milena/doc/examples/split/tuto2_first_image-3.cc
@@ -0,0 +1 @@
+ debug::println(ima);
diff --git a/milena/doc/examples/split/tuto2_first_image-4.cc b/milena/doc/examples/split/tuto2_first_image-4.cc
new file mode 100644
index 0000000..70210b2
--- /dev/null
+++ b/milena/doc/examples/split/tuto2_first_image-4.cc
@@ -0,0 +1 @@
+ doc::pbmsave(ima, "tuto2_first_image");
diff --git a/milena/doc/examples/split/tuto3_colorize-1.cc b/milena/doc/examples/split/tuto3_colorize-1.cc
new file mode 100644
index 0000000..d79e248
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_colorize-1.cc
@@ -0,0 +1,8 @@
+ int_u8 vals[25] = { 100, 100, 200, 200, 230,
+ 100, 100, 200, 230, 230,
+ 140, 140, 140, 0, 0,
+ 65, 186, 65, 127, 127,
+ 65, 65, 65, 127, 127 };
+
+ image2d<int_u8> ima = make::image2d(vals);
+ image2d<rgb8> ima_color = labeling::colorize(rgb8(), ima, 230);
diff --git a/milena/doc/examples/split/tuto3_first_routine-1.cc b/milena/doc/examples/split/tuto3_first_routine-1.cc
new file mode 100644
index 0000000..c9fd1ab
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-1.cc
@@ -0,0 +1,34 @@
+namespace mln
+{
+
+ template <typename I, typename N>
+ mln_concrete(I)
+ my_algorithm(const Image<I>& ima_,
+ const Neighborhood<N>& nbh_)
+ {
+ trace::entering("my_algorithm");
+
+ const I& ima = exact(ima_);
+ const N& nbh = exact(nbh_);
+ mln_precondition(ima.is_valid());
+ mln_precondition(nbh.is_valid());
+
+ typedef value::label_8 V;
+ V nlabels;
+ mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels);
+ util::array<unsigned>
+ count = labeling::compute(accu::meta::count(), lbl, nlabels);
+
+ mln_concrete(I) output;
+ initialize(output, ima);
+ data::fill(output, literal::one);
+
+ for (unsigned i = 1; i <= nlabels; ++i)
+ if (count[i] < 10u)
+ data::fill((output | (pw::value(lbl) == pw::cst(i))).rw(), literal::zero);
+
+ trace::exiting("my_algorithm");
+ return output;
+ }
+
+} // end of namespace mln
diff --git a/milena/doc/examples/split/tuto3_first_routine-2.cc b/milena/doc/examples/split/tuto3_first_routine-2.cc
new file mode 100644
index 0000000..15f5217
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-2.cc
@@ -0,0 +1,4 @@
+ template <typename I, typename N>
+ mln_concrete(I)
+ my_algorithm(const Image<I>& ima_,
+ const Neighborhood<N>& nbh_)
diff --git a/milena/doc/examples/split/tuto3_first_routine-3.cc b/milena/doc/examples/split/tuto3_first_routine-3.cc
new file mode 100644
index 0000000..35421e3
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-3.cc
@@ -0,0 +1 @@
+ trace::entering("my_algorithm");
diff --git a/milena/doc/examples/split/tuto3_first_routine-4.cc b/milena/doc/examples/split/tuto3_first_routine-4.cc
new file mode 100644
index 0000000..ab1f3a9
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-4.cc
@@ -0,0 +1,4 @@
+ const I& ima = exact(ima_);
+ const N& nbh = exact(nbh_);
+ mln_precondition(ima.is_valid());
+ mln_precondition(nbh.is_valid());
diff --git a/milena/doc/examples/split/tuto3_first_routine-5.cc b/milena/doc/examples/split/tuto3_first_routine-5.cc
new file mode 100644
index 0000000..998dc2d
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-5.cc
@@ -0,0 +1,5 @@
+ typedef value::label_8 V;
+ V nlabels;
+ mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels);
+ util::array<unsigned>
+ count = labeling::compute(accu::meta::count(), lbl, nlabels);
diff --git a/milena/doc/examples/split/tuto3_first_routine-6.cc b/milena/doc/examples/split/tuto3_first_routine-6.cc
new file mode 100644
index 0000000..283c2e2
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-6.cc
@@ -0,0 +1,3 @@
+ mln_concrete(I) output;
+ initialize(output, ima);
+ data::fill(output, literal::one);
diff --git a/milena/doc/examples/split/tuto3_first_routine-7.cc b/milena/doc/examples/split/tuto3_first_routine-7.cc
new file mode 100644
index 0000000..7a9c927
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-7.cc
@@ -0,0 +1,3 @@
+ for (unsigned i = 1; i <= nlabels; ++i)
+ if (count[i] < 10u)
+ data::fill((output | (pw::value(lbl) == pw::cst(i))).rw(), literal::zero);
diff --git a/milena/doc/examples/split/tuto3_first_routine-8.cc b/milena/doc/examples/split/tuto3_first_routine-8.cc
new file mode 100644
index 0000000..a0b2a75
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_first_routine-8.cc
@@ -0,0 +1,2 @@
+ trace::exiting("my_algorithm");
+ return output;
diff --git a/milena/doc/examples/split/tuto3_println-1.cc b/milena/doc/examples/split/tuto3_println-1.cc
new file mode 100644
index 0000000..18dfc2a
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_println-1.cc
@@ -0,0 +1,3 @@
+ image2d<int_u8> ima(5,5);
+ data::fill(ima, 2);
+ debug::println(ima);
diff --git a/milena/doc/examples/split/tuto3_println-2.cc b/milena/doc/examples/split/tuto3_println-2.cc
new file mode 100644
index 0000000..bae2dce
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_println-2.cc
@@ -0,0 +1,4 @@
+ image2d<int_u8> ima(5,5);
+ data::fill(ima, 2);
+ border::fill(ima, 7);
+ debug::println_with_border(ima);
diff --git a/milena/doc/examples/split/tuto3_rw_image-1.cc b/milena/doc/examples/split/tuto3_rw_image-1.cc
new file mode 100644
index 0000000..621ff28
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-1.cc
@@ -0,0 +1 @@
+ image2d<value::rgb8> ima(40, 40);
diff --git a/milena/doc/examples/split/tuto3_rw_image-2.cc b/milena/doc/examples/split/tuto3_rw_image-2.cc
new file mode 100644
index 0000000..7ee6c8a
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-2.cc
@@ -0,0 +1 @@
+ data::fill(ima, literal::red);
diff --git a/milena/doc/examples/split/tuto3_rw_image-3.cc b/milena/doc/examples/split/tuto3_rw_image-3.cc
new file mode 100644
index 0000000..f25ab40
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-3.cc
@@ -0,0 +1,3 @@
+ for (def::coord row = 20; row < 30; ++row)
+ for (def::coord col = 20; col < 30; ++col)
+ ima(point2d(row, col)) = literal::blue;
diff --git a/milena/doc/examples/split/tuto3_rw_image-4.cc b/milena/doc/examples/split/tuto3_rw_image-4.cc
new file mode 100644
index 0000000..06559c5
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-4.cc
@@ -0,0 +1,3 @@
+ for (def::coord row = 20; row < 30; ++row)
+ for (def::coord col = 20; col < 30; ++col)
+ opt::at(ima, row, col) = literal::blue;
diff --git a/milena/doc/examples/split/tuto3_rw_image-5.cc b/milena/doc/examples/split/tuto3_rw_image-5.cc
new file mode 100644
index 0000000..d98037c
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-5.cc
@@ -0,0 +1,2 @@
+ image2d<value::rgb8> lena;
+ io::ppm::load(lena, MLN_IMG_DIR "/small.ppm");
diff --git a/milena/doc/examples/split/tuto3_rw_image-6.cc b/milena/doc/examples/split/tuto3_rw_image-6.cc
new file mode 100644
index 0000000..10eb29f
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-6.cc
@@ -0,0 +1 @@
+ data::fill(ima, lena);
diff --git a/milena/doc/examples/split/tuto3_rw_image-7.cc b/milena/doc/examples/split/tuto3_rw_image-7.cc
new file mode 100644
index 0000000..d362105
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_rw_image-7.cc
@@ -0,0 +1 @@
+ data::paste(ima, lena);
diff --git a/milena/doc/examples/split/tuto3_trace-1.cc b/milena/doc/examples/split/tuto3_trace-1.cc
new file mode 100644
index 0000000..39a1013
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_trace-1.cc
@@ -0,0 +1,2 @@
+ // ...
+ trace::quiet = false;
diff --git a/milena/doc/examples/split/tuto3_trace-2.cc b/milena/doc/examples/split/tuto3_trace-2.cc
new file mode 100644
index 0000000..a1e0739
--- /dev/null
+++ b/milena/doc/examples/split/tuto3_trace-2.cc
@@ -0,0 +1,6 @@
+ labeling::blobs(ima, c4(), nlabels);
+
+ trace::quiet = true;
+
+ geom::bbox(ima);
+ // ...
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-1.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-1.cc
new file mode 100644
index 0000000..d98037c
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-1.cc
@@ -0,0 +1,2 @@
+ image2d<value::rgb8> lena;
+ io::ppm::load(lena, MLN_IMG_DIR "/small.ppm");
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-10.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-10.cc
new file mode 100644
index 0000000..80225a9
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-10.cc
@@ -0,0 +1 @@
+ data::fill((lena | (pw::value(label) == pw::cst(0u))).rw(), literal::blue);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-11.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-11.cc
new file mode 100644
index 0000000..6eb4e9b
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-11.cc
@@ -0,0 +1 @@
+ data::fill(extract::green(lena).rw(), literal::max);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-12.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-12.cc
new file mode 100644
index 0000000..9091157
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-12.cc
@@ -0,0 +1,2 @@
+ mln_VAR(object, pw::value(label) == pw::cst(0u));
+ data::fill((extract::green(lena).rw() | object).rw(), literal::max);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-2.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-2.cc
new file mode 100644
index 0000000..edae3e8
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-2.cc
@@ -0,0 +1 @@
+ box2d roi = make::box2d(20, 20, 40, 40);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-3.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-3.cc
new file mode 100644
index 0000000..aaa7567
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-3.cc
@@ -0,0 +1 @@
+ data::fill((lena | roi).rw(), literal::green);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-4.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-4.cc
new file mode 100644
index 0000000..888c001
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-4.cc
@@ -0,0 +1,5 @@
+ p_array<point2d> arr;
+ for (def::coord row = geom::min_row(lena); row < geom::max_row(lena); ++row)
+ for (def::coord col = geom::min_row(lena); col < geom::max_col(lena); ++col)
+ if (((row + col) % 2) == 0)
+ arr.append(point2d(row, col));
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-5.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-5.cc
new file mode 100644
index 0000000..6a17639
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-5.cc
@@ -0,0 +1,4 @@
+ for (def::coord row = geom::min_row(lena); row < geom::max_row(lena); ++row)
+ for (def::coord col = geom::min_row(lena); col < geom::max_col(lena); ++col)
+ if (((row + col) % 2) == 0)
+ opt::at(lena, row, col) = literal::green;
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-6.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-6.cc
new file mode 100644
index 0000000..2b72dd1
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-6.cc
@@ -0,0 +1 @@
+ data::fill((lena | fun::p2b::chess()).rw(), literal::green);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-7.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-7.cc
new file mode 100644
index 0000000..e16190c
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-7.cc
@@ -0,0 +1,6 @@
+ image2d<bool> mask;
+ initialize(mask, lena);
+ data::fill(mask, false);
+ data::fill((mask | make::box2d(10, 10, 14, 14)).rw(), true);
+ data::fill((mask | make::box2d(25, 15, 29, 18)).rw(), true);
+ data::fill((mask | make::box2d(50, 50, 54, 54)).rw(), true);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-8.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-8.cc
new file mode 100644
index 0000000..dd314f0
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-8.cc
@@ -0,0 +1 @@
+ data::fill((lena | pw::value(mask)).rw(), literal::green);
diff --git a/milena/doc/examples/split/tuto4_genericity_and_algorithms-9.cc b/milena/doc/examples/split/tuto4_genericity_and_algorithms-9.cc
new file mode 100644
index 0000000..1fa2000
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_genericity_and_algorithms-9.cc
@@ -0,0 +1,3 @@
+ image2d<bool> lena_bw = binarization::binarization(lena, keep_specific_colors());
+ value::label_8 nlabels;
+ image2d<value::label_8> label = labeling::blobs(lena_bw, c8(), nlabels);
diff --git a/milena/doc/examples/split/tuto4_point2d-1.cc b/milena/doc/examples/split/tuto4_point2d-1.cc
new file mode 100644
index 0000000..70b9e9b
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_point2d-1.cc
@@ -0,0 +1,2 @@
+ point2d p(3,3);
+ std::cout << p << std::endl;
diff --git a/milena/doc/examples/split/tuto4_site_set_create-1.cc b/milena/doc/examples/split/tuto4_site_set_create-1.cc
new file mode 100644
index 0000000..f0f498e
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_site_set_create-1.cc
@@ -0,0 +1 @@
+ box2d b(4,4);
diff --git a/milena/doc/examples/split/tuto4_site_set_create-2.cc b/milena/doc/examples/split/tuto4_site_set_create-2.cc
new file mode 100644
index 0000000..06a04e3
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_site_set_create-2.cc
@@ -0,0 +1,3 @@
+ p_array<point2d> arr;
+ arr.append(point2d(2,2));
+ arr.append(point2d(1,2));
diff --git a/milena/doc/examples/split/tuto4_site_set_create-3.cc b/milena/doc/examples/split/tuto4_site_set_create-3.cc
new file mode 100644
index 0000000..63ceee5
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_site_set_create-3.cc
@@ -0,0 +1,4 @@
+ mln_piter_(box2d) p(b);
+ for_all(p)
+ std::cout << p << ", ";
+ std::cout << std::endl;
diff --git a/milena/doc/examples/split/tuto4_site_set_create-4.cc b/milena/doc/examples/split/tuto4_site_set_create-4.cc
new file mode 100644
index 0000000..1bbf4c0
--- /dev/null
+++ b/milena/doc/examples/split/tuto4_site_set_create-4.cc
@@ -0,0 +1 @@
+ box2d b = make::box2d(-2,-2, 2, 2);
diff --git a/milena/doc/examples/split/win-create-1-1.cc b/milena/doc/examples/split/win-create-1-1.cc
new file mode 100644
index 0000000..cf1a894
--- /dev/null
+++ b/milena/doc/examples/split/win-create-1-1.cc
@@ -0,0 +1,4 @@
+ window2d win;
+ win.insert(-1, -1);
+ win.insert(-1, 0);
+ win.insert(-1, 1);
diff --git a/milena/doc/examples/split/win-create-2-1.cc b/milena/doc/examples/split/win-create-2-1.cc
new file mode 100644
index 0000000..3bfcfc0
--- /dev/null
+++ b/milena/doc/examples/split/win-create-2-1.cc
@@ -0,0 +1,10 @@
+ bool b[9] = { 1, 0, 0,
+ 1, 0, 0,
+ 1, 0, 0 };
+
+ bool b2[3][3] = { { 1, 0, 0 },
+ { 1, 0, 0 },
+ { 1, 0, 0 } };
+
+ window2d win = convert::to<window2d>(b);
+ window2d win2 = convert::to<window2d>(b2);
diff --git a/milena/doc/outputs/split/graph-iter-1.txt b/milena/doc/outputs/split/graph-iter-1.txt
new file mode 100644
index 0000000..4a0f8b8
--- /dev/null
+++ b/milena/doc/outputs/split/graph-iter-1.txt
@@ -0,0 +1,5 @@
+0 : 10
+1 : 11
+2 : 12
+3 : 13
+4 : 14
diff --git a/milena/doc/outputs/split/graph-iter-2.txt b/milena/doc/outputs/split/graph-iter-2.txt
new file mode 100644
index 0000000..8cfdc82
--- /dev/null
+++ b/milena/doc/outputs/split/graph-iter-2.txt
@@ -0,0 +1,5 @@
+0 : (0,1)
+1 : (0,1) (1,2) (1,3)
+2 : (1,2) (2,4)
+3 : (1,3) (3,4)
+4 : (3,4) (2,4)
diff --git a/milena/doc/outputs/split/graph-iter-3.txt b/milena/doc/outputs/split/graph-iter-3.txt
new file mode 100644
index 0000000..7a9fcff
--- /dev/null
+++ b/milena/doc/outputs/split/graph-iter-3.txt
@@ -0,0 +1,5 @@
+(0,1) : (1,2) (1,3)
+(1,2) : (0,1) (1,3) (2,4)
+(1,3) : (0,1) (1,2) (3,4)
+(3,4) : (1,3) (2,4)
+(2,4) : (1,2) (3,4)
diff --git a/milena/doc/outputs/split/graph-iter-4.txt b/milena/doc/outputs/split/graph-iter-4.txt
new file mode 100644
index 0000000..b9c401f
--- /dev/null
+++ b/milena/doc/outputs/split/graph-iter-4.txt
@@ -0,0 +1,5 @@
+0 : 1
+1 : 0 2 3
+2 : 1 4
+3 : 1 4
+4 : 3 2
diff --git a/milena/doc/outputs/split/tuto3_println-1.txt b/milena/doc/outputs/split/tuto3_println-1.txt
new file mode 100644
index 0000000..7ef416e
--- /dev/null
+++ b/milena/doc/outputs/split/tuto3_println-1.txt
@@ -0,0 +1,6 @@
+2 2 2 2 2
+2 2 2 2 2
+2 2 2 2 2
+2 2 2 2 2
+2 2 2 2 2
+
diff --git a/milena/doc/outputs/split/tuto3_println-2.txt b/milena/doc/outputs/split/tuto3_println-2.txt
new file mode 100644
index 0000000..4d76ec4
--- /dev/null
+++ b/milena/doc/outputs/split/tuto3_println-2.txt
@@ -0,0 +1,12 @@
+7 7 7 7 7 7 7 7 7 7 7
+7 7 7 7 7 7 7 7 7 7 7
+7 7 7 7 7 7 7 7 7 7 7
+7 7 7 2 2 2 2 2 7 7 7
+7 7 7 2 2 2 2 2 7 7 7
+7 7 7 2 2 2 2 2 7 7 7
+7 7 7 2 2 2 2 2 7 7 7
+7 7 7 2 2 2 2 2 7 7 7
+7 7 7 7 7 7 7 7 7 7 7
+7 7 7 7 7 7 7 7 7 7 7
+7 7 7 7 7 7 7 7 7 7 7
+
diff --git a/milena/doc/ref_guide/Makefile.am b/milena/doc/ref_guide/Makefile.am
index 3849b1c..d77d1b2 100644
--- a/milena/doc/ref_guide/Makefile.am
+++ b/milena/doc/ref_guide/Makefile.am
@@ -18,18 +18,22 @@
.PHONY: ref-guide ref-guide-html
include $(top_srcdir)/milena/doc/doc.mk
-TEXINPUTS = $(DOC_SRCDIR):$(DOC_BUILDDIR):$(OUTPUTS_SRCDIR):$(IMG_SRCDIR):
+TEXINPUTS ="$(DOC_SRCDIR):$(DOC_BUILDDIR):$(OUTPUTS_SRCDIR):\
+$(SPLIT_OUTPUTS_SRCDIR):$(IMG_SRCDIR):$(SPLIT_EXAMPLES_SRCDIR):"
-ref-guide:
+ref-guide: $(FIGURES_SRCDIR)/* $(OUTPUTS_SRCDIR)/* ref-guide-pdf ref-guide-html
+
+
+ref-guide-pdf: ref_guide.pdf
+
+
+ref_guide.pdf:
TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/ref_guide.tex
TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/ref_guide.tex
TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/ref_guide.tex
-ref_guide.pdf: ref-guide
-
-
ref-guide-html:
chmod u+x $(DOC_SRCDIR)/tools/todoxygen.sh
$(DOC_SRCDIR)/tools/todoxygen.sh $(srcdir)/ref_guide.tex $(DOC_BUILDDIR)/ref_guide $(DOC_SRCDIR)
diff --git a/milena/doc/tools/split_sample.sh b/milena/doc/tools/split_sample.sh
index 20cfc82..9712f40 100755
--- a/milena/doc/tools/split_sample.sh
+++ b/milena/doc/tools/split_sample.sh
@@ -23,5 +23,5 @@ for begin in $begins; do
done
if [ $split ] && [ $i -gt 1 ]; then
- echo "* $1 has been splitted in $i files."
+ echo "* $1 has been split in $i files."
fi
diff --git a/milena/doc/tutorial/Makefile.am b/milena/doc/tutorial/Makefile.am
index 4aa44f0..eac50e9 100644
--- a/milena/doc/tutorial/Makefile.am
+++ b/milena/doc/tutorial/Makefile.am
@@ -21,25 +21,29 @@ include $(top_srcdir)/milena/doc/doc.mk
TEXINPUTS = $(DOC_SRCDIR):$(DOC_BUILDDIR):$(OUTPUTS_SRCDIR):$(IMG_SRCDIR):
-tutorial:
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
+tutorial: $(FIGURES_SRCDIR)/* $(OUTPUTS_SRCDIR)/* tutorial-html tutorial-pdf
-tutorial.pdf: tutorial
+tutorial-pdf: tutorial.pdf
tutorial-html:
chmod u+x $(DOC_SRCDIR)/tools/todoxygen.sh
$(DOC_SRCDIR)/tools/todoxygen.sh $(srcdir)/tutorial.tex $(DOC_BUILDDIR)/tutorial $(DOC_SRCDIR)
+tutorial.pdf:
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/tutorial.tex
+
+
clean-local:
rm -f tutorial.aux tutorial.toc tutorial.log tutorial.bbl tutorial.out
rm -f *~ *blg *.lot
rm -f tutorial.pdf
rm -f *.haux *.hh *.html *.htoc
+ rm -f tutorial.haux tutorial.hh tutorial.html
EXTRA_DIST = \
diff --git a/milena/doc/white_paper/Makefile.am b/milena/doc/white_paper/Makefile.am
index 9e36a18..2dcf5bd 100644
--- a/milena/doc/white_paper/Makefile.am
+++ b/milena/doc/white_paper/Makefile.am
@@ -16,7 +16,7 @@
#
include $(top_srcdir)/milena/doc/doc.mk
-TEXINPUTS = $(DOC_SRCDIR):$(srcdir)/figures:
+TEXINPUTS=$(DOC_SRCDIR):$(srcdir):
PNGS = \
figures/house.png \
@@ -24,30 +24,37 @@ PNGS = \
figures/house_wshed.png \
figures/house_wshed_mean_colors.png
+#FIXME: we want to check if 'figures' exists only once!
.png.eps:
+ test -d figures || mkdir figures
convert $< $@
-.PHONY: white-paper white-paper-html
-white-paper:
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
- TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
+.PHONY: white-paper white-paper-html white-paper-pdf
+
+white-paper: white-paper-pdf white-paper-html
+
-white-paper.pdf: white-paper
+white-paper-pdf: white_paper.pdf
white-paper-html: $(PNGS:png=eps)
- mkdir -p white_paper_html
- TEXINPUTS=$(TEXINPUTS) hevea -O -fix -I $(srcdir)/figures $(srcdir)/white_paper.tex -o white_paper_html/index.html
+ test -d white_paper_html || mkdir white_paper_html
+ TEXINPUTS=$(TEXINPUTS) hevea -O -fix $(srcdir)/white_paper.tex -o white_paper_html/index.html
chmod +x $(top_srcdir)/milena/doc/tools/clearbanner.sh
$(top_srcdir)/milena/doc/tools/clearbanner.sh white_paper_html/index.html
+
+white_paper.pdf:
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(srcdir)/white_paper.tex
+
clean-local:
rm -Rf white_paper_html
- rm -f *.eps
rm -f white_paper_image.*
rm -f white_paper.pdf
rm -f *.log *.idx *.out *.aux
+ rm -Rf figures
EXTRA_DIST = \
white_paper.tex \
diff --git a/milena/doc/white_paper/white_paper.tex b/milena/doc/white_paper/white_paper.tex
index 02467ca..fb230ae 100644
--- a/milena/doc/white_paper/white_paper.tex
+++ b/milena/doc/white_paper/white_paper.tex
@@ -114,10 +114,10 @@ images, that can be used as
\end{itemize}
\begin{center}
- \includegraphics[width=2.5cm]{house}%
- \includegraphics[width=2.5cm]{house_wshed}%
- \includegraphics[width=2.5cm]{house_wshed_mean_colors}%
- \includegraphics[width=2.5cm]{house_rag}%
+ \includegraphics[width=2.5cm]{figures/house}%
+ \includegraphics[width=2.5cm]{figures/house_wshed}%
+ \includegraphics[width=2.5cm]{figures/house_wshed_mean_colors}%
+ \includegraphics[width=2.5cm]{figures/house_rag}%
\end{center}
%=================================================================
--
1.5.6.5
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-11 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Minor fixes in tests/accu Makefile.
* tests/accu/Makefile.am: Minor fixes.
---
Makefile.am | 2 --
1 file changed, 2 deletions(-)
Index: trunk/milena/tests/accu/Makefile.am
===================================================================
--- trunk/milena/tests/accu/Makefile.am (revision 4100)
+++ trunk/milena/tests/accu/Makefile.am (revision 4101)
@@ -45,7 +45,6 @@
all_accus_SOURCES = all_accus.cc
bbox_SOURCES = bbox.cc
compute_SOURCES = compute.cc
-count_SOURCES = count.cc
histo_SOURCES = histo.cc
line_SOURCES = line.cc
max_site_SOURCES = max_site.cc
@@ -60,4 +59,3 @@
tuple_SOURCES = tuple.cc
TESTS = $(check_PROGRAMS)
-# // ACCU_FIXME do not commit
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk
ChangeLog:
2009-06-11 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Update configure.ac with tests/accu/math Makefile.
* configure.ac: Update.
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 4099)
+++ trunk/configure.ac (revision 4100)
@@ -250,6 +250,7 @@
milena/tests/accu/image/Makefile
milena/tests/accu/site_set/Makefile
milena/tests/accu/stat/Makefile
+ milena/tests/accu/math/Makefile
milena/tests/algebra/Makefile
milena/tests/arith/Makefile
milena/tests/binarization/Makefile
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-11 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Move count, sum accus to math directory.
* mln/accu/count.hh,
* mln/accu/sum.hh: Move to...
* mln/accu/math,
* mln/accu/math/count.hh,
* mln/accu/math/sum.hh:
Move accus in math directory.
* mln/accu/all.hh,
* mln/accu/essential.hh,
* mln/accu/math/all.hh,
* mln/accu/math/essential.hh:
Update all.hh, and essential.hh respecting the new location.
* tests/accu/count.cc: Move to...
* tests/accu/math,
* tests/accu/math/count.cc:
Move accus tests in math directory.
* tests/accu/Makefile.am,
* tests/accu/math/Makefile.am:
Update accus Makefiles.
* doc/examples/tuto3/first_routine.cc:
* mln/accu/site_set/rectangularity.hh,
* mln/accu/stat/deviation.hh,
* mln/accu/stat/mean.hh,
* mln/estim/sum.hh,
* mln/labeling/fill_holes.hh,
* mln/registration/icp.hh,
* sandbox/edwin/tree/tree.cc,
* sandbox/fabien/igr/dist_edges.cc,
* sandbox/fabien/igr/filter.cc,
* sandbox/fabien/igr/fixed_seg/main.cc,
* sandbox/fabien/igr/igr.cc,
* sandbox/fabien/igr/matlab.cc,
* sandbox/fabien/igr/mean_median_label.cc,
* sandbox/fabien/igr/seg_vol_irm.hh,
* sandbox/fabien/igr/smooth_fixed_seg/main.cc,
* sandbox/fabien/igr/time_max.cc,
* sandbox/fabien/igr/time_max_norm.cc,
* sandbox/fabien/igr/wst_edges.cc,
* sandbox/fabien/level.cc,
* sandbox/folio/test/histo/project_histo_add.cc,
* sandbox/folio/test/histo/project_screen.cc,
* sandbox/folio/test/histo/projected3d.cc,
* sandbox/fred/old/mean.hh,
* sandbox/garrigues/area_filter_auto_dual.cc,
* sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh,
* sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh,
* sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh,
* sandbox/icdar/2009/hsc/clean_input.hh,
* sandbox/jardonnet/n_cmpt/fused_filter.cc,
* sandbox/jardonnet/n_cmpt/n_cmpt.hh,
* sandbox/jardonnet/n_cmpt/ref_filter.cc,
* sandbox/laurent/ismm2009.cc,
* sandbox/laurent/memo/ismm2009.v0.cc,
* sandbox/laurent/memo/ismm2009.v1.cc,
* sandbox/laurent/memo/ismm2009.v2.cc,
* sandbox/laurent/playing_with_attributes.cc,
* sandbox/lazzara/igr/igr-biggest-comp.cc,
* sandbox/lazzara/igr/igr-cloud.cc,
* sandbox/lazzara/igr/igr.cc,
* sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc,
* sandbox/nivault/extract_character.cc,
* sandbox/nivault/extract_score.cc,
* sandbox/theo/color/filter_blen_rgb_edges.cc,
* sandbox/theo/color/segment_gl_pixels.cc,
* sandbox/theo/color/segment_rgb_edges.cc,
* sandbox/theo/esiee/laurent/ismm09/main.cc,
* sandbox/theo/esiee/laurent/ismm09/trash.hh,
* sandbox/theo/experimental/projected_histo.cc,
* sandbox/theo/publis/icip2009/compute_a.cc,
* sandbox/theo/test_attribute.cc,
* sandbox/theo/tufa_2008/filter_n.cc,
* sandbox/theo/tufa_2008/n_cmpt.cc,
* sandbox/theo/tufa_2008/steps.0.cc,
* sandbox/theo/tufa_2008/steps.1.cc,
* sandbox/theo/tufa_2008/steps.2.cc,
* sandbox/theo/tufa_2008/steps.2b.cc,
* sandbox/theo/tufa_2008/steps.3.cc,
* tests/accu/all_accus.cc,
* tests/accu/compute.cc,
* tests/accu/image/init.cc,
* tests/accu/image/set_value.cc,
* tests/accu/image/take.cc,
* tests/accu/image/take_as_init.cc,
* tests/accu/image/take_n_times.cc,
* tests/accu/image/to_result.cc,
* tests/accu/image/untake.cc,
* tests/accu/transform.cc,
* tests/accu/transform_diagonal.cc,
* tests/accu/transform_directional.cc,
* tests/accu/transform_line.cc,
* tests/accu/transform_snake.cc,
* tests/accu/tuple.cc,
* tests/labeling/compute.cc,
* tests/labeling/n_max.cc,
* tests/labeling/value.cc,
* tests/morpho/closing/algebraic.cc,
* tests/morpho/opening/algebraic.cc,
* tests/set/compute.cc:
Replace accu::accu_name by accu::math::accu_name,
accu::meta::accu_name by accu::meta::math::accu_name,
accu/accu_name.hh by accu/math/accu_name.hh.
---
doc/examples/tuto3/first_routine.cc | 6
mln/accu/all.hh | 2
mln/accu/essential.hh | 2
mln/accu/math/all.hh | 58 ++
mln/accu/math/count.hh | 221 +++++++++
mln/accu/math/essential.hh | 36 +
mln/accu/math/sum.hh | 226 ++++++++++
mln/accu/site_set/rectangularity.hh | 8
mln/accu/stat/deviation.hh | 12
mln/accu/stat/mean.hh | 8
mln/estim/sum.hh | 6
mln/labeling/fill_holes.hh | 4
mln/registration/icp.hh | 4
sandbox/edwin/tree/tree.cc | 4
sandbox/fabien/igr/dist_edges.cc | 4
sandbox/fabien/igr/filter.cc | 6
sandbox/fabien/igr/fixed_seg/main.cc | 6
sandbox/fabien/igr/igr.cc | 4
sandbox/fabien/igr/matlab.cc | 8
sandbox/fabien/igr/mean_median_label.cc | 2
sandbox/fabien/igr/seg_vol_irm.hh | 10
sandbox/fabien/igr/smooth_fixed_seg/main.cc | 4
sandbox/fabien/igr/time_max.cc | 4
sandbox/fabien/igr/time_max_norm.cc | 4
sandbox/fabien/igr/wst_edges.cc | 2
sandbox/fabien/level.cc | 4
sandbox/folio/test/histo/project_histo_add.cc | 6
sandbox/folio/test/histo/project_screen.cc | 6
sandbox/folio/test/histo/projected3d.cc | 6
sandbox/fred/old/mean.hh | 4
sandbox/garrigues/area_filter_auto_dual.cc | 4
sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh | 2
sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh | 2
sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh | 2
sandbox/icdar/2009/hsc/clean_input.hh | 4
sandbox/jardonnet/n_cmpt/fused_filter.cc | 4
sandbox/jardonnet/n_cmpt/n_cmpt.hh | 4
sandbox/jardonnet/n_cmpt/ref_filter.cc | 4
sandbox/laurent/ismm2009.cc | 4
sandbox/laurent/memo/ismm2009.v0.cc | 4
sandbox/laurent/memo/ismm2009.v1.cc | 4
sandbox/laurent/memo/ismm2009.v2.cc | 4
sandbox/laurent/playing_with_attributes.cc | 4
sandbox/lazzara/igr/igr-biggest-comp.cc | 4
sandbox/lazzara/igr/igr-cloud.cc | 2
sandbox/lazzara/igr/igr.cc | 2
sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc | 2
sandbox/nivault/extract_character.cc | 2
sandbox/nivault/extract_score.cc | 2
sandbox/theo/color/filter_blen_rgb_edges.cc | 2
sandbox/theo/color/segment_gl_pixels.cc | 2
sandbox/theo/color/segment_rgb_edges.cc | 4
sandbox/theo/esiee/laurent/ismm09/main.cc | 2
sandbox/theo/esiee/laurent/ismm09/trash.hh | 2
sandbox/theo/experimental/projected_histo.cc | 4
sandbox/theo/publis/icip2009/compute_a.cc | 6
sandbox/theo/test_attribute.cc | 6
sandbox/theo/tufa_2008/filter_n.cc | 4
sandbox/theo/tufa_2008/n_cmpt.cc | 4
sandbox/theo/tufa_2008/steps.0.cc | 4
sandbox/theo/tufa_2008/steps.1.cc | 4
sandbox/theo/tufa_2008/steps.2.cc | 4
sandbox/theo/tufa_2008/steps.2b.cc | 4
sandbox/theo/tufa_2008/steps.3.cc | 4
tests/accu/Makefile.am | 5
tests/accu/all_accus.cc | 4
tests/accu/compute.cc | 4
tests/accu/image/init.cc | 4
tests/accu/image/set_value.cc | 4
tests/accu/image/take.cc | 4
tests/accu/image/take_as_init.cc | 4
tests/accu/image/take_n_times.cc | 4
tests/accu/image/to_result.cc | 4
tests/accu/image/untake.cc | 4
tests/accu/math/Makefile.am | 27 +
tests/accu/math/count.cc | 61 ++
tests/accu/transform.cc | 6
tests/accu/transform_diagonal.cc | 6
tests/accu/transform_directional.cc | 4
tests/accu/transform_line.cc | 4
tests/accu/transform_snake.cc | 4
tests/accu/tuple.cc | 4
tests/labeling/compute.cc | 12
tests/labeling/n_max.cc | 4
tests/labeling/value.cc | 4
tests/morpho/closing/algebraic.cc | 2
tests/morpho/opening/algebraic.cc | 2
tests/set/compute.cc | 4
88 files changed, 802 insertions(+), 176 deletions(-)
Index: trunk/milena/mln/accu/sum.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/count.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/site_set/rectangularity.hh
===================================================================
--- trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4098)
+++ trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4099)
@@ -32,7 +32,7 @@
# include <mln/accu/internal/couple.hh>
# include <mln/accu/bbox.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
namespace mln
{
@@ -50,7 +50,7 @@
template <typename P>
class rectangularity
: public accu::internal::couple<accu::bbox<P>,
- accu::count<P>,
+ accu::math::count<P>,
float,
rectangularity<P> >
{
@@ -58,12 +58,12 @@
public:
typedef accu::internal::couple<accu::bbox<P>,
- accu::count<P>,
+ accu::math::count<P>,
float,
rectangularity<P> > super_;
typedef accu::bbox<P> A1;
- typedef accu::count<P> A2;
+ typedef accu::math::count<P> A2;
typedef float result;
Index: trunk/milena/mln/accu/math/sum.hh
===================================================================
--- trunk/milena/mln/accu/math/sum.hh (revision 0)
+++ trunk/milena/mln/accu/math/sum.hh (revision 4099)
@@ -0,0 +1,226 @@
+// Copyright (C) 2007, 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_ACCU_MATH_SUM_HH
+# define MLN_ACCU_MATH_SUM_HH
+
+/// \file
+///
+/// Define an accumulator that computes a sum.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+# include <mln/util/pix.hh> // To prevent accu::math::sum to work on pixels (ambiguous).
+
+# include <mln/trait/value_.hh> // For mln_sum.
+# include <mln/value/builtin/all.hh> // In the case of summing builtin values.
+# include <mln/literal/zero.hh> // For initialization.
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace math
+ {
+
+ // Forward declaration.
+ template <typename T, typename S>
+ struct sum;
+
+ } // end of namespace mln::accu::math
+
+ namespace meta
+ {
+
+ namespace math
+ {
+
+ /// Meta accumulator for sum.
+ struct sum : public Meta_Accumulator< sum >
+ {
+ template <typename T, typename S = mln_sum(T)>
+ struct with
+ {
+ typedef accu::math::sum<T, S> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::math
+
+ } // end of namespace mln::accu::meta
+
+ } // end of namespace mln::accu
+
+ // Traits.
+ namespace trait
+ {
+
+ template <typename T, typename S>
+ struct accumulator_< accu::math::sum<T,S> >
+ {
+ typedef accumulator::has_untake::yes has_untake;
+ typedef accumulator::has_set_value::yes has_set_value;
+ typedef accumulator::has_stop::no has_stop;
+ typedef accumulator::when_pix::not_ok when_pix;
+ };
+
+ } // end of namespace mln::trait
+
+
+ namespace accu
+ {
+
+ namespace math
+ {
+
+ /// \brief Generic sum accumulator class.
+ ///
+ /// Parameter \c T is the type of values that we sum. Parameter \c
+ /// S is the type to store the value sum; the default type of
+ /// \c S is the summation type (property) of \c T.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ template <typename T, typename S = mln_sum(T)>
+ struct sum : public mln::accu::internal::base< const S&, sum<T,S> >
+ {
+ typedef T argument;
+
+ sum();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument& t);
+ void take_as_init_(const argument& t);
+ void take(const sum<T,S>& other);
+
+ void untake(const argument& t);
+ void set_value(const S& s);
+ /// \}
+
+ /// Get the value of the accumulator.
+ const S& to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+
+ S s_;
+ };
+
+
+ template <typename I, typename S>
+ struct sum< util::pix<I>, S >;
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+
+ template <typename T, typename S>
+ inline
+ sum<T,S>::sum()
+ {
+ init();
+ }
+
+ template <typename T, typename S>
+ inline
+ void
+ sum<T,S>::init()
+ {
+ s_ = literal::zero;
+ }
+
+ template <typename T, typename S>
+ inline
+ void sum<T,S>::take(const argument& t)
+ {
+ s_ += static_cast<S>(t);
+ }
+
+ template <typename T, typename S>
+ inline
+ void sum<T,S>::untake(const argument& t)
+ {
+ s_ -= static_cast<S>(t);
+ }
+
+ template <typename T, typename S>
+ inline
+ void sum<T,S>::take_as_init_(const argument& t)
+ {
+ s_ = static_cast<S>(t);
+ }
+
+ template <typename T, typename S>
+ inline
+ void
+ sum<T,S>::take(const sum<T,S>& other)
+ {
+ s_ += other.s_;
+ }
+
+ template <typename T, typename S>
+ inline
+ const S&
+ sum<T,S>::to_result() const
+ {
+ return s_;
+ }
+
+ template <typename T, typename S>
+ inline
+ void
+ sum<T,S>::set_value(const S& s)
+ {
+ s_ = s;
+ }
+
+ template <typename T, typename S>
+ inline
+ bool
+ sum<T,S>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::math
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_MATH_SUM_HH
Property changes on: trunk/milena/mln/accu/math/sum.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/math/essential.hh
===================================================================
--- trunk/milena/mln/accu/math/essential.hh (revision 0)
+++ trunk/milena/mln/accu/math/essential.hh (revision 4099)
@@ -0,0 +1,36 @@
+// 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_ACCU_MATH_ESSENTIAL_HH
+# define MLN_ACCU_MATH_ESSENTIAL_HH
+
+/// \file
+///
+/// File that includes the most useful mathematic accumulator types.
+
+# include <mln/accu/math/count.hh>
+# include <mln/accu/math/sum.hh>
+
+#endif // ! MLN_ACCU_MATH_ESSENTIAL_HH
Property changes on: trunk/milena/mln/accu/math/essential.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/math/all.hh
===================================================================
--- trunk/milena/mln/accu/math/all.hh (revision 0)
+++ trunk/milena/mln/accu/math/all.hh (revision 4099)
@@ -0,0 +1,58 @@
+// 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_ACCU_MATH_ALL_HH
+# define MLN_ACCU_MATH_ALL_HH
+
+/// \file
+///
+/// File that includes all mathematic accumulator types.
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace meta
+ {
+
+ /// Namespace of mathematic meta-accumulators.
+ namespace math {}
+
+ } // end of namespace mln::accu::meta
+
+ /// Namespace of mathematic accumulators.
+ namespace math {}
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+# include <mln/accu/math/sum.hh>
+# include <mln/accu/math/count.hh>
+
+#endif // ! MLN_ACCU_MATH_ALL_HH
Index: trunk/milena/mln/accu/math/count.hh
===================================================================
--- trunk/milena/mln/accu/math/count.hh (revision 0)
+++ trunk/milena/mln/accu/math/count.hh (revision 4099)
@@ -0,0 +1,221 @@
+// Copyright (C) 2007, 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_ACCU_MATH_COUNT_HH
+# define MLN_ACCU_MATH_COUNT_HH
+
+/// \file
+///
+/// Define an accumulator that counts.
+
+# include <mln/accu/internal/base.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace math
+ {
+
+ // Forward declaration.
+ template <typename T>
+ struct count;
+
+ } // end of namespace mln::accu::math
+
+
+ namespace meta
+ {
+
+ namespace math
+ {
+
+ /// Meta accumulator for count.
+ struct count : public Meta_Accumulator< count >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::math::count<T> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::math
+
+ } // end of namespace mln::accu::meta
+
+ } // end of namespace mln::accu
+
+ // Traits.
+ namespace trait
+ {
+
+ template <typename T>
+ struct accumulator_< accu::math::count<T> >
+ {
+ typedef accumulator::has_untake::yes has_untake;
+ typedef accumulator::has_set_value::yes has_set_value;
+ typedef accumulator::has_stop::no has_stop;
+ typedef accumulator::when_pix::use_pix when_pix;
+ };
+
+ } // end of namespace mln::trait
+
+
+ namespace accu
+ {
+
+ namespace math
+ {
+
+ /// \brief Generic counter accumulator.
+ /// The parameter \a T is the type to be count.
+ ///
+ /// \ingroup modaccusiteset
+ //
+ template <typename T>
+ struct count : public mln::accu::internal::base< unsigned , count<T> >
+ {
+ typedef T argument;
+
+ count();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument&);
+ void take(const count<T>& other);
+
+ void untake(const argument&);
+ void untake(const count<T>& other);
+
+ /// Force the value of the counter to \a c.
+ void set_value(unsigned c);
+ /// \}
+
+ /// Get the value of the accumulator.
+ unsigned to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+ /// The value of the counter.
+ unsigned count_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+
+ template <typename T>
+ inline
+ count<T>::count()
+ {
+ init();
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::init()
+ {
+ count_ = 0;
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::take(const argument&)
+ {
+ ++count_;
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::untake(const argument&)
+ {
+ mln_precondition(count_ > 0);
+ --count_;
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::take(const count<T>& other)
+ {
+ count_ += other.count_;
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::untake(const count<T>& other)
+ {
+ mln_precondition(other.count_ <= count_);
+ count_ -= other.count_;
+ }
+
+ template <typename T>
+ inline
+ unsigned
+ count<T>::to_result() const
+ {
+ return count_;
+ }
+
+ template <typename T>
+ inline
+ void
+ count<T>::set_value(unsigned c)
+ {
+ count_ = c;
+ }
+
+ template <typename T>
+ inline
+ bool
+ count<T>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::math
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_MATH_COUNT_HH
Property changes on: trunk/milena/mln/accu/math/count.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/all.hh
===================================================================
--- trunk/milena/mln/accu/all.hh (revision 4098)
+++ trunk/milena/mln/accu/all.hh (revision 4099)
@@ -54,7 +54,6 @@
# include <mln/accu/bbox.hh>
-# include <mln/accu/count.hh>
# include <mln/accu/count_labels.hh>
# include <mln/accu/center.hh>
// << # include <mln/accu/count_adjacent_vertices.hh> >>
@@ -66,7 +65,6 @@
# include <mln/accu/pair.hh>
# include <mln/accu/rank.hh>
# include <mln/accu/rms.hh>
-# include <mln/accu/sum.hh>
// << # include <mln/accu/tuple.hh> >>
# include <mln/accu/volume.hh>
Index: trunk/milena/mln/accu/essential.hh
===================================================================
--- trunk/milena/mln/accu/essential.hh (revision 4098)
+++ trunk/milena/mln/accu/essential.hh (revision 4099)
@@ -32,10 +32,8 @@
# include <mln/accu/bbox.hh>
# include <mln/accu/center.hh>
-# include <mln/accu/count.hh>
# include <mln/accu/histo.hh>
# include <mln/accu/rank.hh>
-# include <mln/accu/sum.hh>
# include <mln/accu/stat/essential.hh>
# include <mln/accu/image/essential.hh>
Index: trunk/milena/mln/accu/stat/deviation.hh
===================================================================
--- trunk/milena/mln/accu/stat/deviation.hh (revision 4098)
+++ trunk/milena/mln/accu/stat/deviation.hh (revision 4099)
@@ -31,8 +31,8 @@
/// Define an accumulator that computes a standard deviation.
# include <mln/accu/internal/base.hh>
-# include <mln/accu/count.hh>
-# include <mln/accu/sum.hh>
+# include <mln/accu/math/count.hh>
+# include <mln/accu/math/sum.hh>
# include <mln/math/sqr.hh>
# include <mln/math/sqrt.hh>
@@ -83,8 +83,8 @@
protected:
- accu::count<T> count_;
- accu::sum<T,S> sum_;
+ accu::math::count<T> count_;
+ accu::math::sum<T,S> sum_;
T mean_;
};
@@ -136,7 +136,7 @@
void deviation<T,S,M>::take(const argument& t)
{
count_.take(t);
- sum_.take(math::sqr(t - mean_));
+ sum_.take(mln::math::sqr(t - mean_));
}
template <typename T, typename S, typename M>
@@ -157,7 +157,7 @@
unsigned n = count_.to_result();
if (n == 0u)
return M(); // Safety.
- return static_cast<M>(math::sqrt(sum_.to_result() / n));
+ return static_cast<M>(mln::math::sqrt(sum_.to_result() / n));
}
template <typename T, typename S, typename M>
Index: trunk/milena/mln/accu/stat/mean.hh
===================================================================
--- trunk/milena/mln/accu/stat/mean.hh (revision 4098)
+++ trunk/milena/mln/accu/stat/mean.hh (revision 4099)
@@ -33,8 +33,8 @@
/// \todo Use accu::pair just like in accu::stat::min_max.
# include <mln/accu/internal/base.hh>
-# include <mln/accu/count.hh>
-# include <mln/accu/sum.hh>
+# include <mln/accu/math/count.hh>
+# include <mln/accu/math/sum.hh>
namespace mln
@@ -114,8 +114,8 @@
protected:
- accu::count<T> count_;
- accu::sum<T,S> sum_;
+ accu::math::count<T> count_;
+ accu::math::sum<T,S> sum_;
};
Index: trunk/milena/mln/estim/sum.hh
===================================================================
--- trunk/milena/mln/estim/sum.hh (revision 4098)
+++ trunk/milena/mln/estim/sum.hh (revision 4099)
@@ -32,7 +32,7 @@
///
/// \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous.
-# include <mln/accu/sum.hh>
+# include <mln/accu/math/sum.hh>
# include <mln/data/compute.hh>
@@ -67,7 +67,7 @@
mln_sum(mln_value(I)) sum(const Image<I>& input)
{
mln_precondition(exact(input).is_valid());
- return data::compute(accu::meta::sum(), input);
+ return data::compute(accu::meta::math::sum(), input);
}
template <typename I, typename S>
@@ -75,7 +75,7 @@
void sum(const Image<I>& input, S& result)
{
mln_precondition(exact(input).is_valid());
- accu::sum<mln_value(I), S> a;
+ accu::math::sum<mln_value(I), S> a;
result = data::compute(a, input);
}
Index: trunk/milena/mln/registration/icp.hh
===================================================================
--- trunk/milena/mln/registration/icp.hh (revision 4098)
+++ trunk/milena/mln/registration/icp.hh (revision 4099)
@@ -64,7 +64,7 @@
# include <mln/debug/histo.hh>
# include <mln/accu/histo.hh>
-# include <mln/accu/sum.hh>
+# include <mln/accu/math/sum.hh>
# include <mln/value/int_u16.hh>
@@ -378,7 +378,7 @@
float sd;
{
- accu::sum<float> s, s2;
+ accu::math::sum<float> s, s2;
for_all(p)
{
vec3d_f Pk_i = pair.first.rotate(p.to_vec()) + pair.second;
Index: trunk/milena/mln/labeling/fill_holes.hh
===================================================================
--- trunk/milena/mln/labeling/fill_holes.hh (revision 4098)
+++ trunk/milena/mln/labeling/fill_holes.hh (revision 4099)
@@ -34,7 +34,7 @@
# include <mln/labeling/compute.hh>
# include <mln/core/image/dmorph/image_if.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
namespace mln
@@ -83,7 +83,7 @@
mln_ch_value(I, L) lbls = labeling::background(input, nbh, nlabels);
- accu::count<mln_value(I)> a_;
+ accu::math::count<mln_value(I)> a_;
util::array<unsigned> arr = labeling::compute(a_, input, lbls, nlabels);
unsigned bg_count = 0;
Index: trunk/milena/sandbox/fred/old/mean.hh
===================================================================
--- trunk/milena/sandbox/fred/old/mean.hh (revision 4098)
+++ trunk/milena/sandbox/fred/old/mean.hh (revision 4099)
@@ -70,7 +70,7 @@
namespace internal {
template <typename T, typename S>
- struct sum_set_value : public mln::accu::sum<T, S>
+ struct sum_set_value : public mln::accu::math::sum<T, S>
{
void set_value(const S& s);
};
@@ -108,7 +108,7 @@
protected:
- accu::count<value> count_;
+ accu::math::count<value> count_;
internal::sum_set_value<value,result> sum_;
};
Index: trunk/milena/sandbox/nivault/extract_score.cc
===================================================================
--- trunk/milena/sandbox/nivault/extract_score.cc (revision 4098)
+++ trunk/milena/sandbox/nivault/extract_score.cc (revision 4099)
@@ -55,7 +55,7 @@
# include <mln/accu/stat/mean.hh>
# include <mln/accu/bbox.hh>
# include <mln/accu/p.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/value/scalar.hh>
# include <mln/make/voronoi.hh>
Index: trunk/milena/sandbox/nivault/extract_character.cc
===================================================================
--- trunk/milena/sandbox/nivault/extract_character.cc (revision 4098)
+++ trunk/milena/sandbox/nivault/extract_character.cc (revision 4099)
@@ -53,7 +53,7 @@
# include <mln/accu/stat/mean.hh>
# include <mln/accu/bbox.hh>
# include <mln/accu/p.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/value/scalar.hh>
# include <mln/make/voronoi.hh>
Index: trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4098)
+++ trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4099)
@@ -4,7 +4,7 @@
#include <mln/labeling/background.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/bbox.hh>
#include <mln/fun/i2v/array.hh>
@@ -22,7 +22,7 @@
typedef value::label_16 L;
L nlabels;
image2d<L> lab = labeling::background(input, c8(), nlabels);
- util::array<unsigned> count = labeling::compute(accu::count<point2d>(), lab, nlabels);
+ util::array<unsigned> count = labeling::compute(accu::math::count<point2d>(), lab, nlabels);
util::array<box2d> box = labeling::compute(accu::bbox<point2d>(), lab, nlabels);
fun::i2v::array<bool> ok(nlabels.next(), false); // default is text
Index: trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc (revision 4098)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc (revision 4099)
@@ -8,7 +8,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -243,7 +243,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
Index: trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc (revision 4098)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc (revision 4099)
@@ -8,7 +8,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -216,7 +216,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4098)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4099)
@@ -33,7 +33,7 @@
# include <mln/data/fill.hh>
# include <mln/util/pix.hh>
# include <mln/data/sort_psites.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/accu/volume.hh>
namespace mln
@@ -76,7 +76,7 @@
typedef mln_psite(I) P;
typedef accu::volume<I> A;
- //typedef accu::count<unsigned> A;
+ //typedef accu::math::count<unsigned> A;
typedef mln_psite(I) P;
typedef p_array<P> S;
Index: trunk/milena/sandbox/fabien/igr/mean_median_label.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 4099)
@@ -20,7 +20,7 @@
#include <mln/value/label_16.hh>
#include <mln/value/rgb8.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/all.hh>
#include <mln/accu/stat/deviation.hh>
Index: trunk/milena/sandbox/fabien/igr/time_max_norm.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/time_max_norm.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/time_max_norm.cc (revision 4099)
@@ -13,9 +13,9 @@
#include <mln/io/dump/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/all.hh>
#include <mln/arith/minus.hh>
Index: trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc (revision 4099)
@@ -19,7 +19,7 @@
#include <mln/value/int_u12.hh>
#include <mln/value/label_16.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/all.hh>
#include <mln/data/fill.hh>
@@ -106,7 +106,7 @@
{
float res = 0.f;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
image1d<V> tmp_ima;
convert::from_to(v1, tmp_ima);
Index: trunk/milena/sandbox/fabien/igr/time_max.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/time_max.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/time_max.cc (revision 4099)
@@ -11,9 +11,9 @@
#include <mln/io/dicom/load.hh>
#include <mln/io/magick/save.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/all.hh>
#include <mln/arith/minus.hh>
Index: trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh
===================================================================
--- trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4099)
@@ -72,10 +72,10 @@
#include <mln/fun/v2b/threshold.hh>
#include <mln/data/transform.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/center.hh>
#include <mln/accu/stat/max.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/stat/deviation.hh>
@@ -234,13 +234,13 @@
/*label_16 nlabels = 0;
mln_ch_value(I, label_16) bg_labels = labeling::foreground(ima_bg, nbh, nlabels);
- accu::count<int_u8> ab_;
+ accu::math::count<int_u8> ab_;
util::array<unsigned> arr_b_label = labeling::compute(ab_, ima_bg, bg_labels, nlabels);
util::array<label_16> arr_b_big = labeling::n_max<label_16>(arr_b_label, 1);
data::fill((ima_bg | (pw::value(bg_labels) != pw::cst(arr_b_big[1]))).rw(), false);
mln_ch_value(I, label_16) obj_labels = labeling::foreground(ima_obj, nbh, nlabels);
- accu::count<int_u8> ao_;
+ accu::math::count<int_u8> ao_;
util::array<unsigned> arr_o_label = labeling::compute(ao_, ima_obj, obj_labels, nlabels);
util::array<label_16> arr_o_big = labeling::n_max<label_16>(arr_o_label, 1);
data::fill((ima_obj | (pw::value(obj_labels) != pw::cst(arr_o_big[1]))).rw(), false);*/
@@ -265,7 +265,7 @@
histo::array<mln_value(I)> bg_histo = histo::compute(input | pw::value(ima_bg) == true);
histo::array<mln_value(I)> obj_histo = histo::compute(input | pw::value(ima_obj) == true);
- accu::sum<unsigned> sum_accu;
+ accu::math::sum<unsigned> sum_accu;
image1d<unsigned> ima_bg_histo;
convert::from_to(bg_histo, ima_bg_histo);
ima_bg_histo(point1d(0)) = 0;
Index: trunk/milena/sandbox/fabien/igr/wst_edges.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 4099)
@@ -20,7 +20,7 @@
#include <mln/value/label_16.hh>
#include <mln/value/rgb8.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/all.hh>
#include <mln/accu/stat/deviation.hh>
Index: trunk/milena/sandbox/fabien/igr/matlab.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/matlab.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/matlab.cc (revision 4099)
@@ -9,9 +9,9 @@
#include <mln/io/dicom/load.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/all.hh>
#include <mln/arith/minus.hh>
#include <mln/arith/all.hh>
@@ -80,7 +80,7 @@
// Mesure bruit de fond pour seuiller
// calculé sur la première image
image2d<bool> roi_noise; // FIXME: init this ROI, should be a domain
- accu::count<bool> accu_nbrpix1;
+ accu::math::count<bool> accu_nbrpix1;
unsigned nbrpix1 = data::compute(accu_nbrpix1, roi_noise);
image2d<float> datasli = arr_ima[0];
@@ -186,7 +186,7 @@
std::cout << "kk = " << kk << std::endl;
- image2d<accu::sum<float> > accu_sum;
+ image2d<accu::math::sum<float> > accu_sum;
accu::image::init(accu_sum);
for (int k = 0; k < dim3; ++k)
accu::image::take(accu_sum, arr_smooth[k]);
Index: trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc (revision 4099)
@@ -20,7 +20,7 @@
#include <mln/value/label_16.hh>
#include <mln/value/rgb8.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/all.hh>
#include <mln/accu/stat/deviation.hh>
@@ -135,7 +135,7 @@
image1d<V> tmp_ima;
image1d<V> tmp_ima2;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
convert::from_to(v1, tmp_ima);
float sum_v1 = data::compute(accu_sum, tmp_ima);
@@ -166,7 +166,7 @@
{
float res = 0.f;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
image1d<V> tmp_ima;
convert::from_to(v1, tmp_ima);
Index: trunk/milena/sandbox/fabien/igr/dist_edges.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 4099)
@@ -17,7 +17,7 @@
#include <mln/value/int_u8.hh>
#include <mln/value/int_u12.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/arith/div.hh>
#include <mln/convert/from_to.hh>
#include <mln/data/compute.hh>
@@ -83,7 +83,7 @@
image1d<V> tmp_ima;
image1d<V> tmp_ima2;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
convert::from_to(v1, tmp_ima);
double sum_v1 = data::compute(accu_sum, tmp_ima);
Index: trunk/milena/sandbox/fabien/igr/igr.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/igr.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/igr.cc (revision 4099)
@@ -62,7 +62,7 @@
#include <mln/fun/v2b/threshold.hh>
#include <mln/data/transform.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/center.hh>
#include <mln/set/compute.hh>
#include <mln/value/label_16.hh>
@@ -111,7 +111,7 @@
// Labeling.
mln_ch_value(I, L) labels = labeling::flat_zones(threshold, nbh, nlabels);
- accu::count<int_u8> a_;
+ accu::math::count<int_u8> a_;
util::array<unsigned> a = labeling::compute(a_, threshold, labels, nlabels);
// We keep the third and second biggest object.
Index: trunk/milena/sandbox/fabien/igr/filter.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/filter.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/igr/filter.cc (revision 4099)
@@ -20,7 +20,7 @@
#include <mln/value/label_16.hh>
#include <mln/value/rgb8.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/all.hh>
#include <mln/accu/stat/deviation.hh>
@@ -110,7 +110,7 @@
image1d<V> tmp_ima;
image1d<V> tmp_ima2;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
convert::from_to(v1, tmp_ima);
float sum_v1 = data::compute(accu_sum, tmp_ima);
@@ -141,7 +141,7 @@
{
float res = 0.f;
- accu::sum<V> accu_sum;
+ accu::math::sum<V> accu_sum;
image1d<V> tmp_ima;
convert::from_to(v1, tmp_ima);
Index: trunk/milena/sandbox/fabien/level.cc
===================================================================
--- trunk/milena/sandbox/fabien/level.cc (revision 4098)
+++ trunk/milena/sandbox/fabien/level.cc (revision 4099)
@@ -35,7 +35,7 @@
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/compute.hh>
#include "level.hh"
@@ -61,7 +61,7 @@
{
image2d<unsigned> labels = labeling::value(lena, l, c4(), n);
unsigned npix =
- accu::compute(accu::meta::count(),
+ accu::compute(accu::meta::math::count(),
labels | (pw::value(labels) != pw::cst(0u)));
npixels += npix;
}
Index: trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh
===================================================================
--- trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh (revision 4098)
+++ trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh (revision 4099)
@@ -33,7 +33,7 @@
# include <mln/data/fill.hh>
# include <mln/literal/zero.hh>
# include <mln/convert/to_upper_window.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/util/pix.hh>
# include <mln/core/alias/neighb2d.hh>
Index: trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh
===================================================================
--- trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh (revision 4098)
+++ trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh (revision 4099)
@@ -33,7 +33,7 @@
# include <mln/data/fill.hh>
# include <mln/literal/zero.hh>
# include <mln/convert/to_upper_window.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/util/pix.hh>
# include <mln/core/alias/neighb2d.hh>
Index: trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh
===================================================================
--- trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh (revision 4098)
+++ trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh (revision 4099)
@@ -33,7 +33,7 @@
# include <mln/data/fill.hh>
# include <mln/literal/zero.hh>
# include <mln/convert/to_upper_window.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/util/pix.hh>
# include <mln/core/alias/neighb2d.hh>
Index: trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc
===================================================================
--- trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc (revision 4098)
+++ trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc (revision 4099)
@@ -33,7 +33,7 @@
# include <mln/data/fill.hh>
# include <mln/literal/zero.hh>
# include <mln/convert/to_upper_window.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/util/pix.hh>
# include <mln/core/alias/neighb2d.hh>
@@ -187,7 +187,7 @@
typedef image2d<bool> I;
typedef util::pix<I> pix_t;
- typedef accu::count<pix_t> A;
+ typedef accu::math::count<pix_t> A;
typedef mln_psite_(I) P;
typedef p_array<P> S;
Index: trunk/milena/sandbox/theo/test_attribute.cc
===================================================================
--- trunk/milena/sandbox/theo/test_attribute.cc (revision 4098)
+++ trunk/milena/sandbox/theo/test_attribute.cc (revision 4099)
@@ -45,7 +45,7 @@
#include <mln/morpho/closing_area.hh>
#include <mln/morpho/opening_area.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/io/pbm/save.hh>
@@ -84,14 +84,14 @@
{
S s = data::sort_psites_increasing(f);
morpho::tree::data<I,S> t(f, s, c4());
- accu::count<Px> a;
+ accu::math::count<Px> a;
area_inc = morpho::tree::compute_attribute_image(a, t);
debug::println("area_inc =", area_inc);
}
{
S s = data::sort_psites_decreasing(f);
morpho::tree::data<I,S> t(f, s, c4());
- accu::count<Px> a;
+ accu::math::count<Px> a;
area_dec = morpho::tree::compute_attribute_image(a, t);
debug::println("area_dec =", area_dec);
}
Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4098)
+++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4099)
@@ -99,7 +99,7 @@
// << std::endl;
// }
-// // accu::count< util::pix<g_t> > a_;
+// // accu::math::count< util::pix<g_t> > a_;
// accu::height<g_t> a_;
// compute_attribute_extincted(g, cplx2d::e2e(), a_,
Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc (revision 4098)
+++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc (revision 4099)
@@ -11,7 +11,7 @@
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/morpho/attribute/height.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include "pseudo_tree.hh"
#include "cplx2d.hh"
Index: trunk/milena/sandbox/theo/experimental/projected_histo.cc
===================================================================
--- trunk/milena/sandbox/theo/experimental/projected_histo.cc (revision 4098)
+++ trunk/milena/sandbox/theo/experimental/projected_histo.cc (revision 4099)
@@ -8,7 +8,7 @@
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/pw/value.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
@@ -50,7 +50,7 @@
io::pbm::load(pic, "../../../img/fly.pbm");
debug::println(pic);
- typedef accu::count<bool> A;
+ typedef accu::math::count<bool> A;
image1d<A> h(pic.ncols());
accu::image::init(h);
Index: trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc
===================================================================
--- trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc (revision 4098)
+++ trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc (revision 4099)
@@ -50,7 +50,7 @@
#include <mln/morpho/elementary/gradient.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/opt/at.hh>
#include <mln/set/card.hh>
@@ -342,7 +342,7 @@
mln_invariant((nchildren | t.domain()) == nc_ref);
- accu::count< util::pix<I> > fixme_;
+ accu::math::count< util::pix<I> > fixme_;
mln_ch_value(I, mln_result(A)) a_ref;
a_ref = morpho::tree::compute_attribute_image(fixme_, t);
mln_assertion(a == a_ref);
@@ -557,7 +557,7 @@
debug::println("f (gradient)", f);
- typedef accu::count<point2d> A;
+ typedef accu::math::count<point2d> A;
typedef mln_result_(A) L;
A area;
Index: trunk/milena/sandbox/theo/tufa_2008/steps.0.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/steps.0.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/steps.0.cc (revision 4099)
@@ -37,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/morpho/closing_area.hh>
@@ -154,7 +154,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
I g = filtering(f, a, c4(), 10);
Index: trunk/milena/sandbox/theo/tufa_2008/steps.1.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/steps.1.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/steps.1.cc (revision 4099)
@@ -37,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -258,7 +258,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
run_run(f, a, c4());
Index: trunk/milena/sandbox/theo/tufa_2008/steps.2.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/steps.2.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/steps.2.cc (revision 4099)
@@ -37,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -233,7 +233,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
Index: trunk/milena/sandbox/theo/tufa_2008/steps.3.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/steps.3.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/steps.3.cc (revision 4099)
@@ -37,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -178,7 +178,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
run_run(f, a, c4());
Index: trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc (revision 4099)
@@ -37,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <set>
#include <mln/labeling/regional_minima.hh>
@@ -177,7 +177,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
run_run(f, a, c4());
Index: trunk/milena/sandbox/theo/tufa_2008/filter_n.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/filter_n.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/filter_n.cc (revision 4099)
@@ -39,7 +39,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/set.hh>
#include <mln/labeling/regional_minima.hh>
@@ -335,7 +335,7 @@
typedef morpho::tree::data<I,S> tree_t;
tree_t t(f, s, nbh);
- accu::count< util::pix<I> > attr;
+ accu::math::count< util::pix<I> > attr;
I g = get_attribute_image(attr, t, nbh, n, echo);
io::pgm::save(g, argv[3]);
}
Index: trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4098)
+++ trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4099)
@@ -42,7 +42,7 @@
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/accu/volume.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
namespace mln
@@ -255,7 +255,7 @@
unsigned n = std::atoi(argv[2]);
- accu::count< util::pix<I> > acc;
+ accu::math::count< util::pix<I> > acc;
// accu::volume<I> acc;
image2d<int_u8> g = n_cmpt(acc, f, c4(), n + 1);
Index: trunk/milena/sandbox/theo/color/segment_rgb_edges.cc
===================================================================
--- trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4098)
+++ trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4099)
@@ -22,7 +22,7 @@
#include <mln/morpho/meyer_wst.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/volume.hh>
#include <mln/accu/stat/mean.hh>
@@ -283,7 +283,7 @@
typedef f_t I;
- // accu::count< util::pix<I> > a_;
+ // accu::math::count< util::pix<I> > a_;
// accu::volume<I> a_;
// accu::sum_pix< util::pix<I> > a_;
Index: trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc
===================================================================
--- trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4098)
+++ trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/morpho/watershed/flooding.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/volume.hh>
#include <mln/accu/stat/mean.hh>
Index: trunk/milena/sandbox/theo/color/segment_gl_pixels.cc
===================================================================
--- trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4098)
+++ trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4099)
@@ -86,7 +86,7 @@
- // accu::count< util::pix<I> > a_;
+ // accu::math::count< util::pix<I> > a_;
// accu::sum_pix< util::pix<I> > a_;
// accu::volume<I> a_;
accu::height<I> a_;
Index: trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc
===================================================================
--- trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc (revision 4098)
+++ trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc (revision 4099)
@@ -176,7 +176,7 @@
value::label_16 nlabels;
mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels);
- mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels));
+ mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels));
unsigned max_id = 1;
for (unsigned i = 2; i <= nlabels; ++i)
Index: trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc
===================================================================
--- trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc (revision 4098)
+++ trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc (revision 4099)
@@ -53,7 +53,7 @@
value::label_16 nlabels;
mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels);
- mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels));
+ mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels));
unsigned max_id = 1;
for (unsigned i = 2; i <= nlabels; ++i)
@@ -92,7 +92,7 @@
value::label_16 nlabels;
mln_ch_value(I, value::label_16) labels = labeling::flat_zones(in, c8(), nlabels);
- util::array<unsigned> arr = labeling::compute(accu::meta::count(),
+ util::array<unsigned> arr = labeling::compute(accu::meta::math::count(),
in, labels, nlabels);
unsigned big_second_count = 0;
Index: trunk/milena/sandbox/lazzara/igr/igr.cc
===================================================================
--- trunk/milena/sandbox/lazzara/igr/igr.cc (revision 4098)
+++ trunk/milena/sandbox/lazzara/igr/igr.cc (revision 4099)
@@ -86,7 +86,7 @@
value::label_16 nlabels;
mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels);
- mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels));
+ mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels));
unsigned max_id = 1;
for (unsigned i = 2; i <= nlabels; ++i)
Index: trunk/milena/sandbox/lazzara/igr/igr-cloud.cc
===================================================================
--- trunk/milena/sandbox/lazzara/igr/igr-cloud.cc (revision 4098)
+++ trunk/milena/sandbox/lazzara/igr/igr-cloud.cc (revision 4099)
@@ -33,7 +33,7 @@
#include <mln/core/image/dmorph/extension_fun.hh>
#include <mln/accu/histo.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/debug/histo.hh>
#include <mln/io/cloud/load.hh>
Index: trunk/milena/sandbox/edwin/tree/tree.cc
===================================================================
--- trunk/milena/sandbox/edwin/tree/tree.cc (revision 4098)
+++ trunk/milena/sandbox/edwin/tree/tree.cc (revision 4099)
@@ -22,7 +22,7 @@
// to check:
#include <mln/labeling/blobs.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/debug/println.hh>
#include <../../theo/color/change_attributes.hh>
//-----------------
@@ -285,7 +285,7 @@
- //filtercheck(*f, accu::meta::count());
+ //filtercheck(*f, accu::meta::math::count());
io::pbm::save(f->img(), "out.pbm");
Index: trunk/milena/sandbox/folio/test/histo/project_histo_add.cc
===================================================================
--- trunk/milena/sandbox/folio/test/histo/project_histo_add.cc (revision 4098)
+++ trunk/milena/sandbox/folio/test/histo/project_histo_add.cc (revision 4099)
@@ -21,9 +21,9 @@
#include "../../mln/histo/compute_histo_rgb.hh"
#include "../../mln/histo/classify_with_histo_rgb.hh"
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
#include <mln/accu/image/to_result.hh>
@@ -97,7 +97,7 @@
std::cout << " => computing histogram..." << std::endl;
image3d<unsigned> histo = histo::compute_histo_rgb<unsigned>(ima);
- image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo);
+ image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo);
image2d<value::int_u8> proj_int = data::stretch( value::int_u8(),
data::transform( proj,
take_log() ) );
Index: trunk/milena/sandbox/folio/test/histo/project_screen.cc
===================================================================
--- trunk/milena/sandbox/folio/test/histo/project_screen.cc (revision 4098)
+++ trunk/milena/sandbox/folio/test/histo/project_screen.cc (revision 4099)
@@ -21,9 +21,9 @@
#include "../../mln/histo/compute_histo_rgb.hh"
#include "../../mln/histo/classify_with_histo_rgb.hh"
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
#include <mln/accu/image/to_result.hh>
@@ -76,7 +76,7 @@
save_proj_histo(image3d<unsigned> histo, char* name)
{
std::cout << " => save..." << std::endl;
- image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo);
+ image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo);
image2d<value::int_u8> proj_int = data::stretch( value::int_u8(),
data::transform( proj,
take_log() ) );
Index: trunk/milena/sandbox/folio/test/histo/projected3d.cc
===================================================================
--- trunk/milena/sandbox/folio/test/histo/projected3d.cc (revision 4098)
+++ trunk/milena/sandbox/folio/test/histo/projected3d.cc (revision 4099)
@@ -21,9 +21,9 @@
#include "../../mln/histo/compute_histo_rgb.hh"
#include "../../mln/histo/classify_with_histo_rgb.hh"
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/mean.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
#include <mln/accu/image/to_result.hh>
@@ -97,7 +97,7 @@
std::cout << " => computing histogram..." << std::endl;
image3d<unsigned> histo = histo::compute_histo_rgb<unsigned>(ima);
- // image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo);
+ // image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo);
// image2d<value::int_u8> proj_int = data::stretch( value::int_u8(),
// data::transform( proj,
// take_log() ) );
Index: trunk/milena/sandbox/laurent/ismm2009.cc
===================================================================
--- trunk/milena/sandbox/laurent/ismm2009.cc (revision 4098)
+++ trunk/milena/sandbox/laurent/ismm2009.cc (revision 4099)
@@ -19,7 +19,7 @@
#include <mln/data/stretch.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/height.hh>
#include <mln/util/timer.hh>
@@ -550,7 +550,7 @@
}
typedef unsigned A;
- util::array<A> a = labeling::compute(accu::meta::count(),
+ util::array<A> a = labeling::compute(accu::meta::math::count(),
g,
wst_g,
n_basins);
Index: trunk/milena/sandbox/laurent/playing_with_attributes.cc
===================================================================
--- trunk/milena/sandbox/laurent/playing_with_attributes.cc (revision 4098)
+++ trunk/milena/sandbox/laurent/playing_with_attributes.cc (revision 4099)
@@ -17,7 +17,7 @@
#include <mln/data/sort_psites.hh>
#include <mln/geom/nsites.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
@@ -325,7 +325,7 @@
typedef morpho::tree::data<I,S> tree_t;
tree_t t(g, s, nbh);
- accu::count< util::pix<I> > a_; // Kind of attribute.
+ accu::math::count< util::pix<I> > a_; // Kind of attribute.
mln_ch_value(I,unsigned) a = morpho::tree::compute_attribute_image(a_, t);
debug::println("a | nodes:", a | t.nodes());
Index: trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc
===================================================================
--- trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc (revision 4098)
+++ trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc (revision 4099)
@@ -22,7 +22,7 @@
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/morpho/gradient.hh>
#include <mln/morpho/meyer_wst.hh>
@@ -446,7 +446,7 @@
// Compute an attribute per region.
typedef unsigned A;
- util::array<A> a = labeling::compute(accu::meta::count(),
+ util::array<A> a = labeling::compute(accu::meta::math::count(),
g,
wst_g,
n_basins);
Index: trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc
===================================================================
--- trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc (revision 4098)
+++ trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc (revision 4099)
@@ -14,7 +14,7 @@
# include <mln/core/site_set/p_priority.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
@@ -323,7 +323,7 @@
// --------------------------------
typedef unsigned A;
- util::array<A> a = labeling::compute(accu::meta::count(),
+ util::array<A> a = labeling::compute(accu::meta::math::count(),
g,
wst_g,
n_basins);
Index: trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc
===================================================================
--- trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc (revision 4098)
+++ trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc (revision 4099)
@@ -17,7 +17,7 @@
# include <mln/core/site_set/p_priority.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/util/timer.hh>
@@ -496,7 +496,7 @@
// --------------------------------
typedef unsigned A;
- util::array<A> a = labeling::compute(accu::meta::count(),
+ util::array<A> a = labeling::compute(accu::meta::math::count(),
g,
wst_g,
n_basins);
Index: trunk/milena/tests/accu/count.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/transform_snake.cc
===================================================================
--- trunk/milena/tests/accu/transform_snake.cc (revision 4098)
+++ trunk/milena/tests/accu/transform_snake.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/accu/transform_snake.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
#include <mln/data/compare.hh>
@@ -38,6 +38,6 @@
image2d<int> ima(4, 5);
win::rectangle2d rec(3, 3);
- image2d<unsigned> out = accu::transform_snake(accu::meta::count(), ima, rec);
+ image2d<unsigned> out = accu::transform_snake(accu::meta::math::count(), ima, rec);
mln_assertion(out == (pw::cst(rec.size()) | ima.domain()));
}
Index: trunk/milena/tests/accu/image/to_result.cc
===================================================================
--- trunk/milena/tests/accu/image/to_result.cc (revision 4098)
+++ trunk/milena/tests/accu/image/to_result.cc (revision 4099)
@@ -24,7 +24,7 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/to_result.hh>
@@ -37,7 +37,7 @@
{
using namespace mln;
- typedef accu::count<int> A;
+ typedef accu::math::count<int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
Index: trunk/milena/tests/accu/image/take_n_times.cc
===================================================================
--- trunk/milena/tests/accu/image/take_n_times.cc (revision 4098)
+++ trunk/milena/tests/accu/image/take_n_times.cc (revision 4099)
@@ -29,7 +29,7 @@
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take_n_times.hh>
@@ -38,7 +38,7 @@
{
using namespace mln;
- typedef accu::sum<int,int> A;
+ typedef accu::math::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
Index: trunk/milena/tests/accu/image/init.cc
===================================================================
--- trunk/milena/tests/accu/image/init.cc (revision 4098)
+++ trunk/milena/tests/accu/image/init.cc (revision 4099)
@@ -28,7 +28,7 @@
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/image/init.hh>
@@ -36,7 +36,7 @@
{
using namespace mln;
- typedef accu::count<int> A;
+ typedef accu::math::count<int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
Index: trunk/milena/tests/accu/image/take.cc
===================================================================
--- trunk/milena/tests/accu/image/take.cc (revision 4098)
+++ trunk/milena/tests/accu/image/take.cc (revision 4099)
@@ -29,7 +29,7 @@
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
@@ -38,7 +38,7 @@
{
using namespace mln;
- typedef accu::sum<int,int> A;
+ typedef accu::math::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
Index: trunk/milena/tests/accu/image/set_value.cc
===================================================================
--- trunk/milena/tests/accu/image/set_value.cc (revision 4098)
+++ trunk/milena/tests/accu/image/set_value.cc (revision 4099)
@@ -24,7 +24,7 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/image/set_value.hh>
#include <mln/data/compare.hh>
@@ -36,7 +36,7 @@
{
using namespace mln;
- typedef accu::count<int> A;
+ typedef accu::math::count<int> A;
image2d<A> ima(2, 2);
accu::image::set_value(ima, 3);
Index: trunk/milena/tests/accu/image/untake.cc
===================================================================
--- trunk/milena/tests/accu/image/untake.cc (revision 4098)
+++ trunk/milena/tests/accu/image/untake.cc (revision 4099)
@@ -29,7 +29,7 @@
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/take_as_init.hh>
#include <mln/accu/image/untake.hh>
@@ -38,7 +38,7 @@
{
using namespace mln;
- typedef accu::sum<int,int> A;
+ typedef accu::math::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::take_as_init(ima, 60);
Index: trunk/milena/tests/accu/image/take_as_init.cc
===================================================================
--- trunk/milena/tests/accu/image/take_as_init.cc (revision 4098)
+++ trunk/milena/tests/accu/image/take_as_init.cc (revision 4099)
@@ -28,7 +28,7 @@
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/accu/image/take_as_init.hh>
@@ -36,7 +36,7 @@
{
using namespace mln;
- typedef accu::sum<int,int> A;
+ typedef accu::math::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::take_as_init(ima, 3);
Index: trunk/milena/tests/accu/math/Makefile.am
===================================================================
--- trunk/milena/tests/accu/math/Makefile.am (revision 0)
+++ trunk/milena/tests/accu/math/Makefile.am (revision 4099)
@@ -0,0 +1,27 @@
+# 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/>.
+#
+
+## Process this file through Automake to create Makefile.in.
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ count
+
+count_SOURCES = count.cc
+
+TESTS = $(check_PROGRAMS)
Property changes on: trunk/milena/tests/accu/math/Makefile.am
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/math/count.cc
===================================================================
--- trunk/milena/tests/accu/math/count.cc (revision 0)
+++ trunk/milena/tests/accu/math/count.cc (revision 4099)
@@ -0,0 +1,61 @@
+// Copyright (C) 2007, 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/accu/math/count.hh>
+
+
+struct toto {};
+
+
+int main()
+{
+ using namespace mln;
+
+ {
+ // The code below do not compile, as expected :-)
+ // accu::math::count<int> a;
+ // a.take_as_init(toto());
+ }
+ {
+ accu::math::count<int> a;
+ mln_assertion(a.to_result() == 0);
+ }
+ {
+ accu::math::count<int> a;
+ for (int i = 0; i < 200; i++)
+ a.take(i);
+ mln_assertion(a.to_result() == 200);
+ }
+ {
+ accu::math::count<int> a, a_;
+ a.take_as_init(1);
+ mln_assertion(a == 1u);
+ a.take(2);
+ mln_assertion(a == 2u);
+
+ a_.take_as_init(a);
+ mln_assertion(a_ == 2u);
+ }
+}
Property changes on: trunk/milena/tests/accu/math/count.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/transform_diagonal.cc
===================================================================
--- trunk/milena/tests/accu/transform_diagonal.cc (revision 4098)
+++ trunk/milena/tests/accu/transform_diagonal.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/accu/transform_diagonal.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/pw/all.hh>
#include <mln/data/compare.hh>
@@ -38,13 +38,13 @@
{
win::diag2d w(3);
- image2d<unsigned> out = accu::transform_diagonal(accu::meta::count(), ima, w);
+ image2d<unsigned> out = accu::transform_diagonal(accu::meta::math::count(), ima, w);
mln_assertion(out == (pw::cst(w.size()) | ima.domain()));
}
{
win::backdiag2d w(3);
- image2d<unsigned> out = accu::transform_diagonal(accu::meta::count(), ima, w);
+ image2d<unsigned> out = accu::transform_diagonal(accu::meta::math::count(), ima, w);
mln_assertion(out == (pw::cst(w.size()) | ima.domain()));
}
Index: trunk/milena/tests/accu/transform.cc
===================================================================
--- trunk/milena/tests/accu/transform.cc (revision 4098)
+++ trunk/milena/tests/accu/transform.cc (revision 4099)
@@ -26,7 +26,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/accu/transform.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
@@ -42,14 +42,14 @@
{
image2d<unsigned>
- out = accu::transform(ima, accu::count<int>(), rec),
+ out = accu::transform(ima, accu::math::count<int>(), rec),
ref(ima.domain());
mln_assertion(out == (pw::cst(rec.size()) | ima.domain()));
}
{
image2d<unsigned>
- out = accu::transform(ima, accu::meta::count(), rec),
+ out = accu::transform(ima, accu::meta::math::count(), rec),
ref(ima.domain());
mln_assertion(out == (pw::cst(rec.size()) | ima.domain()));
}
Index: trunk/milena/tests/accu/compute.cc
===================================================================
--- trunk/milena/tests/accu/compute.cc (revision 4098)
+++ trunk/milena/tests/accu/compute.cc (revision 4099)
@@ -26,7 +26,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/compute.hh>
@@ -37,6 +37,6 @@
unsigned n = 3;
image2d<int_u8> ima(n, n);
- unsigned c = accu::compute(accu::meta::count(), ima);
+ unsigned c = accu::compute(accu::meta::math::count(), ima);
mln_assertion(c = n * n);
}
Index: trunk/milena/tests/accu/transform_line.cc
===================================================================
--- trunk/milena/tests/accu/transform_line.cc (revision 4098)
+++ trunk/milena/tests/accu/transform_line.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/accu/transform_line.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/pw/all.hh>
#include <mln/data/compare.hh>
@@ -38,7 +38,7 @@
unsigned len = 3;
for (unsigned dir = 0; dir < 2; ++dir)
{
- image2d<unsigned> out = accu::transform_line(accu::meta::count(), ima, len, dir);
+ image2d<unsigned> out = accu::transform_line(accu::meta::math::count(), ima, len, dir);
mln_assertion(out == (pw::cst(3u) | ima.domain()));
}
Index: trunk/milena/tests/accu/Makefile.am
===================================================================
--- trunk/milena/tests/accu/Makefile.am (revision 4098)
+++ trunk/milena/tests/accu/Makefile.am (revision 4099)
@@ -22,13 +22,13 @@
SUBDIRS = \
image \
site_set \
- stat
+ stat \
+ math
check_PROGRAMS = \
all_accus \
bbox \
compute \
- count \
histo \
line \
max_site \
@@ -60,3 +60,4 @@
tuple_SOURCES = tuple.cc
TESTS = $(check_PROGRAMS)
+# // ACCU_FIXME do not commit
Index: trunk/milena/tests/accu/all_accus.cc
===================================================================
--- trunk/milena/tests/accu/all_accus.cc (revision 4098)
+++ trunk/milena/tests/accu/all_accus.cc (revision 4099)
@@ -33,7 +33,7 @@
using namespace mln;
accu::bbox<point2d> b;
- accu::count<int> c;
+ accu::math::count<int> c;
accu::histo<bool> h;
accu::stat::max<int> ma;
accu::stat::mean<int> me;
@@ -44,5 +44,5 @@
accu::stat::min_max<int> mm;
accu::nil<int> n;
accu::pair< accu::stat::min<int>, accu::stat::max<int> > p;
- accu::sum<int> s;
+ accu::math::sum<int> s;
}
Index: trunk/milena/tests/accu/transform_directional.cc
===================================================================
--- trunk/milena/tests/accu/transform_directional.cc (revision 4098)
+++ trunk/milena/tests/accu/transform_directional.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/accu/transform_directional.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
#include <mln/data/compare.hh>
@@ -40,7 +40,7 @@
for (unsigned dir = 0; dir < 2; ++dir)
{
- image2d<unsigned> out = accu::transform_directional(accu::meta::count(), ima, rec, dir);
+ image2d<unsigned> out = accu::transform_directional(accu::meta::math::count(), ima, rec, dir);
mln_assertion(out == (pw::cst(rec.size()) | ima.domain()));
}
}
Index: trunk/milena/tests/accu/tuple.cc
===================================================================
--- trunk/milena/tests/accu/tuple.cc (revision 4098)
+++ trunk/milena/tests/accu/tuple.cc (revision 4099)
@@ -29,7 +29,7 @@
#include <mln/accu/tuple.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/stat/max.hh>
#include <mln/accu/stat/min.hh>
#include <mln/accu/stat/mean.hh>
@@ -39,7 +39,7 @@
{
using namespace mln;
- typedef accu::tuple<int, 4, accu::count<int>, accu::stat::max<int>, accu::stat::min<int>, accu::stat::mean<int> > teratuple;
+ typedef accu::tuple<int, 4, accu::math::count<int>, accu::stat::max<int>, accu::stat::min<int>, accu::stat::mean<int> > teratuple;
teratuple tuple1;
teratuple tuple2;
Index: trunk/milena/tests/set/compute.cc
===================================================================
--- trunk/milena/tests/set/compute.cc (revision 4098)
+++ trunk/milena/tests/set/compute.cc (revision 4099)
@@ -25,7 +25,7 @@
#include <mln/core/site_set/p_set.hh>
#include <mln/core/alias/point2d.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/set/compute.hh>
@@ -34,5 +34,5 @@
using namespace mln;
p_set<point2d> s;
- mln_assertion(set::compute(accu::meta::count(), s) == 0);
+ mln_assertion(set::compute(accu::meta::math::count(), s) == 0);
}
Index: trunk/milena/tests/morpho/closing/algebraic.cc
===================================================================
--- trunk/milena/tests/morpho/closing/algebraic.cc (revision 4098)
+++ trunk/milena/tests/morpho/closing/algebraic.cc (revision 4099)
@@ -50,7 +50,7 @@
// FIXME: Can't be called with new implementation. (When_pix = not_ok).
// {
-// accu::count<point2d> a;
+// accu::math::count<point2d> a;
// io::pgm::save(morpho::closing::algebraic(lena, c4(), a, 10),
// "ref.pgm");
// }
Index: trunk/milena/tests/morpho/opening/algebraic.cc
===================================================================
--- trunk/milena/tests/morpho/opening/algebraic.cc (revision 4098)
+++ trunk/milena/tests/morpho/opening/algebraic.cc (revision 4099)
@@ -50,7 +50,7 @@
// FIXME: Can't be called with new implementation. (When_pix = not_ok).
// {
-// accu::count<point2d> a;
+// accu::math::count<point2d> a;
// io::pgm::save(morpho::opening::algebraic(lena, c4(), a, 10),
// "ref.pgm");
// }
Index: trunk/milena/tests/labeling/n_max.cc
===================================================================
--- trunk/milena/tests/labeling/n_max.cc (revision 4098)
+++ trunk/milena/tests/labeling/n_max.cc (revision 4099)
@@ -35,7 +35,7 @@
#include <mln/fun/v2b/threshold.hh>
#include <mln/data/transform.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/io/pgm/all.hh>
@@ -52,7 +52,7 @@
image2d<bool> threshold = data::transform(lena, fun::v2b::threshold<int_u8>(100));
label_8 nlabels;
image2d<label_8> labels = labeling::flat_zones(threshold, c4(), nlabels);
- accu::count<int_u8> a_;
+ accu::math::count<int_u8> a_;
util::array<unsigned> a = labeling::compute(a_, threshold, labels, nlabels);
util::array<label_8> arr_big = labeling::n_max<label_8>(a, 3);
Index: trunk/milena/tests/labeling/compute.cc
===================================================================
--- trunk/milena/tests/labeling/compute.cc (revision 4098)
+++ trunk/milena/tests/labeling/compute.cc (revision 4099)
@@ -27,8 +27,8 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
#include <mln/labeling/compute.hh>
-#include <mln/accu/count.hh>
-#include <mln/accu/sum.hh>
+#include <mln/accu/math/count.hh>
+#include <mln/accu/math/sum.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/label_8.hh>
#include <mln/util/array.hh>
@@ -60,27 +60,27 @@
image2d<label_8> lbl = make::image(lblvals);
label_8 nlabels = 3;
- accu::sum<int_u8> sum;
+ accu::math::sum<int_u8> sum;
util::array<float> sums = labeling::compute(sum, ima, lbl, nlabels);
mln_assertion(sums[0] == 0);
mln_assertion(sums[1] == 4);
mln_assertion(sums[2] == 8);
mln_assertion(sums[3] == 12);
- sums = labeling::compute(accu::meta::sum(), ima, lbl, nlabels);
+ sums = labeling::compute(accu::meta::math::sum(), ima, lbl, nlabels);
mln_assertion(sums[0] == 0);
mln_assertion(sums[1] == 4);
mln_assertion(sums[2] == 8);
mln_assertion(sums[3] == 12);
- accu::count<mln_site_(image2d<int_u8>)> count;
+ accu::math::count<mln_site_(image2d<int_u8>)> count;
util::array<unsigned int> counts = labeling::compute(count, lbl, nlabels);
mln_assertion(counts[0] == 18);
mln_assertion(counts[1] == 4);
mln_assertion(counts[2] == 4);
mln_assertion(counts[3] == 4);
- counts = labeling::compute(accu::meta::count(), lbl, nlabels);
+ counts = labeling::compute(accu::meta::math::count(), lbl, nlabels);
mln_assertion(counts[0] == 18);
mln_assertion(counts[1] == 4);
mln_assertion(counts[2] == 4);
Index: trunk/milena/tests/labeling/value.cc
===================================================================
--- trunk/milena/tests/labeling/value.cc (revision 4098)
+++ trunk/milena/tests/labeling/value.cc (revision 4099)
@@ -28,7 +28,7 @@
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/accu/compute.hh>
#include <mln/labeling/value.hh>
#include <mln/data/paste.hh>
@@ -53,7 +53,7 @@
{
image2d<unsigned> labels = labeling::value(lena, l, c4(), n);
unsigned npix =
- accu::compute(accu::meta::count(),
+ accu::compute(accu::meta::math::count(),
labels | (pw::value(labels) != pw::cst(0u)));
npixels += npix;
}
Index: trunk/milena/doc/examples/tuto3/first_routine.cc
===================================================================
--- trunk/milena/doc/examples/tuto3/first_routine.cc (revision 4098)
+++ trunk/milena/doc/examples/tuto3/first_routine.cc (revision 4099)
@@ -16,7 +16,7 @@
#include <mln/value/label_8.hh>
-#include <mln/accu/count.hh>
+#include <mln/accu/math/count.hh>
#include <mln/pw/all.hh>
@@ -43,7 +43,7 @@
V nlabels;
mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels);
util::array<unsigned>
- count = labeling::compute(accu::meta::count(), lbl, nlabels);
+ count = labeling::compute(accu::meta::math::count(), lbl, nlabels);
mln_concrete(I) output;
initialize(output, ima);
@@ -88,7 +88,7 @@
V nlabels;
mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels);
util::array<unsigned>
- count = labeling::compute(accu::meta::count(), lbl, nlabels);
+ count = labeling::compute(accu::meta::math::count(), lbl, nlabels);
// \}
// \{
1
0
* core/all.hh
* debug/all.hh
* text/all.hh
* filter/all.hh
* table/all.hh
* demo/Makefile.am
* src/Makefile.am
* src/extract/primitive/Makefile.am
* core/erase_bboxes.hh: move...
* core/erase_objects.hh: ...here.
* debug/save_textbboxes_image.hh: move...
* debug/save_bboxes_image.hh: ...here.
* debug/save_label_image.hh,
* debug/save_linked_bboxes_image.hh,
* debug/save_linked_textbboxes_image.hh,
* debug/usage.hh,
* extract/lines_discontinued.hh,
* extract/primitive/canvas.hh,
* extract/primitive/cells.hh,
* extract/primitive/lines_discontinued.hh,
* filter/small_objects.hh,
* filter/thin_objects.hh,
* make/influence_zone_graph.hh,
* src/binarization/simple.cc,
* src/extract/primitive/extract_discontinued_hlines.cc,
* src/extract/primitive/extract_discontinued_lines.cc,
* src/extract/primitive/extract_discontinued_vlines.cc,
* src/extract/primitive/extract_thick_hlines.cc,
* src/extract/primitive/extract_thick_vlines.cc,
* src/extract/primitive/find_discontinued_lines.cc,
* src/extract_text_double_link.cc,
* src/extract_text_double_several_links.cc,
* src/extract_text_graph.cc,
* src/extract_text_several_graph.cc,
* src/extract_text_several_left_links.cc,
* src/extract_text_single_link.cc,
* src/morpho.cc,
* src/negate.cc,
* src/preprocess.cc,
* src/preprocessing/unskew.cc,
* src/recognition.cc,
* src/superpose.cc,
* src/table/erase.cc,
* src/table/extract.cc,
* src/table_rebuild_opening.cc,
* src/table_rebuild_rank.cc,
* src/text_in_photo.cc,
* src/thin_bboxes.cc,
* table/align_lines_horizontaly.hh,
* table/align_lines_verticaly.hh,
* table/connect_horizontal_lines.hh,
* table/connect_vertical_lines.hh,
* table/erase.hh,
* table/extract.hh,
* table/internal/align_lines.hh,
* table/internal/connect_lines.hh,
* table/internal/repair_lines.hh,
* table/rebuild.hh,
* table/repair_horizontal_lines.hh,
* table/repair_vertical_lines.hh,
* tests/filter/small_and_large_bboxes.cc,
* tests/preprocessing/unskew.cc,
* tests/table/extract_lines_with_rank.cc,
* tests/table/repair_lines.cc,
* text/clean.hh,
* text/extract_lines.hh,
* text/grouping/group_from_double_link.hh,
* text/grouping/group_from_graph.hh,
* text/grouping/group_from_single_link.hh,
* text/grouping/group_with_graph.hh,
* text/grouping/group_with_several_graphes.hh,
* text/grouping/group_with_several_right_links.hh,
* text/grouping/internal/find_graph_link.hh,
* text/grouping/internal/find_right_link.hh,
* text/grouping/internal/update_graph_link.hh,
* text/grouping/internal/update_link_array.hh: fix compilation.
- Add missing includes.
- Use object image.
* tests/unit_test/build_unit_test.sh: do not use some files for unit
tests.
* tests/unit_test/unit-tests.mk: update list.
---
scribo/ChangeLog | 92 +++++++
scribo/core/all.hh | 6 +-
scribo/core/{erase_bboxes.hh => erase_objects.hh} | 39 ++--
scribo/debug/all.hh | 4 +-
...ve_textbboxes_image.hh => save_bboxes_image.hh} | 30 +-
scribo/debug/save_label_image.hh | 14 +-
scribo/debug/save_linked_bboxes_image.hh | 268 ++++++++++++++++++++
scribo/debug/save_linked_textbboxes_image.hh | 253 ------------------
scribo/debug/usage.hh | 67 ++++-
scribo/demo/Makefile.am | 8 +-
.../extract/{primitive => }/lines_discontinued.hh | 66 ++++-
scribo/extract/primitive/canvas.hh | 5 +-
scribo/extract/primitive/cells.hh | 38 ++-
scribo/extract/primitive/lines_discontinued.hh | 8 +-
scribo/filter/all.hh | 8 +-
scribo/filter/small_objects.hh | 11 +-
scribo/filter/thin_objects.hh | 3 +-
scribo/make/influence_zone_graph.hh | 13 +-
scribo/src/Makefile.am | 54 ++--
scribo/src/binarization/simple.cc | 6 +-
scribo/src/extract/primitive/Makefile.am | 6 +-
.../primitive/extract_discontinued_hlines.cc | 4 +-
...ued_vlines.cc => extract_discontinued_lines.cc} | 28 ++-
.../primitive/extract_discontinued_vlines.cc | 4 +-
.../src/extract/primitive/extract_thick_hlines.cc | 4 +-
.../src/extract/primitive/extract_thick_vlines.cc | 4 +-
...tinued_vlines.cc => find_discontinued_lines.cc} | 32 ++-
scribo/src/extract_text_double_link.cc | 40 ++--
scribo/src/extract_text_double_several_links.cc | 36 ++--
scribo/src/extract_text_graph.cc | 32 ++--
scribo/src/extract_text_several_graph.cc | 31 +--
scribo/src/extract_text_several_left_links.cc | 32 ++--
scribo/src/extract_text_single_link.cc | 58 ++--
scribo/src/morpho.cc | 4 +-
scribo/src/negate.cc | 6 +-
.../src/{binarization/simple.cc => preprocess.cc} | 35 ++-
scribo/src/preprocessing/unskew.cc | 6 +-
scribo/src/recognition.cc | 7 +-
scribo/src/superpose.cc | 8 +-
scribo/src/table/erase.cc | 14 +-
scribo/src/table/extract.cc | 8 +-
scribo/src/table_rebuild_opening.cc | 36 ++-
scribo/src/table_rebuild_rank.cc | 36 ++-
scribo/src/text_in_photo.cc | 20 +-
scribo/src/thin_bboxes.cc | 10 +-
scribo/table/align_lines_horizontaly.hh | 18 +-
scribo/table/align_lines_verticaly.hh | 10 +-
scribo/table/all.hh | 13 +-
scribo/table/connect_horizontal_lines.hh | 17 +-
scribo/table/connect_vertical_lines.hh | 12 +-
scribo/table/erase.hh | 34 ++--
scribo/table/extract.hh | 20 +-
scribo/table/internal/align_lines.hh | 14 +-
scribo/table/internal/connect_lines.hh | 29 ++-
scribo/table/internal/repair_lines.hh | 18 +-
scribo/table/rebuild.hh | 24 +-
scribo/table/repair_horizontal_lines.hh | 8 +-
scribo/table/repair_vertical_lines.hh | 8 +-
scribo/tests/filter/small_and_large_bboxes.cc | 36 ++--
scribo/tests/preprocessing/unskew.cc | 9 +-
scribo/tests/table/extract_lines_with_rank.cc | 12 +-
scribo/tests/table/repair_lines.cc | 7 -
scribo/tests/unit_test/build_unit_test.sh | 8 +-
scribo/tests/unit_test/unit-tests.mk | 16 +-
scribo/text/all.hh | 4 +-
scribo/text/clean.hh | 19 ++-
scribo/text/extract_lines.hh | 44 ++--
scribo/text/grouping/group_from_double_link.hh | 2 +
scribo/text/grouping/group_from_graph.hh | 36 ++--
scribo/text/grouping/group_from_single_link.hh | 52 ++---
scribo/text/grouping/group_with_graph.hh | 20 +-
scribo/text/grouping/group_with_several_graphes.hh | 39 ++--
.../grouping/group_with_several_right_links.hh | 3 +
scribo/text/grouping/internal/find_graph_link.hh | 14 +-
scribo/text/grouping/internal/find_right_link.hh | 21 +-
scribo/text/grouping/internal/update_graph_link.hh | 13 +
scribo/text/grouping/internal/update_link_array.hh | 13 +-
77 files changed, 1246 insertions(+), 841 deletions(-)
rename scribo/core/{erase_bboxes.hh => erase_objects.hh} (67%)
rename scribo/debug/{save_textbboxes_image.hh => save_bboxes_image.hh} (74%)
create mode 100644 scribo/debug/save_linked_bboxes_image.hh
delete mode 100644 scribo/debug/save_linked_textbboxes_image.hh
copy scribo/extract/{primitive => }/lines_discontinued.hh (70%)
copy scribo/src/extract/primitive/{extract_discontinued_vlines.cc => extract_discontinued_lines.cc} (73%)
copy scribo/src/extract/primitive/{extract_discontinued_vlines.cc => find_discontinued_lines.cc} (69%)
copy scribo/src/{binarization/simple.cc => preprocess.cc} (64%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 7129cb2..d6ce297 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,97 @@
2009-06-10 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Fix Scribo
+
+ * core/all.hh
+ * debug/all.hh
+ * text/all.hh
+ * filter/all.hh
+ * table/all.hh
+
+ * demo/Makefile.am
+ * src/Makefile.am
+ * src/extract/primitive/Makefile.am
+
+ * core/erase_bboxes.hh: move...
+ * core/erase_objects.hh: ...here.
+
+ * debug/save_textbboxes_image.hh: move...
+ * debug/save_bboxes_image.hh: ...here.
+
+ * debug/save_label_image.hh,
+ * debug/save_linked_bboxes_image.hh,
+ * debug/save_linked_textbboxes_image.hh,
+ * debug/usage.hh,
+ * extract/lines_discontinued.hh,
+ * extract/primitive/canvas.hh,
+ * extract/primitive/cells.hh,
+ * extract/primitive/lines_discontinued.hh,
+ * filter/small_objects.hh,
+ * filter/thin_objects.hh,
+ * make/influence_zone_graph.hh,
+ * src/binarization/simple.cc,
+ * src/extract/primitive/extract_discontinued_hlines.cc,
+ * src/extract/primitive/extract_discontinued_lines.cc,
+ * src/extract/primitive/extract_discontinued_vlines.cc,
+ * src/extract/primitive/extract_thick_hlines.cc,
+ * src/extract/primitive/extract_thick_vlines.cc,
+ * src/extract/primitive/find_discontinued_lines.cc,
+ * src/extract_text_double_link.cc,
+ * src/extract_text_double_several_links.cc,
+ * src/extract_text_graph.cc,
+ * src/extract_text_several_graph.cc,
+ * src/extract_text_several_left_links.cc,
+ * src/extract_text_single_link.cc,
+ * src/morpho.cc,
+ * src/negate.cc,
+ * src/preprocess.cc,
+ * src/preprocessing/unskew.cc,
+ * src/recognition.cc,
+ * src/superpose.cc,
+ * src/table/erase.cc,
+ * src/table/extract.cc,
+ * src/table_rebuild_opening.cc,
+ * src/table_rebuild_rank.cc,
+ * src/text_in_photo.cc,
+ * src/thin_bboxes.cc,
+ * table/align_lines_horizontaly.hh,
+ * table/align_lines_verticaly.hh,
+ * table/connect_horizontal_lines.hh,
+ * table/connect_vertical_lines.hh,
+ * table/erase.hh,
+ * table/extract.hh,
+ * table/internal/align_lines.hh,
+ * table/internal/connect_lines.hh,
+ * table/internal/repair_lines.hh,
+ * table/rebuild.hh,
+ * table/repair_horizontal_lines.hh,
+ * table/repair_vertical_lines.hh,
+ * tests/filter/small_and_large_bboxes.cc,
+ * tests/preprocessing/unskew.cc,
+ * tests/table/extract_lines_with_rank.cc,
+ * tests/table/repair_lines.cc,
+ * text/clean.hh,
+ * text/extract_lines.hh,
+ * text/grouping/group_from_double_link.hh,
+ * text/grouping/group_from_graph.hh,
+ * text/grouping/group_from_single_link.hh,
+ * text/grouping/group_with_graph.hh,
+ * text/grouping/group_with_several_graphes.hh,
+ * text/grouping/group_with_several_right_links.hh,
+ * text/grouping/internal/find_graph_link.hh,
+ * text/grouping/internal/find_right_link.hh,
+ * text/grouping/internal/update_graph_link.hh,
+ * text/grouping/internal/update_link_array.hh: fix compilation.
+ - Add missing includes.
+ - Use object image.
+
+ * tests/unit_test/build_unit_test.sh: do not use some files for unit
+ tests.
+
+ * tests/unit_test/unit-tests.mk: update list.
+
+2009-06-10 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Add Scribo's demo GUI.
* demo/Makefile.am,
diff --git a/scribo/core/all.hh b/scribo/core/all.hh
index 39f0f90..76177b0 100644
--- a/scribo/core/all.hh
+++ b/scribo/core/all.hh
@@ -41,9 +41,9 @@ namespace scribo
} // end of namespace scribo
-#include <scribo/core/component_bboxes.hh>
-#include <scribo/core/macros.hh>
#include <scribo/core/central_sites.hh>
-#include <scribo/core/erase_bboxes.hh>
+#include <scribo/core/erase_objects.hh>
+#include <scribo/core/macros.hh>
+#include <scribo/core/object_image.hh>
#endif // ! SCRIBO_CORE_ALL_HH
diff --git a/scribo/core/erase_bboxes.hh b/scribo/core/erase_objects.hh
similarity index 67%
rename from scribo/core/erase_bboxes.hh
rename to scribo/core/erase_objects.hh
index 06a930c..da003b1 100644
--- a/scribo/core/erase_bboxes.hh
+++ b/scribo/core/erase_objects.hh
@@ -23,10 +23,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_ERASE_BBOXES_HH
-# define SCRIBO_CORE_ERASE_BBOXES_HH
+#ifndef SCRIBO_CORE_ERASE_OBJECTS_HH
+# define SCRIBO_CORE_ERASE_OBJECTS_HH
-/// \file scribo/core/erase_bboxes.hh
+/// \file scribo/core/erase_objects.hh
///
/// Remove the content of bounding boxes from an image.
@@ -37,39 +37,46 @@
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/object_image.hh>
namespace scribo
{
using namespace mln;
- /// Remove the content of bounding boxes from an image.
- template <typename I>
+ /// Remove labeled components from a binary image.
+ ///
+ /// \param[in,out] input_ A binary image.
+ /// \param[in] objects An object image. Objects will be set to
+ /// false in \p input_.
+ ///
+ //
+ template <typename I, typename L>
void
- erase_bboxes(Image<I>& input_,
- const util::array< box<mln_site(I)> >& bboxes);
+ erase_objects(Image<I>& input_,
+ const object_image(L)& objects);
# ifndef MLN_INCLUDE_ONLY
- template <typename I>
+ template <typename I, typename L>
void
- erase_bboxes(Image<I>& input_,
- const util::array< box<mln_site(I)> >& bboxes)
+ erase_objects(Image<I>& input_,
+ const object_image(L)& objects)
{
- trace::entering("scribo::erase_bboxes");
+ trace::entering("scribo::erase_objects");
mlc_equal(mln_value(I),bool)::check();
I& input = exact(input_);
mln_precondition(input.is_valid());
+ mln_precondition(objects.is_valid());
- for_all_components(i, bboxes)
- data::paste((pw::cst(false) | bboxes[i] |
- (pw::value(input) == true)), input);
+ data::fill((input | (pw::value(objects) != pw::cst(literal::zero))).rw(),
+ false);
- trace::exiting("scribo::erase_bboxes");
+ trace::exiting("scribo::erase_objects");
}
@@ -77,4 +84,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_CORE_ERASE_BBOXES_HH
+#endif // ! SCRIBO_CORE_ERASE_OBJECTS_HH
diff --git a/scribo/debug/all.hh b/scribo/debug/all.hh
index ecb3608..a6f3294 100644
--- a/scribo/debug/all.hh
+++ b/scribo/debug/all.hh
@@ -41,9 +41,9 @@ namespace scribo
} // end of namespace scribo
+# include <scribo/debug/save_bboxes_image.hh>
# include <scribo/debug/save_label_image.hh>
-# include <scribo/debug/save_linked_textbboxes_image.hh>
+# include <scribo/debug/save_linked_bboxes_image.hh>
# include <scribo/debug/save_table_image.hh>
-# include <scribo/debug/save_textbboxes_image.hh>
#endif // ! SCRIBO_DEBUG_ALL_HH
diff --git a/scribo/debug/save_textbboxes_image.hh b/scribo/debug/save_bboxes_image.hh
similarity index 74%
rename from scribo/debug/save_textbboxes_image.hh
rename to scribo/debug/save_bboxes_image.hh
index a7b23ce..0265ee4 100644
--- a/scribo/debug/save_textbboxes_image.hh
+++ b/scribo/debug/save_bboxes_image.hh
@@ -23,10 +23,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_DEBUG_SAVE_TEXTBBOXES_IMAGE_HH
-# define SCRIBO_DEBUG_SAVE_TEXTBBOXES_IMAGE_HH
+#ifndef SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH
+# define SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH
-/// \file scribo/draw/bounding_boxes.hh
+/// \file
///
/// Draw a list of bounding boxes and their associated mass center.
@@ -51,10 +51,10 @@ namespace scribo
/// Draw a list of bounding boxes and their associated mass center.
template <typename I>
void
- save_textbboxes_image(const Image<I>& input,
- const mln::util::array< box<mln_site(I)> >& textbboxes,
- const value::rgb8& value,
- const std::string& filename);
+ save_bboxes_image(const Image<I>& input,
+ const mln::util::array< box<mln_site(I)> >& bboxes,
+ const value::rgb8& value,
+ const std::string& filename);
# ifndef MLN_INCLUDE_ONLY
@@ -62,19 +62,19 @@ namespace scribo
template <typename I>
inline
void
- save_textbboxes_image(const Image<I>& input,
- const mln::util::array< box<mln_site(I)> >& textbboxes,
- const value::rgb8& value,
- const std::string& filename)
+ save_bboxes_image(const Image<I>& input,
+ const mln::util::array< box<mln_site(I)> >& bboxes,
+ const value::rgb8& value,
+ const std::string& filename)
{
- trace::entering("scribo::debug::save_textbboxes_image");
+ trace::entering("scribo::debug::save_bboxes_image");
mln_precondition(exact(input).is_valid());
mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
- draw::bounding_boxes(tmp, textbboxes, value);
+ draw::bounding_boxes(tmp, bboxes, value);
io::ppm::save(tmp, filename);
- trace::exiting("scribo::debug::save_textbboxes_image");
+ trace::exiting("scribo::debug::save_bboxes_image");
}
# endif // ! MLN_INCLUDE_ONLY
@@ -84,4 +84,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_DEBUG_SAVE_TEXTBBOXES_IMAGE_HH
+#endif // ! SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH
diff --git a/scribo/debug/save_label_image.hh b/scribo/debug/save_label_image.hh
index cf66b7c..b35dbc5 100644
--- a/scribo/debug/save_label_image.hh
+++ b/scribo/debug/save_label_image.hh
@@ -30,13 +30,25 @@
///
/// Save a labeled image in a color image.
+# include <mln/core/concept/image.hh>
+# include <mln/labeling/colorize.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/io/ppm/save.hh>
+
namespace scribo
{
namespace debug
{
+ using namespace mln;
+
/// Save a labeled image in a color image.
+ ///
+ /// \param[in] lbl A label image.
+ /// \param[in] nlabels The number of labels.
+ /// \param[in] filename The output file name.
+ //
template <typename I>
void
save_label_image(const Image<I>& lbl, const mln_value(I)& nlabels,
@@ -55,7 +67,7 @@ namespace scribo
mlc_is_a(mln_value(I), mln::value::Symbolic)::check();
mln_precondition(exact(lbl).is_valid());
- io::ppm::save(labeling::colorize(rgb8(), lbl, nlabels), filename);
+ io::ppm::save(labeling::colorize(value::rgb8(), lbl, nlabels), filename);
trace::exiting("scribo::debug::save_label_image");
}
diff --git a/scribo/debug/save_linked_bboxes_image.hh b/scribo/debug/save_linked_bboxes_image.hh
new file mode 100644
index 0000000..91d58b4
--- /dev/null
+++ b/scribo/debug/save_linked_bboxes_image.hh
@@ -0,0 +1,268 @@
+// 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_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH
+# define SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH
+
+/// \file scribo/draw/bounding_boxes.hh
+///
+/// Save the bounding box links image.
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/graph.hh>
+# include <mln/labeling/compute.hh>
+# include <mln/accu/center.hh>
+# include <mln/data/convert.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/util/array.hh>
+# include <mln/io/ppm/save.hh>
+
+# include <scribo/core/object_image.hh>
+# include <scribo/draw/bounding_boxes.hh>
+# include <scribo/draw/bounding_box_links.hh>
+
+
+namespace scribo
+{
+
+ namespace debug
+ {
+
+ using namespace mln;
+
+
+ /// Save the line of objects links image.
+ ///
+ /// \param[in,out] input The binary from where the objects are extracted.
+ /// \param[in] objects An object image.
+ /// \param[in] link_array Lines of objects links.
+ /// \param[in] box_value Value used to draw line bounding boxes.
+ /// \param[in] link_value Value used to draw line links.
+ /// \param[in] filename The target file name.
+ template <typename I, typename L>
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& link_array,
+ const value::rgb8& box_value,
+ const value::rgb8& link_value,
+ const std::string& filename);
+
+ /// Save the line of objects left and right links image.
+ ///
+ /// \param[in,out] input The binary from where the objects are extracted.
+ /// \param[in] objects An object image.
+ /// \param[in] left_link Lines of objects left links.
+ /// \param[in] right_link Lines of objects right links.
+ /// \param[in] box_value Value used to draw line bounding boxes.
+ /// \param[in] link_value Value used to draw line links.
+ /// \param[in] filename The target file name.
+ template <typename I, typename L>
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& left_link,
+ const mln::util::array<unsigned>& right_link,
+ const value::rgb8& box_value,
+ const value::rgb8& link_value,
+ const std::string& filename);
+
+ /// Save the line of objects left and right links image.
+ /// Draw also validated links.
+ ///
+ /// \param[in,out] input The binary from where the objects are extracted.
+ /// \param[in] objects An object image.
+ /// \param[in] left_link Lines of objects left links.
+ /// \param[in] right_link Lines of objects right links.
+ /// \param[in] box_value Value used to draw line bounding boxes.
+ /// \param[in] left_link_value Value used to draw line left links.
+ /// \param[in] right_link_value Value used to draw line left links.
+ /// \param[in] validated_link_value Value used to draw line validated links.
+ /// \param[in] filename The target file name.
+ template <typename I, typename L>
+ inline
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& left_link,
+ const mln::util::array<unsigned>& right_link,
+ const value::rgb8& box_value,
+ const value::rgb8& left_link_value,
+ const value::rgb8& right_link_value,
+ const value::rgb8& validated_link_value,
+ const std::string& filename);
+
+
+ /// Save the line link graph image.
+ ///
+ /// \param[in,out] input The binary from where the objects are extracted.
+ /// \param[in] objects An object image.
+ /// \param[in] g The link graph.
+ /// \param[in] box_value Value used to draw line bounding boxes.
+ /// \param[in] link_value Value used to draw line links.
+ /// \param[in] filename The target file name.
+ template <typename I, typename L, typename G>
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const Graph<G>& g,
+ const value::rgb8& box_value,
+ const value::rgb8& link_value,
+ const std::string& filename);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I, typename L>
+ inline
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& link_array,
+ const value::rgb8& box_value,
+ const value::rgb8& link_value,
+ const std::string& filename)
+ {
+ trace::entering("scribo::debug::save_linked_bboxes_image");
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
+
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_center = labeling::compute(accu::meta::center(),
+ objects,
+ objects.nlabels());
+
+ draw::bounding_boxes(tmp, objects.bboxes(), box_value);
+ draw::bounding_box_links(tmp, mass_center, link_array, link_value);
+
+ io::ppm::save(tmp, filename);
+
+ trace::exiting("scribo::debug::save_linked_bboxes_image");
+ }
+
+
+ template <typename I, typename L>
+ inline
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& left_link,
+ const mln::util::array<unsigned>& right_link,
+ const value::rgb8& box_value,
+ const value::rgb8& value,
+ const std::string& filename)
+ {
+ trace::entering("scribo::debug::save_linked_bboxes_image");
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
+
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_center = labeling::compute(accu::meta::center(),
+ objects,
+ objects.nlabels());
+
+ draw::bounding_boxes(tmp, objects.bboxes(), box_value);
+ draw::bounding_box_links(tmp, mass_center,
+ left_link, right_link,
+ value);
+
+ io::ppm::save(tmp, filename);
+
+ trace::exiting("scribo::debug::save_linked_bboxes_image");
+ }
+
+
+ template <typename I, typename L>
+ inline
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const mln::util::array<unsigned>& left_link,
+ const mln::util::array<unsigned>& right_link,
+ const value::rgb8& box_value,
+ const value::rgb8& left_link_value,
+ const value::rgb8& right_link_value,
+ const value::rgb8& validated_link_value,
+ const std::string& filename)
+ {
+ trace::entering("scribo::debug::save_linked_bboxes_image");
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
+
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_center = labeling::compute(accu::meta::center(),
+ objects,
+ objects.nlabels());
+
+ draw::bounding_boxes(tmp, objects.bboxes(), box_value);
+ draw::bounding_box_links(tmp, mass_center,
+ left_link, right_link,
+ left_link_value, right_link_value,
+ validated_link_value);
+
+ io::ppm::save(tmp, filename);
+
+ trace::exiting("scribo::debug::save_linked_bboxes_image");
+ }
+
+
+
+ template <typename I, typename L, typename G>
+ inline
+ void
+ save_linked_bboxes_image(const Image<I>& input,
+ const object_image(L)& objects,
+ const Graph<G>& g,
+ const value::rgb8& box_value,
+ const value::rgb8& link_value,
+ const std::string& filename)
+ {
+ trace::entering("scribo::debug::save_linked_bboxes_image");
+ mln_precondition(exact(g).is_valid());
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
+
+ draw::bounding_boxes(tmp, objects.bboxes(), box_value);
+ draw::bounding_box_links(tmp, objects.bboxes(), g, link_value);
+
+ io::ppm::save(tmp, filename);
+
+ trace::exiting("scribo::debug::save_linked_bboxes_image");
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::debug
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH
diff --git a/scribo/debug/save_linked_textbboxes_image.hh b/scribo/debug/save_linked_textbboxes_image.hh
deleted file mode 100644
index b98defc..0000000
--- a/scribo/debug/save_linked_textbboxes_image.hh
+++ /dev/null
@@ -1,253 +0,0 @@
-// 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_DEBUG_SAVE_LINKED_TEXTBBOXES_IMAGE_HH
-# define SCRIBO_DEBUG_SAVE_LINKED_TEXTBBOXES_IMAGE_HH
-
-/// \file scribo/draw/bounding_boxes.hh
-///
-/// Save the bounding box links image.
-
-# include <mln/core/concept/image.hh>
-# include <mln/core/concept/graph.hh>
-# include <mln/labeling/compute.hh>
-# include <mln/accu/center.hh>
-# include <mln/data/convert.hh>
-# include <mln/value/rgb8.hh>
-# include <mln/util/array.hh>
-# include <mln/io/ppm/save.hh>
-
-# include <scribo/draw/bounding_boxes.hh>
-# include <scribo/draw/bounding_box_links.hh>
-# include <scribo/util/text.hh>
-
-
-namespace scribo
-{
-
- namespace debug
- {
-
- using namespace mln;
-
-
- /// Save the line of text links image.
- ///
- /// \param[in,out] input The binary from where the text is extracted.
- /// \param[in] text The lines of text.
- /// \param[in] link_array Lines of text links.
- /// \param[in] box_value Value used to draw line bounding boxes.
- /// \param[in] link_value Value used to draw line links.
- /// \param[in] filename The target file name.
- template <typename I, typename L>
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& link_array,
- const value::rgb8& box_value,
- const value::rgb8& link_value,
- const std::string& filename);
-
- /// Save the line of text left and right links image.
- ///
- /// \param[in,out] input The binary from where the text is extracted.
- /// \param[in] text The lines of text.
- /// \param[in] left_link Lines of text left links.
- /// \param[in] right_link Lines of text right links.
- /// \param[in] box_value Value used to draw line bounding boxes.
- /// \param[in] link_value Value used to draw line links.
- /// \param[in] filename The target file name.
- template <typename I, typename L>
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& left_link,
- const mln::util::array<unsigned>& right_link,
- const value::rgb8& box_value,
- const value::rgb8& link_value,
- const std::string& filename);
-
- /// Save the line of text left and right links image.
- /// Draw also validated links.
- ///
- /// \param[in,out] input The binary from where the text is extracted.
- /// \param[in] text The lines of text.
- /// \param[in] left_link Lines of text left links.
- /// \param[in] right_link Lines of text right links.
- /// \param[in] box_value Value used to draw line bounding boxes.
- /// \param[in] left_link_value Value used to draw line left links.
- /// \param[in] right_link_value Value used to draw line left links.
- /// \param[in] validated_link_value Value used to draw line validated links.
- /// \param[in] filename The target file name.
- template <typename I, typename L>
- inline
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& left_link,
- const mln::util::array<unsigned>& right_link,
- const value::rgb8& box_value,
- const value::rgb8& left_link_value,
- const value::rgb8& right_link_value,
- const value::rgb8& validated_link_value,
- const std::string& filename);
-
-
- /// Save the line link graph image.
- ///
- /// \param[in,out] input The binary from where the text is extracted.
- /// \param[in] text The lines of text.
- /// \param[in] g The link graph.
- /// \param[in] box_value Value used to draw line bounding boxes.
- /// \param[in] link_value Value used to draw line links.
- /// \param[in] filename The target file name.
- template <typename I, typename L, typename G>
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const Graph<G>& g,
- const value::rgb8& box_value,
- const value::rgb8& link_value,
- const std::string& filename);
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename I, typename L>
- inline
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& link_array,
- const value::rgb8& box_value,
- const value::rgb8& link_value,
- const std::string& filename)
- {
- trace::entering("scribo::debug::save_linked_textbboxes_image");
- mln_precondition(exact(input).is_valid());
-
- mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
-
- draw::bounding_boxes(tmp, text.bboxes(), box_value);
- draw::bounding_box_links(tmp, text.mass_centers(), link_array, link_value);
-
- io::ppm::save(tmp, filename);
-
- trace::exiting("scribo::debug::save_linked_textbboxes_image");
- }
-
-
- template <typename I, typename L>
- inline
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& left_link,
- const mln::util::array<unsigned>& right_link,
- const value::rgb8& box_value,
- const value::rgb8& value,
- const std::string& filename)
- {
- trace::entering("scribo::debug::save_linked_textbboxes_image");
- mln_precondition(exact(input).is_valid());
-
- mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
-
- draw::bounding_boxes(tmp, text.bboxes(), box_value);
- draw::bounding_box_links(tmp, text.mass_centers(),
- left_link, right_link,
- value);
-
- io::ppm::save(tmp, filename);
-
- trace::exiting("scribo::debug::save_linked_textbboxes_image");
- }
-
-
- template <typename I, typename L>
- inline
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const mln::util::array<unsigned>& left_link,
- const mln::util::array<unsigned>& right_link,
- const value::rgb8& box_value,
- const value::rgb8& left_link_value,
- const value::rgb8& right_link_value,
- const value::rgb8& validated_link_value,
- const std::string& filename)
- {
- trace::entering("scribo::debug::save_linked_textbboxes_image");
- mln_precondition(exact(input).is_valid());
-
- mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
-
- draw::bounding_boxes(tmp, text.bboxes(), box_value);
- draw::bounding_box_links(tmp, text.mass_centers(),
- left_link, right_link,
- left_link_value, right_link_value,
- validated_link_value);
-
- io::ppm::save(tmp, filename);
-
- trace::exiting("scribo::debug::save_linked_textbboxes_image");
- }
-
-
-
- template <typename I, typename L, typename G>
- inline
- void
- save_linked_textbboxes_image(const Image<I>& input,
- const scribo::util::text<L>& text,
- const Graph<G>& g,
- const value::rgb8& box_value,
- const value::rgb8& link_value,
- const std::string& filename)
- {
- trace::entering("scribo::debug::save_linked_textbboxes_image");
- mln_precondition(exact(g).is_valid());
- mln_precondition(exact(input).is_valid());
-
- mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
-
- draw::bounding_boxes(tmp, text.bboxes(), box_value);
- draw::bounding_box_links(tmp, text.bboxes(), g, link_value);
-
- io::ppm::save(tmp, filename);
-
- trace::exiting("scribo::debug::save_linked_textbboxes_image");
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::debug
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_DEBUG_SAVE_LINKED_TEXTBBOXES_IMAGE_HH
diff --git a/scribo/debug/usage.hh b/scribo/debug/usage.hh
index 9fc7ff6..f821ead 100644
--- a/scribo/debug/usage.hh
+++ b/scribo/debug/usage.hh
@@ -23,19 +23,56 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-int usage(char* argv[], const char *desc, const char* args,
- const char*args_desc[][2], const char *out_desc)
+#ifndef SCRIBO_DEBUG_USAGE_HH
+# define SCRIBO_DEBUG_USAGE_HH
+
+#include <iostream>
+
+namespace scribo
{
- std::cout << desc << std::endl;
- std::cout << "-----------" << std::endl;
- std::cout << "Usage: " << argv[0] << " " << args << std::endl;
-
- for (unsigned i = 0; args_desc[i][0] != 0; ++i)
- std::cout << " " << args_desc[i][0] << ": " << args_desc[i][1]
- << std::endl;
-
- std::cout << std::endl << "Output: " << out_desc << std::endl;
- std::cout << "-----------" << std::endl;
- std::cout << "EPITA/LRDE - Scribo 2009" << std::endl;
- return 1;
-}
+
+ namespace debug
+ {
+
+ /// Format a standard usage output.
+ ///
+ /// \param[in] argv Arguments passed to the program.
+ /// \param[in] desc Description of the program.
+ /// \param[in] args The expected arguments.
+ /// \param[in] args_desc The description of the expected arguments.
+ /// \param[in] out_desc The description of the output.
+ ///
+ /// \return Return 1.
+ //
+ int usage(char* argv[], const char *desc, const char* args,
+ const char*args_desc[][2], const char *out_desc);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ int
+ usage(char* argv[], const char *desc, const char* args,
+ const char*args_desc[][2], const char *out_desc)
+ {
+ std::cout << desc << std::endl;
+ std::cout << "-----------" << std::endl;
+ std::cout << "Usage: " << argv[0] << " " << args << std::endl;
+
+ for (unsigned i = 0; args_desc[i][0] != 0; ++i)
+ std::cout << " " << args_desc[i][0] << ": " << args_desc[i][1]
+ << std::endl;
+
+ std::cout << std::endl << "Output: " << out_desc << std::endl;
+ std::cout << "-----------" << std::endl;
+ std::cout << "EPITA/LRDE - Scribo 2009" << std::endl;
+ return 1;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::debug
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_DEBUG_USAGE_HH
diff --git a/scribo/demo/Makefile.am b/scribo/demo/Makefile.am
index a5f584b..ab8c1a2 100644
--- a/scribo/demo/Makefile.am
+++ b/scribo/demo/Makefile.am
@@ -2,8 +2,8 @@
include $(top_srcdir)/scribo/scribo.mk
+Makefile.demo:
+ qmake-qt4 $(top_srcdir)/scribo/src/demo/demo.pro -o Makefile.demo
-Makefile:
- qmake-qt4 $(top_srcdir)/scribo/src/demo/demo.pro -o Makefile
-
-all-local: Makefile
+demo: Makefile.demo
+ make -f Makefile.demo all
diff --git a/scribo/extract/primitive/lines_discontinued.hh b/scribo/extract/lines_discontinued.hh
similarity index 70%
copy from scribo/extract/primitive/lines_discontinued.hh
copy to scribo/extract/lines_discontinued.hh
index 3a1b6ea..b790320 100644
--- a/scribo/extract/primitive/lines_discontinued.hh
+++ b/scribo/extract/lines_discontinued.hh
@@ -34,15 +34,20 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/window.hh>
# include <mln/core/concept/neighborhood.hh>
+# include <mln/core/site_set/box.hh>
# include <mln/labeling/blobs.hh>
+# include <mln/labeling/compute.hh>
# include <mln/morpho/rank_filter.hh>
# include <mln/morpho/dilation.hh>
+# include <mln/accu/bbox.hh>
+
+# include <mln/util/array.hh>
+# include <mln/util/couple.hh>
+
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/extract/primitive/objects.hh>
namespace scribo
{
@@ -62,15 +67,25 @@ namespace scribo
*
* \param[in] input_ A binary image.
* \param[in] nbh_ The neighborhood used for labeling image
- * the lines.
+ * components.
* \param[in,out] nlines The label type used for labeling.
* \param[in] win_ A Window used to extract lines.
* \param[in] rank_k Rank used for filtering.
+ * \param[in,out] line_bboxes line bounding boxes.
*
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ mln_ch_value(I,V)
+ lines_discontinued(const Image<I>& input_,
+ const Neighborhood<N>& nbh_, V& nlines,
+ const Window<W>& win_, unsigned rank_k,
+ util::array<box<mln_site(I)> >& line_bboxes);
+
+
+ /// \overload
+ template <typename I, typename N, typename V, typename W>
+ mln_ch_value(I,V)
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k);
@@ -108,7 +123,7 @@ namespace scribo
template <typename I, typename N, typename V, typename W>
inline
- object_image(mln_ch_value(I,V))
+ mln_ch_value(I,V)
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k)
@@ -121,10 +136,8 @@ namespace scribo
const N& nbh = exact(nbh_);
const W& win = exact(win_);
- mln_ch_value(I,bool) filter
- = morpho::dilation(morpho::rank_filter(input, win, rank_k), W(win.length() / 2));
- object_image(mln_ch_value(I,V)) output
- = extract::primitive::objects(filter, nbh, nlines);
+ mln_ch_value(I,bool) filter = morpho::rank_filter(input, win, rank_k);
+ mln_ch_value(I,V) output = labeling::blobs(filter, nbh, nlines);
//FIXME: we would like to enlarge the component in the right direction,
// in order to avoid rank filter side effects (smaller components).
@@ -134,6 +147,41 @@ namespace scribo
}
+
+
+ template <typename I, typename N, typename V, typename W>
+ inline
+ mln_ch_value(I,V)
+ lines_discontinued(const Image<I>& input_,
+ const Neighborhood<N>& nbh_, V& nlines,
+ const Window<W>& win_, unsigned rank_k,
+ util::array<box<mln_site(I)> >& line_bboxes)
+ {
+ trace::entering("scribo::primitive::lines_discontinued");
+
+ internal::lines_discontinued_tests(input_, nbh_, nlines, win_, rank_k);
+
+ const I& input = exact(input_);
+ const N& nbh = exact(nbh_);
+ const W& win = exact(win_);
+
+ mln_ch_value(I,V)
+ output = lines_discontinued(input, nbh, nlines, win, rank_k);
+
+ line_bboxes = labeling::compute(accu::meta::bbox(), output, nlines);
+ mln_postcondition(line_bboxes.nelements() == nlines.next());
+
+ //FIXME: is it correct?
+ for_all_components(i, line_bboxes)
+ {
+ line_bboxes[i].enlarge(W::dir, win.delta_() - rank_k);
+ line_bboxes[i].crop_wrt(input.domain());
+ }
+
+ trace::exiting("scribo::primitive::lines_discontinued");
+ return output;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
diff --git a/scribo/extract/primitive/canvas.hh b/scribo/extract/primitive/canvas.hh
index fd271a7..0c78662 100644
--- a/scribo/extract/primitive/canvas.hh
+++ b/scribo/extract/primitive/canvas.hh
@@ -35,6 +35,7 @@
# include <mln/util/array.hh>
# include <mln/util/couple.hh>
# include <mln/value/label_8.hh>
+# include <mln/util/couple.hh>
# include <scribo/table/align_lines_verticaly.hh>
# include <scribo/table/align_lines_horizontaly.hh>
@@ -84,7 +85,7 @@ namespace scribo
canvas(const Image<I>& input_,
const util::array<box<mln_site(I)> >& hlines,
const util::array<box<mln_site(I)> >& vlines,
- unsigned max_dist_lines);
+ unsigned max_dist_lines)
{
trace::entering("scribo::primitive::canvas");
const I& input = exact(input_);
@@ -93,7 +94,7 @@ namespace scribo
mln_precondition(input.is_valid());
typedef util::array<box<mln_site(I)> > lines_t;
- util::couple<lines_t, lines_t> lines = make::couple(hlines, vlines);
+ util::couple<lines_t, lines_t> lines = mln::make::couple(hlines, vlines);
util::array<int> rows = align_lines_horizontaly(input, hlines, 5);
util::array<int> cols = align_lines_verticaly(input, vlines, 5);
diff --git a/scribo/extract/primitive/cells.hh b/scribo/extract/primitive/cells.hh
index f5b6d71..764d228 100644
--- a/scribo/extract/primitive/cells.hh
+++ b/scribo/extract/primitive/cells.hh
@@ -31,6 +31,8 @@
/// Extract canvas cells from a binary image.
# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+# include <mln/core/site_set/box.hh>
# include <mln/accu/bbox.hh>
@@ -42,7 +44,7 @@
# include <scribo/table/rebuild.hh>
# include <scribo/table/erase.hh>
-# include <scribo/primitive/discontinued_lines.hh>
+# include <scribo/extract/primitive/lines_discontinued.hh>
# include <scribo/make/debug_filename.hh>
@@ -56,16 +58,19 @@ namespace scribo
namespace primitive
{
+ using namespace mln;
+
/// Extract canvas cells from a binary image.
/// Use arbitrary criterions.
- /*
- ** \param[in] input_ A binary image.
- ** \param[in,out] ncells Will store the number of cells found.
- **
- ** \return A list of cell bounding boxes.
- */
- template <typename I, typename V>
- util::couple<util::array<box<mln_site(I)> >
+ ///
+ /// \param[in] input_ A binary image.
+ /// \param[in,out] ncells Will store the number of cells found.
+ ///
+ /// \return A list of cell bounding boxes.
+ //
+ template <typename I, typename N, typename V>
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >
cells(const Image<I>& input_,
const Neighborhood<N>& nbh_, const V& label_type);
@@ -74,7 +79,8 @@ namespace scribo
template <typename I, typename N, typename V>
inline
- util::couple<util::array<box<mln_site(I)> >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >
cells(const Image<I>& input_,
const Neighborhood<N>& nbh_, const V& label_type)
{
@@ -86,21 +92,23 @@ namespace scribo
mln_precondition(nbh.is_valid());
mlc_equal(mln_value(I), bool)::check();
- typedef util::array< box<mln_site(I)> > boxarray_t;
+ typedef mln::util::array< box<mln_site(I)> > boxarray_t;
V ncells;
win::line<mln_grid(I::site), 0, mln_coord(I::site)> vline(51);
win::line<mln_grid(I::site), 1, mln_coord(I::site)> hline(51);
boxarray_t
- vlines = primitive::discontinued_lines(input, nbh, ncells, vline, 6),
- hlines = primitive::discontinued_lines(input, nbh, ncells, hline, 6);
+ vlines = extract::primitive::lines_discontinued(input, nbh,
+ ncells, vline, 6),
+ hlines = extract::primitive::lines_discontinued(input, nbh,
+ ncells, hline, 6);
typedef mln_ch_value(I,V) cells_ima_t;
cells_ima_t
- cells = scribo::table::rebuild(input, make::couple(vlines,hlines),
+ cells = scribo::table::rebuild(input, mln::make::couple(vlines,hlines),
30, ncells).first();
- util::array<box<mln_site(I)> >
+ mln::util::array<box<mln_site(I)> >
cellbboxes = labeling::compute(accu::meta::bbox(), cells, ncells);
trace::exiting("scribo::primitive::cells");
diff --git a/scribo/extract/primitive/lines_discontinued.hh b/scribo/extract/primitive/lines_discontinued.hh
index 3a1b6ea..50792fa 100644
--- a/scribo/extract/primitive/lines_discontinued.hh
+++ b/scribo/extract/primitive/lines_discontinued.hh
@@ -121,8 +121,14 @@ namespace scribo
const N& nbh = exact(nbh_);
const W& win = exact(win_);
+ int dil;
+ if (!(rank_k % 2))
+ dil = win.length() / 2 + rank_k;
+ else
+ dil = win.length() / 2 + rank_k + 1;
+
mln_ch_value(I,bool) filter
- = morpho::dilation(morpho::rank_filter(input, win, rank_k), W(win.length() / 2));
+ = morpho::dilation(morpho::rank_filter(input, win, rank_k), W(dil));
object_image(mln_ch_value(I,V)) output
= extract::primitive::objects(filter, nbh, nlines);
diff --git a/scribo/filter/all.hh b/scribo/filter/all.hh
index b7a08b1..ba8ac7f 100644
--- a/scribo/filter/all.hh
+++ b/scribo/filter/all.hh
@@ -41,9 +41,9 @@ namespace scribo
} // end of namespace scribo
-# include <scribo/filter/thin_bboxes.hh>
-# include <scribo/filter/small_components.hh>
-# include <scribo/filter/large_components.hh>
-# include <scribo/filter/thick_bboxes.hh>
+# include <scribo/filter/large_objects.hh>
+# include <scribo/filter/small_objects.hh>
+# include <scribo/filter/thick_objects.hh>
+# include <scribo/filter/thin_objects.hh>
#endif // ! SCRIBO_FILTER_ALL_HH
diff --git a/scribo/filter/small_objects.hh b/scribo/filter/small_objects.hh
index b23b2de..9fcd153 100644
--- a/scribo/filter/small_objects.hh
+++ b/scribo/filter/small_objects.hh
@@ -170,15 +170,16 @@ namespace scribo
mln_precondition(nbh.is_valid());
V nlabels;
- typedef object_image(mln_ch_value(I,V)) lbl_t;
- lbl_t lbl = extract::primitive::objects(input, nbh, nlabels);
+ typedef mln_ch_value(I,V) lbl_t;
+ object_image(lbl_t) lbl = extract::primitive::objects(input, nbh, nlabels);
- typedef internal::small_objects_filter<lbl_t> func_t;
+ typedef internal::small_objects_filter<mln_ch_value(I,V)> func_t;
func_t fv2b(lbl, min_size);
- labeling::relabel_inplace(lbl, nlabels, fv2b);
+ lbl.relabel(fv2b);
mln_concrete(I) output = duplicate(input);
- data::fill((output | pw::value(lbl) == literal::zero).rw(), false);
+ data::fill((output | pw::value(lbl) == pw::cst(literal::zero)).rw(),
+ false);
trace::exiting("scribo::filter::small_objects");
return output;
diff --git a/scribo/filter/thin_objects.hh b/scribo/filter/thin_objects.hh
index af800d1..1a40c49 100644
--- a/scribo/filter/thin_objects.hh
+++ b/scribo/filter/thin_objects.hh
@@ -151,7 +151,8 @@ namespace scribo
objects.relabel(fv2b);
mln_concrete(I) output = duplicate(input);
- data::fill((output | pw::value(objects) == literal::zero).rw(), false);
+ data::fill((output | pw::value(objects) == pw::cst(literal::zero)).rw(),
+ false);
trace::exiting("scribo::filter::thin_objects");
return output;
diff --git a/scribo/make/influence_zone_graph.hh b/scribo/make/influence_zone_graph.hh
index b4a68c8..3df9f71 100644
--- a/scribo/make/influence_zone_graph.hh
+++ b/scribo/make/influence_zone_graph.hh
@@ -41,6 +41,9 @@
# include <mln/util/graph.hh>
+# include <mln/make/influence_zone_adjacency_graph.hh>
+
+# include <mln/pw/all.hh>
namespace scribo
{
@@ -64,7 +67,7 @@ namespace scribo
/// \param[in] iz_dmax Max distance of the influence zone.
///
/// \return a region adjacency graph.
- template <typename I, typename V>
+ template <typename I, typename N, typename V>
util::graph
influence_zone_graph(const Image<I>& input_,
const Neighborhood<N>& nbh_,
@@ -74,7 +77,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- template <typename I, typename V>
+ template <typename I, typename N, typename V>
util::graph
influence_zone_graph(const Image<I>& input_,
const Neighborhood<N>& nbh_,
@@ -87,7 +90,7 @@ namespace scribo
I& input = exact(input_);
const N& nbh = exact(nbh_);
- mlc_is_equal(mln_value(I), bool)::check();
+ mlc_equal(mln_value(I), bool)::check();
mln_assertion(input.is_valid());
mln_assertion(nbh.is_valid());
@@ -97,7 +100,9 @@ namespace scribo
lbl_t iz = transform::influence_zone_geodesic(lbl, nbh, iz_dmax);
- util::graph g = make::graph(iz | (pw::value(iz) != pw::cst(literal::zero)),
+ util::graph g
+ = mln::make::influence_zone_adjacency_graph(
+ iz | (pw::value(iz) != pw::cst(literal::zero)),
nbh, nlabels);
trace::exiting("scribo::make::influence_zone_graph");
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 0e66301..5944f2d 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -26,44 +26,44 @@ SUBDIRS = \
bin_PROGRAMS = \
dmap \
+ extract_text_double_link \
+ extract_text_double_several_links \
+ extract_text_graph \
+ extract_text_several_graph \
+ extract_text_several_left_links \
+ extract_text_single_link \
morpho \
negate \
+ preprocess \
superpose \
- text_in_photo
-
-# FIXME: These files used to be in bin_PROGRAMS, but as they did not
-# compile, we moved them here.
-EXTRA_DIST = \
- extract_text_double_link \
- extract_text_double_several_links \
- extract_text_graph \
- extract_text_several_graph \
- extract_text_several_left_links \
- extract_text_single_link \
- table_rebuild_opening \
- table_rebuild_rank \
+ table_rebuild_opening \
+ table_rebuild_rank \
+ text_in_photo \
thin_bboxes
+
# FIXME: Should be enclosed in an Automake conditional like HAVE_TESSERACT.
-EXTRA_DIST += recognition
+EXTRA_DIST = recognition
-# FIXME: Deactivate source accordingly.
-dmap_SOURCES = dmap.cc
-#extract_text_double_link_SOURCES = extract_text_double_link.cc
-#extract_text_double_several_links_SOURCES = extract_text_double_several_links.cc
-#extract_text_graph_SOURCES = extract_text_graph.cc
-#extract_text_several_graph_SOURCES = extract_text_several_graph.cc
-#extract_text_several_left_links_SOURCES = extract_text_several_left_links.cc
-#extract_text_single_link_SOURCES = extract_text_single_link.cc
-morpho_SOURCES = morpho.cc
-negate_SOURCES = negate.cc
#recognition_SOURCES = recognition.cc
# FIXME: Do not use $(HOME).
#recognition_CXXFLAGS =
# -I$(HOME)/local/include $(HOME)/local/lib/libtesseract_full.a
#recognition_LDFLAGS = -lpthread
+
+# FIXME: Deactivate source accordingly.
+dmap_SOURCES = dmap.cc
+extract_text_double_link_SOURCES = extract_text_double_link.cc
+extract_text_double_several_links_SOURCES = extract_text_double_several_links.cc
+extract_text_graph_SOURCES = extract_text_graph.cc
+extract_text_several_graph_SOURCES = extract_text_several_graph.cc
+extract_text_several_left_links_SOURCES = extract_text_several_left_links.cc
+extract_text_single_link_SOURCES = extract_text_single_link.cc
+morpho_SOURCES = morpho.cc
+negate_SOURCES = negate.cc
+preprocess_SOURCES = preprocess.cc
superpose_SOURCES = superpose.cc
-#table_rebuild_opening_SOURCES = table_rebuild_opening.cc
-#table_rebuild_rank_SOURCES = table_rebuild_rank.cc
+table_rebuild_opening_SOURCES = table_rebuild_opening.cc
+table_rebuild_rank_SOURCES = table_rebuild_rank.cc
text_in_photo_SOURCES = text_in_photo.cc
-#thin_bboxes_SOURCES = thin_bboxes.cc
+thin_bboxes_SOURCES = thin_bboxes.cc
diff --git a/scribo/src/binarization/simple.cc b/scribo/src/binarization/simple.cc
index 25a1e42..4d02220 100644
--- a/scribo/src/binarization/simple.cc
+++ b/scribo/src/binarization/simple.cc
@@ -42,8 +42,10 @@ int main(int argc, char *argv[])
using value::int_u8;
if (argc != 3)
- return usage(argv, "Simple binarization of a gray-level image.", "input.pbm output.pbm",
- args_desc, "A binary image.");
+ return scribo::debug::usage(argv,
+ "Simple binarization of a gray-level image.",
+ "input.pbm output.pbm",
+ args_desc, "A binary image.");
trace::entering("main");
diff --git a/scribo/src/extract/primitive/Makefile.am b/scribo/src/extract/primitive/Makefile.am
index f530ff5..bab3f62 100644
--- a/scribo/src/extract/primitive/Makefile.am
+++ b/scribo/src/extract/primitive/Makefile.am
@@ -21,14 +21,18 @@ include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
+ extract_discontinued_lines \
extract_discontinued_vlines \
extract_discontinued_hlines \
extract_thick_vlines \
- extract_thick_hlines
+ extract_thick_hlines \
+ find_discontinued_lines
+extract_discontinued_lines_SOURCES = extract_discontinued_lines.cc
extract_discontinued_vlines_SOURCES = extract_discontinued_vlines.cc
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
diff --git a/scribo/src/extract/primitive/extract_discontinued_hlines.cc b/scribo/src/extract/primitive/extract_discontinued_hlines.cc
index b880e16..df682a3 100644
--- a/scribo/src/extract/primitive/extract_discontinued_hlines.cc
+++ b/scribo/src/extract/primitive/extract_discontinued_hlines.cc
@@ -27,7 +27,7 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/io/pbm/all.hh>
-#include <mln/level/convert.hh>
+#include <mln/data/convert.hh>
#include <scribo/extract/primitive/lines_h_discontinued.hh>
#include <scribo/debug/usage.hh>
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
value::label_16 nlines;
image2d<bool> lines
- = level::convert(bool(),
+ = data::convert(bool(),
scribo::extract::primitive::lines_h_discontinued(input,
c8(),
nlines,
diff --git a/scribo/src/extract/primitive/extract_discontinued_vlines.cc b/scribo/src/extract/primitive/extract_discontinued_lines.cc
similarity index 73%
copy from scribo/src/extract/primitive/extract_discontinued_vlines.cc
copy to scribo/src/extract/primitive/extract_discontinued_lines.cc
index 38a83cd..a8388ca 100644
--- a/scribo/src/extract/primitive/extract_discontinued_vlines.cc
+++ b/scribo/src/extract/primitive/extract_discontinued_lines.cc
@@ -27,8 +27,9 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/io/pbm/all.hh>
-#include <mln/level/convert.hh>
+#include <mln/data/convert.hh>
+#include <scribo/extract/primitive/lines_h_discontinued.hh>
#include <scribo/extract/primitive/lines_v_discontinued.hh>
#include <scribo/debug/usage.hh>
@@ -46,23 +47,34 @@ int main(int argc, char *argv[])
using namespace mln;
if (argc != 5)
- return usage(argv, "Extract discontinued vertical lines", "input.pbm length rank output.pbm",
- args_desc, "A binary image of vertical lines.");
+ return usage(argv, "Extract discontinued horizontal and vertical lines",
+ "input.pbm length rank output.pbm",
+ args_desc, "A binary image of horizontal and vertical lines.");
trace::entering("main");
image2d<bool> input;
io::pbm::load(input, argv[1]);
- value::label_16 nlines;
- image2d<bool> lines
- = level::convert(bool(),
+ value::label_16 nhlines;
+ image2d<bool> hlines
+ = data::convert(bool(),
+ scribo::extract::primitive::lines_h_discontinued(input,
+ c8(),
+ nhlines,
+ atoi(argv[2]),
+ atoi(argv[3])));
+ value::label_16 nvlines;
+ image2d<bool> vlines
+ = data::convert(bool(),
scribo::extract::primitive::lines_v_discontinued(input,
c8(),
- nlines,
+ nvlines,
atoi(argv[2]),
atoi(argv[3])));
- io::pbm::save(lines, argv[4]);
+
+ data::fill((hlines | pw::value(vlines)).rw(), true);
+ io::pbm::save(hlines, argv[4]);
trace::exiting("main");
}
diff --git a/scribo/src/extract/primitive/extract_discontinued_vlines.cc b/scribo/src/extract/primitive/extract_discontinued_vlines.cc
index 38a83cd..f39086b 100644
--- a/scribo/src/extract/primitive/extract_discontinued_vlines.cc
+++ b/scribo/src/extract/primitive/extract_discontinued_vlines.cc
@@ -27,7 +27,7 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/io/pbm/all.hh>
-#include <mln/level/convert.hh>
+#include <mln/data/convert.hh>
#include <scribo/extract/primitive/lines_v_discontinued.hh>
#include <scribo/debug/usage.hh>
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
value::label_16 nlines;
image2d<bool> lines
- = level::convert(bool(),
+ = data::convert(bool(),
scribo::extract::primitive::lines_v_discontinued(input,
c8(),
nlines,
diff --git a/scribo/src/extract/primitive/extract_thick_hlines.cc b/scribo/src/extract/primitive/extract_thick_hlines.cc
index 5cc008a..ca6284d 100644
--- a/scribo/src/extract/primitive/extract_thick_hlines.cc
+++ b/scribo/src/extract/primitive/extract_thick_hlines.cc
@@ -27,7 +27,7 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/io/pbm/all.hh>
-#include <mln/level/convert.hh>
+#include <mln/data/convert.hh>
#include <scribo/extract/primitive/lines_h_thick.hh>
#include <scribo/debug/usage.hh>
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
value::label_16 nlines;
image2d<bool> lines
- = level::convert(bool(),
+ = data::convert(bool(),
scribo::extract::primitive::lines_h_thick(input,
c8(),
nlines,
diff --git a/scribo/src/extract/primitive/extract_thick_vlines.cc b/scribo/src/extract/primitive/extract_thick_vlines.cc
index 0d58955..52ab1d4 100644
--- a/scribo/src/extract/primitive/extract_thick_vlines.cc
+++ b/scribo/src/extract/primitive/extract_thick_vlines.cc
@@ -27,7 +27,7 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/io/pbm/all.hh>
-#include <mln/level/convert.hh>
+#include <mln/data/convert.hh>
#include <scribo/extract/primitive/lines_v_thick.hh>
#include <scribo/debug/usage.hh>
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
value::label_16 nlines;
image2d<bool> lines
- = level::convert(bool(),
+ = data::convert(bool(),
scribo::extract::primitive::lines_v_thick(input,
c8(),
nlines,
diff --git a/scribo/src/extract/primitive/extract_discontinued_vlines.cc b/scribo/src/extract/primitive/find_discontinued_lines.cc
similarity index 69%
copy from scribo/src/extract/primitive/extract_discontinued_vlines.cc
copy to scribo/src/extract/primitive/find_discontinued_lines.cc
index 38a83cd..09f295b 100644
--- a/scribo/src/extract/primitive/extract_discontinued_vlines.cc
+++ b/scribo/src/extract/primitive/find_discontinued_lines.cc
@@ -25,10 +25,14 @@
#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/level/convert.hh>
+#include <mln/io/ppm/save.hh>
+#include <mln/data/convert.hh>
+#include <mln/debug/superpose.hh>
+#include <scribo/extract/primitive/lines_h_discontinued.hh>
#include <scribo/extract/primitive/lines_v_discontinued.hh>
#include <scribo/debug/usage.hh>
@@ -46,23 +50,35 @@ int main(int argc, char *argv[])
using namespace mln;
if (argc != 5)
- return usage(argv, "Extract discontinued vertical lines", "input.pbm length rank output.pbm",
- args_desc, "A binary image of vertical lines.");
+ return usage(argv, "Extract discontinued horizontal and vertical lines",
+ "input.pbm length rank output.pbm",
+ args_desc, "A binary image of horizontal and vertical lines.");
trace::entering("main");
image2d<bool> input;
io::pbm::load(input, argv[1]);
- value::label_16 nlines;
- image2d<bool> lines
- = level::convert(bool(),
+ value::label_16 nhlines;
+ image2d<bool> hlines
+ = data::convert(bool(),
+ scribo::extract::primitive::lines_h_discontinued(input,
+ c8(),
+ nhlines,
+ atoi(argv[2]),
+ atoi(argv[3])));
+ value::label_16 nvlines;
+ image2d<bool> vlines
+ = data::convert(bool(),
scribo::extract::primitive::lines_v_discontinued(input,
c8(),
- nlines,
+ nvlines,
atoi(argv[2]),
atoi(argv[3])));
- io::pbm::save(lines, argv[4]);
+
+ data::fill((hlines | pw::value(vlines)).rw(), true);
+ image2d<value::rgb8> out = debug::superpose(input, hlines);
+ io::ppm::save(out, argv[4]);
trace::exiting("main");
}
diff --git a/scribo/src/extract_text_double_link.cc b/scribo/src/extract_text_double_link.cc
index 8e6b498..50706d8 100644
--- a/scribo/src/extract_text_double_link.cc
+++ b/scribo/src/extract_text_double_link.cc
@@ -33,14 +33,16 @@
#include <mln/io/pbm/load.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/core/object_image.hh>
+
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_single_left_link.hh>
#include <scribo/text/grouping/group_with_single_right_link.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/text/grouping/group_from_double_link.hh>
-#include <scribo/filter/small_components.hh>
+#include <scribo/filter/small_objects.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -64,10 +66,10 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
value::label_16 nbboxes;
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = extract::primitive::objects(input, c8(), nbboxes);
- text = filter::small_components(text,4);
+ text = filter::small_objects(text, 4);
mln::util::array<unsigned> left_link
= text::grouping::group_with_single_left_link(text, 30);
@@ -85,30 +87,30 @@ int main(int argc, char* argv[])
// literal::red, literal::cyan,
// scribo::make::debug_filename("right_linked.ppm"));
- scribo::debug::save_linked_textbboxes_image(input,
- text, left_link, right_link,
- literal::red, literal::cyan, literal::yellow,
- literal::green,
- scribo::make::debug_filename("links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, left_link, right_link,
+ literal::red, literal::cyan, literal::yellow,
+ literal::green,
+ scribo::make::debug_filename("links.ppm"));
// io::ppm::save(mln::labeling::colorize(value::rgb8(),
// text.label_image(),
-// text.nbboxes()),
+// text.nlabels()),
// scribo::make::debug_filename("lbl_before.ppm"));
// With validation.
- scribo::util::text<image2d<value::label_16> > grouped_text
+ text_t grouped_text
= text::grouping::group_from_double_link(text, left_link, right_link);
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("label_color.ppm"));
std::cout << "AFTER double grouping - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("bboxes.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("bboxes.ppm"));
}
diff --git a/scribo/src/extract_text_double_several_links.cc b/scribo/src/extract_text_double_several_links.cc
index 149b86f..7dc1bac 100644
--- a/scribo/src/extract_text_double_several_links.cc
+++ b/scribo/src/extract_text_double_several_links.cc
@@ -29,14 +29,14 @@
#include <mln/labeling/colorize.hh>
#include <mln/util/timer.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_several_left_links.hh>
#include <scribo/text/grouping/group_with_several_right_links.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/text/grouping/group_from_double_link.hh>
-#include <scribo/filter/small_components.hh>
+#include <scribo/filter/small_objects.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -68,15 +68,15 @@ int main(int argc, char* argv[])
std::cout << "extract bboxes" << std::endl;
t.restart();
t2.start();
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = scribo::extract::primitive::objects(input, c8(), nbboxes);
std::cout << t << std::endl;
mln::util::timer t3;
std::cout << "Remove small components" << std::endl;
t.restart();
t3.start();
- text = filter::small_components(text,4);
+ text = filter::small_objects(text,4);
std::cout << t << std::endl;
std::cout << "Group with left link" << std::endl;
@@ -93,30 +93,30 @@ int main(int argc, char* argv[])
std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, left_link, right_link,
- literal::red, literal::cyan, literal::yellow,
- literal::green,
- scribo::make::debug_filename("links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, left_link, right_link,
+ literal::red, literal::cyan, literal::yellow,
+ literal::green,
+ scribo::make::debug_filename("links.ppm"));
// With validation.
std::cout << "Group from double link" << std::endl;
t.restart();
- scribo::util::text<image2d<value::label_16> > grouped_text
+ text_t grouped_text
= text::grouping::group_from_double_link(text, left_link, right_link);
std::cout << t << std::endl;
std::cout << "Full process: " << t2 << std::endl;
std::cout << "Cleanup and grouping process: " << t3 << std::endl;
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("label_color.ppm"));
std::cout << "AFTER double grouping - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("bboxes.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("bboxes.ppm"));
}
diff --git a/scribo/src/extract_text_graph.cc b/scribo/src/extract_text_graph.cc
index 682fa03..91bd799 100644
--- a/scribo/src/extract_text_graph.cc
+++ b/scribo/src/extract_text_graph.cc
@@ -33,12 +33,12 @@
#include <mln/literal/colors.hh>
#include <mln/labeling/colorize.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_graph.hh>
#include <scribo/text/grouping/group_from_graph.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -61,32 +61,32 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
value::label_16 nbboxes;
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = extract::primitive::objects(input, c8(), nbboxes);
mln::util::graph g = text::grouping::group_with_graph(text, 30);
std::cout << "BEFORE - nbboxes = " << nbboxes.next() << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, g,
- literal::red, literal::cyan,
- scribo::make::debug_filename("left_linked.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, g,
+ literal::red, literal::cyan,
+ scribo::make::debug_filename("left_linked.ppm"));
// io::ppm::save(mln::labeling::colorize(value::rgb8(),
// text.label_image(),
-// text.nbboxes()),
+// text.nlabels()),
// scribo::make::debug_filename("lbl_before.ppm"));
- scribo::util::text<image2d<value::label_16> > grouped_text
+ text_t grouped_text
= text::grouping::group_from_graph(text, g);
std::cout << "AFTER - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("grouped_text.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("grouped_text.ppm"));
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("label_color.ppm"));
}
diff --git a/scribo/src/extract_text_several_graph.cc b/scribo/src/extract_text_several_graph.cc
index 0fd9694..198f325 100644
--- a/scribo/src/extract_text_several_graph.cc
+++ b/scribo/src/extract_text_several_graph.cc
@@ -27,12 +27,12 @@
#include <mln/essential/2d.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_several_graphes.hh>
#include <scribo/text/grouping/group_from_graph.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -55,28 +55,27 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
value::label_16 nbboxes;
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = scribo::extract::primitive::objects(input, c8(), nbboxes);
mln::util::graph g = text::grouping::group_with_several_graphes(text, 30);
std::cout << "BEFORE - nbboxes = " << nbboxes.next() << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, g,
- literal::red, literal::cyan,
- scribo::make::debug_filename("left_linked.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, g,
+ literal::red, literal::cyan,
+ scribo::make::debug_filename("left_linked.ppm"));
- scribo::util::text<image2d<value::label_16> > grouped_text
- = text::grouping::group_from_graph(text, g);
+ text_t grouped_text = text::grouping::group_from_graph(text, g);
std::cout << "AFTER - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("grouped_text.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("grouped_text.ppm"));
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("label_color.ppm"));
}
diff --git a/scribo/src/extract_text_several_left_links.cc b/scribo/src/extract_text_several_left_links.cc
index d67df60..f717a63 100644
--- a/scribo/src/extract_text_several_left_links.cc
+++ b/scribo/src/extract_text_several_left_links.cc
@@ -27,12 +27,12 @@
#include <mln/essential/2d.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_several_left_links.hh>
#include <scribo/text/grouping/group_from_single_link.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -55,8 +55,8 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
value::label_16 nbboxes;
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = scribo::extract::primitive::objects(input, c8(), nbboxes);
{
std::cout << "* Left grouping" << std::endl;
@@ -64,22 +64,22 @@ int main(int argc, char* argv[])
= text::grouping::group_with_several_left_links(text, 30);
std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, left_link,
- literal::red, literal::cyan,
- scribo::make::debug_filename("left_links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, left_link,
+ literal::red, literal::cyan,
+ scribo::make::debug_filename("left_links.ppm"));
- scribo::util::text<image2d<value::label_16> > grouped_text
- = text::grouping::group_from_single_link(text, left_link);
+ text_t grouped_text
+ = text::grouping::group_from_single_link(text, left_link);
std::cout << "AFTER - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("left_label_color.ppm"));
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("left_bboxes.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("left_bboxes.ppm"));
}
}
diff --git a/scribo/src/extract_text_single_link.cc b/scribo/src/extract_text_single_link.cc
index 77b655a..e29b1c4 100644
--- a/scribo/src/extract_text_single_link.cc
+++ b/scribo/src/extract_text_single_link.cc
@@ -37,13 +37,13 @@
#include <mln/io/pbm/load.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_single_left_link.hh>
#include <scribo/text/grouping/group_with_single_right_link.hh>
#include <scribo/text/grouping/group_from_single_link.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/make/debug_filename.hh>
@@ -68,8 +68,8 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
value::label_16 nbboxes;
- scribo::util::text<image2d<value::label_16> > text
- = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = scribo::extract::primitive::objects(input, c8(), nbboxes);
{
std::cout << "* Left grouping" << std::endl;
@@ -77,26 +77,26 @@ int main(int argc, char* argv[])
= text::grouping::group_with_single_left_link(text, 30);
std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, left_link,
- literal::red, literal::cyan,
- scribo::make::debug_filename("left_links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, left_link,
+ literal::red, literal::cyan,
+ scribo::make::debug_filename("left_links.ppm"));
// io::ppm::save(mln::labeling::colorize(value::rgb8(),
-// text.label_image(),
-// text.nbboxes()),
+// text,
+// text.nlabels()),
// scribo::make::debug_filename("lbl_before.ppm"));
- scribo::util::text<image2d<value::label_16> > grouped_text
+ text_t grouped_text
= text::grouping::group_from_single_link(text, left_link);
std::cout << "AFTER - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("left_label_color.ppm"));
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("left_bboxes.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("left_bboxes.ppm"));
}
{
@@ -105,27 +105,27 @@ int main(int argc, char* argv[])
= text::grouping::group_with_single_right_link(text, 30);
std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- text, right_link,
- literal::red, literal::cyan,
- scribo::make::debug_filename("right_links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, right_link,
+ literal::red, literal::cyan,
+ scribo::make::debug_filename("right_links.ppm"));
// io::ppm::save(mln::labeling::colorize(value::rgb8(),
-// text.label_image(),
-// text.nbboxes()),
+// text,
+// text.nlabels()),
// scribo::make::debug_filename("lbl_before.ppm"));
- scribo::util::text<image2d<value::label_16> > grouped_text
+ text_t grouped_text
= text::grouping::group_from_single_link(text, right_link);
io::ppm::save(mln::labeling::colorize(value::rgb8(),
- grouped_text.label_image(),
- grouped_text.nbboxes()),
+ grouped_text,
+ grouped_text.nlabels()),
scribo::make::debug_filename("right_label_color.ppm"));
std::cout << "AFTER - nbboxes = " << grouped_text.bboxes().nelements() << std::endl;
- scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("right_bboxes.ppm"));
+ scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("right_bboxes.ppm"));
}
diff --git a/scribo/src/morpho.cc b/scribo/src/morpho.cc
index 7121e57..91a089a 100644
--- a/scribo/src/morpho.cc
+++ b/scribo/src/morpho.cc
@@ -26,7 +26,7 @@
#include <mln/essential/2d.hh>
#include <mln/transform/distance_and_influence_zone_geodesic.hh>
#include <mln/core/var.hh>
-#include <mln/fun/v2v/wrap.hh>
+#include <mln/labeling/wrap.hh>
#include <mln/win/hline2d.hh>
#include <mln/morpho/watershed/flooding.hh>
#include <mln/morpho/watershed/superpose.hh>
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
mln_VAR(res, transform::distance_and_influence_zone_geodesic(lbl, c8(), mln_max(unsigned)));
- io::pgm::save(data::transform(res.first(), fun::v2v::wrap<label_8>()), "dmap.pgm");
+ io::pgm::save(labeling::wrap(res.first()), "dmap.pgm");
io::ppm::save(labeling::colorize(rgb8(), res.second(), nlabels), "iz.ppm");
image2d<unsigned>& dmap = res.first();
diff --git a/scribo/src/negate.cc b/scribo/src/negate.cc
index c2ff8e6..9c35f1c 100644
--- a/scribo/src/negate.cc
+++ b/scribo/src/negate.cc
@@ -43,8 +43,10 @@ int main(int argc, char *argv[])
using namespace mln;
if (argc != 3)
- return usage(argv, "Negate a binary image", "input.pbm output.pbm",
- args_desc, "A binary image.");
+ return scribo::debug::usage(argv,
+ "Negate a binary image",
+ "input.pbm output.pbm",
+ args_desc, "A binary image.");
image2d<bool> input;
io::pbm::load(input, argv[1]);
diff --git a/scribo/src/binarization/simple.cc b/scribo/src/preprocess.cc
similarity index 64%
copy from scribo/src/binarization/simple.cc
copy to scribo/src/preprocess.cc
index 25a1e42..bc1a1c7 100644
--- a/scribo/src/binarization/simple.cc
+++ b/scribo/src/preprocess.cc
@@ -23,37 +23,56 @@
// 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/int_u8.hh>
+#include <mln/value/label_16.hh>
+
#include <mln/io/pgm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/logical/not.hh>
+
#include <scribo/binarization/simple.hh>
+#include <scribo/preprocessing/unskew.hh>
+#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/thin_objects.hh>
+
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
{
- { "input.pgm", "A gray level image." },
+ { "input.pgm", "A gray-level image." },
{0, 0}
};
-
int main(int argc, char *argv[])
{
using namespace mln;
- using value::int_u8;
if (argc != 3)
- return usage(argv, "Simple binarization of a gray-level image.", "input.pbm output.pbm",
- args_desc, "A binary image.");
+ return scribo::debug::usage(argv,
+ "Generic image preprocessing",
+ "input.pgm output.pbm",
+ args_desc, "A binary image.");
trace::entering("main");
- image2d<int_u8> input;
+ typedef image2d<value::int_u8> I;
+ I input;
io::pgm::load(input, argv[1]);
+ image2d<bool> input_bw = scribo::binarization::simple(input);
+
+ logical::not_inplace(input_bw);
+ input_bw = scribo::preprocessing::unskew(input_bw);
- io::pbm::save(scribo::binarization::simple(input),
- argv[2]);
+ 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);
+ logical::not_inplace(input_bw);
+ io::pbm::save(input_bw, argv[2]);
trace::exiting("main");
+
}
diff --git a/scribo/src/preprocessing/unskew.cc b/scribo/src/preprocessing/unskew.cc
index d46884f..bdd9035 100644
--- a/scribo/src/preprocessing/unskew.cc
+++ b/scribo/src/preprocessing/unskew.cc
@@ -44,8 +44,10 @@ int main(int argc, char *argv[])
using namespace mln;
if (argc != 3)
- return usage(argv, "Unskew a binary image", "input.pbm output.pbm",
- args_desc, "A binary image.");
+ return scribo::debug::usage(argv,
+ "Unskew a binary image",
+ "input.pbm output.pbm",
+ args_desc, "A binary image.");
image2d<bool> input;
io::pbm::load(input, argv[1]);
diff --git a/scribo/src/recognition.cc b/scribo/src/recognition.cc
index e167d82..87bbade 100644
--- a/scribo/src/recognition.cc
+++ b/scribo/src/recognition.cc
@@ -62,8 +62,11 @@ int main(int argc, char* argv[])
using namespace mln;
if (argc != 2)
- return usage(argv, "Text extraction and recognition", "input.pbm",
- args_desc, "The text is printed on the standard output.");
+ return scribo::debug::usage(argv,
+ "Text extraction and recognition",
+ "input.pbm",
+ args_desc,
+ "The text is printed on the standard output.");
trace::entering("main");
diff --git a/scribo/src/superpose.cc b/scribo/src/superpose.cc
index d219dfd..8449987 100644
--- a/scribo/src/superpose.cc
+++ b/scribo/src/superpose.cc
@@ -46,8 +46,12 @@ int main(int argc, char *argv[])
using namespace mln;
if (argc != 4)
- return usage(argv, "Superpose two binary images", "input.pbm data.pbm output.ppm",
- args_desc, "A color image. Data from 'data.pbm' is colored in red.");
+ return scribo::debug::usage(argv,
+ "Superpose two binary images",
+ "input.pbm data.pbm output.ppm",
+ args_desc,
+ "A color image. Data from 'data.pbm' is \
+colored in red.");
image2d<bool> input;
io::pbm::load(input, argv[1]);
diff --git a/scribo/src/table/erase.cc b/scribo/src/table/erase.cc
index b45d7e9..3cb441e 100644
--- a/scribo/src/table/erase.cc
+++ b/scribo/src/table/erase.cc
@@ -32,7 +32,7 @@
#include <mln/value/label_16.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <scribo/table/extract.hh>
+#include <scribo/table/erase.hh>
#include <scribo/extract/primitive/lines_h_discontinued.hh>
#include <scribo/extract/primitive/lines_v_discontinued.hh>
@@ -55,9 +55,11 @@ int main(int argc, char* argv[])
using mln::value::label_16;
if (argc != 3)
- return usage(argv, "Remove tables from a binary image.",
- "input.pbm output.pbm",
- args_desc, "A binary image without tables.");
+ return scribo::debug::usage(argv,
+ "Remove tables from a binary image.",
+ "input.pbm output.pbm",
+ args_desc,
+ "A binary image without tables.");
trace::entering("main");
@@ -75,8 +77,8 @@ int main(int argc, char* argv[])
nhlines, 51, 6);
image2d<bool> input_notables
- = scribo::table::erase(input,
- mln::make::couple(lbl_v.bboxes(),lbl_h.bboxes()));
+ = scribo::table::erase(input, lbl_h, lbl_v);
+
io::pbm::save(input_notables, argv[2]);
trace::exiting("main");
diff --git a/scribo/src/table/extract.cc b/scribo/src/table/extract.cc
index 2d681f8..060f2f8 100644
--- a/scribo/src/table/extract.cc
+++ b/scribo/src/table/extract.cc
@@ -52,9 +52,11 @@ int main(int argc, char* argv[])
using namespace mln;
if (argc != 4)
- return usage(argv, "Extract tables from a binary image.",
- "input.pbm output.dump output.ppm",
- args_desc, "A color images. 'White' color means \
+ return scribo::debug::usage(argv,
+ "Extract tables from a binary image.",
+ "input.pbm output.dump output.ppm",
+ args_desc,
+ "A color images. 'White' color means \
the background, other colors indicates cells.");
trace::entering("main");
diff --git a/scribo/src/table_rebuild_opening.cc b/scribo/src/table_rebuild_opening.cc
index 2e504e5..8e12467 100644
--- a/scribo/src/table_rebuild_opening.cc
+++ b/scribo/src/table_rebuild_opening.cc
@@ -25,12 +25,18 @@
#include <iostream>
-#include <mln/essential/2d.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/value/label_8.hh>
+#include <mln/value/label_16.hh>
#include <mln/pw/all.hh>
+#include <mln/io/pbm/all.hh>
+#include <mln/util/couple.hh>
#include <scribo/table/rebuild.hh>
#include <scribo/table/erase.hh>
-#include <scribo/table/extract_lines_with_opening.hh>
+#include <scribo/extract/primitive/lines_h_thick.hh>
+#include <scribo/extract/primitive/lines_v_thick.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -54,18 +60,26 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
logical::not_inplace(input);
- typedef util::couple<util::array<box2d>,util::array<box2d> > tblboxes_t;
+ typedef object_image(image2d<value::label_16>) lines_t;
- win::vline2d vline(51);
- win::hline2d hline(51);
value::label_16 nbboxes;
- tblboxes_t lineboxes
- = table::extract_lines_with_opening(input, c8(), nbboxes,
- vline, hline);
+ lines_t hlines
+ = scribo::extract::primitive::lines_h_thick(input,
+ c8(),
+ nbboxes,
+ 51);
+ lines_t vlines
+ = scribo::extract::primitive::lines_v_thick(input,
+ c8(),
+ nbboxes,
+ 51);
value::label_8 ncells;
image2d<value::label_8> tables
- = scribo::table::rebuild(input, lineboxes, 30, ncells).first();
+ = scribo::table::rebuild(input,
+ mln::make::couple(vlines.bboxes(), hlines.bboxes()),
+ 30,
+ ncells).first();
std::cout << "ncells (including background) = " << ncells << std::endl;
@@ -73,11 +87,11 @@ int main(int argc, char* argv[])
scribo::make::debug_filename("table_cells.ppm"));
io::pgm::save(tables, scribo::make::debug_filename("table_cells.pgm"));
- image2d<value::rgb8> input_rgb = level::convert(value::rgb8(), input);
+ image2d<value::rgb8> input_rgb = data::convert(value::rgb8(), input);
data::fill((input_rgb | pw::value(tables) == pw::cst(0u)).rw(), literal::red);
io::ppm::save(input_rgb, scribo::make::debug_filename("table_superposed.ppm"));
- image2d<bool> in_wo_tables = table::erase(input, lineboxes);
+ image2d<bool> in_wo_tables = table::erase(input, hlines, vlines);
io::pbm::save(in_wo_tables,
scribo::make::debug_filename("input_wo_tables.pbm"));
}
diff --git a/scribo/src/table_rebuild_rank.cc b/scribo/src/table_rebuild_rank.cc
index 1c1764b..5e0d339 100644
--- a/scribo/src/table_rebuild_rank.cc
+++ b/scribo/src/table_rebuild_rank.cc
@@ -25,14 +25,20 @@
#include <iostream>
-#include <mln/essential/2d.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/value/label_8.hh>
+#include <mln/value/label_16.hh>
#include <mln/pw/all.hh>
+#include <mln/io/pbm/all.hh>
+#include <mln/util/couple.hh>
#include <mln/data/compute.hh>
#include <mln/accu/maj_h.hh>
#include <scribo/table/rebuild.hh>
#include <scribo/table/erase.hh>
-#include <scribo/table/extract_lines_with_rank.hh>
+#include <scribo/extract/primitive/lines_h_discontinued.hh>
+#include <scribo/extract/primitive/lines_v_discontinued.hh>
#include <scribo/make/debug_filename.hh>
int usage(const char *name)
@@ -56,18 +62,28 @@ int main(int argc, char* argv[])
io::pbm::load(input, argv[1]);
logical::not_inplace(input);
- typedef util::couple<util::array<box2d>,util::array<box2d> > tblboxes_t;
+ typedef object_image(image2d<value::label_16>) lines_t;
- win::vline2d vline(51);
- win::hline2d hline(51);
value::label_16 nbboxes;
- tblboxes_t lineboxes
- = table::extract_lines_with_rank(input, c8(), nbboxes,
- vline, hline, 6, 6);
+ lines_t hlines
+ = scribo::extract::primitive::lines_h_discontinued(input,
+ c8(),
+ nbboxes,
+ 51,
+ 6);
+ lines_t vlines
+ = scribo::extract::primitive::lines_v_discontinued(input,
+ c8(),
+ nbboxes,
+ 51,
+ 6);
value::label_8 ncells;
image2d<value::label_8> tables
- = scribo::table::rebuild(input, lineboxes, 5, ncells).first();
+ = scribo::table::rebuild(input,
+ mln::make::couple(vlines.bboxes(), hlines.bboxes()),
+ 30,
+ ncells).first();
std::cout << "ncells (including background) = " << ncells << std::endl;
@@ -88,7 +104,7 @@ int main(int argc, char* argv[])
data::fill((input_rgb | pw::value(tables) == pw::cst(0u)).rw(), literal::red);
io::ppm::save(input_rgb, scribo::make::debug_filename("table_superposed.ppm"));
- image2d<bool> in_wo_tables = table::erase(input, lineboxes);
+ image2d<bool> in_wo_tables = table::erase(input, hlines, vlines);
io::pbm::save(in_wo_tables,
scribo::make::debug_filename("input_wo_tables.pbm"));
diff --git a/scribo/src/text_in_photo.cc b/scribo/src/text_in_photo.cc
index 1e6b338..d13d741 100644
--- a/scribo/src/text_in_photo.cc
+++ b/scribo/src/text_in_photo.cc
@@ -33,6 +33,8 @@
#include <mln/io/pbm/all.hh>
#include <mln/io/ppm/save.hh>
+#include <mln/math/min.hh>
+
#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_single_left_link.hh>
#include <scribo/text/grouping/group_with_single_right_link.hh>
@@ -42,8 +44,8 @@
#include <scribo/filter/thick_objects.hh>
#include <scribo/make/debug_filename.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/debug/usage.hh>
@@ -63,8 +65,12 @@ int main(int argc, char* argv[])
scribo::make::internal::debug_filename_prefix = "photo";
if (argc != 3)
- return usage(argv, "Find text in a binarized photo.", "input.pbm output.ppm",
- args_desc, "A color image where the text is highlighted.");
+ return scribo::debug::usage(argv,
+ "Find text in a binarized photo.",
+ "input.pbm output.ppm",
+ args_desc,
+ "A color image where the text is \
+highlighted.");
trace::entering("main");
@@ -92,13 +98,13 @@ int main(int argc, char* argv[])
= text::grouping::group_with_single_right_link(objects, 30);
std::cout << "BEFORE - nobjects = " << nobjects << std::endl;
-// scribo::debug::save_linked_textbboxes_image(input,
+// scribo::debug::save_linked_bboxes_image(input,
// filtered_textbboxes, left_link, right_link,
// literal::red, literal::cyan, literal::yellow,
// literal::green,
// scribo::make::debug_filename("links.ppm"));
//
-// scribo::debug::save_textbboxes_image(input, filtered_textbboxes.bboxes(),
+// scribo::debug::save_bboxes_image(input, filtered_textbboxes.bboxes(),
// literal::red,
// scribo::make::debug_filename("test_graph_filtered_text.ppm"));
object_image(L) grouped_objects
@@ -107,7 +113,7 @@ int main(int argc, char* argv[])
std::cout << "AFTER - nobjects = " << grouped_objects.nlabels() << std::endl;
-// scribo::debug::save_textbboxes_image(input, grouped_textbboxes.bboxes(),
+// scribo::debug::save_bboxes_image(input, grouped_textbboxes.bboxes(),
// literal::red,
// scribo::make::debug_filename("test_graph_grouped_text.ppm"));
//
diff --git a/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc
index 3f826ff..49e28bd 100644
--- a/scribo/src/thin_bboxes.cc
+++ b/scribo/src/thin_bboxes.cc
@@ -40,18 +40,18 @@ int main(int argc, char *argv[])
if (argc < 1)
return usage(argv[0]);
- scribo::make::internal::debug_filename_prefix = "thin_bboxes";
+ scribo::make::internal::debug_filename_prefix = "thin_objects";
image2d<bool> input;
io::pbm::load(input, argv[1]);
value::label_16 nlines;
- typedef scribo::util::text<image2d<value::label_16> > text_t;
+ 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);
- scribo::debug::save_textbboxes_image(input, filtered_lines.bboxes(),
- literal::red,
- scribo::make::debug_filename("thickness_filter"));
+ scribo::debug::save_bboxes_image(input, filtered_lines.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("thickness_filter"));
}
diff --git a/scribo/table/align_lines_horizontaly.hh b/scribo/table/align_lines_horizontaly.hh
index 373bc88..b205b97 100644
--- a/scribo/table/align_lines_horizontaly.hh
+++ b/scribo/table/align_lines_horizontaly.hh
@@ -62,9 +62,9 @@ namespace scribo
/// \return A list of the resulting aligned rows. Each integer is actually
/// a row number.
template <typename I>
- util::array<int>
+ mln::util::array<int>
align_lines_horizontaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& line_bboxes,
+ mln::util::array<box<mln_site(I)> >& line_bboxes,
unsigned max_alignment_diff);
@@ -72,19 +72,19 @@ namespace scribo
template <typename I>
- util::array<int>
+ mln::util::array<int>
align_lines_horizontaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& line_bboxes,
+ mln::util::array<box<mln_site(I)> >& line_bboxes,
unsigned max_alignment_diff)
{
trace::entering("scribo::table::align_lines_horizontaly");
mln_precondition(exact(input).is_valid());
- util::array<int> res = internal::align_lines(geom::nrows(input),
- geom::min_row(input),
- geom::max_row(input),
- line_bboxes, 0,
- max_alignment_diff);
+ mln::util::array<int> res = internal::align_lines(geom::nrows(input),
+ geom::min_row(input),
+ geom::max_row(input),
+ line_bboxes, 0,
+ max_alignment_diff);
trace::exiting("scribo::table::align_lines_horizontaly");
return res;
diff --git a/scribo/table/align_lines_verticaly.hh b/scribo/table/align_lines_verticaly.hh
index 147f2ef..f7138bc 100644
--- a/scribo/table/align_lines_verticaly.hh
+++ b/scribo/table/align_lines_verticaly.hh
@@ -63,9 +63,9 @@ namespace scribo
/// \return A list of the resulting aligned cols. Each integer is actually
/// a col number.
template <typename I>
- util::array<int>
+ mln::util::array<int>
align_lines_verticaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& line_bboxes,
+ mln::util::array<box<mln_site(I)> >& line_bboxes,
unsigned max_alignment_diff);
@@ -73,15 +73,15 @@ namespace scribo
template <typename I>
- util::array<int>
+ mln::util::array<int>
align_lines_verticaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& line_bboxes,
+ mln::util::array<box<mln_site(I)> >& line_bboxes,
unsigned max_alignment_diff)
{
trace::entering("scribo::table::align_lines_verticaly");
mln_precondition(exact(input).is_valid());
- util::array<int> res = internal::align_lines(geom::ncols(input),
+ mln::util::array<int> res = internal::align_lines(geom::ncols(input),
geom::min_col(input),
geom::max_col(input),
line_bboxes, 1,
diff --git a/scribo/table/all.hh b/scribo/table/all.hh
index ecd2926..186af77 100644
--- a/scribo/table/all.hh
+++ b/scribo/table/all.hh
@@ -42,16 +42,15 @@ namespace scribo
} // end of namespace scribo
# include <scribo/table/internal/all.hh>
-# include <scribo/table/repair_vertical_lines.hh>
-# include <scribo/table/rebuild.hh>
-# include <scribo/table/connect_horizontal_lines.hh>
-# include <scribo/table/erase.hh>
+
# include <scribo/table/align_lines_horizontaly.hh>
-# include <scribo/table/extract_lines_with_opening.hh>
# include <scribo/table/align_lines_verticaly.hh>
-# include <scribo/table/extract_lines_with_rank.hh>
-# include <scribo/table/extract.hh>
+# include <scribo/table/connect_horizontal_lines.hh>
# include <scribo/table/connect_vertical_lines.hh>
+# include <scribo/table/erase.hh>
+# include <scribo/table/extract.hh>
+# include <scribo/table/rebuild.hh>
# include <scribo/table/repair_horizontal_lines.hh>
+# include <scribo/table/repair_vertical_lines.hh>
#endif // ! SCRIBO_TABLE_ALL_HH
diff --git a/scribo/table/connect_horizontal_lines.hh b/scribo/table/connect_horizontal_lines.hh
index a9ea3f4..45cc826 100644
--- a/scribo/table/connect_horizontal_lines.hh
+++ b/scribo/table/connect_horizontal_lines.hh
@@ -38,13 +38,16 @@
# include <scribo/table/internal/connect_lines.hh>
-
+#include <mln/value/int_u16.hh>
+#include <mln/draw/line.hh>
+#include <mln/io/pgm/all.hh>
namespace scribo
{
namespace table
{
+ using namespace mln;
/// Connect horizontal lines with the new aligned columns.
///
@@ -57,9 +60,9 @@ namespace scribo
/// and horizontal lines.
template <typename I>
void
- connect_horizontal_lines(const util::array<int>& aligned_cols,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ connect_horizontal_lines(const mln::util::array<int>& aligned_cols,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
const Image<I>& input,
unsigned max_distance);
@@ -69,9 +72,9 @@ namespace scribo
template <typename I>
void
- connect_horizontal_lines(const util::array<int>& aligned_cols,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ connect_horizontal_lines(const mln::util::array<int>& aligned_cols,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
const Image<I>& input,
unsigned max_distance)
{
diff --git a/scribo/table/connect_vertical_lines.hh b/scribo/table/connect_vertical_lines.hh
index 5a68217..4b1423c 100644
--- a/scribo/table/connect_vertical_lines.hh
+++ b/scribo/table/connect_vertical_lines.hh
@@ -57,9 +57,9 @@ namespace scribo
/// and horizontal lines.
template <typename I>
void
- connect_vertical_lines(const util::array<int>& aligned_rows,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ connect_vertical_lines(const mln::util::array<int>& aligned_rows,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
const Image<I>& input,
unsigned max_distance);
@@ -70,9 +70,9 @@ namespace scribo
/// Connect vertical lines with the new aligned rows.
template <typename I>
void
- connect_vertical_lines(const util::array<int>& aligned_rows,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ connect_vertical_lines(const mln::util::array<int>& aligned_rows,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
const Image<I>& input,
unsigned max_distance)
{
diff --git a/scribo/table/erase.hh b/scribo/table/erase.hh
index a231e1c..91c4228 100644
--- a/scribo/table/erase.hh
+++ b/scribo/table/erase.hh
@@ -28,7 +28,8 @@
/// \file scribo/table/erase.hh
///
-/// Erase the table lines in an image.
+/// \brief Erase the table lines in an image.
+
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/box.hh>
@@ -39,7 +40,7 @@
# include <mln/util/array.hh>
# include <mln/util/couple.hh>
-# include <scribo/core/erase_bboxes.hh>
+# include <scribo/core/erase_objects.hh>
namespace scribo
{
@@ -49,30 +50,31 @@ namespace scribo
using namespace mln;
- /// Erase table line bboxes from an image.
- ///
- /// \param[in] tablebboxes vertical and horizontal line bounding
- /// boxes.
- /// \param[in] input A binary image from which the table line
- /// bboxes are extracted.
+ /// Erase vertical and horizontal lines from an image.
///
+ /// \param[in] input A binary image from which the table lines
+ /// are extracted.
+ /// \param[in] hlines An object image with horizontal lines.
+ /// \param[in] vlines An object image with vertical lines.
///
/// \return A copy of \p in where the table lines are removed.
- template <typename I>
+ //
+ template <typename I, typename L>
mln_concrete(I)
erase(const Image<I>& input,
- const util::couple<util::array< box<mln_site(I)> >,
- util::array< box<mln_site(I)> > >& tablebboxes);
+ const object_image(L)& hlines,
+ const object_image(L)& vlines);
# ifndef MLN_INCLUDE_ONLY
- template <typename I>
+ template <typename I, typename L>
+ inline
mln_concrete(I)
erase(const Image<I>& input,
- const util::couple<util::array< box<mln_site(I)> >,
- util::array< box<mln_site(I)> > >& tablebboxes)
+ const object_image(L)& hlines,
+ const object_image(L)& vlines)
{
trace::entering("scribo::internal::erase");
mlc_equal(mln_value(I),bool)::check();
@@ -80,8 +82,8 @@ namespace scribo
I output = duplicate(input);
- erase_bboxes(output, tablebboxes.first());
- erase_bboxes(output, tablebboxes.second());
+ erase_objects(output, vlines);
+ erase_objects(output, hlines);
trace::exiting("scribo::internal::erase");
return output;
diff --git a/scribo/table/extract.hh b/scribo/table/extract.hh
index 6154c0d..f117603 100644
--- a/scribo/table/extract.hh
+++ b/scribo/table/extract.hh
@@ -40,8 +40,6 @@
# include <scribo/extract/primitive/lines_h_discontinued.hh>
# include <scribo/extract/primitive/lines_v_discontinued.hh>
-# include <scribo/make/debug_filename.hh>
-
namespace scribo
{
@@ -61,8 +59,8 @@ namespace scribo
*/
template <typename I, typename V>
mln::util::couple<mln_ch_value(I,V),
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > >
extract(const Image<I>& input_, V& ncells);
@@ -71,8 +69,8 @@ namespace scribo
template <typename I, typename V>
inline
mln::util::couple<mln_ch_value(I,V),
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > >
extract(const Image<I>& input_, V& ncells)
{
trace::entering("scribo::table::extract");
@@ -83,12 +81,14 @@ namespace scribo
V nhlines, nvlines;
object_image(mln_ch_value(I,V))
- hlines = extract::primitive::lines_h_discontinued(input, c8(), nhlines, 51, 6),
- vlines = extract::primitive::lines_v_discontinued(input, c8(), nvlines, 51, 6);
+ hlines = extract::primitive::lines_h_discontinued(input, c8(),
+ nhlines, 51, 6),
+ vlines = extract::primitive::lines_v_discontinued(input, c8(),
+ nvlines, 51, 6);
typedef mln::util::couple<mln_ch_value(I,V),
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > >
tables_t;
tables_t tables
= scribo::table::rebuild(input,
diff --git a/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh
index 10c7e2a..8ab2e8b 100644
--- a/scribo/table/internal/align_lines.hh
+++ b/scribo/table/internal/align_lines.hh
@@ -92,11 +92,11 @@ namespace scribo
**
*/
template <typename P>
- util::array<int>
+ mln::util::array<int>
align_lines(unsigned nsites,
int min_coord,
int max_coord,
- util::array<box<P> >& line_bboxes,
+ mln::util::array<box<P> >& line_bboxes,
unsigned dim,
unsigned max_alignment_diff);
@@ -106,11 +106,11 @@ namespace scribo
template <typename P>
- util::array<int>
+ mln::util::array<int>
align_lines(unsigned nsites,
int min_coord,
int max_coord,
- util::array<box<P> >& line_bboxes,
+ mln::util::array<box<P> >& line_bboxes,
unsigned dim,
unsigned max_alignment_diff)
{
@@ -118,7 +118,7 @@ namespace scribo
mln_precondition(nsites > 0);
- util::array< util::set<unsigned> > lines;
+ mln::util::array< mln::util::set<unsigned> > lines;
lines.resize(nsites);
// Map components with actual lines.
@@ -135,7 +135,7 @@ namespace scribo
}
// Init box2line
- util::array<int> box2line;
+ mln::util::array<int> box2line;
box2line.resize(line_bboxes.nelements());
for_all_elements(i, box2line)
box2line[i] = -1;
@@ -150,7 +150,7 @@ namespace scribo
// FIXME: not optimal... Make it faster!
// We may do too much iterations (while loop) and some of them may
// be done for nothing...
- util::array<int> newlines;
+ mln::util::array<int> newlines;
while (max_nelts > 0)
{
for_all_elements(i, lines)
diff --git a/scribo/table/internal/connect_lines.hh b/scribo/table/internal/connect_lines.hh
index baf0e73..5c01c0f 100644
--- a/scribo/table/internal/connect_lines.hh
+++ b/scribo/table/internal/connect_lines.hh
@@ -35,12 +35,16 @@
# include <mln/data/fill.hh>
+# include <mln/transform/influence_zone_geodesic.hh>
+
# include <mln/morpho/elementary/dilation.hh>
# include <mln/util/array.hh>
# include <mln/util/couple.hh>
# include <mln/opt/at.hh>
+# include <mln/transform/influence_zone_geodesic.hh>
+
# include <scribo/core/macros.hh>
# include <scribo/core/central_sites.hh>
@@ -66,8 +70,8 @@ namespace scribo
/// FIXME: doc arguments.
template <typename P>
void
- connect_lines(const util::array<int>& aligned_lines,
- util::array< box<P> >& boxes,
+ connect_lines(const mln::util::array<int>& aligned_lines,
+ mln::util::array< box<P> >& boxes,
unsigned dim,
unsigned dim_size,
unsigned max_distance);
@@ -78,8 +82,8 @@ namespace scribo
template <typename P>
void
- connect_lines(const util::array<int>& aligned_lines,
- util::array< box<P> >& boxes,
+ connect_lines(const mln::util::array<int>& aligned_lines,
+ mln::util::array< box<P> >& boxes,
unsigned dim,
unsigned dim_size,
unsigned max_distance)
@@ -90,18 +94,19 @@ namespace scribo
data::fill(l, -1);
for_all_elements(i, aligned_lines)
- opt::at(l, aligned_lines[i]) = i;
+ opt::at(l, aligned_lines[i]) = aligned_lines[i];
- for (unsigned i = 0; i < max_distance; ++i)
- l = morpho::elementary::dilation(l, c2());
+ l = transform::influence_zone_geodesic(l, c2(), max_distance, -1);
for_all_components(i, boxes)
{
- util::couple<P,P> cp = central_sites(boxes[i], dim);
- if (opt::at(l, cp.first()[dim]) != -1)
- boxes[i].pmin()[dim] = aligned_lines[opt::at(l, cp.first()[dim])];
- if (opt::at(l, cp.second()[dim]) != -1)
- boxes[i].pmax()[dim] = aligned_lines[opt::at(l, cp.second()[dim])];
+ mln::util::couple<P,P> cp = central_sites(boxes[i], dim);
+ if (opt::at(l, cp.first()[dim]) != -1
+ && opt::at(l, cp.first()[dim]) < boxes[i].pmin()[dim])
+ boxes[i].pmin()[dim] = opt::at(l, cp.first()[dim]);
+ if (opt::at(l, cp.second()[dim]) != -1
+ && opt::at(l, cp.second()[dim]) > boxes[i].pmax()[dim])
+ boxes[i].pmax()[dim] = opt::at(l, cp.second()[dim]);
}
trace::exiting("scribo::table::internal::connect_lines");
diff --git a/scribo/table/internal/repair_lines.hh b/scribo/table/internal/repair_lines.hh
index 26fdc17..fa7138a 100644
--- a/scribo/table/internal/repair_lines.hh
+++ b/scribo/table/internal/repair_lines.hh
@@ -79,7 +79,7 @@ namespace scribo
template <unsigned axis, typename I>
void
repair_lines(const Image<I>& input_,
- util::array<box<mln_site(I)> >& tableboxes,
+ mln::util::array<box<mln_site(I)> >& tableboxes,
unsigned max_discontinuity);
@@ -89,7 +89,7 @@ namespace scribo
template <unsigned axis, typename I>
void
repair_lines(const Image<I>& input_,
- util::array<box<mln_site(I)> >& tableboxes,
+ mln::util::array<box<mln_site(I)> >& tableboxes,
unsigned max_discontinuity)
{
trace::entering("scribo::table::internal::repair_lines");
@@ -105,7 +105,7 @@ namespace scribo
data::fill(l, literal::zero);
for_all_components(i, tableboxes)
{
- util::couple<P,P> cp = central_sites(tableboxes[i], axis);
+ mln::util::couple<P,P> cp = central_sites(tableboxes[i], axis);
l(cp.first()) = i;
l(cp.second()) = i;
}
@@ -113,7 +113,7 @@ namespace scribo
// Repair
extension_val<mln_ch_value(I,value::label_16)> l_ext(l, literal::zero);
- util::array<box<P> > result;
+ mln::util::array<box<P> > result;
std::vector<bool> to_keep(tableboxes.nelements(), true);
mln_VAR(tbb_ima, extend(l | (pw::value(l) != pw::cst(literal::zero)), l));
@@ -123,18 +123,18 @@ namespace scribo
mln_qiter(line_t) q(vl, p);
for_all(p)
{
- util::couple<P,P> cp_p = central_sites(tableboxes[l_ext(p)], axis);
+ mln::util::couple<P,P> cp_p = central_sites(tableboxes[l_ext(p)], axis);
for_all(q)
if (l_ext(q) != literal::zero && l_ext(q) != l_ext(p))
{
- if (util::ord_strict(tableboxes[l_ext(p)].pmax(),
+ if (mln::util::ord_strict(tableboxes[l_ext(p)].pmax(),
tableboxes[l_ext(q)].pmax()))
{
tableboxes[l_ext(p)].pmax() = tableboxes[l_ext(q)].pmax();
to_keep[l_ext(q)] = false;
}
- if (util::ord_strict(tableboxes[l_ext(q)].pmin(),
+ if (mln::util::ord_strict(tableboxes[l_ext(q)].pmin(),
tableboxes[l_ext(p)].pmin()))
{
tableboxes[l_ext(p)].pmin() = tableboxes[l_ext(q)].pmin();
@@ -143,7 +143,7 @@ namespace scribo
if (!to_keep[l_ext(q)])
{
- util::couple<P,P> cp_q = central_sites(tableboxes[l_ext(q)], axis);
+ mln::util::couple<P,P> cp_q = central_sites(tableboxes[l_ext(q)], axis);
l_ext(cp_q.first()) = literal::zero;
l_ext(cp_q.second()) = literal::zero;
@@ -151,7 +151,7 @@ namespace scribo
l_ext(cp_p.first()) = literal::zero;
l_ext(cp_p.second()) = literal::zero;
- util::couple<P,P> new_cp_p = central_sites(tableboxes[p_i], axis);
+ mln::util::couple<P,P> new_cp_p = central_sites(tableboxes[p_i], axis);
l_ext(new_cp_p.first()) = p_i;
l_ext(new_cp_p.second()) = p_i;
}
diff --git a/scribo/table/rebuild.hh b/scribo/table/rebuild.hh
index 6c6ba8b..6bfefbf 100644
--- a/scribo/table/rebuild.hh
+++ b/scribo/table/rebuild.hh
@@ -73,11 +73,11 @@ namespace scribo
*/
template <typename I, typename V>
mln::util::couple<mln_ch_value(I,V),
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > >
rebuild(const Image<I>& input_,
- const util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& linebboxes_,
+ const mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& linebboxes_,
unsigned max_dist_lines,
V& ncells);
@@ -87,11 +87,11 @@ namespace scribo
template <typename I, typename V>
mln::util::couple<mln_ch_value(I,V),
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > >
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > >
rebuild(const Image<I>& input_,
- const util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& linebboxes_,
+ const mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& linebboxes_,
unsigned max_dist_lines,
V& ncells)
{
@@ -101,14 +101,14 @@ namespace scribo
mlc_equal(mln_value(I), bool)::check();
mln_precondition(input.is_valid());
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > linebboxes = linebboxes_;
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > > linebboxes = linebboxes_;
scribo::debug::save_table_image(input, linebboxes,
literal::red, "table-raw.ppm");
- util::array<int> rows = align_lines_horizontaly(input, linebboxes.second(), 5);
- util::array<int> cols = align_lines_verticaly(input, linebboxes.first(), 5);
+ mln::util::array<int> rows = align_lines_horizontaly(input, linebboxes.second(), 5);
+ mln::util::array<int> cols = align_lines_verticaly(input, linebboxes.first(), 5);
# ifndef SCRIBO_NDEBUG
scribo::debug::save_table_image(input, linebboxes,
diff --git a/scribo/table/repair_horizontal_lines.hh b/scribo/table/repair_horizontal_lines.hh
index caa8492..6fc3ba1 100644
--- a/scribo/table/repair_horizontal_lines.hh
+++ b/scribo/table/repair_horizontal_lines.hh
@@ -58,8 +58,8 @@ namespace scribo
template <typename I>
void
repair_horizontal_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
unsigned max_discontinuity);
# ifndef MLN_INCLUDE_ONLY
@@ -68,8 +68,8 @@ namespace scribo
inline
void
repair_horizontal_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
unsigned max_discontinuity)
{
trace::entering("scribo::table::repair_horizontal_lines");
diff --git a/scribo/table/repair_vertical_lines.hh b/scribo/table/repair_vertical_lines.hh
index 6edde2e..38ba7f6 100644
--- a/scribo/table/repair_vertical_lines.hh
+++ b/scribo/table/repair_vertical_lines.hh
@@ -64,8 +64,8 @@ namespace scribo
template <typename I>
void
repair_vertical_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
unsigned max_discontinuity);
# ifndef MLN_INCLUDE_ONLY
@@ -74,8 +74,8 @@ namespace scribo
inline
void
repair_vertical_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tablebboxes,
+ mln::util::couple<mln::util::array<box<mln_site(I)> >,
+ mln::util::array<box<mln_site(I)> > >& tablebboxes,
unsigned max_discontinuity)
{
trace::entering("scribo::table::repair_vertical_lines");
diff --git a/scribo/tests/filter/small_and_large_bboxes.cc b/scribo/tests/filter/small_and_large_bboxes.cc
index a4dd76a..38aa85e 100644
--- a/scribo/tests/filter/small_and_large_bboxes.cc
+++ b/scribo/tests/filter/small_and_large_bboxes.cc
@@ -32,15 +32,17 @@
#include <mln/io/pbm/load.hh>
#include <mln/literal/colors.hh>
-#include <scribo/text/extract_bboxes.hh>
+#include <scribo/core/object_image.hh>
+
+#include <scribo/extract/primitive/objects.hh>
#include <scribo/text/grouping/group_with_graph.hh>
#include <scribo/text/grouping/group_from_graph.hh>
-#include <scribo/filter/small_components.hh>
+#include <scribo/filter/small_objects.hh>
#include <scribo/util/text.hh>
#include <scribo/make/debug_filename.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
+#include <scribo/debug/save_bboxes_image.hh>
+#include <scribo/debug/save_linked_bboxes_image.hh>
#include <scribo/tests/data.hh>
@@ -69,37 +71,37 @@ int main(int argc, char* argv[])
image2d<bool> input;
io::pbm::load(input, img.c_str());
- typedef scribo::util::text<image2d<value::label_16> > text_t;
value::label_16 nbboxes;
- text_t textbboxes = text::extract_bboxes(input, c8(), nbboxes);
+ typedef object_image(image2d<value::label_16>) text_t;
+ text_t text = extract::primitive::objects(input, c8(), nbboxes);
- mln::util::graph g = text::grouping::group_with_graph(textbboxes, 30);
+ mln::util::graph g = text::grouping::group_with_graph(text, 30);
mln_assertion(nbboxes == 12u);
// std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
-// scribo::debug::save_linked_textbboxes_image(input,
-// textbboxes, g,
+// scribo::debug::save_linked_bboxes_image(input,
+// text, g,
// literal::red, literal::cyan,
// "test_graph_left_linked.ppm");
- text_t grouped_textbboxes
- = text::grouping::group_from_graph(textbboxes, g);
+ text_t grouped_text
+ = text::grouping::group_from_graph(text, g);
-// std::cout << "AFTER - nbboxes = " << grouped_textbboxes.nbboxes().next() << std::endl;
+// std::cout << "AFTER - nbboxes = " << grouped_text.nbboxes().next() << std::endl;
//
-// scribo::debug::save_textbboxes_image(input, grouped_textbboxes.bboxes(),
+// scribo::debug::save_bboxes_image(input, grouped_text.bboxes(),
// literal::red,
// "test_graph_grouped_text.ppm");
- mln_assertion(grouped_textbboxes.nbboxes() == 6u);
+ mln_assertion(grouped_text.nbboxes() == 6u);
text_t
- filtered_textbboxes = scribo::filter::small_components(grouped_textbboxes, 20);
+ filtered_text = scribo::filter::small_objects(grouped_text, 20);
- mln_assertion(filtered_textbboxes.nbboxes() == 2u);
+ mln_assertion(filtered_text.nbboxes() == 2u);
-// scribo::debug::save_textbboxes_image(input, filtered_textbboxes.bboxes(),
+// scribo::debug::save_bboxes_image(input, filtered_text.bboxes(),
// literal::red,
// "test_graph_filtered_text.ppm");
diff --git a/scribo/tests/preprocessing/unskew.cc b/scribo/tests/preprocessing/unskew.cc
index ff6e715..832ae3d 100644
--- a/scribo/tests/preprocessing/unskew.cc
+++ b/scribo/tests/preprocessing/unskew.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009
- EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -30,14 +29,16 @@
#include <scribo/preprocessing/unskew.hh>
+#include <scribo/tests/data.hh>
int main(int argc, char *argv[])
{
(void) argc;
+ (void) argv;
using namespace mln;
image2d<bool> ima;
- io::pbm::load(ima, argv[1]);
+ io::pbm::load(ima, SCRIBO_IMG_DIR "/text_to_group.pbm");
- io::pbm::save(scribo::preprocessing::unskew(ima), "tr.pbm");
+ io::pbm::save(scribo::preprocessing::unskew(ima), "unskew.pbm");
}
diff --git a/scribo/tests/table/extract_lines_with_rank.cc b/scribo/tests/table/extract_lines_with_rank.cc
index 33bbac0..4ff6d89 100644
--- a/scribo/tests/table/extract_lines_with_rank.cc
+++ b/scribo/tests/table/extract_lines_with_rank.cc
@@ -74,15 +74,13 @@ int main(int argc, char *argv[])
lineboxes_t hboxes_, vboxes_;
- typedef image2d<value::label_8> lbl_t;
+ typedef object_image(image2d<value::label_8>) lbl_t;
lbl_t
hlbl = scribo::extract::primitive::lines_h_discontinued(input, c8(),
- nbboxes, 11, 2,
- hboxes_);
+ nbboxes, 11, 2);
lbl_t
vlbl = scribo::extract::primitive::lines_v_discontinued(input, c8(),
- nbboxes, 11, 2,
- vboxes_);
- mln_assertion(hboxes_ == hboxes);
- mln_assertion(vboxes_ == vboxes);
+ nbboxes, 11, 2);
+ mln_assertion(hlbl.bboxes() == hboxes);
+ mln_assertion(vlbl.bboxes() == vboxes);
}
diff --git a/scribo/tests/table/repair_lines.cc b/scribo/tests/table/repair_lines.cc
index d73d917..addbb10 100644
--- a/scribo/tests/table/repair_lines.cc
+++ b/scribo/tests/table/repair_lines.cc
@@ -35,7 +35,6 @@
#include <scribo/table/repair_vertical_lines.hh>
#include <scribo/table/repair_horizontal_lines.hh>
-#include <scribo/table/extract_lines_with_rank.hh>
#include <scribo/debug/save_table_image.hh>
#include <scribo/tests/data.hh>
@@ -64,12 +63,6 @@ int main(int argc, char *argv[])
lineboxes.second().append(make::box2d(27,0, 31, 26));
lineboxes.second().append(make::box2d(27,34, 31,59));
-
-// tblboxes_t lineboxes = scribo::table::extract_lines_with_rank(input, c8(), value::label_16(), win::vline2d(11), win::hline2d(11), 2, 2);
-//
-// std::cout << lineboxes.first() << std::endl;
-// std::cout << lineboxes.second() << std::endl;
-
scribo::table::repair_vertical_lines(input, lineboxes, 31);
scribo::table::repair_horizontal_lines(input, lineboxes, 31);
diff --git a/scribo/tests/unit_test/build_unit_test.sh b/scribo/tests/unit_test/build_unit_test.sh
index 87863e3..e722204 100755
--- a/scribo/tests/unit_test/build_unit_test.sh
+++ b/scribo/tests/unit_test/build_unit_test.sh
@@ -15,7 +15,13 @@ test $# -eq 1 || { echo "Usage: $0 <scribo path>" && exit 1; }
## FIXME: Ouch! Using `find' properly can probably save us some pipes,
## forks and characters here.
-HEADERS=`find $1 -name "*.hh" | grep -vE "*.spe.hh" | sort | sed -e 's/.*\/scribo\/\(.*\)/scribo\/\1/g' | sed 's/\.\.\/\.\.\///g'`
+HEADERS=`find $1 -name "*.hh" \
+ | grep -vE "*.spe.hh" \
+ | grep -v "recognition" \
+ | grep -v "demo" \
+ | sort \
+ | sed -e 's/.*\/scribo\/\(.*\)/scribo\/\1/g' \
+ | sed 's/\.\.\/\.\.\///g'`
output=unit-tests.mk
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 1f58b67..8024afb 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -5,18 +5,19 @@ scribo_all \
scribo_binarization_simple \
scribo_core_all \
scribo_core_central_sites \
-scribo_core_erase_bboxes \
+scribo_core_erase_objects \
scribo_core_macros \
scribo_core_object_image \
scribo_debug_all \
+scribo_debug_save_bboxes_image \
scribo_debug_save_label_image \
-scribo_debug_save_linked_textbboxes_image \
+scribo_debug_save_linked_bboxes_image \
scribo_debug_save_table_image \
-scribo_debug_save_textbboxes_image \
scribo_debug_usage \
scribo_draw_all \
scribo_draw_bounding_box_links \
scribo_draw_bounding_boxes \
+scribo_extract_lines_discontinued \
scribo_extract_primitive_canvas \
scribo_extract_primitive_cells \
scribo_extract_primitive_lines_discontinued \
@@ -73,7 +74,6 @@ scribo_text_grouping_internal_init_link_array \
scribo_text_grouping_internal_is_link_valid \
scribo_text_grouping_internal_update_graph_link \
scribo_text_grouping_internal_update_link_array \
-scribo_text_recognition \
scribo_util_all \
scribo_util_text
@@ -81,18 +81,19 @@ scribo_all_SOURCES = scribo_all.cc
scribo_binarization_simple_SOURCES = scribo_binarization_simple.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
-scribo_core_erase_bboxes_SOURCES = scribo_core_erase_bboxes.cc
+scribo_core_erase_objects_SOURCES = scribo_core_erase_objects.cc
scribo_core_macros_SOURCES = scribo_core_macros.cc
scribo_core_object_image_SOURCES = scribo_core_object_image.cc
scribo_debug_all_SOURCES = scribo_debug_all.cc
+scribo_debug_save_bboxes_image_SOURCES = scribo_debug_save_bboxes_image.cc
scribo_debug_save_label_image_SOURCES = scribo_debug_save_label_image.cc
-scribo_debug_save_linked_textbboxes_image_SOURCES = scribo_debug_save_linked_textbboxes_image.cc
+scribo_debug_save_linked_bboxes_image_SOURCES = scribo_debug_save_linked_bboxes_image.cc
scribo_debug_save_table_image_SOURCES = scribo_debug_save_table_image.cc
-scribo_debug_save_textbboxes_image_SOURCES = scribo_debug_save_textbboxes_image.cc
scribo_debug_usage_SOURCES = scribo_debug_usage.cc
scribo_draw_all_SOURCES = scribo_draw_all.cc
scribo_draw_bounding_box_links_SOURCES = scribo_draw_bounding_box_links.cc
scribo_draw_bounding_boxes_SOURCES = scribo_draw_bounding_boxes.cc
+scribo_extract_lines_discontinued_SOURCES = scribo_extract_lines_discontinued.cc
scribo_extract_primitive_canvas_SOURCES = scribo_extract_primitive_canvas.cc
scribo_extract_primitive_cells_SOURCES = scribo_extract_primitive_cells.cc
scribo_extract_primitive_lines_discontinued_SOURCES = scribo_extract_primitive_lines_discontinued.cc
@@ -149,6 +150,5 @@ scribo_text_grouping_internal_init_link_array_SOURCES = scribo_text_grouping_int
scribo_text_grouping_internal_is_link_valid_SOURCES = scribo_text_grouping_internal_is_link_valid.cc
scribo_text_grouping_internal_update_graph_link_SOURCES = scribo_text_grouping_internal_update_graph_link.cc
scribo_text_grouping_internal_update_link_array_SOURCES = scribo_text_grouping_internal_update_link_array.cc
-scribo_text_recognition_SOURCES = scribo_text_recognition.cc
scribo_util_all_SOURCES = scribo_util_all.cc
scribo_util_text_SOURCES = scribo_util_text.cc
diff --git a/scribo/text/all.hh b/scribo/text/all.hh
index 141e113..d269ebb 100644
--- a/scribo/text/all.hh
+++ b/scribo/text/all.hh
@@ -42,8 +42,8 @@ namespace scribo
} // end of namespace scribo
# include <scribo/text/extract_lines.hh>
-# include <scribo/text/recognition.hh>
-# include <scribo/text/extract_bboxes.hh>
+//# include <scribo/text/recognition.hh>
+# include <scribo/text/clean.hh>
# include <scribo/text/grouping/all.hh>
#endif // ! SCRIBO_TEXT_ALL_HH
diff --git a/scribo/text/clean.hh b/scribo/text/clean.hh
index 559ba2e..5a0b2e1 100644
--- a/scribo/text/clean.hh
+++ b/scribo/text/clean.hh
@@ -34,6 +34,7 @@
# include <mln/core/routine/extend.hh>
# include <mln/morpho/skeleton_constrained.hh>
+# include <mln/morpho/dilation.hh>
# include <mln/topo/skeleton/is_simple_point.hh>
# include <mln/topo/skeleton/crest.hh>
@@ -50,16 +51,30 @@
#include <mln/arith/revert.hh>
+#include <mln/transform/distance_front.hh>
+
#include <mln/linear/gaussian.hh>
#include <mln/value/int_u8.hh>
+
+
namespace scribo
{
namespace text
{
+ using namespace mln;
+
+
+ /// Improve quality of an image with text.
+ ///
+ /// \param[in] input_ A binary image.
+ /// \param[in] dmap_win_ A weighted window.
+ ///
+ /// \return An image. The text have better quality.
+ //
template <typename I, typename W>
mln_concrete(I)
clean(const Image<I>& input_, const Weighted_Window<W>& dmap_win_);
@@ -68,7 +83,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- static int plop = 0;
+// static int plop = 0;
template <typename I, typename W>
mln_concrete(I)
@@ -117,7 +132,7 @@ namespace scribo
// io::pbm::save(output, mln::debug::filename("dil_skel.pbm"));
}
- ++plop;
+// ++plop;
trace::exiting("scribo::text::clean");
return output;
}
diff --git a/scribo/text/extract_lines.hh b/scribo/text/extract_lines.hh
index f803990..a84d10f 100644
--- a/scribo/text/extract_lines.hh
+++ b/scribo/text/extract_lines.hh
@@ -47,15 +47,17 @@
# include <mln/util/graph.hh>
# include <mln/value/label_16.hh>
+# include <scribo/extract/primitive/objects.hh>
# include <scribo/text/grouping/group_with_several_left_links.hh>
# include <scribo/text/grouping/group_with_several_right_links.hh>
# include <scribo/text/grouping/group_from_double_link.hh>
-# include <scribo/filter/small_objects.hh>
-# include <scribo/util/text.hh>
-# include <scribo/make/debug_filename.hh>
-# include <scribo/debug/save_textbboxes_image.hh>
-# include <scribo/debug/save_linked_textbboxes_image.hh>
+# ifndef SCRIBO_NDEBUG
+# include <mln/literal/colors.hh>
+# include <scribo/make/debug_filename.hh>
+# include <scribo/debug/save_bboxes_image.hh>
+# include <scribo/debug/save_linked_bboxes_image.hh>
+# endif // SCRIBO_NDEBUG
namespace scribo
{
@@ -72,10 +74,10 @@ namespace scribo
** \param[in,out] nbboxes Will hold the number of bounding boxes
** at the end of the routine.
**
- ** \return The text lines.
+ ** \return An object image with grouped potential text objects.
*/
template <typename I, typename N, typename V>
- scribo::util::text<mln_ch_value(I,V)>
+ object_image(mln_ch_value(I,V))
extract_lines(const Image<I>& input_,
const Neighborhood<N>& nbh_,
V& nbboxes);
@@ -85,7 +87,7 @@ namespace scribo
template <typename I, typename N, typename V>
- scribo::util::text<mln_ch_value(I,V)>
+ object_image(mln_ch_value(I,V))
extract_lines(const Image<I>& input_,
const Neighborhood<N>& nbh_,
V& nbboxes)
@@ -98,12 +100,12 @@ namespace scribo
mln_precondition(input.is_valid());
mln_precondition(nbh.is_valid());
- scribo::util::text<mln_ch_value(I,V)> text
- = scribo::make::text(input, nbh, nbboxes);
+ typedef object_image(mln_ch_value(I,V)) text_t;
+ text_t text = scribo::extract::primitive::objects(input, nbh, nbboxes);
# ifndef SCRIBO_NDEBUG
- debug::save_textbboxes_image(input, text.bboxes(), literal::red,
- scribo::make::debug_filename("character-bboxes.ppm"));
+ debug::save_bboxes_image(input, text.bboxes(), literal::red,
+ scribo::make::debug_filename("character-bboxes.ppm"));
# endif // ! SCRIBO_NDEBUG
//Link character bboxes to their left neighboor if possible.
@@ -113,21 +115,21 @@ namespace scribo
= text::grouping::group_with_several_right_links(text, 30);
# ifndef SCRIBO_NDEBUG
- scribo::debug::save_linked_textbboxes_image(input,
- text, left_link, right_link,
- literal::red, literal::cyan,
- literal::yellow, literal::green,
- scribo::make::debug_filename("links.ppm"));
+ scribo::debug::save_linked_bboxes_image(input,
+ text, left_link, right_link,
+ literal::red, literal::cyan,
+ literal::yellow, literal::green,
+ scribo::make::debug_filename("links.ppm"));
# endif // ! SCRIBO_NDEBUG
//Merge character bboxes through a graph.
- scribo::util::text<mln_ch_value(I,V)> grouped_text
+ text_t grouped_text
= text::grouping::group_from_double_link(text, left_link, right_link);
# ifndef SCRIBO_NDEBUG
- debug::save_textbboxes_image(input, grouped_text.bboxes(),
- literal::red,
- scribo::make::debug_filename("multiple_links_grouped_text.ppm"));
+ debug::save_bboxes_image(input, grouped_text.bboxes(),
+ literal::red,
+ scribo::make::debug_filename("multiple_links_grouped_text.ppm"));
# endif // ! SCRIBO_NDEBUG
diff --git a/scribo/text/grouping/group_from_double_link.hh b/scribo/text/grouping/group_from_double_link.hh
index 4c9fa47..9c0cfa1 100644
--- a/scribo/text/grouping/group_from_double_link.hh
+++ b/scribo/text/grouping/group_from_double_link.hh
@@ -46,8 +46,10 @@
# include <scribo/make/text.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/find_root.hh>
# include <scribo/text/grouping/internal/is_link_valid.hh>
+# include <scribo/text/grouping/internal/init_link_array.hh>
namespace scribo
diff --git a/scribo/text/grouping/group_from_graph.hh b/scribo/text/grouping/group_from_graph.hh
index aeb8683..d6debd2 100644
--- a/scribo/text/grouping/group_from_graph.hh
+++ b/scribo/text/grouping/group_from_graph.hh
@@ -46,9 +46,8 @@
# include <mln/util/array.hh>
# include <mln/util/graph_ids.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/util/text.hh>
-# include <scribo/make/text.hh>
namespace scribo
@@ -60,19 +59,22 @@ namespace scribo
namespace grouping
{
+ using namespace mln;
+
/// Group lines of text according to a graph of links between
/// the lines of text.
- /*!
- ** \param[in] text The lines of text.
- ** \param[in] g_ The graph of links between the lines of text.
- **
- ** \return The grouped and non-grouped lines of text.
- */
- template <typename I, typename G>
- scribo::util::text<I>
- group_from_graph(const scribo::util::text<I>& text,
+ ///
+ /// \param[in] text An object image.
+ /// \param[in] g_ The graph of links between the lines of text.
+ ///
+ /// \return An image with grouped objects.
+ //
+ template <typename L, typename G>
+ object_image(L)
+ group_from_graph(const object_image(L)& text,
const Graph<G>& g_);
+
# ifndef MLN_INCLUDE_ONLY
@@ -138,10 +140,10 @@ namespace scribo
- template <typename I, typename G>
+ template <typename L, typename G>
inline
- scribo::util::text<I>
- group_from_graph(const scribo::util::text<I>& text,
+ object_image(L)
+ group_from_graph(const object_image(L)& text,
const Graph<G>& g_)
{
trace::entering("scribo::text::grouping::group_from_graph");
@@ -150,10 +152,12 @@ namespace scribo
mln_assertion(g.is_valid());
- internal::map_vertex_to_representative_id_functor<mln_value(I)> f;
+ internal::map_vertex_to_representative_id_functor<mln_value(L)> f;
canvas::browsing::depth_first_search(g, f);
- scribo::util::text<I> output = scribo::make::text(text, f.vertextorep);
+ object_image(L) output;
+ output.init_from_(text);
+ output.relabel(f.vertextorep);
trace::exiting("scribo::text::grouping::group_from_graph");
return output;
diff --git a/scribo/text/grouping/group_from_single_link.hh b/scribo/text/grouping/group_from_single_link.hh
index 4885cb5..242cce9 100644
--- a/scribo/text/grouping/group_from_single_link.hh
+++ b/scribo/text/grouping/group_from_single_link.hh
@@ -28,7 +28,7 @@
/// \file scribo/text/grouping/group_from_single_link.hh
///
-/// Link lines of text with their neighbor line if they have one.
+/// Link text objects with their neighbor line if they have one.
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/box.hh>
@@ -40,9 +40,8 @@
# include <scribo/text/grouping/internal/find_root.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/util/text.hh>
-# include <scribo/make/text.hh>
namespace scribo
@@ -54,55 +53,44 @@ namespace scribo
namespace grouping
{
- /// Link lines of text with their neighbor line if they have one.
+ using namespace mln;
+
+ /// Link text objects with their neighbor line if they have one.
/*!
- ** \param[in] text The lines of text.
+ ** \param[in] objects An object image.
** \param[in] link_array The neighbor line of each line.
**
- ** \return The grouped and non-grouped lines of text.
+ ** \return An object image with grouped objects.
*/
- template <typename I>
- scribo::util::text<I>
- group_from_single_link(const scribo::util::text<I>& text,
+ template <typename L>
+ object_image(L)
+ group_from_single_link(const object_image(L)& objects,
const mln::util::array<unsigned>& link_array);
# ifndef MLN_INCLUDE_ONLY
- template <typename I>
+ template <typename L>
inline
- scribo::util::text<I>
- group_from_single_link(const scribo::util::text<I>& text,
+ object_image(L)
+ group_from_single_link(const object_image(L)& objects,
const mln::util::array<unsigned>& link_array)
{
trace::entering("scribo::text::grouping::group_from_single_link");
- mln_precondition(text.is_valid());
- mln_precondition(link_array.nelements() == text.nbboxes().next());
- mln_precondition(link_array.nelements() == text.bboxes().nelements());
+ mln_precondition(objects.is_valid());
+ mln_precondition(link_array.nelements() == objects.nlabels().next());
+ mln_precondition(link_array.nelements() == objects.bboxes().nelements());
mln::util::array<unsigned> parent_array = link_array;
for_all_components(i, parent_array)
internal::find_root(parent_array, i);
- mln::util::array< accu::bbox<mln_site(I)> > tboxes;
- tboxes.resize(text.nbboxes().next());
- for_all_components(i, text.bboxes())
- tboxes[parent_array[i]].take(text.bbox(i));
-
- mln::util::array< box<mln_site(I)> > result;
- // component 0, the background, has an invalid box.
- result.append(box<mln_site(I)>());
- for_all_components(i, tboxes)
- if (tboxes[i].is_valid())
- result.append(tboxes[i]);
-
- I lbl = labeling::relabel(text.label_image(), text.nbboxes(),
- convert::to<fun::i2v::array<mln_value(I)> >(parent_array));
- mln_value(I) new_nbboxes = result.nelements() - 1;
+ object_image(L) output;
+ output.init_from_(objects);
+ output.relabel(parent_array);
trace::exiting("scribo::text::grouping::group_from_single_link");
- /// FIXME: construct a new util::text from the old one.
- return scribo::make::text(result, lbl, new_nbboxes);
+ return output;
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/scribo/text/grouping/group_with_graph.hh b/scribo/text/grouping/group_with_graph.hh
index e266cad..7865a7b 100644
--- a/scribo/text/grouping/group_with_graph.hh
+++ b/scribo/text/grouping/group_with_graph.hh
@@ -34,10 +34,15 @@
# include <mln/math/abs.hh>
+# include <mln/labeling/compute.hh>
+
+# include <mln/accu/center.hh>
+
# include <mln/util/array.hh>
# include <mln/util/graph.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/init_link_array.hh>
# include <scribo/text/grouping/internal/find_graph_link.hh>
# include <scribo/util/text.hh>
@@ -63,7 +68,7 @@ namespace scribo
*/
template <typename L>
mln::util::graph
- group_with_graph(const scribo::util::text<L>& text,
+ group_with_graph(const object_image(L)& text,
unsigned neighb_max_distance);
# ifndef MLN_INCLUDE_ONLY
@@ -71,25 +76,30 @@ namespace scribo
template <typename L>
inline
mln::util::graph
- group_with_graph(const scribo::util::text<L>& text,
+ group_with_graph(const object_image(L)& text,
unsigned neighb_max_distance)
{
trace::entering("scribo::text::grouping::group_with_graph");
- mln::util::graph g(text.nbboxes().next());
+ mln::util::graph g(text.nlabels().next());
- for_all_ncomponents(i, text.nbboxes())
+ for_all_ncomponents(i, text.nlabels())
{
unsigned midcol = (text.bbox(i).pmax().col()
- text.bbox(i).pmin().col()) / 2;
int dmax = midcol + neighb_max_distance;
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_center = labeling::compute(accu::meta::center(),
+ text,
+ text.nlabels());
+
// -------
// | |
// | X------->
// | |
// -------
- internal::find_graph_link(g, text, i, dmax, text.mass_center(i));
+ internal::find_graph_link(g, text, i, dmax, mass_center[i]);
}
trace::exiting("scribo::text::grouping::group_with_graph");
diff --git a/scribo/text/grouping/group_with_several_graphes.hh b/scribo/text/grouping/group_with_several_graphes.hh
index 292c663..24cea3d 100644
--- a/scribo/text/grouping/group_with_several_graphes.hh
+++ b/scribo/text/grouping/group_with_several_graphes.hh
@@ -26,7 +26,7 @@
#ifndef SCRIBO_TEXT_GROUPING_GROUP_WITH_SEVERAL_GRAPHES_HH
# define SCRIBO_TEXT_GROUPING_GROUP_WITH_SEVERAL_GRAPHES_HH
-/// \file scribo/text/grouping/group_with_several_graphes.hh
+/// \file
///
/// Group character bounding boxes with several graphes.
@@ -37,11 +37,12 @@
# include <mln/math/abs.hh>
# include <mln/util/array.hh>
+# include <mln/util/graph.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
# include <scribo/text/grouping/internal/init_link_array.hh>
# include <scribo/text/grouping/internal/find_graph_link.hh>
-# include <scribo/util/text.hh>
namespace scribo
{
@@ -56,27 +57,33 @@ namespace scribo
/// Look up for neighbors on the left of each box.
template <typename L>
mln::util::graph
- group_with_several_graphes(const scribo::util::text<L>& text,
- unsigned neighb_max_distance);
+ group_with_several_graphes(const object_image(L)& objects,
+ unsigned neighb_max_distance);
# ifndef MLN_INCLUDE_ONLY
template <typename L>
inline
mln::util::graph
- group_with_several_graphes(const scribo::util::text<L>& text,
- unsigned neighb_max_distance)
+ group_with_several_graphes(const object_image(L)& objects,
+ unsigned neighb_max_distance)
{
trace::entering("scribo::text::grouping::group_with_several_graphes");
- mln::util::graph g(text.nbboxes().next());
+ mln::util::graph g(objects.nlabels().next());
- for_all_ncomponents(i, text.nbboxes())
+ for_all_ncomponents(i, objects.nlabels())
{
- unsigned midcol = (text.bbox(i).pmax().col()
- - text.bbox(i).pmin().col()) / 2;
+ unsigned midcol = (objects.bbox(i).pmax().col()
+ - objects.bbox(i).pmin().col()) / 2;
int dmax = midcol + neighb_max_distance;
- mln_site(L) c = text.mass_center(i);
+
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_center = labeling::compute(accu::meta::center(),
+ objects,
+ objects.nlabels());
+
+ mln_site(L) c = mass_center(i);
// -------
// | X------->
@@ -93,16 +100,16 @@ namespace scribo
/// Left link from the top anchor.
mln_site(L) a1 = c;
- a1.row() = text.bbox(i).pmin().row() + (c.row() - text.bbox(i).pmin().row()) / 4;
- internal::find_graph_link(g, text, i, dmax, a1);
+ a1.row() = objects.bbox(i).pmin().row() + (c.row() - objects.bbox(i).pmin().row()) / 4;
+ internal::find_graph_link(g, objects, i, dmax, a1);
/// First site on the right of the central site
- internal::find_graph_link(g, text, i, dmax, c);
+ internal::find_graph_link(g, objects, i, dmax, c);
/// Left link from the bottom anchor.
mln_site(L) a2 = c;
- a2.row() = text.bbox(i).pmax().row() - (c.row() - text.bbox(i).pmin().row()) / 4;
- internal::find_graph_link(g, text, i, dmax, a2);
+ a2.row() = objects.bbox(i).pmax().row() - (c.row() - objects.bbox(i).pmin().row()) / 4;
+ internal::find_graph_link(g, objects, i, dmax, a2);
}
diff --git a/scribo/text/grouping/group_with_several_right_links.hh b/scribo/text/grouping/group_with_several_right_links.hh
index d8ac693..c785b0e 100644
--- a/scribo/text/grouping/group_with_several_right_links.hh
+++ b/scribo/text/grouping/group_with_several_right_links.hh
@@ -37,6 +37,7 @@
# include <mln/util/array.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
# include <scribo/text/grouping/internal/init_link_array.hh>
# include <scribo/text/grouping/internal/find_right_link.hh>
@@ -52,6 +53,8 @@ namespace scribo
namespace grouping
{
+ using namespace mln;
+
/// Map each character bounding box to its right bounding box neighbor
/// if possible.
/// Iterate to the right but link boxes to the right.
diff --git a/scribo/text/grouping/internal/find_graph_link.hh b/scribo/text/grouping/internal/find_graph_link.hh
index 41ed0c7..b6fa1ee 100644
--- a/scribo/text/grouping/internal/find_graph_link.hh
+++ b/scribo/text/grouping/internal/find_graph_link.hh
@@ -37,7 +37,7 @@
# include <mln/util/array.hh>
-# include <scribo/util/text.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/update_graph_link.hh>
//FIXME: not generic.
@@ -63,10 +63,11 @@ namespace scribo
/// \param current_comp The current line being processed.
/// \param dmax The maximum lookup distance.
/// \param c Start point of the neighbor lookup.
+ //
template <typename G, typename L>
void
find_graph_link(Graph<G>& g_,
- const scribo::util::text<L>& text,
+ const object_image(L)& text,
unsigned current_comp,
int dmax,
const mln_site(L)& c);
@@ -76,7 +77,7 @@ namespace scribo
template <typename G, typename L>
void
find_graph_link(Graph<G>& g_,
- const scribo::util::text<L>& text,
+ const object_image(L)& text,
unsigned current_comp,
int dmax,
const mln_site(L)& c)
@@ -91,13 +92,12 @@ namespace scribo
/// First site on the right of the central site
mln_site(L) p = c + right;
- const L& lbl = text.label_image();
- while (lbl.domain().has(p) && (lbl(p) == literal::zero
- || lbl(p) == current_comp)
+ while (text.domain().has(p) && (text(p) == literal::zero
+ || text(p) == current_comp)
&& math::abs(p.col() - c.col()) < dmax)
++p.col();
- update_graph_link(lbl, g, p, c, current_comp, dmax);
+ update_graph_link(text, g, p, c, current_comp, dmax);
trace::exiting("scribo::text::grouping::internal::find_graph_link");
}
diff --git a/scribo/text/grouping/internal/find_right_link.hh b/scribo/text/grouping/internal/find_right_link.hh
index b98811e..bd3c863 100644
--- a/scribo/text/grouping/internal/find_right_link.hh
+++ b/scribo/text/grouping/internal/find_right_link.hh
@@ -36,7 +36,7 @@
# include <mln/util/array.hh>
-# include <scribo/util/text.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/update_link_array.hh>
//FIXME: not generic.
@@ -54,6 +54,8 @@ namespace scribo
namespace internal
{
+ using namespace mln;
+
/// Find the right neighbor of a line of text if exists.
///
/// \param text The lines of text.
@@ -61,23 +63,24 @@ namespace scribo
/// \param current_comp A text line id.
/// \param dmax The maximum lookup distance.
/// \param c The lookup start point.
+ //
template <typename L>
void
find_right_link(const object_image(L)& text,
- mln::util::array<unsigned>& right_link,
- unsigned current_comp,
- int dmax,
- const mln_site(L)& c);
+ mln::util::array<unsigned>& right_link,
+ unsigned current_comp,
+ int dmax,
+ const mln_site(L)& c);
# ifndef MLN_INCLUDE_ONLY
template <typename L>
void
find_right_link(const object_image(L)& objects,
- mln::util::array<unsigned>& right_link,
- unsigned current_comp,
- int dmax,
- const mln_site(L)& c)
+ mln::util::array<unsigned>& right_link,
+ unsigned current_comp,
+ int dmax,
+ const mln_site(L)& c)
{
///FIXME: the following code is not generic...
/// First site on the right of the central site
diff --git a/scribo/text/grouping/internal/update_graph_link.hh b/scribo/text/grouping/internal/update_graph_link.hh
index c576290..9fd3ede 100644
--- a/scribo/text/grouping/internal/update_graph_link.hh
+++ b/scribo/text/grouping/internal/update_graph_link.hh
@@ -32,6 +32,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/graph.hh>
+# include <mln/math/abs.hh>
namespace scribo
{
@@ -45,7 +46,19 @@ namespace scribo
namespace internal
{
+ using namespace mln;
+
+
/// Update graph edges if a valid neighbor is found.
+ ///
+ /// \param[in] lbl_ A label image.
+ /// \param[in] g_ A graph.
+ /// \param[in] p A site of \p lbl_.
+ /// \param[in] c A site of \p lbl_.
+ /// \param[in] i A vertex id.
+ /// \param[in] dmax The maximum distance allowed to look for a
+ /// neighbor.
+ //
template <typename I, typename G>
void
update_graph_link(const Image<I>& lbl_, Graph<G>& g_,
diff --git a/scribo/text/grouping/internal/update_link_array.hh b/scribo/text/grouping/internal/update_link_array.hh
index 4deb25c..ef20dc9 100644
--- a/scribo/text/grouping/internal/update_link_array.hh
+++ b/scribo/text/grouping/internal/update_link_array.hh
@@ -34,6 +34,7 @@
# include <mln/core/concept/image.hh>
# include <mln/util/array.hh>
+# include <mln/math/abs.hh>
namespace scribo
@@ -48,11 +49,21 @@ namespace scribo
namespace internal
{
+ using namespace mln;
+
+
/// Update the lookup table \p link_array if a neighbor is found
/// on the right of the current bbox.
+ ///
+ /// \param[in] lbl A label image.
+ /// \param[in] link_array Links of bounding boxes.
+ /// \param[in] p A site of \p lbl.
+ /// \param[in] c A site of \p lbl.
+ //
template <typename I>
void
- update_link_array(const Image<I>& lbl, mln::util::array<unsigned>& link_array,
+ update_link_array(const Image<I>& lbl,
+ mln::util::array<unsigned>& link_array,
const mln_site(I)& p, const mln_site(I)& c,
unsigned i, int dmax);
--
1.5.6.5
1
0
* demo/Makefile.am,
* demo/demo.pro,
* demo/demo.qrc: build system based on qmake-qt4.
* demo/icons/document-open.png,
* demo/icons/edit-find.png,
* demo/icons/format-indent-more.png,
* demo/icons/go-next.png,
* demo/icons/image-x-generic.png,
* demo/icons/list-add.png,
* demo/icons/ocr.png,
* demo/icons/text-x-generic.png,
* demo/icons/view-refresh.png,
* demo/icons/x-office-spreadsheet.png: icon set.
* demo/src/main.cc,
* demo/src/mainwindow.cc,
* demo/src/mainwindow.hh,
* demo/ui/mainwindow.ui: main classes.
---
scribo/ChangeLog | 24 +++
scribo/demo/Makefile.am | 9 +
scribo/demo/demo.pro | 16 ++
scribo/demo/demo.qrc | 13 ++
scribo/demo/icons/document-open.png | Bin 0 -> 1550 bytes
scribo/demo/icons/edit-find.png | Bin 0 -> 1636 bytes
scribo/demo/icons/format-indent-more.png | Bin 0 -> 766 bytes
scribo/demo/icons/go-next.png | Bin 0 -> 1219 bytes
scribo/demo/icons/image-x-generic.png | Bin 0 -> 1163 bytes
scribo/demo/icons/list-add.png | Bin 0 -> 601 bytes
scribo/demo/icons/ocr.png | Bin 0 -> 14929 bytes
scribo/demo/icons/text-x-generic.png | Bin 0 -> 744 bytes
scribo/demo/icons/view-refresh.png | Bin 0 -> 2024 bytes
scribo/demo/icons/x-office-spreadsheet.png | Bin 0 -> 1518 bytes
scribo/demo/src/main.cc | 40 ++++
scribo/demo/src/mainwindow.cc | 305 ++++++++++++++++++++++++++++
scribo/demo/src/mainwindow.hh | 93 +++++++++
scribo/demo/ui/mainwindow.ui | 147 +++++++++++++
18 files changed, 647 insertions(+), 0 deletions(-)
create mode 100644 scribo/demo/Makefile.am
create mode 100644 scribo/demo/demo.pro
create mode 100644 scribo/demo/demo.qrc
create mode 100644 scribo/demo/icons/document-open.png
create mode 100644 scribo/demo/icons/edit-find.png
create mode 100644 scribo/demo/icons/format-indent-more.png
create mode 100644 scribo/demo/icons/go-next.png
create mode 100644 scribo/demo/icons/image-x-generic.png
create mode 100644 scribo/demo/icons/list-add.png
create mode 100644 scribo/demo/icons/ocr.png
create mode 100644 scribo/demo/icons/text-x-generic.png
create mode 100644 scribo/demo/icons/view-refresh.png
create mode 100644 scribo/demo/icons/x-office-spreadsheet.png
create mode 100644 scribo/demo/src/main.cc
create mode 100644 scribo/demo/src/mainwindow.cc
create mode 100644 scribo/demo/src/mainwindow.hh
create mode 100644 scribo/demo/ui/mainwindow.ui
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a9b29a3..7129cb2 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,27 @@
+2009-06-10 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Add Scribo's demo GUI.
+
+ * demo/Makefile.am,
+ * demo/demo.pro,
+ * demo/demo.qrc: build system based on qmake-qt4.
+
+ * demo/icons/document-open.png,
+ * demo/icons/edit-find.png,
+ * demo/icons/format-indent-more.png,
+ * demo/icons/go-next.png,
+ * demo/icons/image-x-generic.png,
+ * demo/icons/list-add.png,
+ * demo/icons/ocr.png,
+ * demo/icons/text-x-generic.png,
+ * demo/icons/view-refresh.png,
+ * demo/icons/x-office-spreadsheet.png: icon set.
+
+ * demo/src/main.cc,
+ * demo/src/mainwindow.cc,
+ * demo/src/mainwindow.hh,
+ * demo/ui/mainwindow.ui: main classes.
+
2009-06-10 Roland Levillain <roland(a)lrde.epita.fr>
Have SCRIBO compile.
diff --git a/scribo/demo/Makefile.am b/scribo/demo/Makefile.am
new file mode 100644
index 0000000..a5f584b
--- /dev/null
+++ b/scribo/demo/Makefile.am
@@ -0,0 +1,9 @@
+## Process this file through Automake to create Makefile.in.
+
+include $(top_srcdir)/scribo/scribo.mk
+
+
+Makefile:
+ qmake-qt4 $(top_srcdir)/scribo/src/demo/demo.pro -o Makefile
+
+all-local: Makefile
diff --git a/scribo/demo/demo.pro b/scribo/demo/demo.pro
new file mode 100644
index 0000000..01e36ee
--- /dev/null
+++ b/scribo/demo/demo.pro
@@ -0,0 +1,16 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Mon Jun 1 10:28:31 2009
+######################################################################
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += . src ui
+INCLUDEPATH += . src ../../ ../../milena
+DEFINES += NDEBUG
+
+# Input
+HEADERS += src/mainwindow.hh
+FORMS += ui/mainwindow.ui
+SOURCES += src/main.cc src/mainwindow.cc
+
+RESOURCES = demo.qrc
diff --git a/scribo/demo/demo.qrc b/scribo/demo/demo.qrc
new file mode 100644
index 0000000..8492d35
--- /dev/null
+++ b/scribo/demo/demo.qrc
@@ -0,0 +1,13 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>icons/go-next.png</file>
+ <file>icons/view-refresh.png</file>
+ <file>icons/format-indent-more.png</file>
+ <file>icons/document-open.png</file>
+ <file>icons/text-x-generic.png</file>
+ <file>icons/x-office-spreadsheet.png</file>
+ <file>icons/image-x-generic.png</file>
+ <file>icons/edit-find.png</file>
+ <file>icons/list-add.png</file>
+ </qresource>
+</RCC>
diff --git a/scribo/demo/icons/document-open.png b/scribo/demo/icons/document-open.png
new file mode 100644
index 0000000000000000000000000000000000000000..f35f2583540678b7a544d9175245096082f302af
GIT binary patch
literal 1550
zcmV+p2J!icP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS00009a7bBm000fw000fw0YWI7cmMzZ8FWQhbW?9;ba!ELWdL_~cP?peYja~^
zaAhuUa%Y?FJQ@H11&c{UK~z|U#g@&F97h?(fAullGrQyQ?ivxr27!T<5(|M$K7csM
zItOCq;6x#iJ@mzbD+m4oB>x2@7Ze~uNfga3vbZE9GEM?G2QWwx$l|aG!6EBtvokxp
zvoq5l)m6n|XM1OQW{kx~$|IHPv)|{b_kF9YL=;7Qme9AeD9aOny9T9{E~r#qPhztg
z1VQi60-DXH_~GhP{O0)=sMqT=*LlCEvE6RV7hihev3LLe?mJnMeJ2Ql_)r2aUc4x-
z|MMTLudh!Kdhc=0;hZDSbBr;>am=?)-y@FSdHfr{d*ijY=4<m0_4|D@%f9?y0<K@b
zE&wm3WWNX@kW!+QLTimuib|zI5Cl}KRiu<W{`eC-`n_}a_v79hS(d3=dSH2ZS!Y>x
z#ajD7d4czy8~^!0D5VNF1HAo*w{gynt<zd_-@W&fWf@@@^8F{D65ji>m#<v@?ebTa
zp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=762S!BcM5{=|$VEjvd5-9bi{+sfaLzqfVQT1kL&ZU6$O=SZ!i
zJ1}I%jais=AZJ8kY+Opg=1zhXauAI?&Bk&dj$^v9<@lW;b5%_>`2WbpmJD4ag&<B+
zq!c@&^P>X#0LE9SR|WHW;{8|{n}zcHXy18Hr;{SQ*qRW~Y&L_Hl@;3^WNZ&SA8l+8
zpWjniZku$p?>%g6?AXi<{@iRfbreN8?0HTCpF4T-<kKhaTYWY;`gJws_kSpOa01BF
z{zo6a^YTwx?_IqL>_k!I_OG@E@Fg9FcT}rK8<bA?Vc?uI)>@w<oE>z!z{kKk5Jyqu
zMHEFen@tG>fa2i3{j}kS#Q=E}MGi)uWS<rO3(L49D6+d!F8}}l07*qoM6N<$f<9#9
AC;$Ke
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/edit-find.png b/scribo/demo/icons/edit-find.png
new file mode 100644
index 0000000000000000000000000000000000000000..5594785d10896bc17095baf387437d01bcb1fcf5
GIT binary patch
literal 1636
zcmV-q2AlbbP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS000IXNkl<ZScT=6ZD?E98OML;UR}M}mgG0tj$dl0v824T$<koQTbfeRlGRQ6
zp-CE&v1T-kQP`KU4;u{DFb0D$7=vY)P?*V<v60|(9^3NC9bI15cnxjr&YNFmFE~!*
zmq@Z@$-4L4d-oxhkQFI*!oKZ+hjY)-<vhRpKhJZ{5&XZKC>%I@_UxOQru7OTDilRQ
zQ4}o8!m=!+l$fSjv|VpZ2(hH=`qz4Ud;1<s)YH=wGfmUBEX%em%hq*0_iUQx8kbV$
z+%SwauIqZvGntH?$z<%)r%%TU<2eckq?7?61e24K2q7>{ld`fhbX`Y?hk_NhIXT56
zf&yUMHo;&J!!QEt0@${ln=I@3{igvaHC`0JvaF&3g%FI7k7Jr<(Fu!<sj5mS6e<~f
zU4Z=HLI~R1+lwku3ZT%k>aGh=Y#D?QjE#+9nr6{}r4$H<!%qf~AD}P~L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-h2G_WASYiN#_FA&^qy^?ET)laY}TR#wuC|9gz8sw%qnb`h+tLvuPYrAaLQfKNZW
z#lXM-;ZTI8#ulWMM59qOO=EmwjL-iu{0A)M<i(2@lSKiJ9zAMbxNxB;K(;g$MPYU}
z%INqgGk2#+E+^3(8h(F(a5zG!JxtHJUr<p|LHm|4hHfxFKabPtWOhEvwQE<0OwB&n
z_v^lUPjnb%?cp`Mj{5qB++LAAL9_OaufNOrU-feR##Q!qe36=(8shOdkx+zSUF~z1
z`!4?+I8vAcK1ER$ZQI7@^WpRP@caFEJRZu*%J6!<xLmH>za?GQNu^ROFE5i!CP^d`
zBoYbY@i?heilax~VsqQG{Q1fsu`H9O=0;jJH`3YJ3GfQ6t%3@mc6xgHN2gAm`o0jt
zQ~2fC3v2dZDfXPNM%Gn_!lk}T96NT5R(A`7gM(PMeHBpibHD`zfodSI+E)u0)I3*K
zUCnDnp4))6>gl#;+gf*Q-+sd7c1A4A{3s<e?_T-f%2csSoC|QTwxuq4q5vQtXpLyA
it^*k$1*BKU0QfH;-bM?m2>+x20000<MNUMnLSTaBT_SJ*
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/format-indent-more.png b/scribo/demo/icons/format-indent-more.png
new file mode 100644
index 0000000000000000000000000000000000000000..6a18867ca760573a9391b9b5ca9d72a5c40aebee
GIT binary patch
literal 766
zcmV<a0s;MrP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS0008DNkl<ZScS!x&rj1}7{@=`>KqY0$Sy#XFcU7^!9=~NNATttg2SL5G#>py
zybB^C8a)`j2&ib(KS52{zktDBNIb9>6Azkgb#1zOsI%?bvaW3SByaZi{n77_=Xtli
z@Sh`Mf0$pG6E#ikYb9VTCggh#^&U>A(>j1)pVTz9@79gmt;A=3;a+lMW1}7T=^{{#
za`|`DfephTk!S-9$9S~qNIu|(Vf^ho=R6%~G!_?^>aH0dAM+e<3W14<tZS^Q+Ei>g
z&=LY}U<-6t2n0#N=xC;O1hU!lwj$d_2b`e0Ou!Dhy!>+8wdr)4+VdZpfS2mAv2!j5
z%x7nR#{}F~``I0wK%j3z3(Rbliuw8G?FyQvx#s;^C<3*h_O_Z^<-x=I6bgmr6YvAI
zw`eqqD2hza+(DA1ZP!*R4G^$z)O8(A(@<5Fa=DD6lqi;p6pKaTd*T3Wec$5l><sH)
z*F96UodcdlSlyti8uFHel+TlwBxG4ek|ktWLRD4Ao>HmA<0p?8NoP2I?1X2*hH}8F
z?)stYI<Hq=@&3a*bX~7eADRGI$1E6=PoF>X?D<m^MX?>n9XVj%9E`-;mo=7_U(|KL
zvj)tHb-Lj9kH#;0dsAdGqgd)2EJCO4hHbol3=9l1a&`nkh}BI&AOb=2ABjX59vbG<
z$<wY=5Xu2T5a{mern{@_UmEN$y*YIqMNt4qBobuDv-J1(d#DcWfcFoOwZ@E&jt(wO
zUZ%6N)1|t4iW+vn57e#-3{t5SlNT=1-oDRQb*L2htF}}P4jg58=nSz~)K|6Dw?Y)f
zcrAf8;9zwynM``Jt&OW!t_50G6OmjlcLaz7KdJ=cK*E4;vvbouVcr@v41-^ro0}0J
w0nXd;Uf=+*AJdU$-x)MO2TGV1(*jWW0}B`e&>~*k`v3p{07*qoM6N<$f)vPN&;S4c
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/go-next.png b/scribo/demo/icons/go-next.png
new file mode 100644
index 0000000000000000000000000000000000000000..a68e2db77531cb15a2cddd62f567f030513b60fa
GIT binary patch
literal 1219
zcmV;!1U&nRP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS000DfNkl<ZScUDDe`r-@7{@>Fd(Ls*Wa_5Q6f;u`ihh?a=O`)@EeXr|Ly9sZ
zC=5b3BMHKwqR9S{L?bMO<qxEV7-g(!vo_pvD(0`y&6!g-o7%R!yL*1T@7o{uoOyTM
z=A7VPd*Hdx%RT3LzTfkGp7Xv325ry=Xaz;KnNe&#cfEDw^(0Rod*{Z&VtXY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=9Y;y&2KV28F0QHlMy&(<ux7e<I~y_y=+G4qglr@4BG^?#2!>|e#QnLmxOBGD
zl>D?laqd`h>9HTwt}s7xmA3A42uTCJLYcHe7Jw~=FfC^x`}gk)cK!ZqOXEKM%E@wd
zA_Lq{i&uOx^+dn`UI-Wg2jRUI(I5$o@}aDv+&yq)@4@;V{-UPC{FgyAiZ1kgEcfSQ
z(!K&5WI>UAAuo5F-*o<L$)WY?y?C5}%PovZ`@I48r9h@dQbx1T^{O^EH!a_@T75<L
h0gF@{v_b2a{SV9&9x2I+Scw1t002ovPDHLkV1o1PM3evk
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/image-x-generic.png b/scribo/demo/icons/image-x-generic.png
new file mode 100644
index 0000000000000000000000000000000000000000..6f118cd0875464017b8b9ace2419b4f03f10d1a2
GIT binary patch
literal 1163
zcmV;61a$j}P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS000C+Nkl<ZScUDD+iP4^6o<ck&fGGSNivf*O>Cu96a@{{M-ibf{U<Cw_&4~f
zAoM|t`0h(lO6!}!7oQqvXiF^xtyW80OdHzfewoRc>zT7J%ZIs~Nv3TSLqY6<&0hP$
z`F(q>wKoS|*#F%Wz{R<X7Z5&p&dT4NJaO_A0JC$mPM)*P&doZ21b~Prfcg3P7*MI6
zFCshOyW?l|&sv+Fp6+QTc1Pyxv*%ID!|Mk?5GObhoO6hCIOnjP-nsU?wYD>ko3*yH
zuf6B=ryuXo+X0}IBH{aNrQgEy6iPuptI1|9wWcDdcxa<=POwg})^+^2w@!Af+b*0F
zCY#p>N?{-ZzVDOIrSUyDcBH|(Z~IJ)6{*y#T>GuTt-HfSmbSP^ENtTlb^U%wCxYMd
z_6AT2vgsuGT*Q0FecpWKeG*=g$?<?x@+zf3v$i?Z328^DU%WftTZ=&{59kj9Ai_{O
z$w)4uI5tGWD*_(A8l#XO<3M4RT0Pavsq587+}l<aU0uT)J+>n?)m_Cr0MM=8Oge!`
zhDt5KjBnz5<A@8WHUo?qBAZF}6=k~@iBDc$xr68s!H_Dxj<pH_0&53u)Dr+K*-R2h
za&IBTOI)FlAEq8QxpyCQG(k3_5Q%}?5bbek={CAqL6XC)|9Oq0?;IpIItjq0r`T;z
zjKEMjfkIKO9pdI6A(>Q*$c)o$rOBkcZl+=YX<yYwrNqPAS4rn5$Yru1LS^X|lZTH2
zbZ(Y<Iskxkj%+$byf2M0-~qX`bc6vUh5(|-aO3)qgv|!yQzIn(_6Nj-jOH>O0PooV
zA_C4al1tLRO?G)*VF2rdNE_yVzs~mNG601_fsK`i0KEFfaSn{O0sOrpAR^QoAwU0m
zpZ<OQb<-2Jj<BU^MFyiARMwXmIrtg?i_04XtB)8i9%C&?vU%e!0L?Jk8$fGKP^kd)
zAYuSP8%L|9(Z=-Vbr?{qM>uBy@Kl6LzeKfZV7p8zqk(pM_XLQvrqTfbg>w#LEXG>2
zvF!(Cz&!li6k)YYE!f04%V^;c%|?|{aEJWZ1i5^1Zvbm8K@bq>b)1udJG-Z;6q%7j
zG^$&ytvq71I7OpUre0s5FyY8L2SBM@LOT8vQV_Adz5UOGcbk_Xk@YE+);ROYhkXkt
zSXy0VX=M?u^&kMW^Hix-{~bWj(r9COdFlwRb7Er*ODjv#2peBL72t4oW1j#Z3PY^5
zY;A4f`#vjcD-yQC$LGE|cV+-UDaDsxobLJk^Sk}OJ9qQeFBoIcTJw1Mv8&apYv0ez
zoSK`PGcka|Ip@6T>FIqtIkcmB<)_Qse=yJ1_Lf~;UcGq!+=b5<78VwPMhpPoUb=GW
zqwas&ewc``vA#jIQl(tpesJyb)z4;Tez*zLfej!6*e$4lp-xNf7Yyw;JnFOt;P&y`
dFYG^Ve*q5@n(l(H*RlWr002ovPDHLkV1jy_DSZF{
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/list-add.png b/scribo/demo/icons/list-add.png
new file mode 100644
index 0000000000000000000000000000000000000000..2acdd8f514c199a37b7b14f53081467f88ef7bff
GIT binary patch
literal 601
zcmV-f0;c_mP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS0006INkl<ZScUDDv1=4T6vltMo4dV8Bm_h&L9h@Mt5~HJ#6Q78TSK%F{SU;#
zMi47OL7UiIVPR<_b|Qj;g26&8Ohh7R?rd_od7s71?S)Nt&)th!cpnTqyq)*n_r94o
zyD-576Z~UDRUPIR+q02+KX!Zf>i&hw@usRe0Hlp%^VXF!>2}-I+fVC+BCh2Xu(H}=
zWwkR-i17&Q1@?r1slIQmGmt?bz+``iz=_N4nTEMJnWp6PdlDi4$xDysihSSRJ^#HD
zfm0WkcL*Ezw|WjD;wX`Y@`<u7*k`Qm7R#Ah6tsM)0(Y*R&6}Fw_uP<A4w#7>OQ$i>
zk~|wHA%P^W-+NY=qm+O%@!?CCIP&DpgbAGaz)s%w=F<kwffMwdvUPnYjvQ>2r6?z`
z-r3~+=g{XtaVheZ<!ykp-R7VBr^_$Lk%w^M*Z~yOFdJ6wOuYWMffRB4@C+tzGYNCT
z@CuCT&{6_7A3QI7w{&hHtK1|WK7KK(mTClwJ}mQ#?b#&S`f8?hAhQc?Q0HS*`zCaz
zY_FZGe-&0G5cPh3i!%ZP1(Xr^BMQX$t!e^kckNx85g;fqyop;t3N(P^cL<H@f+P?~
z2J>Eby-7%X^w2a;hK35HfD6NN^I8P7V;(0mQ@Z@*Wtm@8FfUzLwkFPvfh|u~3@f)V
nN>6CzLo>o}j6Z`3{#X10^GpxssPJ~100000NkvXXu0mjfzW5Zm
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/ocr.png b/scribo/demo/icons/ocr.png
new file mode 100644
index 0000000000000000000000000000000000000000..25231728ca35cd55bbf305e2df297e43ea307243
GIT binary patch
literal 14929
zcmV-XI<CcuP)<h;3K|Lk000e1NJLTq005%^006590ssI2g<ZS400001b5ch_0Itp)
z=>Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1_TT>97gTpEdT%@07*naRCwC$
zy?K;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)y_
z1R>kfbob$`UFv4@@@`&|?d54N7t*atS^imfnd8@X(p#r-46QpOH|(p8hS<t!XyU{y
z<`Q9r6^CKvT%m>3>EV=GiDW66#A=!WatNcgtzkp8vUlqE7cai}NFiC5QjKcbn`MG)
zEIa+)JY9Bo6|~*@3vGbW@d+=;p6)#)x6s}UZ9N8yxyZcNH~&w8sQ3uk5Rg!Z$|EJ9
z5XKXC$Ih%DjYsh@DNle*v@8P~Kzu5g_^b6hs#U?|Q7P8~2O5EIDM!z*{dRgjeWdjE
z!(~tZ)UdN+9f9~4<Hrug)W@CzF5+l5nX-%gKaQ?h!aR`Enzix<((PBI5`<og<5%LO
zAw-qZEydy*ju_H!Abn1)sU)a!7ZT6_KGu>d2Q&wvwRJYayo?&z*}fRJQ_z4C#)t!2
zg2JFzezVy(XnNr*0e~dokb=TOS&CqZfO8;c>koQ^rrR%xghYq|;Sxa#Ku|~^Ay9@l
zkUqzdW*7hjAOMLtAp{Vdz4ZJB(w&zAumMAq0%saSBqE1WkO1UtePaJVio9hD)0|qN
P00000NkvXXu0mjfmla@5
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/text-x-generic.png b/scribo/demo/icons/text-x-generic.png
new file mode 100644
index 0000000000000000000000000000000000000000..928a67995ee9713bc3c86159ed84c0bc568675d9
GIT binary patch
literal 744
zcmV<E0vG*>P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS0007?Nkl<ZScT=6O==r46vuxvQrwo{Vkk}91NbXWAOT~@HF|+`kzMZ4ZI@kn
z8Sn{ukSx5lu?+zi(p?Kp1F<_AbrEZ-ku_g#yXu2sB+dA}zkcs&B*Xu1fjcl94&O>C
zM?hT&K^TU_ag0(bxuPga?shwG47iJ;=-p^E`eetGTZ)3<>f+*}zG)Lh5mHLD)~WaG
ze#v(I^78Tu$QPiLY5?5a+z<o-N-6gD_gSykMj%1(8=T$t^^K5&g9Fy<b;EtOB|vMP
z1ToIsw(p)5yvVi$#BrPoY6n^@7RmE6L4^>sTCLRNN(nF&Tp`V7^WPItN~Ijy6m}ud
zZnu+uX#&3BK@iYtwRR$4#!Cq>1bjs}pU+WBmBucFpwsCj{YnA=#^W)kr>BVkgVVPv
zio{eBV2W@s7^K$!Y&NS*pxf<M7hoL6ahwX!ZnrbP4@F{ttpd&!V4DeK2xJ9w$Al0Z
z9v&wB$|-PXY6{A?Lb62JR*Jx8=knTgI!!q#+6ROX^m@H&0^DV2U)^rE)IQ-et@Z9T
zkY!n^@CAno1hRI->2#V}hDF=55Q3wlqb(u10_+;NzP_g4?<ajX1-{D`;|o}dfU&c)
zGghlr;?xkZgXH0tQgVEJTwQ=sZg3mtWeC{s|1kk~R+GsjbF=dOW+wus27E{jfiMh9
zQP5f!Qpin#Ylc8p{-u<hoSalT8D*xxK9(7?Yaok)dn_-aQ0Y@_n{n!jEK_)S0_tHH
ze%D$*Z!{i{@JcE6_Vy|}Hf9T~)oORZYv3EOas||Zm$$dKAI{Iu-viHfikL0rVYys>
z1l|Aw_yWW>zZ&ogcmXtkCz}`lhCT2&*?ZtC@EQ04o<FCXz)v@Vsvq?I76U(d#J&QO
aeEtFfNrWO3lKaU30000<MNUMnLSTYuo=&U)
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/view-refresh.png b/scribo/demo/icons/view-refresh.png
new file mode 100644
index 0000000000000000000000000000000000000000..606ea9eba46b82eea04678e64369b97e595f9da5
GIT binary patch
literal 2024
zcmV<E2N(E>P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS000M{Nkl<ZScS!xX>3&2703Vg-nY!=84tGEaSdr|grO`3Ts7naC?zFPi$WDz
z<A9nJ<EDxfwNjLpwo?0{`B15?)J8?2ENQSw1)<8)stFNsLkUd)W0o2ch_MZLw`a3w
z=B@Yi!_3g<1>4_xq^mdg&AI3QJ9o}K?+x&OHZ~Kd)lWAr^ZC{9C>)PF4plg=Tf{kY
z7+97I)^5A<BiD7_F_XSC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Cx#0Qxw9dvnbnDJomOWo7Zg6*YQM*_XJcmw~uKj0pxgDjl=ei1&Rs
zbmO1z4qQLgSrGFI=dXtM6ih0XAL_WzYQBDicRK+%0Bp|~pYfRN0hrz*v@!Nr7J|C@
zz)pT)L0DjHBcr^p*WdQ6^FkT<>!g273O|R6vDuCnE)-KCMgh10JsC(r_+GD_?o~_V
zg$oee1K<@e0C*w1!cP9)1e?*j-Xv?hqaf~unD`ImKK5UPJ;I1>GIMqS0000<MNUMn
GLSTY33DUU$
literal 0
HcmV?d00001
diff --git a/scribo/demo/icons/x-office-spreadsheet.png b/scribo/demo/icons/x-office-spreadsheet.png
new file mode 100644
index 0000000000000000000000000000000000000000..c0ccb7ab6fea5c4c77208b0ba10cd49d5b8b394d
GIT binary patch
literal 1518
zcmV<K1rhp*P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW
zd<bNS000H0Nkl<ZScT=6&1+Ow7{-6+-aC^~XOfI&GHNDGlo%(eP`_F&ly=dD1wo5o
zbyIL53RSvsQK+<kK-bkprI2n~s30^I3T>e!SS+O0LQSIiAj!mJK1`w$lg!-jE;9G@
z-pQ9)bkzfgd*1V&bKd7X@AKZd1ON9Xswb{pyLL*`v@Rf~sw#@2;5ZJpZOd+1mVElh
zYs~@AEz3IB)zx*&A5U9`NQf`bpFba~jOD!Rx`B0m`vu3bOP4Nv39Jpkw(WX=(a}+a
z5E6v{=?CT?uVi~b8XFri45Pl<w+w*mx-!U(8#hQK5`m!ke4b=7DeXd`Kr)$>`wN8v
zjg5`co}QlO!i5XVK&=YEaU6M*R4PR(l?vRdrluw^7l}kjrBZT_-}e08+Uhi}3czE*
zJGA;)otl+s_qVnDD``NEr>3T`Z95RGP$&e}<nwt<)0F;vKJTes`Zvsgci7III|K9z
zA<#69<HwK7Lq|qNXlrYeYler1r42AVJdC0!FAl)Foe+X-HjCpp%S1RdG$hwgOiTno
zXEGUS17tE8(&_ZZ0RZgSv4iI3<^TXyRoT0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kegGdnfPSD{4Iri{
z%AD)Ewe|J?e!^FOR318ZjE38{`Q@|E_`SQESSUnN*HIrYFh2eaXOqBjT|zS!N?$*(
zKKvD@SfH?Vt91u1W}z2&0>Qs#F(7f|$dUJ2T3S8@HdV9ZZ?5ZN7zWn-JT;S(L}q8H
znV&~93>3@4(KO6Z2t6956pvHdzTFtj<-Qmk9Q+0t2eN?U2M`95z&4;Bs9~v8)@uq7
z0XA3mXq7nthov8$r+^MT17=zJ9hk3Xz-u*?1H-HM*K4BEy{`|q0>rF<(0xAs0iPb2
UWFB|2M*si-07*qoM6N<$f{C8cCjbBd
literal 0
HcmV?d00001
diff --git a/scribo/demo/src/main.cc b/scribo/demo/src/main.cc
new file mode 100644
index 0000000..b467a07
--- /dev/null
+++ b/scribo/demo/src/main.cc
@@ -0,0 +1,40 @@
+// 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 <QApplication>
+#include <QtGui>
+
+#include <src/mainwindow.hh>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ scribo::demo::MainWindow win;
+
+ win.show();
+ return app.exec();
+}
diff --git a/scribo/demo/src/mainwindow.cc b/scribo/demo/src/mainwindow.cc
new file mode 100644
index 0000000..720e086
--- /dev/null
+++ b/scribo/demo/src/mainwindow.cc
@@ -0,0 +1,305 @@
+// 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 <QtCore>
+#include <QtGui>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/logical/not.hh>
+#include <mln/io/pbm/all.hh>
+
+#include <src/mainwindow.hh>
+
+
+const char * modes[][4] = {
+ { "Text in pictures", "pics", "text_in_photo", "image-x-generic.png" },
+ { (const char *)(1), 0, 0, 0}, // Separator
+ { "Handwritten text lines", "hsc", "input_to_lines", "text-x-generic.png" },
+ { "Handwritten text words", "hsc", "input_to_words", "text-x-generic.png" },
+ { (const char *)(1), 0, 0, 0}, // Separator
+ { "Horizontal and Vertical Lines", "hvl", "extract/primitive/find_discontinued_lines", "list-add.png" },
+ { "Tables", "tables", "table/extract", "x-office-spreadsheet.png" },
+ { "Pre-processing", "pproc", "preprocess", "format-indent-more.png" },
+ { "OCR", "ocr", "recognition", "edit-find.png" },
+ { 0, 0, 0 } // Empty line, do NOT delete.
+};
+
+
+// Allow to set up to 3 extra arguments to the binaries.
+//
+// A program will be launched as follow:
+//
+// ./my_program input.pbm <arg1> <arg2> <arg3> output.ppm
+//
+// Unused arguments are set to 0.
+// Each line must be mapped to the related on in the previous
+// array "modes". So DO preserve the order.
+//
+const char *args_list[][3] = {
+ { 0, 0, 0 }, // Text in Pictures
+ { (const char *)(1), 0, 0}, // Separator
+ { "/dev/null", 0, 0 }, // Handwritten text lines
+ { "/dev/null", 0, 0 }, // Handwritten text words
+ { (const char *)(1), 0, 0}, // Separator
+ { "51", "6", 0 }, // Horizontal and Vertical lines
+ { "/dev/null", 0, 0 }, // Tables
+ { 0, 0, 0 }, // Pre-processing
+ { 0, 0, 0 }, // OCR
+ // Not empty line needed.
+};
+
+
+
+namespace scribo
+{
+
+ namespace demo
+ {
+
+ MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent), context_(this)
+ {
+ setupUi(this);
+
+ mainItem_ = 0;
+ exec_prefix_ = "../";
+ pdialog_.setRange(0,0);
+ pdialog_.setLabelText(tr("Please wait while computing..."));
+ pdialog_.setWindowModality(Qt::WindowModal);
+
+ connect(&pdialog_, SIGNAL(canceled()), this, SLOT(compute_canceled()));
+ connect(&exec_, SIGNAL(finished(int, QProcess::ExitStatus)),
+ this, SLOT(exec_finished(int, QProcess::ExitStatus)));
+ connect(&exec_, SIGNAL(error(QProcess::ProcessError)),
+ this, SLOT(exec_error(QProcess::ProcessError)));
+
+ connect(&context_, SIGNAL(triggered(QAction *)),
+ this, SLOT(context_changed(QAction *)));
+
+ context_.setExclusive(true);
+
+ initToolBar();
+ setup_scene();
+ }
+
+
+ void MainWindow::initToolBar()
+ {
+ QToolBar *tbar = new QToolBar("Tools");
+ tbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+
+ for (unsigned i = 0; modes[i][0]; ++i)
+ {
+ if (modes[i][0] == (const char *)(1))
+ {
+ tbar->addSeparator();
+ continue;
+ }
+
+ QAction *action = tbar->addAction(modes[i][0]);
+ context_.addAction(action);
+ action->setCheckable(true);
+ action->setData(i);
+
+ if (modes[i][3] != 0)
+ action->setIcon(QIcon(QString(":/icons/") + modes[i][3]));
+ }
+
+ addToolBar(Qt::TopToolBarArea, tbar);
+ context_.actions().first()->trigger();
+ }
+
+
+
+ void MainWindow::on_browseBtn_clicked(bool)
+ {
+ QString current_dir = modes[mode_][1] + QString("/");
+
+ QString
+ filename = QFileDialog::getOpenFileName(this,
+ tr("Open Image."),
+ QCoreApplication::applicationDirPath() + "/" + current_dir,
+ tr("Images (*.pbm *.pgm *.ppm)"));
+
+ if (!filename.isEmpty())
+ {
+ filepath->setText(filename);
+ update_pixmap(filepath->text());
+ }
+ }
+
+
+ void MainWindow::on_runBtn_clicked(bool)
+ {
+ wait_for_result();
+
+ QStringList args;
+ args << filepath->text();
+ for (unsigned i = 0; args_list[mode_][i]; ++i)
+ args << args_list[mode_][i];
+
+ if (!is_in_ocr_mode())
+ {
+ QTemporaryFile f;
+ f.open();
+ args << f.fileName();
+ last_output_ = f.fileName();
+ }
+
+ exec_.start(exec_prefix_ + modes[mode_][2], args);
+ }
+
+
+ void MainWindow::on_displayBtn_clicked(bool)
+ {
+ update_pixmap(filepath->text());
+ }
+
+
+ void MainWindow::on_filepath_textChanged()
+ {
+ bool b = !filepath->text().isEmpty();
+
+ runBtn->setEnabled(b);
+ displayBtn->setEnabled(b);
+ }
+
+
+ void MainWindow::update_pixmap(const QString& name)
+ {
+ QPixmap pixmap;
+ if (!pixmap.load(name))
+ {
+ qDebug() << "Invalid file format!";
+ update_status_message(tr("Invalid file format!"));
+ return;
+ }
+
+ imageResult->scene()->removeItem(mainItem_);
+ mainItem_ = imageResult->scene()->addPixmap(pixmap);
+ imageResult->scene()->setSceneRect(mainItem_->boundingRect());
+ Q_ASSERT(mainItem_ != 0);
+ }
+
+
+ void MainWindow::exec_finished(int rvalue, QProcess::ExitStatus status)
+ {
+ pdialog_.hide();
+ qDebug() << rvalue;
+ if (rvalue == 0)
+ {
+ if (status != QProcess::CrashExit)
+ {
+ setEnabled(true);
+ if (is_in_ocr_mode())
+ {
+ textBrowser->setText(exec_.readAllStandardOutput());
+ on_displayBtn_clicked(true);
+ tabWidget->setCurrentIndex(1);
+ }
+ else
+ update_pixmap(last_output_);
+ }
+ // Else : canceled.
+ }
+ else
+ exec_error(tr("Error during last run."));
+ }
+
+
+ void MainWindow::setup_scene()
+ {
+ QGraphicsScene *scene = new QGraphicsScene();
+ imageResult->setScene(scene);
+
+ update_status_message(tr("1) Choose an algorithm.\n\
+2) Select an image.\n3) Run."));
+
+ imageResult->show();
+ }
+
+
+ void MainWindow::wait_for_result()
+ {
+ pdialog_.show();
+ setEnabled(false);
+
+ if (!is_in_ocr_mode())
+ update_status_message(tr("Please wait while computing..."));
+ }
+
+
+ void MainWindow::update_status_message(const QString& msg)
+ {
+ if (mainItem_ != 0)
+ imageResult->scene()->removeItem(mainItem_);
+ mainItem_ = imageResult->scene()->addText(msg);
+ }
+
+
+ void MainWindow::exec_error(const QString& msg)
+ {
+ setEnabled(true);
+ QMessageBox::critical(0, tr("Error!"),
+ tr("The result cannot be computed!"));
+ update_status_message(msg);
+ qDebug() << exec_.readAllStandardOutput();
+ }
+
+ void MainWindow::exec_error(QProcess::ProcessError error)
+ {
+ pdialog_.reset();
+ if (error == QProcess::FailedToStart)
+ exec_error(tr("This program does not exist: ")
+ + exec_prefix_ + modes[mode_][2]);
+ else
+ qDebug() << "The computation stopped.";
+ }
+
+
+ void MainWindow::context_changed(QAction *action)
+ {
+ mode_ = action->data().toInt();
+ filepath->clear();
+ tabWidget->setTabEnabled(1, is_in_ocr_mode());
+ }
+
+
+ void MainWindow::compute_canceled()
+ {
+ setEnabled(true);
+ exec_.kill();
+ update_status_message("Computation canceled.");
+ }
+
+
+ bool MainWindow::is_in_ocr_mode()
+ {
+ return (QString(modes[mode_][1]) == "ocr");
+ }
+
+ } // end of namespace scribo::demo
+
+} // end of namespace scribo
diff --git a/scribo/demo/src/mainwindow.hh b/scribo/demo/src/mainwindow.hh
new file mode 100644
index 0000000..698186b
--- /dev/null
+++ b/scribo/demo/src/mainwindow.hh
@@ -0,0 +1,93 @@
+// 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_APPS_DEMO_SRC_MAINWINDOW_HH
+
+# include <QStringList>
+# include <QProcess>
+# include <QtGui/QWidget>
+# include <QProgressDialog>
+# include <ui_mainwindow.h>
+
+namespace scribo
+{
+
+ namespace demo
+ {
+
+ class MainWindow : public QMainWindow, private Ui::MainWindow
+ {
+ Q_OBJECT
+
+
+ public:
+ MainWindow(QWidget *parent = 0);
+
+
+ private slots:
+ void initToolBar();
+
+ void on_browseBtn_clicked(bool b);
+ void on_runBtn_clicked(bool b);
+ void on_displayBtn_clicked(bool b);
+ void on_filepath_textChanged();
+
+ void exec_finished(int rvalue, QProcess::ExitStatus status);
+ void exec_error(QProcess::ProcessError error);
+
+ void context_changed(QAction *action);
+
+ void compute_canceled();
+
+ private: // Members
+ void setup_scene();
+ void update_pixmap(const QString& name);
+
+ void exec_error(const QString& msg);
+
+ void wait_for_result();
+
+ void update_status_message(const QString& msg);
+
+ bool is_in_ocr_mode();
+
+ private: // Attributes
+ QGraphicsItem *mainItem_;
+ QString exec_prefix_;
+
+ QActionGroup context_;
+ int mode_;
+ QString last_output_;
+ QProcess exec_;
+
+ QProgressDialog pdialog_;
+ };
+
+
+ } // end of namespace scribo::demo
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_APPS_DEMO_SRC_MAINWINDOW_HH
diff --git a/scribo/demo/ui/mainwindow.ui b/scribo/demo/ui/mainwindow.ui
new file mode 100644
index 0000000..9a237be
--- /dev/null
+++ b/scribo/demo/ui/mainwindow.ui
@@ -0,0 +1,147 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>658</width>
+ <height>459</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Scribo Demo - v0.1</string>
+ </property>
+ <property name="dockOptions" >
+ <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" colspan="4" >
+ <widget class="QLabel" name="description" >
+ <property name="text" >
+ <string>Write description here.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="filepath" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="browseBtn" >
+ <property name="text" >
+ <string>&Browse</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../demo.qrc" >
+ <normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QPushButton" name="displayBtn" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Display</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../demo.qrc" >
+ <normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QPushButton" name="runBtn" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Run</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../demo.qrc" >
+ <normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Image</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <widget class="QGraphicsView" name="imageResult" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Text</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <widget class="QTextBrowser" name="textBrowser" >
+ <property name="html" >
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Test</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>658</width>
+ <height>31</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ </widget>
+ <resources>
+ <include location="../demo.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>filepath</sender>
+ <signal>returnPressed()</signal>
+ <receiver>displayBtn</receiver>
+ <slot>click()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>201</x>
+ <y>92</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>516</x>
+ <y>92</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--
1.5.6.5
1
0
* Makefile.am (SUBDIRS) [ENABLE_SCRIBO]: Add scribo.
---
ChangeLog | 6 ++++++
Makefile.am | 4 ++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b9fe2db..b4926df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-06-10 Roland Levillain <roland(a)lrde.epita.fr>
+ Add scribo to SUBDIRS.
+
+ * Makefile.am (SUBDIRS) [ENABLE_SCRIBO]: Add scribo.
+
+2009-06-10 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix Automake macro OLN_WITH_LIB (again).
* m4/oln-with-lib.m4 (_OLN_WITH_LIB): Set $5_CPPFLAGS instead of
diff --git a/Makefile.am b/Makefile.am
index 8ceba09..45a5954 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,6 +25,10 @@ if ENABLE_SWILENA
SUBDIRS += swilena
endif ENABLE_SWILENA
+if ENABLE_SCRIBO
+ SUBDIRS += scribo
+endif ENABLE_SCRIBO
+
# Target shortcuts delegating the actual action to milena/Makefile.
LOCAL_RECURSIVE_TARGETS = doc pretty-check tests
$(LOCAL_RECURSIVE_TARGETS):
--
1.6.2.4
1
0
* binarization/simple.hh,
* debug/save_linked_textbboxes_image.hh,
* debug/save_table_image.hh,
* debug/save_textbboxes_image.hh,
* src/morpho.cc,
* src/table_rebuild_rank.cc,
* src/thin_bboxes.cc,
* table/internal/align_lines.hh,
* table/internal/repair_lines.hh,
* text/extract_lines.hh,
* text/recognition.hh:
Adjust paths and names.
* text/grouping/group_from_single_link.hh:
Include scribo/make/text.hh.
* src/Makefile.am (bin_PROGRAMS): Move
extract_text_double_link,
extract_text_double_several_links,
extract_text_graph,
extract_text_several_graph,
extract_text_several_left_links,
extract_text_single_link,
recognition,
table_rebuild_opening,
table_rebuild_rank and
thin_bboxes...
(EXTRA_DIST): ...here.
(extract_text_double_link_SOURCES)
(extract_text_double_several_links_SOURCES)
(extract_text_graph_SOURCES)
(extract_text_several_graph_SOURCES)
(extract_text_several_left_links_SOURCES)
(extract_text_single_link_SOURCES)
(recognition_SOURCES)
(recognition_CXXFLAGS)
(recognition_LDFLAGS)
(table_rebuild_opening_SOURCES)
(table_rebuild_rank_SOURCES)
(thin_bboxes_SOURCES):
Disable.
---
scribo/ChangeLog | 44 ++++++++++++++++++
scribo/binarization/simple.hh | 2 +-
scribo/debug/save_linked_textbboxes_image.hh | 10 ++--
scribo/debug/save_table_image.hh | 4 +-
scribo/debug/save_textbboxes_image.hh | 4 +-
scribo/src/Makefile.am | 59 +++++++++++++----------
scribo/src/morpho.cc | 7 +--
scribo/src/table_rebuild_rank.cc | 8 ++--
scribo/src/thin_bboxes.cc | 7 +--
scribo/table/internal/align_lines.hh | 4 +-
scribo/table/internal/repair_lines.hh | 4 +-
scribo/text/extract_lines.hh | 2 +-
scribo/text/grouping/group_from_single_link.hh | 1 +
scribo/text/recognition.hh | 2 +-
14 files changed, 104 insertions(+), 54 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 55b969d..a9b29a3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,49 @@
2009-06-10 Roland Levillain <roland(a)lrde.epita.fr>
+ Have SCRIBO compile.
+
+ * binarization/simple.hh,
+ * debug/save_linked_textbboxes_image.hh,
+ * debug/save_table_image.hh,
+ * debug/save_textbboxes_image.hh,
+ * src/morpho.cc,
+ * src/table_rebuild_rank.cc,
+ * src/thin_bboxes.cc,
+ * table/internal/align_lines.hh,
+ * table/internal/repair_lines.hh,
+ * text/extract_lines.hh,
+ * text/recognition.hh:
+ Adjust paths and names.
+ * text/grouping/group_from_single_link.hh:
+ Include scribo/make/text.hh.
+ * src/Makefile.am (bin_PROGRAMS): Move
+ extract_text_double_link,
+ extract_text_double_several_links,
+ extract_text_graph,
+ extract_text_several_graph,
+ extract_text_several_left_links,
+ extract_text_single_link,
+ recognition,
+ table_rebuild_opening,
+ table_rebuild_rank and
+ thin_bboxes...
+ (EXTRA_DIST): ...here.
+ (extract_text_double_link_SOURCES)
+ (extract_text_double_several_links_SOURCES)
+ (extract_text_graph_SOURCES)
+ (extract_text_several_graph_SOURCES)
+ (extract_text_several_left_links_SOURCES)
+ (extract_text_single_link_SOURCES)
+ (recognition_SOURCES)
+ (recognition_CXXFLAGS)
+ (recognition_LDFLAGS)
+ (table_rebuild_opening_SOURCES)
+ (table_rebuild_rank_SOURCES)
+ (thin_bboxes_SOURCES):
+ Disable.
+
+2009-06-10 Roland Levillain <roland(a)lrde.epita.fr>
+
* tests/unit_test/unit-tests.mk: Regen.
2009-06-09 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
diff --git a/scribo/binarization/simple.hh b/scribo/binarization/simple.hh
index c49b1f5..e36003e 100644
--- a/scribo/binarization/simple.hh
+++ b/scribo/binarization/simple.hh
@@ -37,7 +37,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/routine/duplicate.hh>
-# include <mln/core/image/image_if.hh>
+# include <mln/core/image/dmorph/image_if.hh>
# include <mln/pw/all.hh>
# include <mln/histo/compute.hh>
diff --git a/scribo/debug/save_linked_textbboxes_image.hh b/scribo/debug/save_linked_textbboxes_image.hh
index 37b6549..b98defc 100644
--- a/scribo/debug/save_linked_textbboxes_image.hh
+++ b/scribo/debug/save_linked_textbboxes_image.hh
@@ -34,7 +34,7 @@
# include <mln/core/concept/graph.hh>
# include <mln/labeling/compute.hh>
# include <mln/accu/center.hh>
-# include <mln/level/convert.hh>
+# include <mln/data/convert.hh>
# include <mln/value/rgb8.hh>
# include <mln/util/array.hh>
# include <mln/io/ppm/save.hh>
@@ -149,7 +149,7 @@ namespace scribo
trace::entering("scribo::debug::save_linked_textbboxes_image");
mln_precondition(exact(input).is_valid());
- mln_ch_value(I,value::rgb8) tmp = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
draw::bounding_boxes(tmp, text.bboxes(), box_value);
draw::bounding_box_links(tmp, text.mass_centers(), link_array, link_value);
@@ -174,7 +174,7 @@ namespace scribo
trace::entering("scribo::debug::save_linked_textbboxes_image");
mln_precondition(exact(input).is_valid());
- mln_ch_value(I,value::rgb8) tmp = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
draw::bounding_boxes(tmp, text.bboxes(), box_value);
draw::bounding_box_links(tmp, text.mass_centers(),
@@ -203,7 +203,7 @@ namespace scribo
trace::entering("scribo::debug::save_linked_textbboxes_image");
mln_precondition(exact(input).is_valid());
- mln_ch_value(I,value::rgb8) tmp = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
draw::bounding_boxes(tmp, text.bboxes(), box_value);
draw::bounding_box_links(tmp, text.mass_centers(),
@@ -232,7 +232,7 @@ namespace scribo
mln_precondition(exact(g).is_valid());
mln_precondition(exact(input).is_valid());
- mln_ch_value(I,value::rgb8) tmp = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
draw::bounding_boxes(tmp, text.bboxes(), box_value);
draw::bounding_box_links(tmp, text.bboxes(), g, link_value);
diff --git a/scribo/debug/save_table_image.hh b/scribo/debug/save_table_image.hh
index 1c0eada..2ac67af 100644
--- a/scribo/debug/save_table_image.hh
+++ b/scribo/debug/save_table_image.hh
@@ -35,7 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/image/image2d.hh>
# include <mln/data/fill.hh>
-# include <mln/level/convert.hh>
+# include <mln/data/convert.hh>
# include <mln/util/array.hh>
# include <mln/util/couple.hh>
# include <mln/value/rgb8.hh>
@@ -90,7 +90,7 @@ namespace scribo
const I& input = exact(input_);
mln_precondition(input.is_valid());
- mln_ch_value(I,value::rgb8) out2 = level::convert(value::rgb8(), input);
+ mln_ch_value(I, value::rgb8) out2 = data::convert(value::rgb8(), input);
draw::bounding_boxes(out2, tableboxes.first(), bbox_color);
draw::bounding_boxes(out2, tableboxes.second(), bbox_color);
io::ppm::save(out2, filename);
diff --git a/scribo/debug/save_textbboxes_image.hh b/scribo/debug/save_textbboxes_image.hh
index 1ef5747..a7b23ce 100644
--- a/scribo/debug/save_textbboxes_image.hh
+++ b/scribo/debug/save_textbboxes_image.hh
@@ -31,7 +31,7 @@
/// Draw a list of bounding boxes and their associated mass center.
# include <mln/core/concept/image.hh>
-# include <mln/level/convert.hh>
+# include <mln/data/convert.hh>
# include <mln/value/rgb8.hh>
# include <mln/util/array.hh>
# include <mln/io/ppm/save.hh>
@@ -70,7 +70,7 @@ namespace scribo
trace::entering("scribo::debug::save_textbboxes_image");
mln_precondition(exact(input).is_valid());
- mln_ch_value(I,value::rgb8) tmp = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input);
draw::bounding_boxes(tmp, textbboxes, value);
io::ppm::save(tmp, filename);
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 35269cb..0e66301 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -19,9 +19,6 @@
include $(top_srcdir)/scribo/scribo.mk
-recognition_CXXFLAGS = -I$(HOME)/local/include $(HOME)/local/lib/libtesseract_full.a
-recognition_LDFLAGS = -lpthread
-
SUBDIRS = \
binarization \
preprocessing \
@@ -29,34 +26,44 @@ SUBDIRS = \
bin_PROGRAMS = \
dmap \
- extract_text_double_link \
- extract_text_double_several_links \
- extract_text_graph \
- extract_text_several_graph \
- extract_text_several_left_links \
- extract_text_single_link \
morpho \
negate \
- recognition \
superpose \
- table_rebuild_opening \
- table_rebuild_rank \
- text_in_photo \
+ text_in_photo
+
+# FIXME: These files used to be in bin_PROGRAMS, but as they did not
+# compile, we moved them here.
+EXTRA_DIST = \
+ extract_text_double_link \
+ extract_text_double_several_links \
+ extract_text_graph \
+ extract_text_several_graph \
+ extract_text_several_left_links \
+ extract_text_single_link \
+ table_rebuild_opening \
+ table_rebuild_rank \
thin_bboxes
-dmap_SOURCES = dmap.cc
-extract_text_double_link_SOURCES = extract_text_double_link.cc
-extract_text_double_several_links_SOURCES = extract_text_double_several_links.cc
-extract_text_graph_SOURCES = extract_text_graph.cc
-extract_text_several_graph_SOURCES = extract_text_several_graph.cc
-extract_text_several_left_links_SOURCES = extract_text_several_left_links.cc
-extract_text_single_link_SOURCES = extract_text_single_link.cc
-morpho_SOURCES = morpho.cc
+# FIXME: Should be enclosed in an Automake conditional like HAVE_TESSERACT.
+EXTRA_DIST += recognition
+
+# FIXME: Deactivate source accordingly.
+dmap_SOURCES = dmap.cc
+#extract_text_double_link_SOURCES = extract_text_double_link.cc
+#extract_text_double_several_links_SOURCES = extract_text_double_several_links.cc
+#extract_text_graph_SOURCES = extract_text_graph.cc
+#extract_text_several_graph_SOURCES = extract_text_several_graph.cc
+#extract_text_several_left_links_SOURCES = extract_text_several_left_links.cc
+#extract_text_single_link_SOURCES = extract_text_single_link.cc
+morpho_SOURCES = morpho.cc
negate_SOURCES = negate.cc
-recognition_SOURCES = recognition.cc
+#recognition_SOURCES = recognition.cc
+# FIXME: Do not use $(HOME).
+#recognition_CXXFLAGS =
+# -I$(HOME)/local/include $(HOME)/local/lib/libtesseract_full.a
+#recognition_LDFLAGS = -lpthread
superpose_SOURCES = superpose.cc
-table_rebuild_opening_SOURCES = table_rebuild_opening.cc
-table_rebuild_rank_SOURCES = table_rebuild_rank.cc
+#table_rebuild_opening_SOURCES = table_rebuild_opening.cc
+#table_rebuild_rank_SOURCES = table_rebuild_rank.cc
text_in_photo_SOURCES = text_in_photo.cc
-thin_bboxes_SOURCES = thin_bboxes.cc
-
+#thin_bboxes_SOURCES = thin_bboxes.cc
diff --git a/scribo/src/morpho.cc b/scribo/src/morpho.cc
index d6e2487..7121e57 100644
--- a/scribo/src/morpho.cc
+++ b/scribo/src/morpho.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009
- EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -27,7 +26,7 @@
#include <mln/essential/2d.hh>
#include <mln/transform/distance_and_influence_zone_geodesic.hh>
#include <mln/core/var.hh>
-#include <mln/fun/l2l/wrap.hh>
+#include <mln/fun/v2v/wrap.hh>
#include <mln/win/hline2d.hh>
#include <mln/morpho/watershed/flooding.hh>
#include <mln/morpho/watershed/superpose.hh>
@@ -53,7 +52,7 @@ int main(int argc, char *argv[])
mln_VAR(res, transform::distance_and_influence_zone_geodesic(lbl, c8(), mln_max(unsigned)));
- io::pgm::save(level::transform(res.first(), fun::l2l::wrap<label_8>()), "dmap.pgm");
+ io::pgm::save(data::transform(res.first(), fun::v2v::wrap<label_8>()), "dmap.pgm");
io::ppm::save(labeling::colorize(rgb8(), res.second(), nlabels), "iz.ppm");
image2d<unsigned>& dmap = res.first();
diff --git a/scribo/src/table_rebuild_rank.cc b/scribo/src/table_rebuild_rank.cc
index bf6d854..1c1764b 100644
--- a/scribo/src/table_rebuild_rank.cc
+++ b/scribo/src/table_rebuild_rank.cc
@@ -27,7 +27,7 @@
#include <mln/essential/2d.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
#include <mln/accu/maj_h.hh>
#include <scribo/table/rebuild.hh>
@@ -73,9 +73,9 @@ int main(int argc, char* argv[])
std::cout << "ncells (including background) = " << ncells << std::endl;
image2d<value::rgb8> table_color = mln::labeling::colorize(value::rgb8(), tables, ncells);
- value::label_8 bg = level::compute(accu::maj_h<value::label_8>(), tables);
+ value::label_8 bg = data::compute(accu::maj_h<value::label_8>(), tables);
- image2d<value::rgb8> sup = level::convert(value::rgb8(), input);
+ image2d<value::rgb8> sup = data::convert(value::rgb8(), input);
data::paste((table_color | pw::value(tables) != pw::cst(bg))
| (pw::value(sup) == pw::cst(literal::black)), sup);
io::ppm::save(sup, scribo::make::debug_filename("table_color_sup.ppm"));
@@ -84,7 +84,7 @@ int main(int argc, char* argv[])
scribo::make::debug_filename("table_cells.ppm"));
io::pgm::save(tables, scribo::make::debug_filename("table_cells.pgm"));
- image2d<value::rgb8> input_rgb = level::convert(value::rgb8(), input);
+ image2d<value::rgb8> input_rgb = data::convert(value::rgb8(), input);
data::fill((input_rgb | pw::value(tables) == pw::cst(0u)).rw(), literal::red);
io::ppm::save(input_rgb, scribo::make::debug_filename("table_superposed.ppm"));
diff --git a/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc
index 408c99b..3f826ff 100644
--- a/scribo/src/thin_bboxes.cc
+++ b/scribo/src/thin_bboxes.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009
- EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,7 +25,7 @@
#include <mln/essential/2d.hh>
#include <scribo/text/extract_lines.hh>
-#include <scribo/filter/thin_bboxes.hh>
+#include <scribo/filter/thin_objects.hh>
int usage(const char *name)
{
@@ -50,7 +49,7 @@ int main(int argc, char *argv[])
typedef scribo::util::text<image2d<value::label_16> > text_t;
text_t lines = scribo::text::extract_lines(input, c8(), nlines);
- text_t filtered_lines = scribo::filter::thin_bboxes(lines, 5);
+ text_t filtered_lines = scribo::filter::thin_objects(lines, 5);
scribo::debug::save_textbboxes_image(input, filtered_lines.bboxes(),
literal::red,
diff --git a/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh
index 7d9c494..10c7e2a 100644
--- a/scribo/table/internal/align_lines.hh
+++ b/scribo/table/internal/align_lines.hh
@@ -33,7 +33,7 @@
# include <mln/core/site_set/box.hh>
-# include <mln/accu/mean.hh>
+# include <mln/accu/stat/mean.hh>
# include <mln/util/array.hh>
# include <mln/util/set.hh>
@@ -156,7 +156,7 @@ namespace scribo
for_all_elements(i, lines)
if (lines[i].nelements() == max_nelts)
{
- accu::mean<unsigned> mean;
+ accu::stat::mean<unsigned> mean;
for_all_elements(j, lines[i])
if (box2line[lines[i][j]] == -1)
mean.take(line_bboxes[lines[i][j]].center()[dim]);
diff --git a/scribo/table/internal/repair_lines.hh b/scribo/table/internal/repair_lines.hh
index 7ca5d21..26fdc17 100644
--- a/scribo/table/internal/repair_lines.hh
+++ b/scribo/table/internal/repair_lines.hh
@@ -32,8 +32,8 @@
# include <vector>
-# include <mln/core/image/image_if.hh>
-# include <mln/core/image/extension_val.hh>
+# include <mln/core/image/dmorph/image_if.hh>
+# include <mln/core/image/dmorph/extension_val.hh>
# include <mln/pw/all.hh>
diff --git a/scribo/text/extract_lines.hh b/scribo/text/extract_lines.hh
index a814533..f803990 100644
--- a/scribo/text/extract_lines.hh
+++ b/scribo/text/extract_lines.hh
@@ -50,7 +50,7 @@
# include <scribo/text/grouping/group_with_several_left_links.hh>
# include <scribo/text/grouping/group_with_several_right_links.hh>
# include <scribo/text/grouping/group_from_double_link.hh>
-# include <scribo/filter/small_components.hh>
+# include <scribo/filter/small_objects.hh>
# include <scribo/util/text.hh>
# include <scribo/make/debug_filename.hh>
diff --git a/scribo/text/grouping/group_from_single_link.hh b/scribo/text/grouping/group_from_single_link.hh
index 0bc494c..4885cb5 100644
--- a/scribo/text/grouping/group_from_single_link.hh
+++ b/scribo/text/grouping/group_from_single_link.hh
@@ -42,6 +42,7 @@
# include <scribo/core/macros.hh>
# include <scribo/util/text.hh>
+# include <scribo/make/text.hh>
namespace scribo
diff --git a/scribo/text/recognition.hh b/scribo/text/recognition.hh
index 24852e3..01d0986 100644
--- a/scribo/text/recognition.hh
+++ b/scribo/text/recognition.hh
@@ -33,7 +33,7 @@
/// \todo For each text bbox, we create a new image. We may like to avoid that.
/// \todo Do not store the result in an image?
-# include <mln/core/image/image_if.hh>
+# include <mln/core/image/dmorph/image_if.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/site_set/box.hh>
# include <mln/util/array.hh>
--
1.6.2.4
1
0