URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-12 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Move height, volume, bbox accus in shape directory.
* mln/accu/height.hh,
* mln/accu/bbox.hh,
* mln/accu/volume.hh: Move to...
* mln/accu/shape,
* mln/accu/shape/bbox.hh,
* mln/accu/shape/height.hh,
* mln/accu/shape/volume.hh:
Move accus in shape directory.
* tests/accu/bbox.cc: Move to...
* tests/accu/shape,
* tests/accu/shape/bbox.cc:
Move tests in shape directory.
* tests/accu/Makefile.am,
* tests/accu/shape/Makefile.am:
Update makefiles respecting new locations.
* mln/accu/median_alt.hh: Move to...
* mln/accu/stat/median_alt.hh:
Move median_alt (no more used anywhere...) in stat directory.
* mln/accu/all.hh,
* mln/accu/essential.hh,
* mln/accu/shape/all.hh,
* mln/accu/shape/essential.hh
* mln/accu/stat/all.hh:
Update all.hh and essential.hh respecting new locations.
* doc/examples/labeling-compute.cc,
* doc/examples/split/labeling-compute-3.cc,
* mln/accu/site_set/rectangularity.hh,
* mln/accu/center.hh,
* mln/core/image/dmorph/p2p_image.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/core/internal/geom_bbox.hh,
* mln/core/internal/site_set_impl.hh,
* mln/geom/bbox.hh,
* sandbox/abraham/mln/core/site_set/p_priority_queue.hh,
* sandbox/duhamel/mesh_p.hh,
* sandbox/duhamel/queue_p_fast.hh,
* sandbox/duhamel/queue_p_priority.hh,
* sandbox/fred/old/p2p/p2p_morpher.hh,
* sandbox/fred/old/value.cc,
* sandbox/garrigues/factures/extract_array.cc,
* sandbox/garrigues/factures/extract_array_highlight.cc,
* sandbox/garrigues/fllt/essai.cc,
* sandbox/garrigues/fllt/fllt_simple.cc,
* sandbox/garrigues/fllt/fllt_simple.svg.1.cc,
* sandbox/garrigues/fllt/fllt_simple.svg.2.cc,
* sandbox/garrigues/fllt/fllt_simple.svg.3.cc,
* sandbox/garrigues/fllt/fllt_theo.cc,
* sandbox/garrigues/fllt/types.hh,
* sandbox/icdar/2009/hsc/clean_input.hh,
* sandbox/icdar/2009/hsc/clean_lines.hh,
* sandbox/icdar/2009/hsc/clean_lines_with_grouped_bboxes.hh,
* sandbox/icdar/2009/hsc/get_line_images.hh,
* sandbox/icdar/2009/hsc/lines_to_boxes.cc,
* sandbox/inim/2010/boxes/boxes.cc,
* sandbox/inim/2010/rag/center_weight.hh,
* sandbox/jardonnet/n_cmpt/n_cmpt.cc,
* sandbox/jardonnet/n_cmpt/n_cmpt.hh,
* sandbox/jardonnet/n_cmpt/n_cmpt2.hh,
* sandbox/jardonnet/n_cmpt/n_cmpt3.hh,
* sandbox/jardonnet/n_cmpt/n_cmpt4.hh,
* sandbox/jardonnet/n_cmpt/n_cmpt5.hh,
* sandbox/jardonnet/n_cmpt/nwst.hh,
* sandbox/jardonnet/n_cmpt/test_attribute_watershed.cc,
* sandbox/jardonnet/n_cmpt/tikz.hh,
* sandbox/laurent/ismm2009.cc,
* sandbox/nivault/extract_character.cc,
* sandbox/nivault/extract_score.cc,
* sandbox/pellegrin/set/core/internal/multi_set.hh,
* sandbox/pellegrin/set/core/internal/uni_set.hh,
* sandbox/pellegrin/set/core/p_array.hh,
* sandbox/pellegrin/set/core/p_bgraph.hh,
* sandbox/pellegrin/set/core/p_graph.hh,
* sandbox/pellegrin/set/core/p_line_graph.hh,
* sandbox/pellegrin/set/core/p_priority_queue.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh,
* sandbox/pellegrin/set/core/p_queue.hh,
* sandbox/pellegrin/set/core/p_queue_fast.hh,
* sandbox/pellegrin/set/core/p_run.hh,
* sandbox/pellegrin/set/core/p_runs.hh,
* sandbox/pellegrin/set/core/p_set.hh,
* sandbox/theo/color/blen_pix.hh,
* 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/trash.hh,
* sandbox/theo/fllt.svg.6.cc,
* sandbox/theo/fllt.svg.7.hh,
* sandbox/theo/fllt/fllt.hh,
* sandbox/theo/fllt/fllt.svg.1.cc,
* sandbox/theo/fllt/fllt.svg.2.cc,
* sandbox/theo/fllt/fllt.svg.3.cc,
* sandbox/theo/fllt/fllt.svg.4.cc,
* sandbox/theo/fllt/fllt.svg.5.cc,
* sandbox/theo/fllt/fllt.svg.6.cc,
* sandbox/theo/fllt/fllt.svg.7.hh,
* sandbox/theo/fllt/fllt_test.hh,
* sandbox/theo/p_runs__with_dedicated_piter.hh,
* sandbox/theo/tufa_2008/experiment.cc,
* sandbox/theo/tufa_2008/filter.cc,
* sandbox/theo/tufa_2008/n_cmpt.cc,
* sandbox/theo/tufa_2008/wst_f_equal_wst_a.cc,
* tests/accu/all_accus.cc,
* tests/core/image/edge_image.cc,
* tests/core/image/graph_image.cc,
* tests/core/image/imorph/labeled_image.cc,
* tests/core/image/vertex_image.cc,
* tests/morpho/closing/leveling.cc,
* tests/morpho/graph_image_morpho.cc,
* tests/morpho/opening/leveling.cc,
* trash/obased_rle_image.hh,
* trash/p_bgraph.hh:
Replace accu::accu_name by accu::shape::accu_name,
accu::meta::accu_name by accu::meta::shape::accu_name,
accu/accu_name by accu/shape/accu_name.
---
doc/examples/labeling-compute.cc | 4
doc/examples/split/labeling-compute-3.cc | 2
mln/accu/all.hh | 6
mln/accu/center.hh | 2
mln/accu/essential.hh | 3
mln/accu/shape/all.hh | 59 +
mln/accu/shape/bbox.hh | 236 ++++++
mln/accu/shape/essential.hh | 37 +
mln/accu/shape/height.hh | 212 ++++++
mln/accu/shape/volume.hh | 229 ++++++
mln/accu/site_set/rectangularity.hh | 8
mln/accu/stat/all.hh | 1
mln/accu/stat/median_alt.hh | 339 ++++++++++
mln/core/image/dmorph/p2p_image.hh | 4
mln/core/image/imorph/labeled_image.hh | 6
mln/core/internal/geom_bbox.hh | 4
mln/core/internal/site_set_impl.hh | 4
mln/geom/bbox.hh | 4
sandbox/abraham/mln/core/site_set/p_priority_queue.hh | 4
sandbox/duhamel/mesh_p.hh | 4
sandbox/duhamel/queue_p_fast.hh | 4
sandbox/duhamel/queue_p_priority.hh | 4
sandbox/fred/old/p2p/p2p_morpher.hh | 6
sandbox/fred/old/value.cc | 4
sandbox/garrigues/factures/extract_array.cc | 2
sandbox/garrigues/factures/extract_array_highlight.cc | 2
sandbox/garrigues/fllt/essai.cc | 4
sandbox/garrigues/fllt/fllt_simple.cc | 4
sandbox/garrigues/fllt/fllt_simple.svg.1.cc | 4
sandbox/garrigues/fllt/fllt_simple.svg.2.cc | 4
sandbox/garrigues/fllt/fllt_simple.svg.3.cc | 4
sandbox/garrigues/fllt/fllt_theo.cc | 4
sandbox/garrigues/fllt/types.hh | 2
sandbox/icdar/2009/hsc/clean_input.hh | 4
sandbox/icdar/2009/hsc/clean_lines.hh | 2
sandbox/icdar/2009/hsc/clean_lines_with_grouped_bboxes.hh | 4
sandbox/icdar/2009/hsc/get_line_images.hh | 4
sandbox/icdar/2009/hsc/lines_to_boxes.cc | 2
sandbox/inim/2010/boxes/boxes.cc | 2
sandbox/inim/2010/rag/center_weight.hh | 2
sandbox/jardonnet/n_cmpt/n_cmpt.cc | 2
sandbox/jardonnet/n_cmpt/n_cmpt.hh | 4
sandbox/jardonnet/n_cmpt/n_cmpt2.hh | 4
sandbox/jardonnet/n_cmpt/n_cmpt3.hh | 6
sandbox/jardonnet/n_cmpt/n_cmpt4.hh | 6
sandbox/jardonnet/n_cmpt/n_cmpt5.hh | 6
sandbox/jardonnet/n_cmpt/nwst.hh | 2
sandbox/jardonnet/n_cmpt/test_attribute_watershed.cc | 4
sandbox/jardonnet/n_cmpt/tikz.hh | 6
sandbox/laurent/ismm2009.cc | 2
sandbox/nivault/extract_character.cc | 10
sandbox/nivault/extract_score.cc | 2
sandbox/pellegrin/set/core/internal/multi_set.hh | 2
sandbox/pellegrin/set/core/internal/uni_set.hh | 2
sandbox/pellegrin/set/core/p_array.hh | 4
sandbox/pellegrin/set/core/p_bgraph.hh | 4
sandbox/pellegrin/set/core/p_graph.hh | 4
sandbox/pellegrin/set/core/p_line_graph.hh | 4
sandbox/pellegrin/set/core/p_priority_queue.hh | 4
sandbox/pellegrin/set/core/p_priority_queue_fast.hh | 4
sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh | 4
sandbox/pellegrin/set/core/p_queue.hh | 4
sandbox/pellegrin/set/core/p_queue_fast.hh | 4
sandbox/pellegrin/set/core/p_run.hh | 4
sandbox/pellegrin/set/core/p_runs.hh | 4
sandbox/pellegrin/set/core/p_set.hh | 4
sandbox/theo/color/blen_pix.hh | 8
sandbox/theo/color/filter_blen_rgb_edges.cc | 2
sandbox/theo/color/segment_gl_pixels.cc | 6
sandbox/theo/color/segment_rgb_edges.cc | 4
sandbox/theo/esiee/laurent/ismm09/trash.hh | 2
sandbox/theo/fllt.svg.6.cc | 4
sandbox/theo/fllt.svg.7.hh | 4
sandbox/theo/fllt/fllt.hh | 6
sandbox/theo/fllt/fllt.svg.1.cc | 4
sandbox/theo/fllt/fllt.svg.2.cc | 4
sandbox/theo/fllt/fllt.svg.3.cc | 4
sandbox/theo/fllt/fllt.svg.4.cc | 4
sandbox/theo/fllt/fllt.svg.5.cc | 4
sandbox/theo/fllt/fllt.svg.6.cc | 4
sandbox/theo/fllt/fllt.svg.7.hh | 4
sandbox/theo/fllt/fllt_test.hh | 4
sandbox/theo/p_runs__with_dedicated_piter.hh | 4
sandbox/theo/tufa_2008/experiment.cc | 4
sandbox/theo/tufa_2008/filter.cc | 2
sandbox/theo/tufa_2008/n_cmpt.cc | 4
sandbox/theo/tufa_2008/wst_f_equal_wst_a.cc | 4
tests/accu/Makefile.am | 5
tests/accu/all_accus.cc | 2
tests/accu/shape/Makefile.am | 27
tests/accu/shape/bbox.cc | 42 +
tests/core/image/edge_image.cc | 4
tests/core/image/graph_image.cc | 4
tests/core/image/imorph/labeled_image.cc | 2
tests/core/image/vertex_image.cc | 4
tests/morpho/closing/leveling.cc | 2
tests/morpho/graph_image_morpho.cc | 4
tests/morpho/opening/leveling.cc | 2
trash/obased_rle_image.hh | 2
trash/p_bgraph.hh | 4
100 files changed, 1356 insertions(+), 176 deletions(-)
Index: trunk/milena/trash/obased_rle_image.hh
===================================================================
--- trunk/milena/trash/obased_rle_image.hh (revision 4119)
+++ trunk/milena/trash/obased_rle_image.hh (revision 4120)
@@ -61,7 +61,7 @@
std::vector< std::vector<unsigned> > obj_;
/// Bounding boxes of the objects.
- std::vector< accu::bbox<P> > bbox_;
+ std::vector< accu::shape::bbox<P> > bbox_;
/// Value of Objects.
std::vector<T> v_obj_;
Index: trunk/milena/trash/p_bgraph.hh
===================================================================
--- trunk/milena/trash/p_bgraph.hh (revision 4119)
+++ trunk/milena/trash/p_bgraph.hh (revision 4120)
@@ -33,7 +33,7 @@
# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/site_set_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/internal/boost_graph.hh>
# include <mln/core/image/bgraph_psite.hh>
# include <mln/core/site_set/p_bgraph_piter.hh>
@@ -121,7 +121,7 @@
mln_precondition(gr != 0);
// FIXME: Warning: if the underlying graph is updated later, this
// won't be taken into account by this p_bgraph!
- accu::bbox<P> a;
+ accu::shape::bbox<P> a;
for (node_iterators iter = boost::vertices(*gr_);
iter.first != iter.second;
Index: trunk/milena/mln/core/image/dmorph/p2p_image.hh
===================================================================
--- trunk/milena/mln/core/image/dmorph/p2p_image.hh (revision 4119)
+++ trunk/milena/mln/core/image/dmorph/p2p_image.hh (revision 4120)
@@ -32,7 +32,7 @@
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/concept/function.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
namespace mln
@@ -160,7 +160,7 @@
: ima_(ima),
f_(f)
{
- accu::bbox<mln_site(I)> a;
+ accu::shape::bbox<mln_site(I)> a;
mln_domain(I) b = ima.domain();
a.take(f(b.pmin()));
a.take(f(b.pmax()));
Index: trunk/milena/mln/core/image/imorph/labeled_image.hh
===================================================================
--- trunk/milena/mln/core/image/imorph/labeled_image.hh (revision 4119)
+++ trunk/milena/mln/core/image/imorph/labeled_image.hh (revision 4120)
@@ -128,7 +128,7 @@
typedef labeled_image< tag::image_<I> > skeleton;
/// Type of the bounding component bounding boxes.
- typedef mln_result(accu::bbox<mln_psite(I)>) bbox_t;
+ typedef mln_result(accu::shape::bbox<mln_psite(I)>) bbox_t;
/// Constructors
/// @{
@@ -334,7 +334,7 @@
void
labeled_image<I>::update_()
{
- this->data_->bboxes_ = labeling::compute(accu::meta::bbox(),
+ this->data_->bboxes_ = labeling::compute(accu::meta::shape::bbox(),
this->data_->ima_,
this->data_->nlabels_);
}
@@ -352,7 +352,7 @@
//// p_if<mln_psite(I)>
// unsigned
// extended_impl_selector<I,
-// accu::pair<accu::bbox<mln_psite(I)>,
+// accu::pair<accu::shape::bbox<mln_psite(I)>,
// accu::center<mln_psite(I),V> >,
// E>::domain(const mln_value(I)& label) const
// {
Index: trunk/milena/mln/core/internal/site_set_impl.hh
===================================================================
--- trunk/milena/mln/core/internal/site_set_impl.hh (revision 4119)
+++ trunk/milena/mln/core/internal/site_set_impl.hh (revision 4120)
@@ -30,7 +30,7 @@
/// Provide implementation for optional site set methods.
# include <mln/core/concept/site_set.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
@@ -83,7 +83,7 @@
template <typename S>
void update_bbox_(const Site_Set<S>& s);
- accu::bbox<mln_site(Sc)> bb_;
+ accu::shape::bbox<mln_site(Sc)> bb_;
};
template <typename Sc>
Index: trunk/milena/mln/core/internal/geom_bbox.hh
===================================================================
--- trunk/milena/mln/core/internal/geom_bbox.hh (revision 4119)
+++ trunk/milena/mln/core/internal/geom_bbox.hh (revision 4120)
@@ -33,7 +33,7 @@
/// circular dependency since mln/geom/bbox.hh cannot be included in
/// concept files.
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/literal/origin.hh>
@@ -55,7 +55,7 @@
geom_bbox(const W& win)
{
typedef mln_psite(W) P;
- accu::bbox<P> b;
+ accu::shape::bbox<P> b;
P O = literal::origin;
mln_qiter(W) q(exact(win), O);
for_all(q)
Index: trunk/milena/mln/accu/bbox.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/median_alt.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/volume.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/height.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/site_set/rectangularity.hh
===================================================================
--- trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4119)
+++ trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4120)
@@ -31,7 +31,7 @@
/// Compute the rectangularity of a site set.
# include <mln/accu/internal/couple.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/accu/math/count.hh>
namespace mln
@@ -49,7 +49,7 @@
//
template <typename P>
class rectangularity
- : public accu::internal::couple<accu::bbox<P>,
+ : public accu::internal::couple<accu::shape::bbox<P>,
accu::math::count<P>,
float,
rectangularity<P> >
@@ -57,12 +57,12 @@
public:
- typedef accu::internal::couple<accu::bbox<P>,
+ typedef accu::internal::couple<accu::shape::bbox<P>,
accu::math::count<P>,
float,
rectangularity<P> > super_;
- typedef accu::bbox<P> A1;
+ typedef accu::shape::bbox<P> A1;
typedef accu::math::count<P> A2;
typedef float result;
Index: trunk/milena/mln/accu/shape/essential.hh
===================================================================
--- trunk/milena/mln/accu/shape/essential.hh (revision 0)
+++ trunk/milena/mln/accu/shape/essential.hh (revision 4120)
@@ -0,0 +1,37 @@
+// 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_SHAPE_ESSENTIAL_HH
+# define MLN_ACCU_SHAPE_ESSENTIAL_HH
+
+/// \file
+///
+/// File that includes the most useful shape accumulator types.
+
+# include <mln/accu/shape/bbox.hh>
+
+#endif // ! MLN_ACCU_SHAPE_ESSENTIAL_HH
+
+
Property changes on: trunk/milena/mln/accu/shape/essential.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/shape/volume.hh
===================================================================
--- trunk/milena/mln/accu/shape/volume.hh (revision 0)
+++ trunk/milena/mln/accu/shape/volume.hh (revision 4120)
@@ -0,0 +1,229 @@
+// 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_SHAPE_VOLUME_HH
+# define MLN_ACCU_SHAPE_VOLUME_HH
+
+/// \file
+/// Define an accumulator that computes the volume of a
+/// component through one of its pixels.
+
+/*!
+This accumulator uses an mln::util::pix (pixel) to update the
+reference level, area and volume information of the component.
+
+The class mln/accu/volume is not a general-purpose accumulator;
+it is used to implement volume-based connected filters.
+\see mln::morpho::closing::volume
+\see mln::morpho::opening::volume
+*/
+
+# include <mln/accu/internal/base.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/math/diff_abs.hh>
+
+# include <mln/util/pix.hh>
+# include <mln/literal/zero.hh>
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace shape
+ {
+
+ /// \brief Volume accumulator class.
+ ///
+ /// The parameter \p I is the image type on which the accumulator
+ /// of pixels is built.
+ ///
+ /// \ingroup modaccuimages
+ template <typename I>
+ struct volume
+ : public mln::accu::internal::base< unsigned , volume<I> >
+ {
+ /// The accumulated data type.
+ ///
+ /// The volume of component is represented by the volume of its
+ /// root pixel. See mln::morpho::closing_volume and
+ /// mln::morpho::opening_volume for actual uses of this
+ /// accumulator.
+ /// FIXME: Replaced by mln::morpho::attribute::volume
+ typedef util::pix<I> argument;
+ /// The value type associated to the pixel type.
+ typedef typename argument::value value;
+
+ volume();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument& pixel);
+ void take(const volume<I>& other);
+
+ /// Force the value of the counter to \a v.
+ void set_value(unsigned v);
+ /// \}
+
+ /// 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 reference level (the level of the component's root).
+ value ref_level__;
+ /// The area of the component.
+ unsigned area__;
+ /// The volume of the component.
+ unsigned volume_;
+ };
+
+
+ } // end of mln::accu::shape
+
+
+ namespace meta
+ {
+
+ namespace shape
+ {
+
+ /// Meta accumulator for volume.
+
+ struct volume : public Meta_Accumulator< volume >
+ {
+ template <typename I>
+ struct with
+ {
+ typedef accu::shape::volume<I> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::shape
+
+ } // end of namespace mln::accu::meta
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace shape
+ {
+
+ template <typename I>
+ inline
+ volume<I>::volume()
+ {
+ init();
+ }
+
+ template <typename I>
+ inline
+ void
+ volume<I>::init()
+ {
+ ref_level__ = literal::zero;
+ volume_ = 0;
+ area__ = 0;
+ }
+
+ template <typename I>
+ inline
+ void
+ volume<I>::take(const argument& pixel)
+ {
+ /* FIXME: Growing a component using this particular `take'
+ routine won't work, since the update does not take care of
+ the reference level to compute the new volume. Maybe we
+ could distinguish two cases:
+
+ 1. the empty accumulator case (which corresponds to the
+ following code);
+ 2. the non-empty accumulator case (which sohuld act as in
+ `take(const volume<I>& other)').
+
+ Currently, the implementation is only valid if the
+ accumulator was initialy empty before the call to
+ `take(const argument&)'. */
+ ref_level__ = pixel.v();
+ ++area__;
+ ++volume_;
+ }
+
+ template <typename I>
+ inline
+ void
+ volume<I>::take(const volume<I>& other)
+ {
+ area__ += other.area__;
+ /* FIXME: Is it `t.area__' or `area__' ? Théo said it was
+ the latter, but both the ISMM 2005 paper and Olena 0.11 use
+ the former. */
+ volume_ +=
+ other.volume_ +
+ other.area__ * mln::math::diff_abs(other.ref_level__, ref_level__);
+ // Member ref_level__ is not touched.
+ }
+
+ template <typename I>
+ inline
+ unsigned
+ volume<I>::to_result() const
+ {
+ return volume_;
+ }
+
+ template <typename I>
+ inline
+ void
+ volume<I>::set_value(unsigned v)
+ {
+ volume_ = v;
+ // Reset the other members.
+ ref_level__ = literal::zero;
+ area__ = 0;
+ }
+
+ template <typename I>
+ inline
+ bool
+ volume<I>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::shape
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_SHAPE_VOLUME_HH
Property changes on: trunk/milena/mln/accu/shape/volume.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/shape/all.hh
===================================================================
--- trunk/milena/mln/accu/shape/all.hh (revision 0)
+++ trunk/milena/mln/accu/shape/all.hh (revision 4120)
@@ -0,0 +1,59 @@
+// 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_SHAPE_ALL_HH
+# define MLN_ACCU_SHAPE_ALL_HH
+
+/// \file
+///
+/// File that includes all shape accumulator types.
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace meta
+ {
+
+ /// Namespace of shape meta-accumulators.
+ namespace shape {}
+
+ } // end of namespace mln::accu::meta
+
+ /// Namespace of shape accumulators.
+ namespace shape {}
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+# include <mln/accu/shape/volume.hh>
+# include <mln/accu/shape/height.hh>
+# include <mln/accu/shape/bbox.hh>
+
+#endif // ! MLN_ACCU_SHAPE_ALL_HH
Property changes on: trunk/milena/mln/accu/shape/all.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/shape/height.hh
===================================================================
--- trunk/milena/mln/accu/shape/height.hh (revision 0)
+++ trunk/milena/mln/accu/shape/height.hh (revision 4120)
@@ -0,0 +1,212 @@
+// 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_SHAPE_HEIGHT_HH
+# define MLN_ACCU_SHAPE_HEIGHT_HH
+
+/// \file
+///
+/// Define an accumulator that computes the height of a
+/// component through one of its pixels.
+/*
+This accumulator uses an mln::util::pix (pixel) to update the
+height information of the component.
+
+The class mln/accu/height is not a general-purpose accumulator;
+it is used to implement height-based connected filters.
+\see mln::morpho::closing::height
+\see mln::morpho::opening::height
+*/
+
+# include <mln/accu/internal/base.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+
+# include <mln/util/pix.hh>
+# include <mln/math/min.hh>
+# include <mln/math/max.hh>
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace shape
+ {
+
+ /// \brief Height accumulator.
+ ///
+ /// The parameter \p I is the image type on which the accumulator
+ /// of pixels is built.
+ ///
+ /// \ingroup modaccuimages
+ //
+ template <typename I>
+ struct height
+ : public mln::accu::internal::base< unsigned , height<I> >
+ {
+ /// The accumulated data type.
+ ///
+ /// The height of component is represented by the height of its
+ /// root pixel. See mln::morpho::closing_height and
+ /// mln::morpho::opening_height for actual uses of this
+ /// accumulator.
+ /// FIXME: Replaced by mln::morpho::attribute::height
+ typedef util::pix<I> argument;
+ /// The value type associated to the pixel type.
+ typedef typename argument::value value;
+
+ height();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument&);
+ void take(const height<I>& other);
+
+ /// Force the value of the counter to \a h.
+ void set_value(unsigned h);
+ /// \}
+
+ /// 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 minimum level in the component.
+ value min_level__;
+ /// The maximum level in the component.
+ value max_level__;
+ /// The height of the component.
+ unsigned height_;
+ };
+
+
+ } // end of mln::accu::shape
+
+
+ namespace meta
+ {
+
+ namespace shape
+ {
+
+ /// Meta accumulator for height.
+ struct height : public Meta_Accumulator< height >
+ {
+ template <typename I>
+ struct with
+ {
+ typedef accu::shape::height<I> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::shape
+
+ } // end of namespace mln::accu::meta
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace shape
+ {
+
+ template <typename I>
+ inline
+ height<I>::height()
+ {
+ init();
+ }
+
+ template <typename I>
+ inline
+ void
+ height<I>::init()
+ {
+ min_level__ = mln_max(value);
+ max_level__ = mln_min(value);
+ height_ = 0;
+ }
+
+ template <typename I>
+ inline
+ void
+ height<I>::take(const argument& t)
+ {
+ min_level__ = mln::math::min(min_level__, t.v());
+ max_level__ = mln::math::max(max_level__, t.v());
+ height_ = max_level__ - min_level__;
+ }
+
+ template <typename I>
+ inline
+ void
+ height<I>::take(const height<I>& other)
+ {
+ min_level__ = mln::math::min(min_level__, other.min_level__);
+ max_level__ = mln::math::max(max_level__, other.max_level__);
+ height_ = max_level__ - min_level__;
+ }
+
+ template <typename I>
+ inline
+ unsigned
+ height<I>::to_result() const
+ {
+ return height_;
+ }
+
+ template <typename I>
+ inline
+ void
+ height<I>::set_value(unsigned h)
+ {
+ height_ = h;
+ // Reset the other members.
+ min_level__ = mln_max(value);
+ max_level__ = mln_min(value);
+ }
+
+ template <typename I>
+ inline
+ bool
+ height<I>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::shape
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_SHAPE_HEIGHT_HH
Property changes on: trunk/milena/mln/accu/shape/height.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/shape/bbox.hh
===================================================================
--- trunk/milena/mln/accu/shape/bbox.hh (revision 0)
+++ trunk/milena/mln/accu/shape/bbox.hh (revision 4120)
@@ -0,0 +1,236 @@
+// 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_SHAPE_BBOX_HH
+# define MLN_ACCU_SHAPE_BBOX_HH
+
+/// \file
+///
+/// Define an accumulator that computes a bbox.
+
+# include <mln/core/site_set/box.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace shape
+ {
+
+
+ /// \brief Generic bounding box accumulator class.
+ ///
+ /// The parameter \c P is the type of points.
+ ///
+ /// \ingroup modaccusiteset
+ //
+ template <typename P>
+ struct bbox : public mln::accu::internal::base< const box<P>& ,
bbox<P> >
+ {
+ typedef P argument;
+
+ bbox();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const P& p);
+ void take(const P& p);
+ void take(const bbox<P>& other);
+ void take(const box<P>& b);
+ /// \}
+
+ /// Get the value of the accumulator.
+ const box<P>& to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+
+ bool is_valid_;
+ box<P> b_;
+ };
+
+
+ } // end of mln::accu::shape
+
+
+ namespace meta
+ {
+
+ namespace shape
+ {
+
+ /// Meta accumulator for bbox.
+ struct bbox : public Meta_Accumulator< bbox >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::shape::bbox<T> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::shape
+
+ } // end of namespace mln::accu::meta
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace shape
+ {
+
+ template <typename P>
+ inline
+ bbox<P>::bbox()
+ {
+ init();
+ }
+
+ template <typename P>
+ inline
+ void
+ bbox<P>::init()
+ {
+ is_valid_ = false;
+ }
+
+ template <typename P>
+ inline
+ void
+ bbox<P>::take_as_init_(const P& p)
+ {
+ b_.pmin() = p;
+ b_.pmax() = p;
+ is_valid_ = true;
+ }
+
+ template <typename P>
+ inline
+ void
+ bbox<P>::take(const P& p)
+ {
+ if (! is_valid_)
+ {
+ b_.pmin() = p;
+ b_.pmax() = p;
+ is_valid_ = true;
+ return;
+ }
+ for (unsigned i = 0; i < P::dim; ++i)
+ if (p[i] < b_.pmin()[i])
+ b_.pmin()[i] = p[i];
+ else if (p[i] > b_.pmax()[i])
+ b_.pmax()[i] = p[i];
+ }
+
+ template <typename P>
+ inline
+ void
+ bbox<P>::take(const bbox<P>& other)
+ {
+ if (! other.is_valid_)
+ {
+ // no-op
+ return;
+ }
+ if (! this->is_valid_)
+ {
+ // 'other' makes '*this' valid
+ *this = other;
+ is_valid_ = true;
+ return;
+ }
+ // both are valids so:
+ const box<P>& o_b = other.b_;
+ for (unsigned i = 0; i < P::dim; ++i)
+ {
+ if (o_b.pmin()[i] < b_.pmin()[i])
+ b_.pmin()[i] = o_b.pmin()[i];
+ if (o_b.pmax()[i] > b_.pmax()[i])
+ b_.pmax()[i] = o_b.pmax()[i];
+ }
+ }
+
+ template <typename P>
+ inline
+ void
+ bbox<P>::take(const box<P>& b)
+ {
+ if (! b.is_valid())
+ {
+ // no-op
+ return;
+ }
+ if (! this->is_valid_)
+ {
+ b_ = b;
+ is_valid_ = true;
+ return;
+ }
+ // both are valids so:
+ for (unsigned i = 0; i < P::dim; ++i)
+ {
+ if (b.pmin()[i] < b_.pmin()[i])
+ b_.pmin()[i] = b.pmin()[i];
+ if (b.pmax()[i] > b_.pmax()[i])
+ b_.pmax()[i] = b.pmax()[i];
+ }
+ }
+
+ template <typename P>
+ inline
+ const box<P>&
+ bbox<P>::to_result() const
+ {
+ // mln_precondition(is_valid_);
+ return b_;
+ }
+
+ template <typename P>
+ inline
+ bool
+ bbox<P>::is_valid() const
+ {
+ return is_valid_;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::shape
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_SHAPE_BBOX_HH
Property changes on: trunk/milena/mln/accu/shape/bbox.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/all.hh
===================================================================
--- trunk/milena/mln/accu/all.hh (revision 4119)
+++ trunk/milena/mln/accu/all.hh (revision 4120)
@@ -53,11 +53,9 @@
}
-# include <mln/accu/bbox.hh>
# include <mln/accu/count_labels.hh>
# include <mln/accu/center.hh>
// << # include <mln/accu/count_adjacent_vertices.hh> >>
-# include <mln/accu/height.hh>
# include <mln/accu/histo.hh>
# include <mln/accu/label_used.hh>
# include <mln/accu/line.hh>
@@ -66,7 +64,6 @@
# include <mln/accu/rank.hh>
# include <mln/accu/rms.hh>
// << # include <mln/accu/tuple.hh> >>
-# include <mln/accu/volume.hh>
// Routines.
@@ -85,6 +82,7 @@
# include <mln/accu/site_set/all.hh>
# include <mln/accu/stat/all.hh>
# include <mln/accu/logic/all.hh>
-
+# include <mln/accu/math/all.hh>
+# include <mln/accu/shape/all.hh>
#endif // ! MLN_ACCU_ALL_HH
Index: trunk/milena/mln/accu/center.hh
===================================================================
--- trunk/milena/mln/accu/center.hh (revision 4119)
+++ trunk/milena/mln/accu/center.hh (revision 4120)
@@ -33,7 +33,7 @@
/// \todo Fix to_result() value when invalid...
# include <mln/accu/internal/base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
namespace mln
{
Index: trunk/milena/mln/accu/essential.hh
===================================================================
--- trunk/milena/mln/accu/essential.hh (revision 4119)
+++ trunk/milena/mln/accu/essential.hh (revision 4120)
@@ -30,7 +30,6 @@
///
/// File that includes the most useful accumulator types.
-# include <mln/accu/bbox.hh>
# include <mln/accu/center.hh>
# include <mln/accu/histo.hh>
# include <mln/accu/rank.hh>
@@ -38,5 +37,7 @@
# include <mln/accu/stat/essential.hh>
# include <mln/accu/image/essential.hh>
# include <mln/accu/site_set/essential.hh>
+# include <mln/accu/shape/essential.hh>
+# include <mln/accu/math/essential.hh>
#endif // ! MLN_ACCU_ESSENTIAL_HH
Index: trunk/milena/mln/accu/stat/all.hh
===================================================================
--- trunk/milena/mln/accu/stat/all.hh (revision 4119)
+++ trunk/milena/mln/accu/stat/all.hh (revision 4120)
@@ -63,5 +63,6 @@
# include <mln/accu/stat/min_max.hh>
# include <mln/accu/stat/mean.hh>
# include <mln/accu/stat/median_h.hh>
+# include <mln/accu/stat/median_alt.hh>
#endif // ! MLN_ACCU_STAT_ALL_HH
Index: trunk/milena/mln/accu/stat/median_alt.hh
===================================================================
--- trunk/milena/mln/accu/stat/median_alt.hh (revision 0)
+++ trunk/milena/mln/accu/stat/median_alt.hh (revision 4120)
@@ -0,0 +1,339 @@
+// 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_STAT_MEDIAN_ALT_HH
+# define MLN_ACCU_STAT_MEDIAN_ALT_HH
+
+/// \file
+///
+/// Define alternative generic median accumulator class.
+
+# include <mln/accu/internal/base.hh>
+# include <mln/accu/histo.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace stat
+ {
+
+
+ /// \brief Generic median_alt function based on histogram over a
+ /// value set with type \c S.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ template <typename S>
+ struct median_alt : public mln::accu::internal::base< const mln_value(S)&,
median_alt<S> >
+ {
+ typedef mln_value(S) argument;
+
+ median_alt(const Value_Set<S>& s);
+
+ /// Manipulators.
+ /// \{
+ void take(const argument& t);
+ void untake(const argument& t);
+ void init();
+ /// \}
+
+ /// Get the value of the accumulator.
+ const argument& to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ // FIXME: remove
+ void debug__() const
+ {
+ std::cout << " i = " << i_
+ << " t = " << t_
+ << " s = " << sum_minus_ << " ; " <<
h_[i_] << " ; " << sum_plus_ << " = " <<
h_.sum()
+ << std::endl;
+ }
+
+ protected:
+
+ histo<S> h_;
+ /// derived from h_
+ const S& s_;
+
+ unsigned sum_minus_, sum_plus_;
+
+ /// the median index
+ unsigned i_;
+ /// the median argument
+ argument t_;
+
+ // Auxiliary methods
+ void go_minus_();
+ void go_plus_();
+ };
+
+ template <typename T>
+ struct median_alt_on : public median_alt< value::set<T> >
+ {
+ median_alt_on()
+ : median_alt< value::set<T> >(value::set<T>::the())
+ {
+ }
+ };
+
+ } // end of mln::accu::stat
+
+
+ namespace meta
+ {
+
+ namespace stat
+ {
+
+ /// Meta accumulator for median_alt.
+
+ template <typename T>
+ struct median_alt : public Meta_Accumulator< median_alt<T> >
+ {
+ median_alt(const Value_Set<T>& s_) : s(s_) {}
+
+ struct with
+ {
+ typedef accu::stat::median_alt<T> ret;
+ };
+
+ Value_Set<T> s;
+ };
+
+ } // end of namespace mln::accu::meta::stat
+
+ } // end of namespace mln::accu::meta
+
+
+ template <typename T>
+ stat::median_alt<T> unmeta(const meta::stat::median_alt<T>& m, T)
+ {
+ stat::median_alt<T> a(m.s);
+ return a;
+ }
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace stat
+ {
+
+ template <typename S>
+ inline
+ median_alt<S>::median_alt(const Value_Set<S>& s)
+ : h_(s),
+ s_(h_.vset())
+ {
+ init();
+ }
+
+
+ template <typename S>
+ inline
+ void
+ median_alt<S>::take(const argument& t)
+ {
+ // update h_
+ h_.take(t);
+
+ // particular case:
+ // current state was initialization
+ if (h_[i_] == 0)
+ {
+ // std::cout << "init!" << std::endl;
+ i_ = s_.index_of(t);
+ t_ = t;
+ return;
+ }
+
+ // particular case:
+ // the median does not change
+ if (t == t_)
+ {
+ // std::cout << "no change!" << std::endl;
+ return;
+ }
+
+ // general case:
+
+ if (t < t_)
+ {
+ ++sum_minus_;
+ if (2 * sum_minus_ > h_.sum())
+ go_minus_();
+ }
+ else
+ // t > t_
+ {
+ ++sum_plus_;
+ if (2 * sum_plus_ > h_.sum())
+ go_plus_();
+ }
+ }
+
+
+ template <typename S>
+ inline
+ void
+ median_alt<S>::untake(const argument& t)
+ {
+ mln_precondition(h_(t) != 0);
+
+ // update h_
+ h_.untake(t);
+
+ // particular case:
+ // the only value has been removed
+ if (h_.sum() == 0)
+ {
+ init();
+ return;
+ }
+
+ // general case:
+ if (t < t_)
+ {
+ --sum_minus_;
+ if (2 * sum_plus_ > h_.sum())
+ go_plus_();
+ }
+ else if (t > t_)
+ {
+ --sum_plus_;
+ if (2 * sum_minus_ > h_.sum())
+ go_minus_();
+ }
+ else
+ // t == t_
+ {
+ if (h_[i_] == 0)
+ {
+ // go to the heaviest side
+ if (sum_plus_ > sum_minus_)
+ go_plus_();
+ else
+ go_minus_(); // default when both sides are balanced
+ }
+ else
+ {
+ if (2 * sum_plus_ > h_.sum())
+ go_plus_();
+ else if (2 * sum_minus_ > h_.sum())
+ go_minus_();
+ // else no change
+ }
+ }
+ }
+
+ template <typename S>
+ inline
+ void
+ median_alt<S>::init()
+ {
+ h_.init();
+ sum_minus_ = 0;
+ sum_plus_ = 0;
+ i_ = (mln_max(argument) - mln_min(argument)) / 2;
+ t_ = s_[i_];
+ }
+
+ template <typename S>
+ inline
+ const typename median_alt<S>::argument&
+ median_alt<S>::to_result() const
+ {
+ return t_;
+ }
+
+ template <typename S>
+ inline
+ bool
+ median_alt<S>::is_valid() const
+ {
+ return true;
+ }
+
+ template <typename S>
+ inline
+ void
+ median_alt<S>::go_minus_()
+ {
+ do
+ {
+ sum_plus_ += h_[i_];
+ do
+ --i_;
+ while (h_[i_] == 0);
+ sum_minus_ -= h_[i_];
+ }
+ while (2 * sum_minus_ > h_.sum());
+ t_ = s_[i_];
+ }
+
+
+ template <typename S>
+ inline
+ void
+ median_alt<S>::go_plus_()
+ {
+ do
+ {
+ sum_minus_ += h_[i_];
+ do
+ ++i_;
+ while (h_[i_] == 0);
+ sum_plus_ -= h_[i_];
+ }
+ while (2 * sum_plus_ > h_.sum());
+ t_ = s_[i_];
+ }
+
+ template <typename S>
+ inline
+ std::ostream& operator<<(std::ostream& ostr, const
median_alt<S>& m)
+ {
+ m.debug__();
+ return ostr << m.to_result();
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::stat
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MEDIAN_ALT_HH
Property changes on: trunk/milena/mln/accu/stat/median_alt.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/geom/bbox.hh
===================================================================
--- trunk/milena/mln/geom/bbox.hh (revision 4119)
+++ trunk/milena/mln/geom/bbox.hh (revision 4120)
@@ -44,7 +44,7 @@
# include <mln/core/concept/window.hh>
# include <mln/core/concept/weighted_window.hh>
# include <mln/literal/zero.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
namespace mln
@@ -149,7 +149,7 @@
trace::entering("geom::bbox");
typedef mln_psite(W) P;
- accu::bbox<P> b;
+ accu::shape::bbox<P> b;
P O = literal::origin;
mln_qiter(W) q(exact(win), O);
for_all(q)
Index: trunk/milena/sandbox/duhamel/mesh_p.hh
===================================================================
--- trunk/milena/sandbox/duhamel/mesh_p.hh (revision 4119)
+++ trunk/milena/sandbox/duhamel/mesh_p.hh (revision 4120)
@@ -4,7 +4,7 @@
# include <mln/core/concept/point.hh>
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/internal/site_iterator_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/graph.hh>
# include "mesh_psite.hh"
@@ -120,7 +120,7 @@
: gr_ (gr),
loc_ (loc)
{
- accu::bbox<P> a;
+ accu::shape::bbox<P> a;
for (unsigned i = 0; i < loc.size(); ++i)
a.take(loc[i]);
bb_ = a.to_result();
Index: trunk/milena/sandbox/duhamel/queue_p_fast.hh
===================================================================
--- trunk/milena/sandbox/duhamel/queue_p_fast.hh (revision 4119)
+++ trunk/milena/sandbox/duhamel/queue_p_fast.hh (revision 4120)
@@ -40,7 +40,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/vec_p_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
namespace mln
@@ -121,7 +121,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
};
Index: trunk/milena/sandbox/duhamel/queue_p_priority.hh
===================================================================
--- trunk/milena/sandbox/duhamel/queue_p_priority.hh (revision 4119)
+++ trunk/milena/sandbox/duhamel/queue_p_priority.hh (revision 4120)
@@ -41,7 +41,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/vec_p_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/queue_p.hh>
namespace mln
@@ -120,7 +120,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/fred/old/value.cc
===================================================================
--- trunk/milena/sandbox/fred/old/value.cc (revision 4119)
+++ trunk/milena/sandbox/fred/old/value.cc (revision 4120)
@@ -2,7 +2,7 @@
#include <mln/opt/at.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/canvas/morpho/connected_filter.hh>
#include <mln/core/alias/neighb2d.hh>
#include "value_wrapper.hh"
@@ -20,5 +20,5 @@
for (int k = 0; k < 2; k++)
opt::at(a, i, j)[k] = 20 + (k ? i : j);
- debug::println(canvas::morpho::connected_filter(a, c4(),
morpho::attribute::site_wrapper< accu::bbox<mln::point2d> >(), make::box2d(8,
8), true));
+ debug::println(canvas::morpho::connected_filter(a, c4(),
morpho::attribute::site_wrapper< accu::shape::bbox<mln::point2d> >(),
make::box2d(8, 8), true));
}
\ No newline at end of file
Index: trunk/milena/sandbox/fred/old/p2p/p2p_morpher.hh
===================================================================
--- trunk/milena/sandbox/fred/old/p2p/p2p_morpher.hh (revision 4119)
+++ trunk/milena/sandbox/fred/old/p2p/p2p_morpher.hh (revision 4120)
@@ -37,7 +37,7 @@
# include <mln/core/site_set/box.hh>
# include <mln/value/set.hh>
# include <mln/core/concept/function.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
namespace mln
{
@@ -181,7 +181,7 @@
a box. */
// Create transformed bounding box
- accu::bbox<P> tbox;
+ accu::shape::bbox<P> tbox;
tbox.take_as_init (fun (ima.domain ().pmin ()));
tbox.take (fun (ima.domain ().pmax ()));
@@ -223,7 +223,7 @@
typedef mln_psite(I) P;
// Create transformed bounding box
- accu::bbox<P> tbox;
+ accu::shape::bbox<P> tbox;
tbox.take_as_init (this->data_->funinv_ (this->data_->ima_.domain ().pmin
()));
tbox.take (this->data_->funinv_ (this->data_->ima_.domain ().pmax ()));
Index: trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast.hh (revision 4120)
@@ -42,7 +42,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/p_array_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_queue_fast.hh>
# include <trait/point_set.hh>
@@ -139,7 +139,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/pellegrin/set/core/p_bgraph.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_bgraph.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_bgraph.hh (revision 4120)
@@ -36,7 +36,7 @@
# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/internal/boost_graph.hh>
# include <mln/core/image/bgraph_psite.hh>
# include <mln/core/site_set/p_bgraph_piter.hh>
@@ -134,7 +134,7 @@
mln_precondition(gr != 0);
// FIXME: Warning: if the underlying graph is updated later, this
// won't be taken into account by this p_bgraph!
- accu::bbox<P> a;
+ accu::shape::bbox<P> a;
for (node_iterators iter = boost::vertices(*gr_);
iter.first != iter.second;
Index: trunk/milena/sandbox/pellegrin/set/core/p_run.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_run.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_run.hh (revision 4120)
@@ -35,7 +35,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/internal/set_of.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <trait/point_set.hh>
@@ -109,7 +109,7 @@
protected:
- accu::bbox<P> bb_;
+ accu::shape::bbox<P> bb_;
// FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
/// The first point of the run.
Index: trunk/milena/sandbox/pellegrin/set/core/p_line_graph.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_line_graph.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_line_graph.hh (revision 4120)
@@ -31,7 +31,7 @@
# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/graph.hh>
# include <mln/core/image/line_graph_psite.hh>
# include <mln/core/site_set/p_line_graph_piter.hh>
@@ -126,7 +126,7 @@
// FIXME: Dummy initialization of bb_.
// // FIXME: Warning: if the underlying graph is updated later, this
// // won't be taken into account by this p_line_graph!
-// accu::bbox<point> a;
+// accu::shape::bbox<point> a;
// for (util::edge_id e = 0; e < nlines(); ++e)
// a.take(point(gr_.node_data(gr_.edge(e).n1()),
// gr_.node_data(gr_.edge(e).n2())));
Index: trunk/milena/sandbox/pellegrin/set/core/p_array.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_array.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_array.hh (revision 4120)
@@ -36,7 +36,7 @@
# include <vector>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <trait/point_set.hh>
@@ -116,7 +116,7 @@
protected:
std::vector<P> vect_;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void update_bb_() const;
Index: trunk/milena/sandbox/pellegrin/set/core/p_queue.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_queue.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_queue.hh (revision 4120)
@@ -40,7 +40,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/p_array_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <trait/point_set.hh>
@@ -137,7 +137,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/pellegrin/set/core/p_priority_queue.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_priority_queue.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_priority_queue.hh (revision 4120)
@@ -42,7 +42,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/p_array_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_queue.hh>
# include <trait/point_set.hh>
@@ -139,7 +139,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/pellegrin/set/core/p_runs.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_runs.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_runs.hh (revision 4120)
@@ -40,7 +40,7 @@
# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/runs_psite.hh>
# include <mln/core/site_set/p_run.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/lazy_set.hh>
# include <trait/point_set.hh>
@@ -120,7 +120,7 @@
util::lazy_set_<p_run<P> > con_;
/// Exact bounding box.
- accu::bbox<P> fb_;
+ accu::shape::bbox<P> fb_;
};
# ifndef MLN_INCLUDE_ONLY
Index: trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (revision
4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (revision
4120)
@@ -42,7 +42,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/p_array_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_queue_fast.hh>
# include <trait/point_set.hh>
@@ -139,7 +139,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/pellegrin/set/core/p_set.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_set.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_set.hh (revision 4120)
@@ -35,7 +35,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/internal/set_of.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_array.hh>
# include <trait/point_set.hh>
@@ -109,7 +109,7 @@
protected:
- accu::bbox<P> bb_;
+ accu::shape::bbox<P> bb_;
// FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
Index: trunk/milena/sandbox/pellegrin/set/core/internal/multi_set.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/internal/multi_set.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/internal/multi_set.hh (revision 4120)
@@ -90,7 +90,7 @@
protected:
- accu::bbox<P> bb_;
+ accu::shape::bbox<P> bb_;
// FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
Index: trunk/milena/sandbox/pellegrin/set/core/internal/uni_set.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/internal/uni_set.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/internal/uni_set.hh (revision 4120)
@@ -90,7 +90,7 @@
protected:
- accu::bbox<P> bb_;
+ accu::shape::bbox<P> bb_;
// FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
Index: trunk/milena/sandbox/pellegrin/set/core/p_graph.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_graph.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_graph.hh (revision 4120)
@@ -31,7 +31,7 @@
# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/graph.hh>
# include <mln/core/image/graph_psite.hh>
# include <mln/core/site_set/p_graph_piter.hh>
@@ -131,7 +131,7 @@
{
// FIXME: Warning: if the underlying graph is updated later, this
// won't be taken into account by this p_graph!
- accu::bbox<P> a;
+ accu::shape::bbox<P> a;
for (unsigned i = 0; i < nsites(); ++i)
a.take(gr_.node_data(i));
bb_ = a.to_result();
Index: trunk/milena/sandbox/pellegrin/set/core/p_queue_fast.hh
===================================================================
--- trunk/milena/sandbox/pellegrin/set/core/p_queue_fast.hh (revision 4119)
+++ trunk/milena/sandbox/pellegrin/set/core/p_queue_fast.hh (revision 4120)
@@ -41,7 +41,7 @@
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/p_array_piter.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <trait/point_set.hh>
@@ -138,7 +138,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
};
Index: trunk/milena/sandbox/nivault/extract_score.cc
===================================================================
--- trunk/milena/sandbox/nivault/extract_score.cc (revision 4119)
+++ trunk/milena/sandbox/nivault/extract_score.cc (revision 4120)
@@ -53,7 +53,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/accu/stat/mean.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/accu/p.hh>
# include <mln/accu/math/count.hh>
Index: trunk/milena/sandbox/nivault/extract_character.cc
===================================================================
--- trunk/milena/sandbox/nivault/extract_character.cc (revision 4119)
+++ trunk/milena/sandbox/nivault/extract_character.cc (revision 4120)
@@ -51,7 +51,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/accu/stat/mean.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/accu/p.hh>
# include <mln/accu/math/count.hh>
@@ -128,7 +128,7 @@
template <typename I, typename O>
void
extract_lines(I& text_image, O& output,
- std::vector< accu::bbox <point2d> >& v_bbox,
+ std::vector< accu::shape::bbox <point2d> >& v_bbox,
int limits)
{
typedef image2d<unsigned> I_LABEL;
@@ -143,7 +143,7 @@
{
bool ok = false;
int i = 0;
- accu::bbox<point2d> accu;
+ accu::shape::bbox<point2d> accu;
{
bool okk = true;
while (okk)
@@ -256,7 +256,7 @@
std::cout << "nb_labels = " << nb_labels << std::endl;
// Extraction of informations in the image (BoundingBox, Cardinality, ... ).
- std::vector< accu::bbox <point2d> > vec_bbox (nb_labels + 1);
+ std::vector< accu::shape::bbox <point2d> > vec_bbox (nb_labels + 1);
std::vector< accu::count_<point2d> > vec_card (nb_labels + 1);
mln_piter_(I_LABEL) p (label_image.domain ());
@@ -320,7 +320,7 @@
// unsigned nb_dilated_node_labels;
// I_LABEL label_image2 = labeling::blobs(bool_ima, c8(), nb_dilated_node_labels);
// std::cout << "nb_dilated_node_labels = " <<
nb_dilated_node_labels << std::endl;
-// std::vector< accu::bbox <point2d> > vec_bbox2 (nb_dilated_node_labels +
1);
+// std::vector< accu::shape::bbox <point2d> > vec_bbox2
(nb_dilated_node_labels + 1);
// // Extract area of text.
// mln_piter_(I_LABEL) pl (label_image.domain ());
Index: trunk/milena/sandbox/icdar/2009/hsc/clean_lines_with_grouped_bboxes.hh
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/clean_lines_with_grouped_bboxes.hh (revision
4119)
+++ trunk/milena/sandbox/icdar/2009/hsc/clean_lines_with_grouped_bboxes.hh (revision
4120)
@@ -65,12 +65,12 @@
// mln_ch_value(L,LV) lbl = labeling::background(input, c8(), nlabels);
// util::array<box<mln_site(L)> >
-// bboxes = labeling::compute(accu::meta::bbox(), lbl, nlabels);
+// bboxes = labeling::compute(accu::meta::shape::bbox(), lbl, nlabels);
nlabels = text.nbboxes();
const image2d<value::label_16>& lbl = text.label_image();
util::array<box<mln_site(L)> >
- bboxes = labeling::compute(accu::meta::bbox(), lbl, nlabels);
+ bboxes = labeling::compute(accu::meta::shape::bbox(), lbl, nlabels);
text.bboxes() = bboxes;
scribo::debug::save_textbboxes_image(input, text.bboxes(), literal::red,
"plop.ppm");
Index: trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4119)
+++ trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4120)
@@ -5,7 +5,7 @@
#include <mln/labeling/background.hh>
#include <mln/labeling/compute.hh>
#include <mln/accu/math/count.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/data/transform.hh>
@@ -23,7 +23,7 @@
L nlabels;
image2d<L> lab = labeling::background(input, c8(), nlabels);
util::array<unsigned> count =
labeling::compute(accu::math::count<point2d>(), lab, nlabels);
- util::array<box2d> box = labeling::compute(accu::bbox<point2d>(),
lab, nlabels);
+ util::array<box2d> box =
labeling::compute(accu::shape::bbox<point2d>(), lab, nlabels);
fun::i2v::array<bool> ok(nlabels.next(), false); // default is text
ok(0) = true; // bg is 'white'
Index: trunk/milena/sandbox/icdar/2009/hsc/lines_to_boxes.cc
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/lines_to_boxes.cc (revision 4119)
+++ trunk/milena/sandbox/icdar/2009/hsc/lines_to_boxes.cc (revision 4120)
@@ -44,7 +44,7 @@
label_8 n = unsigned(n_boxes);
mln_VAR(input_, violent_cast_image_<label_8>(input));
- util::array<box2d> boxes = labeling::compute(accu::meta::bbox(),
+ util::array<box2d> boxes = labeling::compute(accu::meta::shape::bbox(),
input_,
n);
Index: trunk/milena/sandbox/icdar/2009/hsc/get_line_images.hh
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/get_line_images.hh (revision 4119)
+++ trunk/milena/sandbox/icdar/2009/hsc/get_line_images.hh (revision 4120)
@@ -10,7 +10,7 @@
#include <mln/data/fill.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
@@ -37,7 +37,7 @@
mln_precondition(lines.is_valid());
util::array<box<mln_site(L)> >
- bboxes = labeling::compute(accu::meta::bbox(), lines, nlines);
+ bboxes = labeling::compute(accu::meta::shape::bbox(), lines, nlines);
typedef mln_ch_value(L,bool) line_t;
util::array<line_t> result;
Index: trunk/milena/sandbox/icdar/2009/hsc/clean_lines.hh
===================================================================
--- trunk/milena/sandbox/icdar/2009/hsc/clean_lines.hh (revision 4119)
+++ trunk/milena/sandbox/icdar/2009/hsc/clean_lines.hh (revision 4120)
@@ -40,7 +40,7 @@
LV nlabels;
mln_ch_value(L,LV) lbl = labeling::background(input, c8(), nlabels);
- util::array<box<mln_site(L)> > bboxes =
labeling::compute(accu::meta::bbox(), lbl, nlabels);
+ util::array<box<mln_site(L)> > bboxes =
labeling::compute(accu::meta::shape::bbox(), lbl, nlabels);
/// Compute the most represented label for each component.
accu::label_maj<LV, mln_value(L)> accu(nlabels.next());
Index: trunk/milena/sandbox/jardonnet/n_cmpt/tikz.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/tikz.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/tikz.hh (revision 4120)
@@ -39,7 +39,7 @@
# include <mln/debug/println.hh>
# include <mln/debug/iota.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
@@ -109,7 +109,7 @@
typedef p_array<mln_psite(I)> S;
typedef mln_ch_value(I, value::int_u<16>) V;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_decreasing(ima);
morpho::tree::data<I,S> t(ima, sp, nbh);
@@ -153,7 +153,7 @@
typedef mln_psite(V) P;
//data
- mln_ch_value(V, accu::volume<V>) data(volume.domain());
+ mln_ch_value(V, accu::shape::volume<V>) data(volume.domain());
//deja_vu
mln_ch_value(V, bool) deja_vu(volume.domain());
Index: trunk/milena/sandbox/jardonnet/n_cmpt/nwst.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/nwst.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/nwst.hh (revision 4120)
@@ -38,7 +38,7 @@
# include <mln/literal/colors.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
Index: trunk/milena/sandbox/jardonnet/n_cmpt/test_attribute_watershed.cc
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/test_attribute_watershed.cc (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/test_attribute_watershed.cc (revision 4120)
@@ -9,7 +9,7 @@
#include <mln/morpho/meyer_wst.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/morpho/tree/data.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
@@ -47,7 +47,7 @@
// compute volume image
typedef p_array<mln_psite_(I)> S;
typedef mln_ch_value_(I,unsigned) V;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_decreasing(ima);
morpho::tree::data<I,S> t(ima, sp, c4());
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt2.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt2.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt2.hh (revision 4120)
@@ -31,7 +31,7 @@
# include <mln/data/fill.hh>
# include <mln/core/site_set/p_vaccess.hh>
# include <mln/data/sort_psites.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
# include <mln/value/int_u.hh>
@@ -73,7 +73,7 @@
// compute volume image
typedef p_array<mln_psite(I)> S;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_increasing(input);
morpho::tree::data<I,S> t(input, sp, c4());
image2d<unsigned> volume = morpho::tree::compute_attribute_image(A(), t);
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt3.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt3.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt3.hh (revision 4120)
@@ -34,7 +34,7 @@
# include <mln/debug/println.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
@@ -79,7 +79,7 @@
// compute volume image
typedef p_array<mln_psite(I)> S;
typedef mln_ch_value(I,unsigned) V;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_decreasing(ima);
morpho::tree::data<I,S> t(ima, sp, nbh);
@@ -108,7 +108,7 @@
// prepare union find
typedef mln_psite(V) P;
//data
- mln_ch_value(V, accu::volume<V>) data(volume.domain());
+ mln_ch_value(V, accu::shape::volume<V>) data(volume.domain());
//deja_vu
mln_ch_value(V, bool) deja_vu(volume.domain());
mln::data::fill(deja_vu, false);
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt4.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt4.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt4.hh (revision 4120)
@@ -34,7 +34,7 @@
# include <mln/debug/println.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
@@ -79,7 +79,7 @@
// compute volume image
typedef p_array<mln_psite(I)> S;
typedef mln_ch_value(I,unsigned) V;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_decreasing(ima);
morpho::tree::data<I,S> t(ima, sp, nbh);
@@ -109,7 +109,7 @@
// prepare union find
typedef mln_psite(V) P;
//data
- mln_ch_value(V, accu::volume<V>) data(volume.domain());
+ mln_ch_value(V, accu::shape::volume<V>) data(volume.domain());
//deja_vu
mln_ch_value(V, bool) deja_vu(volume.domain());
mln::data::fill(deja_vu, false);
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt5.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt5.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt5.hh (revision 4120)
@@ -35,7 +35,7 @@
# include <mln/debug/println.hh>
# include <mln/debug/iota.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/compute_attribute_image.hh>
@@ -79,7 +79,7 @@
typedef p_array<mln_psite(I)> S;
typedef mln_ch_value(I,unsigned) V;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
S sp = data::sort_psites_decreasing(ima);
morpho::tree::data<I,S> t(ima, sp, nbh);
@@ -117,7 +117,7 @@
typedef mln_psite(V) P;
//data
- mln_ch_value(V, accu::volume<V>) data(volume.domain());
+ mln_ch_value(V, accu::shape::volume<V>) data(volume.domain());
//deja_vu
mln_ch_value(V, bool) deja_vu(volume.domain());
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.cc
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.cc (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.cc (revision 4120)
@@ -7,7 +7,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include "n_cmpt.hh"
Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh
===================================================================
--- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4119)
+++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4120)
@@ -34,7 +34,7 @@
# include <mln/util/pix.hh>
# include <mln/data/sort_psites.hh>
# include <mln/accu/math/count.hh>
-# include <mln/accu/volume.hh>
+# include <mln/accu/shape/volume.hh>
namespace mln
{
@@ -75,7 +75,7 @@
// Local type.
typedef mln_psite(I) P;
- typedef accu::volume<I> A;
+ typedef accu::shape::volume<I> A;
//typedef accu::math::count<unsigned> A;
typedef mln_psite(I) P;
typedef p_array<P> S;
Index: trunk/milena/sandbox/garrigues/fllt/essai.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/essai.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/essai.cc (revision 4120)
@@ -4,7 +4,7 @@
#include <mln/core/image_if_value.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
@@ -36,7 +36,7 @@
// private:
// image2d<int_u8> ima_;
-// accu::bbox<point2d> bb_;
+// accu::shape::bbox<point2d> bb_;
// };
# define image_if_value_sub image_if_value<const
sub_image<image2d<value::int_u8>, box2d> >
Index: trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.1.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.1.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.1.cc (revision 4120)
@@ -43,7 +43,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/io/pgm/save.hh>
@@ -160,7 +160,7 @@
arr_t* A = new arr_t();
arr_t* N = new arr_t();
- accu::bbox<mln_point(I)> R_box, N_box;
+ accu::shape::bbox<mln_point(I)> R_box, N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.3.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.3.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.3.cc (revision 4120)
@@ -44,7 +44,7 @@
#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/io/pgm/save.hh>
#include <mln/util/tree.hh>
@@ -344,7 +344,7 @@
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<mln_point(I)> R_box, N_box;
+ accu::shape::bbox<mln_point(I)> R_box, N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
unsigned cc_cpt = 0;
Index: trunk/milena/sandbox/garrigues/fllt/fllt_simple.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt_simple.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/fllt_simple.cc (revision 4120)
@@ -49,7 +49,7 @@
#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/io/pgm/save.hh>
#include <mln/util/tree.hh>
@@ -462,7 +462,7 @@
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<mln_point(I)> R_box, N_box;
+ accu::shape::bbox<mln_point(I)> R_box, N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
unsigned cc_cpt = 0;
Index: trunk/milena/sandbox/garrigues/fllt/types.hh
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/types.hh (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/types.hh (revision 4120)
@@ -104,7 +104,7 @@
private:
image2d<value::int_u8> ima_;
unsigned nsites_;
- accu::bbox<point2d> bb_;
+ accu::shape::bbox<point2d> bb_;
};
Index: trunk/milena/sandbox/garrigues/fllt/fllt_theo.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt_theo.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/fllt_theo.cc (revision 4120)
@@ -42,7 +42,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/io/pgm/save.hh>
@@ -110,7 +110,7 @@
arr_t A;
arr_t N[256];
- accu::bbox<mln_point(I)> R_box;
+ accu::shape::bbox<mln_point(I)> R_box;
data::fill(tagged, false);
mln_piter(I) min(input.domain());
Index: trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.2.cc
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.2.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/fllt/fllt_simple.svg.2.cc (revision 4120)
@@ -43,7 +43,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/io/pgm/save.hh>
@@ -177,7 +177,7 @@
arr_t* A = new arr_t();
arr_t* N = new arr_t();
- accu::bbox<mln_point(I)> R_box, N_box;
+ accu::shape::bbox<mln_point(I)> R_box, N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/garrigues/factures/extract_array_highlight.cc
===================================================================
--- trunk/milena/sandbox/garrigues/factures/extract_array_highlight.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/factures/extract_array_highlight.cc (revision 4120)
@@ -66,7 +66,7 @@
image2d<unsigned> labels = labeling::value(in, true, c4(), nlabels);
// Get the caracteristics of the connected components.
- std::vector< accu::pair_< accu::bbox<point2d>, accu::count_<point2d>
> > caracteristics(nlabels + 1);
+ std::vector< accu::pair_< accu::shape::bbox<point2d>,
accu::count_<point2d> > > caracteristics(nlabels + 1);
mln_fwd_piter_(ima2d_unsigned) p(labels.domain());
for_all(p)
caracteristics[labels(p)].take(p);
Index: trunk/milena/sandbox/garrigues/factures/extract_array.cc
===================================================================
--- trunk/milena/sandbox/garrigues/factures/extract_array.cc (revision 4119)
+++ trunk/milena/sandbox/garrigues/factures/extract_array.cc (revision 4120)
@@ -70,7 +70,7 @@
image2d<unsigned> labels = labeling::value(bin, true, c4(), nlabels);
// Get the caracteristics of the connected components.
- std::vector< accu::pair_< accu::bbox<point2d>, accu::count_<point2d>
> > caracteristics(nlabels);
+ std::vector< accu::pair_< accu::shape::bbox<point2d>,
accu::count_<point2d> > > caracteristics(nlabels);
mln_fwd_piter_(ima2d_unsigned) p(labels.domain());
for_all(p)
caracteristics[labels(p)].take(p);
Index: trunk/milena/sandbox/abraham/mln/core/site_set/p_priority_queue.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/core/site_set/p_priority_queue.hh (revision 4119)
+++ trunk/milena/sandbox/abraham/mln/core/site_set/p_priority_queue.hh (revision 4120)
@@ -42,7 +42,7 @@
# include <mln/core/internal/site_set_base.hh>
# include <mln/core/site_set/p_array.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_queue.hh>
namespace mln
@@ -124,7 +124,7 @@
mutable bool vect_needs_update_;
void vect_update_() const;
- mutable accu::bbox<P> bb_;
+ mutable accu::shape::bbox<P> bb_;
mutable bool bb_needs_update_;
void bb_update_() const;
Index: trunk/milena/sandbox/inim/2010/boxes/boxes.cc
===================================================================
--- trunk/milena/sandbox/inim/2010/boxes/boxes.cc (revision 4119)
+++ trunk/milena/sandbox/inim/2010/boxes/boxes.cc (revision 4120)
@@ -88,7 +88,7 @@
mln::util::array<unsigned>& array)
{
/// Accumulator array
- mln::util::array< accu::bbox<mln_site(I)> > tboxes;
+ mln::util::array< accu::shape::bbox<mln_site(I)> > tboxes;
tboxes.resize(text.bboxes().nelements());
/// Adding bounding boxes to accumulator
Index: trunk/milena/sandbox/inim/2010/rag/center_weight.hh
===================================================================
--- trunk/milena/sandbox/inim/2010/rag/center_weight.hh (revision 4119)
+++ trunk/milena/sandbox/inim/2010/rag/center_weight.hh (revision 4120)
@@ -36,7 +36,7 @@
/// \todo Fix to_result() value when invalid...
# include <mln/accu/internal/base.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/util/couple.hh>
namespace mln
Index: trunk/milena/sandbox/theo/p_runs__with_dedicated_piter.hh
===================================================================
--- trunk/milena/sandbox/theo/p_runs__with_dedicated_piter.hh (revision 4119)
+++ trunk/milena/sandbox/theo/p_runs__with_dedicated_piter.hh (revision 4120)
@@ -33,7 +33,7 @@
* \brief Definition of a set of point runs.
*/
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/core/site_set/p_run.hh>
# include <mln/core/p_double.hh>
# include <mln/core/internal/piter_adaptor.hh>
@@ -158,7 +158,7 @@
unsigned nsites_;
/// Bounding box accumulator.
- accu::bbox<P> b_;
+ accu::shape::bbox<P> b_;
/// Set of runs.
util::set< p_run<P> > run_;
Index: trunk/milena/sandbox/theo/fllt.svg.6.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt.svg.6.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt.svg.6.cc (revision 4120)
@@ -48,7 +48,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -576,7 +576,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
bool touch_border_of_image = false;
unsigned n_step_1 = 0, n_step_3 = 0, n_comps = 0, n_holes = 0;
Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4119)
+++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4120)
@@ -100,7 +100,7 @@
// }
// // accu::math::count< util::pix<g_t> > a_;
-// accu::height<g_t> a_;
+// accu::shape::height<g_t> a_;
// compute_attribute_extincted(g, cplx2d::e2e(), a_,
// w);
Index: trunk/milena/sandbox/theo/fllt/fllt.hh
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.hh (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.hh (revision 4120)
@@ -52,7 +52,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -400,7 +400,7 @@
image2d< fllt_node(P, V)* >& smallest_shapes,
int in_R,
int in_N,
- accu::bbox<P>& N_box,
+ accu::shape::bbox<P>& N_box,
p_array<P>* N[257],
const V& g,
unsigned& n_comps)
@@ -608,7 +608,7 @@
arr_t* N[257];
for (unsigned i = 0; i < 257; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
unsigned n_step_1 = 0, n_step_3 = 0, n_step_4c = 0, sum4c = 0,
n_comps = 0, n_holes = 0, n_browsed = 0, n_find_root = 0,
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.1.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.1.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.1.cc (revision 4120)
@@ -40,7 +40,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/literal/black.hh>
#include <mln/literal/white.hh>
@@ -116,7 +116,7 @@
arr_t A;
arr_t N[256];
- accu::bbox<mln_point(I)> R_box;
+ accu::shape::bbox<mln_point(I)> R_box;
// Step 1.
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.7.hh
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.7.hh (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.7.hh (revision 4120)
@@ -54,7 +54,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -493,7 +493,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
bool touch_border_of_image = false;
unsigned n_step_1 = 0, n_step_3 = 0, n_step_4c = 0, n_comps = 0, n_holes = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.2.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.2.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.2.cc (revision 4120)
@@ -41,7 +41,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/literal/black.hh>
@@ -163,7 +163,7 @@
R.reserve(input.nsites());
arr_t N[256];
- accu::bbox<mln_point(I)> R_box;
+ accu::shape::bbox<mln_point(I)> R_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.3.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.3.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.3.cc (revision 4120)
@@ -42,7 +42,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/literal/black.hh>
@@ -168,7 +168,7 @@
typedef p_array<mln_point(I)> arr_t;
arr_t A;
arr_t N[256];
- accu::bbox<mln_point(I)> N_box;
+ accu::shape::bbox<mln_point(I)> N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.4.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.4.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.4.cc (revision 4120)
@@ -43,7 +43,7 @@
#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -173,7 +173,7 @@
typedef p_array<mln_point(I)> arr_t;
arr_t A;
arr_t N[256];
- accu::bbox<mln_point(I)> N_box;
+ accu::shape::bbox<mln_point(I)> N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.5.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.5.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.5.cc (revision 4120)
@@ -43,7 +43,7 @@
#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -175,7 +175,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<mln_point(I)> N_box;
+ accu::shape::bbox<mln_point(I)> N_box;
unsigned n_step_1 = 0, n_step_3 = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt.svg.6.cc
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt.svg.6.cc (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt.svg.6.cc (revision 4120)
@@ -48,7 +48,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -573,7 +573,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
bool touch_border_of_image = false;
unsigned n_step_1 = 0, n_step_3 = 0, n_comps = 0, n_holes = 0;
Index: trunk/milena/sandbox/theo/fllt/fllt_test.hh
===================================================================
--- trunk/milena/sandbox/theo/fllt/fllt_test.hh (revision 4119)
+++ trunk/milena/sandbox/theo/fllt/fllt_test.hh (revision 4120)
@@ -50,7 +50,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -522,7 +522,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
bool touch_border_of_image = false;
unsigned n_step_1 = 0, n_step_3 = 0, n_step_4c = 0, n_comps = 0, n_holes = 0;
Index: trunk/milena/sandbox/theo/fllt.svg.7.hh
===================================================================
--- trunk/milena/sandbox/theo/fllt.svg.7.hh (revision 4119)
+++ trunk/milena/sandbox/theo/fllt.svg.7.hh (revision 4120)
@@ -52,7 +52,7 @@
#include <mln/debug/println.hh>
#include <mln/labeling/regional_minima.hh>
#include <mln/labeling/regional_maxima.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/geom/bbox.hh>
#include <mln/pw/all.hh>
@@ -485,7 +485,7 @@
arr_t* N[256];
for (unsigned i = 0; i < 256; ++i)
N[i] = new arr_t();
- accu::bbox<P> N_box;
+ accu::shape::bbox<P> N_box;
bool touch_border_of_image = false;
unsigned n_step_1 = 0, n_step_3 = 0, n_step_4c = 0, n_comps = 0, n_holes = 0;
Index: trunk/milena/sandbox/theo/tufa_2008/wst_f_equal_wst_a.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/wst_f_equal_wst_a.cc (revision 4119)
+++ trunk/milena/sandbox/theo/tufa_2008/wst_f_equal_wst_a.cc (revision 4120)
@@ -42,7 +42,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/morpho/meyer_wst.hh>
@@ -119,7 +119,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::volume<I> vol;
+ accu::shape::volume<I> vol;
image2d<unsigned> a = morpho::tree::compute_attribute_image(vol, t);
labeling::regional_minima(a, c4(), n);
Index: trunk/milena/sandbox/theo/tufa_2008/experiment.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/experiment.cc (revision 4119)
+++ trunk/milena/sandbox/theo/tufa_2008/experiment.cc (revision 4120)
@@ -42,7 +42,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/morpho/tree/data.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/win/disk2d.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
@@ -112,7 +112,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::volume<I> attr;
+ accu::shape::volume<I> attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
io::pgm::save(data::stretch(int_u8(), a),
Index: trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4119)
+++ trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4120)
@@ -41,7 +41,7 @@
#include <mln/morpho/tree/data.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/accu/math/count.hh>
@@ -256,7 +256,7 @@
unsigned n = std::atoi(argv[2]);
accu::math::count< util::pix<I> > acc;
- // accu::volume<I> acc;
+ // accu::shape::volume<I> acc;
image2d<int_u8> g = n_cmpt(acc, f, c4(), n + 1);
debug::println(g);
Index: trunk/milena/sandbox/theo/tufa_2008/filter.cc
===================================================================
--- trunk/milena/sandbox/theo/tufa_2008/filter.cc (revision 4119)
+++ trunk/milena/sandbox/theo/tufa_2008/filter.cc (revision 4120)
@@ -150,7 +150,7 @@
// We get a min-tree so that we can perform morphological closings.
morpho::tree::data<I,S> t(f, s, c4());
- accu::volume<I> attr;
+ accu::shape::volume<I> attr;
image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t);
Index: trunk/milena/sandbox/theo/color/segment_rgb_edges.cc
===================================================================
--- trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4119)
+++ trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4120)
@@ -23,7 +23,7 @@
#include <mln/labeling/compute.hh>
#include <mln/accu/math/count.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/accu/stat/mean.hh>
#include "sum_pix.hh"
@@ -284,7 +284,7 @@
// accu::math::count< util::pix<I> > a_;
- // accu::volume<I> a_;
+ // accu::shape::volume<I> a_;
// accu::sum_pix< util::pix<I> > a_;
blen_image = input_;
Index: trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc
===================================================================
--- trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4119)
+++ trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4120)
@@ -26,7 +26,7 @@
#include <mln/labeling/compute.hh>
#include <mln/accu/math/count.hh>
-#include <mln/accu/volume.hh>
+#include <mln/accu/shape/volume.hh>
#include <mln/accu/stat/mean.hh>
#include "sum_pix.hh"
Index: trunk/milena/sandbox/theo/color/segment_gl_pixels.cc
===================================================================
--- trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4119)
+++ trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4120)
@@ -17,7 +17,7 @@
#include <mln/morpho/elementary/gradient.hh>
#include <mln/morpho/meyer_wst.hh>
-#include <mln/accu/height.hh>
+#include <mln/accu/shape/height.hh>
#include "segment.hh"
@@ -88,8 +88,8 @@
// accu::math::count< util::pix<I> > a_;
// accu::sum_pix< util::pix<I> > a_;
- // accu::volume<I> a_;
- accu::height<I> a_;
+ // accu::shape::volume<I> a_;
+ accu::shape::height<I> a_;
// It seems that both extinction and changing attributes only
// properly works for the 'height' attribute.
Index: trunk/milena/sandbox/theo/color/blen_pix.hh
===================================================================
--- trunk/milena/sandbox/theo/color/blen_pix.hh (revision 4119)
+++ trunk/milena/sandbox/theo/color/blen_pix.hh (revision 4120)
@@ -34,7 +34,7 @@
/// Define an accumulator that computes a sum.
# include <mln/core/concept/meta_accumulator.hh>
-# include <mln/accu/bbox.hh>
+# include <mln/accu/shape/bbox.hh>
# include <mln/accu/internal/base.hh>
# include <mln/util/pix.hh> // To prevent accu::blen_pix to work on pixels
(ambiguous).
@@ -81,19 +81,19 @@
/// Always true here.
bool is_valid() const;
- const accu::bbox<point3d>& b() const
+ const accu::shape::bbox<point3d>& b() const
{
return b_;
}
- accu::bbox<point3d>& b()
+ accu::shape::bbox<point3d>& b()
{
return b_;
}
protected:
- accu::bbox<point3d> b_;
+ accu::shape::bbox<point3d> b_;
unsigned len_;
};
Index: trunk/milena/sandbox/laurent/ismm2009.cc
===================================================================
--- trunk/milena/sandbox/laurent/ismm2009.cc (revision 4119)
+++ trunk/milena/sandbox/laurent/ismm2009.cc (revision 4120)
@@ -20,7 +20,7 @@
#include <mln/labeling/compute.hh>
#include <mln/accu/math/count.hh>
-#include <mln/accu/height.hh>
+#include <mln/accu/shape/height.hh>
#include <mln/util/timer.hh>
#include <mln/util/fibonacci_heap.hh>
Index: trunk/milena/tests/core/image/vertex_image.cc
===================================================================
--- trunk/milena/tests/core/image/vertex_image.cc (revision 4119)
+++ trunk/milena/tests/core/image/vertex_image.cc (revision 4120)
@@ -28,7 +28,7 @@
#include <mln/core/image/vertex_image.hh>
#include <mln/make/vertex_image.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/util/graph.hh>
#include <mln/debug/draw_graph.hh>
@@ -121,7 +121,7 @@
// FIXME: Move this part to a special test case.
// Compute the bounding box of 'ima'.
- accu::bbox<point2d> a;
+ accu::shape::bbox<point2d> a;
mln_piter_(ima_t) p(ima.domain());
for_all(p)
a.take(p);
Index: trunk/milena/tests/core/image/graph_image.cc
===================================================================
--- trunk/milena/tests/core/image/graph_image.cc (revision 4119)
+++ trunk/milena/tests/core/image/graph_image.cc (revision 4120)
@@ -31,7 +31,7 @@
#include <mln/core/concept/function.hh>
#include <mln/core/neighb.hh>
#include <mln/core/var.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/util/graph.hh>
#include <mln/debug/draw_graph.hh>
@@ -126,7 +126,7 @@
// FIXME: Move this part to a special test case.
// Compute the bounding box of 'ima'.
- accu::bbox<point2d> a;
+ accu::shape::bbox<point2d> a;
mln_piter_(ima_t) p(ima.domain());
for_all(p)
a.take(p);
Index: trunk/milena/tests/core/image/edge_image.cc
===================================================================
--- trunk/milena/tests/core/image/edge_image.cc (revision 4119)
+++ trunk/milena/tests/core/image/edge_image.cc (revision 4120)
@@ -27,7 +27,7 @@
#include <mln/core/image/edge_image.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/util/graph.hh>
#include <mln/util/site_pair.hh>
@@ -115,7 +115,7 @@
// FIXME: Move this part to a special test case.
// Compute the bounding box of 'ima'.
- accu::bbox<point2d> a;
+ accu::shape::bbox<point2d> a;
mln_piter_(ima_t) p(ima.domain());
for_all(p)
{
Index: trunk/milena/tests/core/image/imorph/labeled_image.cc
===================================================================
--- trunk/milena/tests/core/image/imorph/labeled_image.cc (revision 4119)
+++ trunk/milena/tests/core/image/imorph/labeled_image.cc (revision 4120)
@@ -31,7 +31,7 @@
#include <mln/value/label_8.hh>
#include <mln/accu/pair.hh>
#include <mln/accu/center.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
Index: trunk/milena/tests/accu/bbox.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/shape/Makefile.am
===================================================================
--- trunk/milena/tests/accu/shape/Makefile.am (revision 0)
+++ trunk/milena/tests/accu/shape/Makefile.am (revision 4120)
@@ -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 = \
+ bbox
+
+bbox_SOURCES = bbox.cc
+
+TESTS = $(check_PROGRAMS)
Property changes on: trunk/milena/tests/accu/shape/Makefile.am
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/shape/bbox.cc
===================================================================
--- trunk/milena/tests/accu/shape/bbox.cc (revision 0)
+++ trunk/milena/tests/accu/shape/bbox.cc (revision 4120)
@@ -0,0 +1,42 @@
+// 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/core/alias/point2d.hh>
+#include <mln/core/alias/box2d.hh>
+
+#include <mln/accu/shape/bbox.hh>
+
+int main()
+{
+ using namespace mln;
+ accu::shape::bbox<point2d> accu;
+
+ accu.take_as_init(point2d(0,0));
+ accu.take(point2d(0,5));
+ accu.take(point2d(5,0));
+ accu.take(point2d(5,5));
+
+ mln_assertion(accu.to_result() == make::box2d(0,0,5,5));
+}
Property changes on: trunk/milena/tests/accu/shape/bbox.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/Makefile.am
===================================================================
--- trunk/milena/tests/accu/Makefile.am (revision 4119)
+++ trunk/milena/tests/accu/Makefile.am (revision 4120)
@@ -23,11 +23,11 @@
image \
site_set \
stat \
- math
+ math \
+ shape
check_PROGRAMS = \
all_accus \
- bbox \
compute \
histo \
line \
@@ -43,7 +43,6 @@
tuple
all_accus_SOURCES = all_accus.cc
-bbox_SOURCES = bbox.cc
compute_SOURCES = compute.cc
histo_SOURCES = histo.cc
line_SOURCES = line.cc
Index: trunk/milena/tests/accu/all_accus.cc
===================================================================
--- trunk/milena/tests/accu/all_accus.cc (revision 4119)
+++ trunk/milena/tests/accu/all_accus.cc (revision 4120)
@@ -32,7 +32,7 @@
{
using namespace mln;
- accu::bbox<point2d> b;
+ accu::shape::bbox<point2d> b;
accu::math::count<int> c;
accu::histo<bool> h;
accu::stat::max<int> ma;
Index: trunk/milena/tests/morpho/closing/leveling.cc
===================================================================
--- trunk/milena/tests/morpho/closing/leveling.cc (revision 4119)
+++ trunk/milena/tests/morpho/closing/leveling.cc (revision 4120)
@@ -50,7 +50,7 @@
// FIXME: Can't be called with new implementation. (When_pix = not_ok).
// {
-// accu::volume<I> a;
+// accu::shape::volume<I> a;
// io::pgm::save(morpho::closing::leveling(lena, c4(), a, 10),
// "ref.pgm");
// }
Index: trunk/milena/tests/morpho/opening/leveling.cc
===================================================================
--- trunk/milena/tests/morpho/opening/leveling.cc (revision 4119)
+++ trunk/milena/tests/morpho/opening/leveling.cc (revision 4120)
@@ -50,7 +50,7 @@
// FIXME: Can't be called with new implementation. (When_pix = not_ok).
// {
-// accu::volume<I> a;
+// accu::shape::volume<I> a;
// io::pgm::save(morpho::opening::leveling(lena, c4(), a, 10),
// "ref.pgm");
// }
Index: trunk/milena/tests/morpho/graph_image_morpho.cc
===================================================================
--- trunk/milena/tests/morpho/graph_image_morpho.cc (revision 4119)
+++ trunk/milena/tests/morpho/graph_image_morpho.cc (revision 4120)
@@ -23,7 +23,7 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/core/alias/box2d.hh>
#include <mln/core/alias/point2d.hh>
@@ -105,7 +105,7 @@
// Compute the bounding box of IMA.
/* FIXME: mln::graph_image should automatically feature a bbox when
its parameter P is akin to a point. */
- accu::bbox<point2d> a;
+ accu::shape::bbox<point2d> a;
for (unsigned i = 0; i < sites.size(); ++i)
a.take(sites(i));
box2d bbox = a.to_result();
Index: trunk/milena/doc/examples/split/labeling-compute-3.cc
===================================================================
--- trunk/milena/doc/examples/split/labeling-compute-3.cc (revision 4119)
+++ trunk/milena/doc/examples/split/labeling-compute-3.cc (revision 4120)
@@ -1,4 +1,4 @@
util::array<box2d> boxes =
- labeling::compute(accu::meta::bbox(),
+ labeling::compute(accu::meta::shape::bbox(),
lbl,
nlabels);
Index: trunk/milena/doc/examples/labeling-compute.cc
===================================================================
--- trunk/milena/doc/examples/labeling-compute.cc (revision 4119)
+++ trunk/milena/doc/examples/labeling-compute.cc (revision 4120)
@@ -9,7 +9,7 @@
#include <mln/util/array.hh>
-#include <mln/accu/bbox.hh>
+#include <mln/accu/shape/bbox.hh>
#include <mln/value/label_8.hh>
@@ -45,7 +45,7 @@
// \{
util::array<box2d> boxes =
- labeling::compute(accu::meta::bbox(),
+ labeling::compute(accu::meta::shape::bbox(),
lbl,
nlabels);
// \}