
* Makefile.am, * headers.mk, * tests/accu/Makefile.am, * tests/make/Makefile.am, * tests/unit_test/unit-tests.mk: fix build system. 'make dist' now works. * mln/convert/impl/from_unsigned_to_value.hh: add missing include. * mln/core/image/complex_neighborhood_piter.hh, * mln/io/magick/load.hh: avoid warnings. * mln/core/routine/all.hh * mln/labeling/blobs.hh: update doc * mln/labeling/compute.hh: add a new postcondition. * mln/labeling/relabel.hh: use v2v and v2b functions instead of l2l and l2b. * mln/make/relabelfun.hh: use v2v and v2b functions instead of l2l and l2b and add a new overload. * tools/area_flooding.cc: update use of morpho::closing::area_on_vertices. --- milena/ChangeLog | 30 +++++++++ milena/Makefile.am | 2 - milena/headers.mk | 11 +++ milena/mln/convert/impl/from_unsigned_to_value.hh | 1 + .../mln/core/image/complex_neighborhood_piter.hh | 2 +- milena/mln/core/routine/all.hh | 14 ++-- milena/mln/io/magick/load.hh | 13 ++-- milena/mln/labeling/blobs.hh | 3 +- milena/mln/labeling/compute.hh | 2 + milena/mln/labeling/relabel.hh | 59 ++++++++++------- milena/mln/make/relabelfun.hh | 69 ++++++++++++++++---- milena/tests/accu/Makefile.am | 3 - milena/tests/make/Makefile.am | 2 +- milena/tests/unit_test/unit-tests.mk | 46 ++++++++++--- milena/tools/area_flooding.cc | 19 ++++-- 15 files changed, 200 insertions(+), 76 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index f0c8e0f..cda14ac 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,33 @@ +2009-03-16 Guillaume Lazzara <lazzara@lrde.epita.fr> + + Small fixes. + + * Makefile.am, + * headers.mk, + * tests/accu/Makefile.am, + * tests/make/Makefile.am, + * tests/unit_test/unit-tests.mk: fix build system. 'make dist' now + works. + + * mln/convert/impl/from_unsigned_to_value.hh: add missing include. + + * mln/core/image/complex_neighborhood_piter.hh, + * mln/io/magick/load.hh: avoid warnings. + + * mln/core/routine/all.hh + * mln/labeling/blobs.hh: update doc + + * mln/labeling/compute.hh: add a new postcondition. + + * mln/labeling/relabel.hh: use v2v and v2b functions instead of l2l + and l2b. + + * mln/make/relabelfun.hh: use v2v and v2b functions instead of l2l + and l2b and add a new overload. + + * tools/area_flooding.cc: update use of + morpho::closing::area_on_vertices. + 2009-03-17 Fabien Freling <fabien.freling@lrde.epita.fr> Integrate ImageMagick support in Milena. diff --git a/milena/Makefile.am b/milena/Makefile.am index b394cf2..a2b83c6 100644 --- a/milena/Makefile.am +++ b/milena/Makefile.am @@ -43,10 +43,8 @@ img/medium.ppm \ img/picasso.pbm \ img/picasso.pgm \ img/quite-small.pgm \ -img/small-enlarged.png \ img/small.pbm \ img/small.pgm \ -img/small.png \ img/small.ppm \ img/squares-lc.pgm \ img/squares.pgm \ diff --git a/milena/headers.mk b/milena/headers.mk index 9513a84..dfab609 100644 --- a/milena/headers.mk +++ b/milena/headers.mk @@ -262,10 +262,13 @@ mln/fun/meta/hue.hh \ mln/fun/meta/lum.hh \ mln/fun/meta/all.hh \ mln/fun/meta/green.hh \ +mln/fun/meta/second.hh \ mln/fun/meta/inty.hh \ mln/fun/meta/blue.hh \ mln/fun/meta/sat.hh \ +mln/fun/meta/first.hh \ mln/fun/meta/to_enc.hh \ +mln/fun/meta/essential.hh \ mln/fun/x2v/trilinear.hh \ mln/fun/x2v/linear.hh \ mln/fun/x2v/bilinear.hh \ @@ -285,6 +288,7 @@ mln/convert/to_window.hh \ mln/convert/from_to.hh \ mln/convert/impl/from_value_to_value.hh \ mln/convert/impl/all.hh \ +mln/convert/impl/from_unsigned_to_value.hh \ mln/convert/impl/from_double_to_value.hh \ mln/convert/impl/from_site_set_to_image.hh \ mln/convert/impl/from_image_to_site_set.hh \ @@ -629,6 +633,11 @@ mln/morpho/internal/elementary.hh \ mln/morpho/contrast.hh \ mln/morpho/thickening.hh \ mln/morpho/dilation.hh \ +mln/morpho/approx/dilation.hh \ +mln/morpho/approx/all.hh \ +mln/morpho/approx/erosion.hh \ +mln/morpho/closing/approx/all.hh \ +mln/morpho/closing/approx/structural.hh \ mln/morpho/closing/all.hh \ mln/morpho/closing/algebraic.hh \ mln/morpho/closing/leveling.hh \ @@ -643,6 +652,8 @@ mln/morpho/laplacian.hh \ mln/morpho/all.hh \ mln/morpho/watershed/flooding.hh \ mln/morpho/watershed/all.hh \ +mln/morpho/opening/approx/all.hh \ +mln/morpho/opening/approx/structural.hh \ mln/morpho/opening/all.hh \ mln/morpho/opening/algebraic.hh \ mln/morpho/opening/leveling.hh \ diff --git a/milena/mln/convert/impl/from_unsigned_to_value.hh b/milena/mln/convert/impl/from_unsigned_to_value.hh index 4c6bac7..f5b08ac 100644 --- a/milena/mln/convert/impl/from_unsigned_to_value.hh +++ b/milena/mln/convert/impl/from_unsigned_to_value.hh @@ -37,6 +37,7 @@ # include <utility> # include <mln/value/concept/integer.hh> # include <mln/core/concept/value.hh> +# include <mln/value/label.hh> # include <mln/math/round.hh> diff --git a/milena/mln/core/image/complex_neighborhood_piter.hh b/milena/mln/core/image/complex_neighborhood_piter.hh index 32beda6..3eb7b8e 100644 --- a/milena/mln/core/image/complex_neighborhood_piter.hh +++ b/milena/mln/core/image/complex_neighborhood_piter.hh @@ -339,7 +339,7 @@ namespace mln template <typename Pref> inline void - complex_neighborhood_bkd_piter<I, G, N>::center_at_(const Pref& c) + complex_neighborhood_bkd_piter<I, G, N>::center_at_(const Pref&) { iter_.center_at(this->center().face()); } diff --git a/milena/mln/core/routine/all.hh b/milena/mln/core/routine/all.hh index 503919b..1c0d3f0 100644 --- a/milena/mln/core/routine/all.hh +++ b/milena/mln/core/routine/all.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,12 +28,11 @@ #ifndef MLN_CORE_ROUTINE_ALL_HH # define MLN_CORE_ROUTINE_ALL_HH -/*! \file mln/core/routine/all.hh - * - * \brief File that includes all core routines. - * - * \todo Move files, update, and activate. - */ +/// \file mln/core/routine/all.hh +/// +/// File that includes all core routines. +/// +/// \todo Move files, update, and activate. # include <mln/core/routine/duplicate.hh> @@ -42,5 +41,4 @@ # include <mln/core/routine/initialize.hh> # include <mln/core/routine/primary.hh> - #endif // ! MLN_CORE_ROUTINE_ALL_HH diff --git a/milena/mln/io/magick/load.hh b/milena/mln/io/magick/load.hh index 8636b77..4067395 100644 --- a/milena/mln/io/magick/load.hh +++ b/milena/mln/io/magick/load.hh @@ -28,13 +28,11 @@ #ifndef MLN_IO_MAGICK_LOAD_HH # define MLN_IO_MAGICK_LOAD_HH -/*! - * \file mln/io/magick/load.hh - * - * \brief Define a function which loads an image of kind magick with - * given path. - * - */ +/// +/// \file mln/io/magick/load.hh +/// +/// Define a function which loads an image of kind magick with +/// given path. # include <mln/core/image/image2d.hh> # include <mln/value/int_u8.hh> @@ -99,6 +97,7 @@ namespace mln inline bool do_it(const value::rgb8& in, value::rgb8& out, const std::string& filename) { + (void) filename; out = in; return true; } diff --git a/milena/mln/labeling/blobs.hh b/milena/mln/labeling/blobs.hh index 566d2ba..60040db 100644 --- a/milena/mln/labeling/blobs.hh +++ b/milena/mln/labeling/blobs.hh @@ -54,7 +54,8 @@ namespace mln /// /// \param[in] input The input image. /// \param[in] nbh The connexity of the objects. - /// \param[out] nlabels The number of labels. + /// \param[out] nlabels The Number of labels. Its value is set in the + /// algorithms. /// \return The label image. /// /// \pre The input image has to be binary (checked at compile-time). diff --git a/milena/mln/labeling/compute.hh b/milena/mln/labeling/compute.hh index f6e45f0..e0ad32a 100644 --- a/milena/mln/labeling/compute.hh +++ b/milena/mln/labeling/compute.hh @@ -295,6 +295,8 @@ namespace mln typedef util::array<mln_result(A)> R; R res = internal::compute_dispatch(a, label, nlabels); + mln_postcondition(res.nelements() == nlabels.next()); + trace::exiting("labeling::compute"); return res; } diff --git a/milena/mln/labeling/relabel.hh b/milena/mln/labeling/relabel.hh index 71e4d05..867a0fb 100644 --- a/milena/mln/labeling/relabel.hh +++ b/milena/mln/labeling/relabel.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -58,12 +58,11 @@ namespace mln relabel(const Image<I>& label, const mln_value(I)& nlabels, mln_value(I)& new_nlabels, - const Function_l2b<F>& fl2b); + const Function_v2b<F>& fv2b); /// Remove components and relabel a labeled image. /// \input[in] label the labeled image. /// \input[in] nlabels the number of labels in \p label. - /// \input[out] new_nlabels the number of labels after relabeling. /// \input[in] f function returning the new component id for each pixel /// value. /// @@ -72,8 +71,7 @@ namespace mln mln_concrete(I) relabel(const Image<I>& label, const mln_value(I)& nlabels, - mln_value(I)& new_nlabels, - const Function_l2l<F>& fl2l); + const Function_v2v<F>& fv2v); /// Remove components and relabel a labeled image inplace. /// \input[in, out] label the labeled image. @@ -85,7 +83,7 @@ namespace mln void relabel_inplace(Image<I>& label, mln_value(I)& nlabels, - const Function_l2b<F>& fl2b); + const Function_v2b<F>& fv2b); /// Remove components and relabel a labeled image inplace. /// \input[in, out] label the labeled image. @@ -97,7 +95,7 @@ namespace mln void relabel_inplace(Image<I>& label, mln_value(I)& nlabels, - const Function_l2l<F>& fl2l); + const Function_v2v<F>& fv2v); # ifndef MLN_INCLUDE_ONLY @@ -124,6 +122,20 @@ namespace mln } template <typename I, typename F> + void + relabel_tests(const Image<I>& label, + const mln_value(I)& nlabels, + const Function<F>& f) + { + // FIXME: we may want to check that it is exactly a label. + mlc_is_a(mln_value(I), mln::value::Symbolic)::check(); + mln_precondition(exact(label).is_valid()); + (void) label; + (void) nlabels; + (void) f; + } + + template <typename I, typename F> inline void relabel_inplace_tests(Image<I>& label, @@ -147,14 +159,13 @@ namespace mln mln_concrete(I) relabel(const Image<I>& label, const mln_value(I)& nlabels, - mln_value(I)& new_nlabels, - const Function_l2l<F>& fl2l) + const Function_v2v<F>& fv2v) { trace::entering("labeling::relabel"); - internal::relabel_tests(label, nlabels, new_nlabels, fl2l); + internal::relabel_tests(label, nlabels, fv2v); - mln_concrete(I) output = level::transform(label, fl2l); + mln_concrete(I) output = level::transform(label, fv2v); trace::exiting("labeling::relabel"); return output; @@ -168,15 +179,15 @@ namespace mln relabel(const Image<I>& label, const mln_value(I)& nlabels, mln_value(I)& new_nlabels, - const Function_l2b<F>& fl2b) + const Function_v2b<F>& fv2b) { trace::entering("labeling::relabel"); - internal::relabel_tests(label, nlabels, new_nlabels, fl2b); + internal::relabel_tests(label, nlabels, new_nlabels, fv2b); - typedef fun::l2l::relabel<mln_value(I)> fl2l_t; - fl2l_t fl2l = make::relabelfun(fl2b, nlabels, new_nlabels); - mln_concrete(I) output = labeling::relabel(label, nlabels, new_nlabels, fl2l); + typedef fun::l2l::relabel<mln_value(I)> fv2v_t; + fv2v_t fv2v = make::relabelfun(fv2b, nlabels, new_nlabels); + mln_concrete(I) output = labeling::relabel(label, nlabels, new_nlabels, fv2v); trace::exiting("labeling::relabel"); return output; @@ -189,13 +200,13 @@ namespace mln void relabel_inplace(Image<I>& label, mln_value(I)& nlabels, - const Function_l2l<F>& fl2l) + const Function_v2v<F>& fv2v) { trace::entering("labeling::relabel_inplace"); - internal::relabel_inplace_tests(label, nlabels, fl2l); + internal::relabel_inplace_tests(label, nlabels, fv2v); - level::transform_inplace(label, fl2l); + level::transform_inplace(label, fv2v); trace::exiting("labeling::relabel_inplace"); } @@ -207,15 +218,15 @@ namespace mln void relabel_inplace(Image<I>& label, mln_value(I)& nlabels, - const Function_l2b<F>& fl2b) + const Function_v2b<F>& fv2b) { trace::entering("labeling::relabel_inplace"); - internal::relabel_inplace_tests(label, nlabels, fl2b); + internal::relabel_inplace_tests(label, nlabels, fv2b); - typedef fun::l2l::relabel<mln_value(I)> fl2l_t; - fl2l_t fl2l = make::relabelfun(fl2b, nlabels, nlabels); - labeling::relabel_inplace(label, nlabels, fl2l); + typedef fun::l2l::relabel<mln_value(I)> fv2v_t; + fv2v_t fv2v = make::relabelfun(fv2b, nlabels, nlabels); + labeling::relabel_inplace(label, nlabels, fv2v); trace::exiting("labeling::relabel_inplace"); } diff --git a/milena/mln/make/relabelfun.hh b/milena/mln/make/relabelfun.hh index abbba80..612e3a6 100644 --- a/milena/mln/make/relabelfun.hh +++ b/milena/mln/make/relabelfun.hh @@ -42,43 +42,86 @@ namespace mln namespace make { - /// Create a l2l function from a l2b function. + /// Create a l2l function from a v2b function. /// This function can be used to relabel a labeled image. /// - /// \param[in] f a l2b function. + /// \param[in] f a v2b function. /// /// \return a l2l function. /// /// \sa mln::labeling::relabel template <unsigned n, typename F> - mln::fun::l2l::relabel< value::label<n> > - relabelfun(const mln::Function_l2b<F>& fl2b, - const value::label<n>& nlabels); + fun::l2l::relabel< value::label<n> > + relabelfun(const Function_v2b<F>& fv2b, + const value::label<n>& nlabels, + value::label<n>& new_nlabels); + + /// Create a l2l function from a v2v function. + /// This function can be used to relabel a labeled image. + /// + /// \param[in] f a v2v function. + /// + /// \return a l2l function. + /// + /// \sa mln::labeling::relabel + template <unsigned n, typename F> + fun::l2l::relabel< value::label<n> > + relabelfun(const Function_v2v<F>& fv2v, + const value::label<n>& nlabels, + value::label<n>& new_nlabels); # ifndef MLN_INCLUDE_ONLY template <unsigned n, typename F> inline - mln::fun::l2l::relabel< value::label<n> > - relabelfun(const mln::Function_l2b<F>& fl2b_, - const value::label<n>& nlabels, - value::label<n>& new_nlabels) + fun::l2l::relabel< value::label<n> > + relabelfun(const Function_v2b<F>& fv2b_, + const value::label<n>& nlabels, + value::label<n>& new_nlabels) { - trace::entering("mln::make::relabelfun"); + trace::entering("make::relabelfun"); - const F& fl2b = exact(fl2b_); + const F& fv2b = exact(fv2b_); value::label<n> tmp_nlabels = literal::zero; typedef value::label<n> label_t; fun::l2l::relabel<label_t> fl2l(nlabels.next(), literal::zero); for (label_t i = 1; i <= nlabels; ++i) - if (fl2b(i)) + if (fv2b(i)) { fl2l(i) = ++tmp_nlabels; } new_nlabels = tmp_nlabels; - trace::exiting("mln::make::relabelfun"); + trace::exiting("make::relabelfun"); + return fl2l; + } + + + template <unsigned n, typename F> + inline + fun::l2l::relabel< value::label<n> > + relabelfun(const Function_v2v<F>& fv2v_, + const value::label<n>& nlabels, + value::label<n>& new_nlabels) + { + trace::entering("make::relabelfun"); + + const F& fv2v = exact(fv2v_); + + value::label<n> tmp_nlabels = literal::zero; + typedef value::label<n> label_t; + fun::l2l::relabel<label_t> fl2l(nlabels.next(), literal::zero); + for (label_t i = 1; i < nlabels.next(); ++i) + if (fl2l(fv2v(i)) == literal::zero) + { + fl2l(fv2v(i)) = ++tmp_nlabels; + fl2l(i) = tmp_nlabels; + } + else + fl2l(i) = fl2l(fv2v(i)); + new_nlabels = tmp_nlabels; + trace::exiting("make::relabelfun"); return fl2l; } diff --git a/milena/tests/accu/Makefile.am b/milena/tests/accu/Makefile.am index 3f78d07..fafbec1 100644 --- a/milena/tests/accu/Makefile.am +++ b/milena/tests/accu/Makefile.am @@ -2,9 +2,6 @@ include $(top_srcdir)/milena/tests/tests.mk -SUBDIRS = \ - image - check_PROGRAMS = \ all_accus \ bbox \ diff --git a/milena/tests/make/Makefile.am b/milena/tests/make/Makefile.am index 95eb5ea..bf96093 100644 --- a/milena/tests/make/Makefile.am +++ b/milena/tests/make/Makefile.am @@ -13,7 +13,7 @@ check_PROGRAMS = \ w_window \ w_window_directional -dual_neighb_SOURCES = dual_neighb.c +dual_neighb_SOURCES = dual_neighb.cc graph_SOURCES = graph.cc h_mat_SOURCES = h_mat.cc image2d_SOURCES = image2d.cc diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk index 53cd03f..f288f80 100644 --- a/milena/tests/unit_test/unit-tests.mk +++ b/milena/tests/unit_test/unit-tests.mk @@ -93,6 +93,7 @@ mln_util_line_graph \ mln_util_ord \ mln_util_tree_fast_to_image \ mln_util_tree \ +mln_util_couple \ mln_util_index \ mln_util_multi_site \ mln_util_branch_iter \ @@ -256,10 +257,13 @@ mln_fun_meta_hue \ mln_fun_meta_lum \ mln_fun_meta_all \ mln_fun_meta_green \ +mln_fun_meta_second \ mln_fun_meta_inty \ mln_fun_meta_blue \ mln_fun_meta_sat \ +mln_fun_meta_first \ mln_fun_meta_to_enc \ +mln_fun_meta_essential \ mln_fun_x2v_trilinear \ mln_fun_x2v_linear \ mln_fun_x2v_bilinear \ @@ -279,6 +283,7 @@ mln_convert_to_window \ mln_convert_from_to \ mln_convert_impl_from_value_to_value \ mln_convert_impl_all \ +mln_convert_impl_from_unsigned_to_value \ mln_convert_impl_from_double_to_value \ mln_convert_impl_from_site_set_to_image \ mln_convert_impl_from_image_to_site_set \ @@ -362,6 +367,7 @@ mln_value_label_8 \ mln_value_essential \ mln_accu_tuple \ mln_accu_min_h \ +mln_accu_stat_deviation \ mln_accu_max \ mln_accu_lor \ mln_accu_rank \ @@ -595,7 +601,6 @@ mln_linear_log \ mln_linear_essential \ mln_morpho_thinning \ mln_morpho_meyer_wst \ -mln_morpho_opening \ mln_morpho_includes \ mln_morpho_elementary_opening \ mln_morpho_elementary_gradient_internal \ @@ -621,18 +626,27 @@ mln_morpho_internal_elementary \ mln_morpho_contrast \ mln_morpho_thickening \ mln_morpho_dilation \ +mln_morpho_approx_dilation \ +mln_morpho_approx_all \ +mln_morpho_approx_erosion \ +mln_morpho_closing_approx_all \ +mln_morpho_closing_approx_structural \ mln_morpho_closing_all \ mln_morpho_closing_algebraic \ mln_morpho_closing_leveling \ mln_morpho_closing_area_on_vertices \ mln_morpho_closing_area \ mln_morpho_closing_volume \ +mln_morpho_closing_sum \ mln_morpho_closing_height \ +mln_morpho_closing_structural \ mln_morpho_closing_essential \ mln_morpho_laplacian \ mln_morpho_all \ mln_morpho_watershed_flooding \ mln_morpho_watershed_all \ +mln_morpho_opening_approx_all \ +mln_morpho_opening_approx_structural \ mln_morpho_opening_all \ mln_morpho_opening_algebraic \ mln_morpho_opening_leveling \ @@ -640,6 +654,7 @@ mln_morpho_opening_area_on_vertices \ mln_morpho_opening_area \ mln_morpho_opening_volume \ mln_morpho_opening_height \ +mln_morpho_opening_structural \ mln_morpho_opening_essential \ mln_morpho_attribute_all \ mln_morpho_attribute_volume \ @@ -657,15 +672,12 @@ mln_morpho_tree_utils \ mln_morpho_tree_data \ mln_morpho_tree_compute_attribute_image \ mln_morpho_min \ -mln_morpho_closing \ mln_morpho_top_hat \ mln_morpho_erosion \ mln_morpho_leveling_filter \ -mln_morpho_closing_sum \ mln_morpho_Rd \ mln_morpho_thick_miss \ mln_morpho_algebraic_filter \ -mln_morpho_closing_attribute \ mln_morpho_rank_filter \ mln_morpho_essential \ mln_topo_n_face_iter \ @@ -700,6 +712,7 @@ mln_essential_routine \ mln_essential_3d \ mln_essential_2d \ mln_win_inter \ +mln_win_sphere3d \ mln_win_backdiag2d \ mln_win_segment1d \ mln_win_cuboid3d \ @@ -710,10 +723,10 @@ mln_win_multiple_size \ mln_win_cube3d \ mln_win_shift \ mln_win_sym \ +mln_win_ball \ mln_win_diff \ mln_win_multiple \ mln_win_diag2d \ -mln_win_ball3d \ mln_win_disk2d \ mln_win_rectangle2d \ mln_win_hline2d \ @@ -1177,6 +1190,7 @@ mln_util_line_graph_SOURCES = mln_util_line_graph.cc mln_util_ord_SOURCES = mln_util_ord.cc mln_util_tree_fast_to_image_SOURCES = mln_util_tree_fast_to_image.cc mln_util_tree_SOURCES = mln_util_tree.cc +mln_util_couple_SOURCES = mln_util_couple.cc mln_util_index_SOURCES = mln_util_index.cc mln_util_multi_site_SOURCES = mln_util_multi_site.cc mln_util_branch_iter_SOURCES = mln_util_branch_iter.cc @@ -1340,10 +1354,13 @@ mln_fun_meta_hue_SOURCES = mln_fun_meta_hue.cc mln_fun_meta_lum_SOURCES = mln_fun_meta_lum.cc mln_fun_meta_all_SOURCES = mln_fun_meta_all.cc mln_fun_meta_green_SOURCES = mln_fun_meta_green.cc +mln_fun_meta_second_SOURCES = mln_fun_meta_second.cc mln_fun_meta_inty_SOURCES = mln_fun_meta_inty.cc mln_fun_meta_blue_SOURCES = mln_fun_meta_blue.cc mln_fun_meta_sat_SOURCES = mln_fun_meta_sat.cc +mln_fun_meta_first_SOURCES = mln_fun_meta_first.cc mln_fun_meta_to_enc_SOURCES = mln_fun_meta_to_enc.cc +mln_fun_meta_essential_SOURCES = mln_fun_meta_essential.cc mln_fun_x2v_trilinear_SOURCES = mln_fun_x2v_trilinear.cc mln_fun_x2v_linear_SOURCES = mln_fun_x2v_linear.cc mln_fun_x2v_bilinear_SOURCES = mln_fun_x2v_bilinear.cc @@ -1363,6 +1380,7 @@ mln_convert_to_window_SOURCES = mln_convert_to_window.cc mln_convert_from_to_SOURCES = mln_convert_from_to.cc mln_convert_impl_from_value_to_value_SOURCES = mln_convert_impl_from_value_to_value.cc mln_convert_impl_all_SOURCES = mln_convert_impl_all.cc +mln_convert_impl_from_unsigned_to_value_SOURCES = mln_convert_impl_from_unsigned_to_value.cc mln_convert_impl_from_double_to_value_SOURCES = mln_convert_impl_from_double_to_value.cc mln_convert_impl_from_site_set_to_image_SOURCES = mln_convert_impl_from_site_set_to_image.cc mln_convert_impl_from_image_to_site_set_SOURCES = mln_convert_impl_from_image_to_site_set.cc @@ -1446,6 +1464,7 @@ mln_value_label_8_SOURCES = mln_value_label_8.cc mln_value_essential_SOURCES = mln_value_essential.cc mln_accu_tuple_SOURCES = mln_accu_tuple.cc mln_accu_min_h_SOURCES = mln_accu_min_h.cc +mln_accu_stat_deviation_SOURCES = mln_accu_stat_deviation.cc mln_accu_max_SOURCES = mln_accu_max.cc mln_accu_lor_SOURCES = mln_accu_lor.cc mln_accu_rank_SOURCES = mln_accu_rank.cc @@ -1679,7 +1698,6 @@ mln_linear_log_SOURCES = mln_linear_log.cc mln_linear_essential_SOURCES = mln_linear_essential.cc mln_morpho_thinning_SOURCES = mln_morpho_thinning.cc mln_morpho_meyer_wst_SOURCES = mln_morpho_meyer_wst.cc -mln_morpho_opening_SOURCES = mln_morpho_opening.cc mln_morpho_includes_SOURCES = mln_morpho_includes.cc mln_morpho_elementary_opening_SOURCES = mln_morpho_elementary_opening.cc mln_morpho_elementary_gradient_internal_SOURCES = mln_morpho_elementary_gradient_internal.cc @@ -1705,18 +1723,27 @@ mln_morpho_internal_elementary_SOURCES = mln_morpho_internal_elementary.cc mln_morpho_contrast_SOURCES = mln_morpho_contrast.cc mln_morpho_thickening_SOURCES = mln_morpho_thickening.cc mln_morpho_dilation_SOURCES = mln_morpho_dilation.cc +mln_morpho_approx_dilation_SOURCES = mln_morpho_approx_dilation.cc +mln_morpho_approx_all_SOURCES = mln_morpho_approx_all.cc +mln_morpho_approx_erosion_SOURCES = mln_morpho_approx_erosion.cc +mln_morpho_closing_approx_all_SOURCES = mln_morpho_closing_approx_all.cc +mln_morpho_closing_approx_structural_SOURCES = mln_morpho_closing_approx_structural.cc mln_morpho_closing_all_SOURCES = mln_morpho_closing_all.cc mln_morpho_closing_algebraic_SOURCES = mln_morpho_closing_algebraic.cc mln_morpho_closing_leveling_SOURCES = mln_morpho_closing_leveling.cc mln_morpho_closing_area_on_vertices_SOURCES = mln_morpho_closing_area_on_vertices.cc mln_morpho_closing_area_SOURCES = mln_morpho_closing_area.cc mln_morpho_closing_volume_SOURCES = mln_morpho_closing_volume.cc +mln_morpho_closing_sum_SOURCES = mln_morpho_closing_sum.cc mln_morpho_closing_height_SOURCES = mln_morpho_closing_height.cc +mln_morpho_closing_structural_SOURCES = mln_morpho_closing_structural.cc mln_morpho_closing_essential_SOURCES = mln_morpho_closing_essential.cc mln_morpho_laplacian_SOURCES = mln_morpho_laplacian.cc mln_morpho_all_SOURCES = mln_morpho_all.cc mln_morpho_watershed_flooding_SOURCES = mln_morpho_watershed_flooding.cc mln_morpho_watershed_all_SOURCES = mln_morpho_watershed_all.cc +mln_morpho_opening_approx_all_SOURCES = mln_morpho_opening_approx_all.cc +mln_morpho_opening_approx_structural_SOURCES = mln_morpho_opening_approx_structural.cc mln_morpho_opening_all_SOURCES = mln_morpho_opening_all.cc mln_morpho_opening_algebraic_SOURCES = mln_morpho_opening_algebraic.cc mln_morpho_opening_leveling_SOURCES = mln_morpho_opening_leveling.cc @@ -1724,6 +1751,7 @@ mln_morpho_opening_area_on_vertices_SOURCES = mln_morpho_opening_area_on_vertice mln_morpho_opening_area_SOURCES = mln_morpho_opening_area.cc mln_morpho_opening_volume_SOURCES = mln_morpho_opening_volume.cc mln_morpho_opening_height_SOURCES = mln_morpho_opening_height.cc +mln_morpho_opening_structural_SOURCES = mln_morpho_opening_structural.cc mln_morpho_opening_essential_SOURCES = mln_morpho_opening_essential.cc mln_morpho_attribute_all_SOURCES = mln_morpho_attribute_all.cc mln_morpho_attribute_volume_SOURCES = mln_morpho_attribute_volume.cc @@ -1741,15 +1769,12 @@ mln_morpho_tree_utils_SOURCES = mln_morpho_tree_utils.cc mln_morpho_tree_data_SOURCES = mln_morpho_tree_data.cc mln_morpho_tree_compute_attribute_image_SOURCES = mln_morpho_tree_compute_attribute_image.cc mln_morpho_min_SOURCES = mln_morpho_min.cc -mln_morpho_closing_SOURCES = mln_morpho_closing.cc mln_morpho_top_hat_SOURCES = mln_morpho_top_hat.cc mln_morpho_erosion_SOURCES = mln_morpho_erosion.cc mln_morpho_leveling_filter_SOURCES = mln_morpho_leveling_filter.cc -mln_morpho_closing_sum_SOURCES = mln_morpho_closing_sum.cc mln_morpho_Rd_SOURCES = mln_morpho_Rd.cc mln_morpho_thick_miss_SOURCES = mln_morpho_thick_miss.cc mln_morpho_algebraic_filter_SOURCES = mln_morpho_algebraic_filter.cc -mln_morpho_closing_attribute_SOURCES = mln_morpho_closing_attribute.cc mln_morpho_rank_filter_SOURCES = mln_morpho_rank_filter.cc mln_morpho_essential_SOURCES = mln_morpho_essential.cc mln_topo_n_face_iter_SOURCES = mln_topo_n_face_iter.cc @@ -1784,6 +1809,7 @@ mln_essential_routine_SOURCES = mln_essential_routine.cc mln_essential_3d_SOURCES = mln_essential_3d.cc mln_essential_2d_SOURCES = mln_essential_2d.cc mln_win_inter_SOURCES = mln_win_inter.cc +mln_win_sphere3d_SOURCES = mln_win_sphere3d.cc mln_win_backdiag2d_SOURCES = mln_win_backdiag2d.cc mln_win_segment1d_SOURCES = mln_win_segment1d.cc mln_win_cuboid3d_SOURCES = mln_win_cuboid3d.cc @@ -1794,10 +1820,10 @@ mln_win_multiple_size_SOURCES = mln_win_multiple_size.cc mln_win_cube3d_SOURCES = mln_win_cube3d.cc mln_win_shift_SOURCES = mln_win_shift.cc mln_win_sym_SOURCES = mln_win_sym.cc +mln_win_ball_SOURCES = mln_win_ball.cc mln_win_diff_SOURCES = mln_win_diff.cc mln_win_multiple_SOURCES = mln_win_multiple.cc mln_win_diag2d_SOURCES = mln_win_diag2d.cc -mln_win_ball3d_SOURCES = mln_win_ball3d.cc mln_win_disk2d_SOURCES = mln_win_disk2d.cc mln_win_rectangle2d_SOURCES = mln_win_rectangle2d.cc mln_win_hline2d_SOURCES = mln_win_hline2d.cc diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc index fc5c444..742ec94 100644 --- a/milena/tools/area_flooding.cc +++ b/milena/tools/area_flooding.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -44,7 +45,6 @@ an average grey level of the corresponding region in the input image. - FIXME: do not use mln_VAR. */ #include <cstdlib> @@ -61,7 +61,7 @@ #include <mln/core/var.hh> #include <mln/morpho/line_gradient.hh> -#include <mln/morpho/closing_area_on_vertices.hh> +#include <mln/morpho/closing/area_on_vertices.hh> #include <mln/labeling/regional_minima.hh> #include <mln/morpho/meyer_wst.hh> @@ -101,10 +101,14 @@ int main(int argc, char* argv[]) | Line gradient. | `----------------*/ + // Type of the function mapping graph edges and image sites. + typedef fun::i2v::array<util::site_pair<point2d> > fedge_site_t; + // Line graph image. typedef fun::i2v::array<val_t> fval_t; fval_t values; - mln_VAR(lg_ima, morpho::line_gradient(input)); + typedef pw::image<fval_t, p_edges<util::graph,fedge_site_t> > lg_ima_t; + lg_ima_t lg_ima = morpho::line_gradient(input); /*-----------. | Flooding. | @@ -129,7 +133,7 @@ int main(int argc, char* argv[]) << "nregions = " << nregions << std::endl; lg_ima_t work = duplicate(result); // Compute the closing. - result = morpho::closing_area_on_vertices(work, nbh, area); + result = morpho::closing::area_on_vertices(work, nbh, area); // Compute the number of local minima (but get rid of the image, // as we don't need it). labeling::regional_minima(result, nbh, nregions); @@ -142,7 +146,10 @@ int main(int argc, char* argv[]) // Perform a Watershed Transform. typedef int_u16 wst_val_t; wst_val_t nbasins; - mln_VAR(wshed, morpho::meyer_wst(result, nbh, nbasins)); + typedef pw::image<fun::i2v::array<wst_val_t>, + p_edges<util::graph,fedge_site_t> > wshed_t; + + wshed_t wshed = morpho::meyer_wst(result, nbh, nbasins); std::cout << "nbasins = " << nbasins << std::endl; /*---------. -- 1.5.6.5
participants (1)
-
Guillaume Lazzara