oln 10.102: Restrict types.

Index: olena/ChangeLog from Niels Van Vliet <niels@lrde.epita.fr> * olena/oln/level/cc.hh (frontp_connected_component): Change image to binary_image. * olena/oln/level/connected.hh (connected_component): Change image to binary_image_with_dim. * olena/oln/morpho/extrema_killer.hh (internal_kill_cc_area): Change non_vectorial_image to binary_image_with_dim * olena/oln/morpho/attribute_closing_opening_map.hh (f_tarjan_map): Change image to non_vectorial_image. Index: olena/oln/level/cc.hh --- olena/oln/level/cc.hh Mon, 15 Mar 2004 17:40:54 +0100 van-vl_n (oln/e/20_cc.hh 1.11.1.14 600) +++ olena/oln/level/cc.hh Fri, 19 Mar 2004 17:57:54 +0100 van-vl_n (oln/e/20_cc.hh 1.11.1.14 600) @@ -42,8 +42,6 @@ # include <oln/level/compare.hh> # include <set> -# include <list> -# include <vector> # include <ntg/core/macros.hh> # include <mlc/is_a.hh> @@ -102,12 +100,10 @@ template <class DestType, class I, class E> typename mute<I, DestType>::ret - frontp_connected_component(const abstract::image<I>& input, + frontp_connected_component(const abstract::binary_image<I>& input, const abstract::neighborhood<E>& se, unsigned& nb_label) { - ntg_is_a(oln_value_type(I), ntg::binary)::ensure(); - typename mute<I, DestType>::ret output(input.size()); level::fill(output, 0); Index: olena/oln/level/connected.hh --- olena/oln/level/connected.hh Mon, 15 Mar 2004 15:32:27 +0100 van-vl_n (oln/30_connected. 1.9.1.13 600) +++ olena/oln/level/connected.hh Fri, 19 Mar 2004 17:56:36 +0100 van-vl_n (oln/30_connected. 1.9.1.13 600) @@ -40,7 +40,7 @@ /* \brief Processing connected_component extract the connected components. ** - ** \arg: input image + ** \arg: input a 2d image of binary. ** \arg: Ng neighborhood ** ** \return Returns a labeled image @@ -52,18 +52,15 @@ ** d'images, filtrages et segmentations p.62. ** ** \see level::frontp_connected_component - ** \todo FIXME: The type of input shoud be a binary 2d image. */ // Number the connected components i.e label true. background(i.e // label false) has the label 0; This algorithm works only for 2D images. template <class DestType, class I, class N> typename mute<I, DestType>::ret - connected_component(const abstract::image<I>& input, + connected_component(const abstract::binary_image_with_dim<2, I>& input, const abstract::neighborhood<N>& Ng) { - // FIXME: ensure the oln_value_type(I) is bin. mlc::eq<I::dim, N::dim>::ensure(); - mlc::eq<I::dim, 2>::ensure(); typename mute<I, DestType>::ret output(input.size()); level::hlut< DestType, DestType > T; DestType k = 1; Index: olena/oln/morpho/extrema_killer.hh --- olena/oln/morpho/extrema_killer.hh Thu, 18 Mar 2004 18:24:14 +0100 van-vl_n (oln/e/19_extrema_ki 1.7.1.4.1.14 600) +++ olena/oln/morpho/extrema_killer.hh Tue, 23 Mar 2004 13:12:27 +0100 van-vl_n (oln/e/19_extrema_ki 1.7.1.4.1.14 600) @@ -60,7 +60,7 @@ */ template<class I, class N> typename mute<I, ntg::bin>::ret - internal_kill_cc_area(const abstract::non_vectorial_image<I>& input, + internal_kill_cc_area(const abstract::binary_image_with_dim<2, I>& input, const unsigned int area, const abstract::neighborhood<N>& Ng) { Index: olena/oln/morpho/attribute_closing_opening_map.hh --- olena/oln/morpho/attribute_closing_opening_map.hh Thu, 18 Mar 2004 18:24:14 +0100 van-vl_n (oln/j/49_attribute_ 1.9 600) +++ olena/oln/morpho/attribute_closing_opening_map.hh Tue, 23 Mar 2004 13:34:03 +0100 van-vl_n (oln/j/49_attribute_ 1.9 600) @@ -65,14 +65,25 @@ struct f_tarjan_map { public: - typedef abstract::image<I> input_type; ///< Image type (abstract). - typedef oln_concrete_type(I) img_type; ///< Image type (concrete). + typedef abstract::non_vectorial_image<I> input_type; + ///< Image type (abstract). - typedef oln_point_type(input_type) point_type; ///< Associated point type. - typedef oln_value_type(input_type) value_type; ///< Value type fo the image. - typedef typename mute<input_type, point_type>::ret parent_type; ///< Image of points. - typedef typename mute<input_type, bool>::ret is_proc_type; ///< Image of bool. - typedef attr_lambda_type(D) lambda_type; ///< dTthreshold type. + typedef oln_concrete_type(I) img_type; + ///< Image type (concrete). + + typedef oln_point_type(input_type) point_type; + ///< Associated point type. + + typedef oln_value_type(input_type) value_type; + ///< Value type fo the image. + + typedef typename mute<input_type, point_type>::ret parent_type; + ///< Image of points. + + typedef typename mute<input_type, bool>::ret is_proc_type; + ///< Image of bool. + typedef attr_lambda_type(D) lambda_type; + ///< Threshold type. // e.g., // when I is image2d<int_u8> and D is area_type, we've got: @@ -164,9 +175,11 @@ const input_type& input; ///< Input image. lambda_type lambda; ///< Trheshold. parent_type parent; ///< Give a parent of a point. - is_proc_type is_proc; ///< Tell if a point has already been preceded - img_type output; ///< Image to store the result - std::map<point_type, D, oln::internal::default_less<point_type> > auxdata; ///< Map to store attributes. + is_proc_type is_proc;///< Tell if a point has already been preceded. + img_type output; ///< Image to store the result. + std::map<point_type, D, + oln::internal::default_less<point_type> > auxdata; + ///< Map to store attributes. Env env; ///< The envronment. }; @@ -180,7 +193,7 @@ template <class D, class I, class N> oln_concrete_type(I) tarjan_map(bool is_closing, - const abstract::image<I>& input, + const abstract::non_vectorial_image<I>& input, const abstract::neighborhood<N>& ng, const attr_lambda_type(D)& lambda, const attr_env_type(D)& env/* = Env()*/) @@ -198,7 +211,7 @@ # define xxx_opening_map_decl(T) \ template <class I, class N> \ oln_concrete_type(I) \ -T##_opening(const abstract::image<I>& input, \ +T##_opening(const abstract::non_vectorial_image<I>& input, \ const abstract::neighborhood<N>& ng, \ const attr_lambda_type(T##_type<>)& lambda) \ { \ @@ -210,7 +223,7 @@ # define xxx_opening_im_map_decl(T) \ template <class I, class N> \ oln_concrete_type(I) \ -T##_opening(const abstract::image<I>& input, \ +T##_opening(const abstract::non_vectorial_image<I>& input, \ const abstract::neighborhood<N>& ng, \ const attr_lambda_type(T##_type<I>)& lambda) \ { \ @@ -219,26 +232,29 @@ } //return input; - // return tarjan_map<T##_type, I, N>(false, input, ng, lambda, attr_env_type(T##_type<>)()); + // return tarjan_map<T##_type, I, N>(false, input, ng, lambda, + // attr_env_type(T##_type<>)()); # define xxx_closing_map_decl(T) \ template <class I, class N> \ oln_concrete_type(I) \ -T##_closing(const abstract::image<I>& input, \ +T##_closing(const abstract::non_vectorial_image<I>& input, \ const abstract::neighborhood<N>& ng, \ const attr_lambda_type(T##_type<>)& lambda) \ { \ - return tarjan_map<T##_type<>, I, N>(true, input, ng, lambda, attr_env_type(T##_type<>)()); \ + return tarjan_map<T##_type<>, I, N>(true, input, ng, lambda, \ + attr_env_type(T##_type<>)()); \ } // same but attribute take care of the image type # define xxx_closing_im_map_decl(T) \ template <class I, class N> \ oln_concrete_type(I) \ -T##_closing(const abstract::image<I>& input, \ +T##_closing(const abstract::non_vectorial_image<I>& input, \ const abstract::neighborhood<N>& ng, \ const attr_lambda_type(T##_type<I>)& lambda) \ { \ - return tarjan_map<T##_type<I>, I, N>(true, input, ng, lambda, attr_env_type(T##_type<I>)()); \ + return tarjan_map<T##_type<I>, I, N>(true, input, ng, lambda, \ + attr_env_type(T##_type<I>)());\ } /*! @@ -306,7 +322,8 @@ ** typedef oln::image2d<ntg::int_u8> im_type; ** ** im_type im1(oln::load(IMG_IN "lena128.pgm")); - ** im1 = oln::morpho::slow::integral_closing(im1, oln::neighb_c4(), 200); + ** im1 = oln::morpho::slow::integral_closing(im1, oln::neighb_c4(), + ** 200); ** oln::save(im1, IMG_OUT "oln_morpho_slow_integral_closing.ppm"); ** } ** \endcode @@ -332,7 +349,8 @@ ** typedef oln::image2d<ntg::int_u8> im_type; ** ** im_type im1(oln::load(IMG_IN "lena128.pgm")); - ** im1 = oln::morpho::slow::integral_opening(im1, oln::neighb_c4(), 200); + ** im1 = oln::morpho::slow::integral_opening(im1, oln::neighb_c4(), + ** 200); ** oln::save(im1, IMG_OUT "oln_morpho_slow_integral_opening.ppm"); ** } ** \endcode
participants (1)
-
Niels Van Vliet