
* mln/util/array.hh, * mln/io/pgm/save.hh: remove a wrong precondition. * mln/labeling/compute.hh: do not call next() anymore. * mln/linear/gaussian_directional_2d.hh: avoid a warning. * tests/core/image/safe_image.cc: remove invalid code. * tests/level/transform.cc: update invalid code. No implicit conversion allowed from morphers to concrete images. * tests/make/Makefile.am: remove duplicate test entry. * tests/unit_test/unit-tests.mk: update unit test list. * tools/area_flooding.cc: use edge_image and vertex_image. --- milena/ChangeLog | 22 ++++++++++++++++ milena/mln/labeling/compute.hh | 6 ++-- milena/mln/linear/gaussian_directional_2d.hh | 1 + milena/mln/util/array.hh | 2 - milena/tests/core/image/safe_image.cc | 15 ++++------- milena/tests/level/transform.cc | 19 ++++++-------- milena/tests/make/Makefile.am | 1 - milena/tests/unit_test/unit-tests.mk | 34 +++++++++++++++++++++---- milena/tools/area_flooding.cc | 11 ++++---- 9 files changed, 72 insertions(+), 39 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 54be57c..1a416bd 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,27 @@ 2009-04-27 Guillaume Lazzara <lazzara@lrde.epita.fr> + Small fixes. + + * mln/util/array.hh, + * mln/io/pgm/save.hh: remove a wrong precondition. + + * mln/labeling/compute.hh: do not call next() anymore. + + * mln/linear/gaussian_directional_2d.hh: avoid a warning. + + * tests/core/image/safe_image.cc: remove invalid code. + + * tests/level/transform.cc: update invalid code. No implicit + conversion allowed from morphers to concrete images. + + * tests/make/Makefile.am: remove duplicate test entry. + + * tests/unit_test/unit-tests.mk: update unit test list. + + * tools/area_flooding.cc: use edge_image and vertex_image. + +2009-04-27 Guillaume Lazzara <lazzara@lrde.epita.fr> + Revamp graph images. * headers.mk: update distributed file list. diff --git a/milena/mln/labeling/compute.hh b/milena/mln/labeling/compute.hh index 9bf6394..7099069 100644 --- a/milena/mln/labeling/compute.hh +++ b/milena/mln/labeling/compute.hh @@ -175,7 +175,7 @@ namespace mln const A& a = exact(a_); const L& label = exact(label_); - util::array<A> accus(nlabels.next(), a); + util::array<A> accus(static_cast<unsigned>(nlabels) + 1, a); mln_piter(L) p(label.domain()); for_all(p) @@ -204,7 +204,7 @@ namespace mln const I& input = exact(input_); const L& label = exact(label_); - util::array<A> accus(nlabels.next(), a); + util::array<A> accus(static_cast<unsigned>(nlabels) + 1, a); mln_piter(I) p(input.domain()); for_all(p) @@ -302,7 +302,7 @@ namespace mln typedef util::array<mln_result(A)> R; R res = internal::compute_dispatch(a, label, nlabels); - mln_postcondition(res.nelements() == nlabels.next()); + mln_postcondition(res.nelements() == static_cast<unsigned>(nlabels) + 1); trace::exiting("labeling::compute"); return res; diff --git a/milena/mln/linear/gaussian_directional_2d.hh b/milena/mln/linear/gaussian_directional_2d.hh index 18b350c..eeb93d2 100644 --- a/milena/mln/linear/gaussian_directional_2d.hh +++ b/milena/mln/linear/gaussian_directional_2d.hh @@ -405,6 +405,7 @@ namespace mln // Non causal part + (void) bdr; // extension::fill(ima, bdr); unsigned diff --git a/milena/mln/util/array.hh b/milena/mln/util/array.hh index 5d1fed5..f48d242 100644 --- a/milena/mln/util/array.hh +++ b/milena/mln/util/array.hh @@ -374,8 +374,6 @@ namespace mln void from_to_(const util::array<T1>& from, util::array<T2>& to) { - mlc_converts_to(T1,T2)::check(); - to.reserve(from.nelements()); for (unsigned i = 0; i < from.nelements(); ++i) diff --git a/milena/tests/core/image/safe_image.cc b/milena/tests/core/image/safe_image.cc index 2fff120..8a74d0d 100644 --- a/milena/tests/core/image/safe_image.cc +++ b/milena/tests/core/image/safe_image.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 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 @@ -25,10 +25,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/image/safe_image.cc - * - * \brief Tests on mln::safe_image. - */ +/// \file tests/core/image/safe_image.cc +/// +/// Tests on mln::safe_image. #include <mln/core/image/image2d.hh> #include <mln/core/image/safe.hh> @@ -49,13 +48,9 @@ int main() ima_(in) = 51; mln_assertion(ima_(in) == 51); - + ima_(out) = 0; mln_assertion(ima_(out) == 7); - - // test "image_adaptor_<..>::operator I() const" - I ima2 = ima_; - const I ima3 = ima_; } { diff --git a/milena/tests/level/transform.cc b/milena/tests/level/transform.cc index e771b01..179aea8 100644 --- a/milena/tests/level/transform.cc +++ b/milena/tests/level/transform.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2007, 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 @@ -126,7 +126,7 @@ int main() { const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(), make::box2d(2,2, 5,5)); - image2d<short unsigned int> out(8, 8); + image2d<unsigned short> out(8, 8); data::fill(out, (short unsigned int)0); out = level::transform(ima, mysqrt()); @@ -151,12 +151,11 @@ int main() typedef image_if<I, fun::p2b::chess> II; I ima(size, size); - I out(size, size); II ima_if = ima | fun::p2b::chess(); data::fill_with_value(ima, 0); debug::iota(ima); - out = level::transform(ima_if, mysqrt()); + II out = level::transform(ima_if, mysqrt()); II::piter p(ima_if.domain()); for_all(p) @@ -187,14 +186,13 @@ int main() { typedef image2d<int> I; typedef sub_image< image2d<int>, box2d > II; - typedef image2d<unsigned short> III; + typedef sub_image< image2d<unsigned short>, box2d > III; I ima(size, size); II sub_ima(ima, make::box2d(4,4, 10,10)); - III out(size, size); data::fill(ima, 51); - out = level::transform(sub_ima, mysqrt()); + III out = level::transform(sub_ima, mysqrt()); II::piter p(sub_ima.domain()); for_all(p) @@ -205,14 +203,13 @@ int main() { typedef image2d<int> I; typedef extension_val< image2d<int> > II; - typedef image2d<unsigned short> III; + typedef extension_val< image2d<unsigned short> > III; I ima(size, size); II extend_ima(ima, 5); - III out(size, size); data::fill(ima, 51); - out = level::transform(extend_ima, mysqrt()); + III out = level::transform(extend_ima, mysqrt()); II::piter p(extend_ima.domain()); for_all(p) diff --git a/milena/tests/make/Makefile.am b/milena/tests/make/Makefile.am index f83f95c..d9e391c 100644 --- a/milena/tests/make/Makefile.am +++ b/milena/tests/make/Makefile.am @@ -18,7 +18,6 @@ check_PROGRAMS = \ w_window \ w_window_directional -dual_neighb_SOURCES = dual_neighb.c dual_neighb_SOURCES = dual_neighb.cc dummy_p_edges_SOURCES = dummy_p_edges.cc dummy_p_vertices_SOURCES = dummy_p_vertices.cc diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk index 15c6fcd..46fbff2 100644 --- a/milena/tests/unit_test/unit-tests.mk +++ b/milena/tests/unit_test/unit-tests.mk @@ -81,6 +81,7 @@ mln_util_internal_vertex_impl \ mln_util_internal_edge_impl \ mln_util_internal_graph_base \ mln_util_internal_boost_graph \ +mln_util_internal_id2element \ mln_util_internal_graph_nbh_iter_base \ mln_util_internal_boost_graph_property \ mln_util_ord_pair \ @@ -108,6 +109,7 @@ mln_util_pix \ mln_util_tree_fast \ mln_util_site_pair \ mln_util_nil \ +mln_util_graph_ids \ mln_util_eat \ mln_util_essential \ mln_data_memset_ \ @@ -130,13 +132,13 @@ mln_trace_resume \ mln_trace_quiet \ mln_trace_stop \ mln_trace_essential \ -mln_make_graph \ mln_make_double_neighb2d \ mln_make_image3d \ mln_make_dpoint2d_h \ mln_make_w_window \ mln_make_cell \ mln_make_image \ +mln_make_influence_zone_adjacency_graph \ mln_make_vec \ mln_make_all \ mln_make_dual_neighb \ @@ -148,11 +150,15 @@ mln_make_w_window2d_int \ mln_make_box1d \ mln_make_voronoi \ mln_make_box2d \ +mln_make_p_edges_with_mass_centers \ mln_make_h_mat \ +mln_make_p_vertices_with_mass_centers \ +mln_make_vertex_image \ mln_make_w_window2d \ mln_make_box3d \ mln_make_detachment \ mln_make_region_adjacency_graph \ +mln_make_dummy_p_vertices \ mln_make_relabelfun \ mln_make_pixel \ mln_make_pix \ @@ -161,6 +167,7 @@ mln_make_w_window1d \ mln_make_image2d \ mln_make_w_window_directional \ mln_make_rag_and_labeled_wsl \ +mln_make_dummy_p_edges \ mln_make_w_window3d_int \ mln_make_essential \ mln_make_w_window1d_int \ @@ -208,7 +215,6 @@ mln_fun_vv2v_diff_abs \ mln_fun_vv2v_land \ mln_fun_vv2v_min \ mln_fun_vv2v_essential \ -mln_fun_internal_array_base \ mln_fun_internal_x2x_linear_impl \ mln_fun_internal_ch_function_value_impl \ mln_fun_internal_resolve \ @@ -252,7 +258,6 @@ mln_fun_i2v_all \ mln_fun_i2v_array \ mln_fun_i2v_all_to \ mln_fun_i2v_essential \ -mln_fun_l2l_relabel \ mln_fun_l2l_all \ mln_fun_l2l_wrap \ mln_fun_l2l_essential \ @@ -938,6 +943,7 @@ mln_core_concept_window \ mln_core_concept_value \ mln_core_concept_accumulator \ mln_core_concept_site_set \ +mln_core_concept_object_id \ mln_core_concept_object \ mln_core_concept_meta_fun \ mln_core_concept_delta_point_site \ @@ -1017,6 +1023,7 @@ mln_labeling_foreground \ mln_labeling_regional_maxima \ mln_labeling_wrap \ mln_labeling_compute \ +mln_labeling_pack \ mln_labeling_regional_minima \ mln_labeling_essential \ mln_labeling_fill_holes \ @@ -1107,6 +1114,7 @@ mln_debug_println_with_border \ mln_debug_colorize \ mln_debug_slices_2d \ mln_debug_draw_graph \ +mln_debug_filename \ mln_debug_put_word \ mln_debug_histo \ mln_debug_quiet \ @@ -1118,6 +1126,9 @@ mln_estim_all \ mln_estim_sum \ mln_estim_mean \ mln_estim_essential \ +mln_graph_attribute_representative \ +mln_graph_attribute_card \ +mln_graph_compute \ mln_set_uni \ mln_set_unique \ mln_set_inter \ @@ -1225,6 +1236,7 @@ mln_util_internal_vertex_impl_SOURCES = mln_util_internal_vertex_impl.cc mln_util_internal_edge_impl_SOURCES = mln_util_internal_edge_impl.cc mln_util_internal_graph_base_SOURCES = mln_util_internal_graph_base.cc mln_util_internal_boost_graph_SOURCES = mln_util_internal_boost_graph.cc +mln_util_internal_id2element_SOURCES = mln_util_internal_id2element.cc mln_util_internal_graph_nbh_iter_base_SOURCES = mln_util_internal_graph_nbh_iter_base.cc mln_util_internal_boost_graph_property_SOURCES = mln_util_internal_boost_graph_property.cc mln_util_ord_pair_SOURCES = mln_util_ord_pair.cc @@ -1252,6 +1264,7 @@ mln_util_pix_SOURCES = mln_util_pix.cc mln_util_tree_fast_SOURCES = mln_util_tree_fast.cc mln_util_site_pair_SOURCES = mln_util_site_pair.cc mln_util_nil_SOURCES = mln_util_nil.cc +mln_util_graph_ids_SOURCES = mln_util_graph_ids.cc mln_util_eat_SOURCES = mln_util_eat.cc mln_util_essential_SOURCES = mln_util_essential.cc mln_data_memset__SOURCES = mln_data_memset_.cc @@ -1274,13 +1287,13 @@ mln_trace_resume_SOURCES = mln_trace_resume.cc mln_trace_quiet_SOURCES = mln_trace_quiet.cc mln_trace_stop_SOURCES = mln_trace_stop.cc mln_trace_essential_SOURCES = mln_trace_essential.cc -mln_make_graph_SOURCES = mln_make_graph.cc mln_make_double_neighb2d_SOURCES = mln_make_double_neighb2d.cc mln_make_image3d_SOURCES = mln_make_image3d.cc mln_make_dpoint2d_h_SOURCES = mln_make_dpoint2d_h.cc mln_make_w_window_SOURCES = mln_make_w_window.cc mln_make_cell_SOURCES = mln_make_cell.cc mln_make_image_SOURCES = mln_make_image.cc +mln_make_influence_zone_adjacency_graph_SOURCES = mln_make_influence_zone_adjacency_graph.cc mln_make_vec_SOURCES = mln_make_vec.cc mln_make_all_SOURCES = mln_make_all.cc mln_make_dual_neighb_SOURCES = mln_make_dual_neighb.cc @@ -1292,11 +1305,15 @@ mln_make_w_window2d_int_SOURCES = mln_make_w_window2d_int.cc mln_make_box1d_SOURCES = mln_make_box1d.cc mln_make_voronoi_SOURCES = mln_make_voronoi.cc mln_make_box2d_SOURCES = mln_make_box2d.cc +mln_make_p_edges_with_mass_centers_SOURCES = mln_make_p_edges_with_mass_centers.cc mln_make_h_mat_SOURCES = mln_make_h_mat.cc +mln_make_p_vertices_with_mass_centers_SOURCES = mln_make_p_vertices_with_mass_centers.cc +mln_make_vertex_image_SOURCES = mln_make_vertex_image.cc mln_make_w_window2d_SOURCES = mln_make_w_window2d.cc mln_make_box3d_SOURCES = mln_make_box3d.cc mln_make_detachment_SOURCES = mln_make_detachment.cc mln_make_region_adjacency_graph_SOURCES = mln_make_region_adjacency_graph.cc +mln_make_dummy_p_vertices_SOURCES = mln_make_dummy_p_vertices.cc mln_make_relabelfun_SOURCES = mln_make_relabelfun.cc mln_make_pixel_SOURCES = mln_make_pixel.cc mln_make_pix_SOURCES = mln_make_pix.cc @@ -1305,6 +1322,7 @@ mln_make_w_window1d_SOURCES = mln_make_w_window1d.cc mln_make_image2d_SOURCES = mln_make_image2d.cc mln_make_w_window_directional_SOURCES = mln_make_w_window_directional.cc mln_make_rag_and_labeled_wsl_SOURCES = mln_make_rag_and_labeled_wsl.cc +mln_make_dummy_p_edges_SOURCES = mln_make_dummy_p_edges.cc mln_make_w_window3d_int_SOURCES = mln_make_w_window3d_int.cc mln_make_essential_SOURCES = mln_make_essential.cc mln_make_w_window1d_int_SOURCES = mln_make_w_window1d_int.cc @@ -1352,7 +1370,6 @@ mln_fun_vv2v_diff_abs_SOURCES = mln_fun_vv2v_diff_abs.cc mln_fun_vv2v_land_SOURCES = mln_fun_vv2v_land.cc mln_fun_vv2v_min_SOURCES = mln_fun_vv2v_min.cc mln_fun_vv2v_essential_SOURCES = mln_fun_vv2v_essential.cc -mln_fun_internal_array_base_SOURCES = mln_fun_internal_array_base.cc mln_fun_internal_x2x_linear_impl_SOURCES = mln_fun_internal_x2x_linear_impl.cc mln_fun_internal_ch_function_value_impl_SOURCES = mln_fun_internal_ch_function_value_impl.cc mln_fun_internal_resolve_SOURCES = mln_fun_internal_resolve.cc @@ -1396,7 +1413,6 @@ mln_fun_i2v_all_SOURCES = mln_fun_i2v_all.cc mln_fun_i2v_array_SOURCES = mln_fun_i2v_array.cc mln_fun_i2v_all_to_SOURCES = mln_fun_i2v_all_to.cc mln_fun_i2v_essential_SOURCES = mln_fun_i2v_essential.cc -mln_fun_l2l_relabel_SOURCES = mln_fun_l2l_relabel.cc mln_fun_l2l_all_SOURCES = mln_fun_l2l_all.cc mln_fun_l2l_wrap_SOURCES = mln_fun_l2l_wrap.cc mln_fun_l2l_essential_SOURCES = mln_fun_l2l_essential.cc @@ -2082,6 +2098,7 @@ mln_core_concept_window_SOURCES = mln_core_concept_window.cc mln_core_concept_value_SOURCES = mln_core_concept_value.cc mln_core_concept_accumulator_SOURCES = mln_core_concept_accumulator.cc mln_core_concept_site_set_SOURCES = mln_core_concept_site_set.cc +mln_core_concept_object_id_SOURCES = mln_core_concept_object_id.cc mln_core_concept_object_SOURCES = mln_core_concept_object.cc mln_core_concept_meta_fun_SOURCES = mln_core_concept_meta_fun.cc mln_core_concept_delta_point_site_SOURCES = mln_core_concept_delta_point_site.cc @@ -2161,6 +2178,7 @@ mln_labeling_foreground_SOURCES = mln_labeling_foreground.cc mln_labeling_regional_maxima_SOURCES = mln_labeling_regional_maxima.cc mln_labeling_wrap_SOURCES = mln_labeling_wrap.cc mln_labeling_compute_SOURCES = mln_labeling_compute.cc +mln_labeling_pack_SOURCES = mln_labeling_pack.cc mln_labeling_regional_minima_SOURCES = mln_labeling_regional_minima.cc mln_labeling_essential_SOURCES = mln_labeling_essential.cc mln_labeling_fill_holes_SOURCES = mln_labeling_fill_holes.cc @@ -2251,6 +2269,7 @@ mln_debug_println_with_border_SOURCES = mln_debug_println_with_border.cc mln_debug_colorize_SOURCES = mln_debug_colorize.cc mln_debug_slices_2d_SOURCES = mln_debug_slices_2d.cc mln_debug_draw_graph_SOURCES = mln_debug_draw_graph.cc +mln_debug_filename_SOURCES = mln_debug_filename.cc mln_debug_put_word_SOURCES = mln_debug_put_word.cc mln_debug_histo_SOURCES = mln_debug_histo.cc mln_debug_quiet_SOURCES = mln_debug_quiet.cc @@ -2262,6 +2281,9 @@ mln_estim_all_SOURCES = mln_estim_all.cc mln_estim_sum_SOURCES = mln_estim_sum.cc mln_estim_mean_SOURCES = mln_estim_mean.cc mln_estim_essential_SOURCES = mln_estim_essential.cc +mln_graph_attribute_representative_SOURCES = mln_graph_attribute_representative.cc +mln_graph_attribute_card_SOURCES = mln_graph_attribute_card.cc +mln_graph_compute_SOURCES = mln_graph_compute.cc mln_set_uni_SOURCES = mln_set_uni.cc mln_set_unique_SOURCES = mln_set_unique.cc mln_set_inter_SOURCES = mln_set_inter.cc diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc index 742ec94..55813c6 100644 --- a/milena/tools/area_flooding.cc +++ b/milena/tools/area_flooding.cc @@ -57,7 +57,6 @@ #include <mln/core/routine/duplicate.hh> #include <mln/core/image/image2d.hh> -#include <mln/core/image/line_graph_elt_neighborhood.hh> #include <mln/core/var.hh> #include <mln/morpho/line_gradient.hh> @@ -102,12 +101,13 @@ int main(int argc, char* argv[]) `----------------*/ // Type of the function mapping graph edges and image sites. - typedef fun::i2v::array<util::site_pair<point2d> > fedge_site_t; + typedef util::site_pair<point2d> P; + typedef fun::i2v::array<P> fedge_site_t; // Line graph image. typedef fun::i2v::array<val_t> fval_t; fval_t values; - typedef pw::image<fval_t, p_edges<util::graph,fedge_site_t> > lg_ima_t; + typedef edge_image<P,val_t> lg_ima_t; lg_ima_t lg_ima = morpho::line_gradient(input); /*-----------. @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) /* FIXME: I'm not sure this is the way it should be done. Anyway, we should implement this as a canvas. */ - typedef line_graph_elt_neighborhood<util::graph, lg_ima_t::pset::fun_t> nbh_t; + typedef lg_ima_t::nbh_t nbh_t; nbh_t nbh; unsigned area = 0; @@ -146,8 +146,7 @@ int main(int argc, char* argv[]) // Perform a Watershed Transform. typedef int_u16 wst_val_t; wst_val_t nbasins; - typedef pw::image<fun::i2v::array<wst_val_t>, - p_edges<util::graph,fedge_site_t> > wshed_t; + typedef edge_image<P,wst_val_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