
Index: olena/ChangeLog from Giovanni Palma <giovanni@lrde.epita.fr> * oln/morpho/closing.inc: Correct comments. * oln/morpho/extrema_killer.hh: Likewise. * oln/morpho/attribute_closing_opening_map.hh: Likewise. * oln/morpho/extrema.hxx: Likewise. * oln/morpho/erosion.hh: Likewise. * oln/morpho/extrema.hh: Likewise. * oln/morpho/attribute_closing_opening.hh: Likewise. * oln/morpho/attribute_union_find.hh: Likewise. * oln/morpho/attributes.hh: Likewise. * oln/morpho/dilation.hh: Add comments. * oln/morpho/fast_morpho.hh: Likewise. * oln/morpho/fast_morpho.hxx: Likewise. * oln/morpho/geodesic_dilation.hh: Likewise. * oln/morpho/geodesic_erosion.hh: Likewise. * oln/morpho/gradient.inc: Likewise. * oln/morpho/hit_or_miss.inc: Likezise. * oln/morpho/laplacian.inc: Likewise. * oln/morpho/minmax.hh: Likewise. * oln/morpho/opening.inc: Likewise. * oln/morpho/reconstruction.hh: Likewise. * oln/morpho/splitse.hh: Likewise. * oln/morpho/stat.hh: Likewise. * oln/morpho/thickening.inc: Likewise. * oln/morpho/thinning.inc: Likewise. * oln/morpho/top_hat.inc: Likewise. * oln/morpho/watershed.hh: Likewise. * oln/morpho/watershed.hxx: Likewise. Index: olena/oln/morpho/closing.inc --- olena/oln/morpho/closing.inc Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/44_closing.in 1.15 600) +++ olena/oln/morpho/closing.inc Wed, 10 Mar 2004 19:57:33 +0100 palma_g (oln/44_closing.in 1.15 640) @@ -30,11 +30,11 @@ * ns: morpho, morpho::fast * what: Morphological closing. * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element + * arg: const abstract::struct_elt<E>&, se, IN, structuring element * ret:oln_concrete_type(I) * doc: * Compute the morphological closing of \var{input} using \var{se} - * as structural element. + * as structuring element. * see: morpho::erosion * see: morpho::dilation * see: morpho::closing @@ -47,14 +47,14 @@ /*! ** \brief Processing closing. ** -** Compute the morphological closing of input using se as structural +** Compute the morphological closing of input using se as structuring ** element. ** -** \param I: exact type of the input image. -** \param E: exact type of the structural element. +** \param I Exact type of the input image. +** \param E Exact type of the structuring element. ** -** \arg input: input image to close. -** \arg se: structural element to use. +** \arg input Input image to close. +** \arg se Structuring element to use. ** ** \warning This code is the same for morpho and morpho::fast ** namespaces. Index: olena/oln/morpho/dilation.hh --- olena/oln/morpho/dilation.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/b/5_dilation.h 1.16 600) +++ olena/oln/morpho/dilation.hh Wed, 10 Mar 2004 19:58:42 +0100 palma_g (oln/b/5_dilation.h 1.16 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2004 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 @@ -37,42 +37,56 @@ namespace morpho { - /*=processing dilation - * ns: morpho, morpho::fast - * what: Morphological dilation. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the morphological dilation of \var{input} using \var{se} - * as structural element. - * - * On grey-scale images, each point is replaced by the maximum value - * of its neighbors, as indicated by \var{se}. On binary images, - * a logical \code{or} is performed between neighbors. - * - * The \code{morpho::fast} version of this function use a different - * algorithm: This algorith; is described in - * Implementation of morphological operations from: - * M. Van Droogenbroeck and H. Talbot. - * "Fast computation of morphological operations with arbitrary - * structuring elements". Pattern Recognition Letters, - * 17(14):1451-1460, 1996. - * - * An - * histogram of the value of the neighborhood indicated by - * \var{se} is updated while iterating over all point of the - * image. Doing so is more efficient when the - * structural element is large. - * - * see: morpho::n_dilation - * see: morpho::erosion - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * $ save(morpho::dilation(im, win_c8p()), "out.pbm"); - * exi: object.pbm - * exo: out.pbm - =*/ + /*! + ** \brief Processing dilation. + ** + ** Compute the morphological dilation of input using se + ** as structural element. + ** + ** On grey-scale images, each point is replaced by the maximum value + ** of its neighbors, as indicated by se. On binary images, + ** a logical or is performed between neighbors. + ** + ** The morpho::fast version of this function use a different + ** algorithm: This algorithm is described in + ** Implementation of morphological operations from: + ** M. Van Droogenbroeck and H. Talbot. + ** "Fast computation of morphological operations with arbitrary + ** structuring elements". Pattern Recognition Letters, + ** 17(14):1451-1460, 1996. + ** + ** An histogram of the value of the neighborhood indicated by + ** se is updated while iterating over all point of the + ** image. Doing so is more efficient when the + ** structural element is large. + ** + ** \param I Exact type of the input image. + ** \param E Exact type of the neighborhood. + ** + ** \arg input The input image. + ** \arg se Structuring element to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/dilation.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::bin> im_type; + ** + ** im_type im1(oln::load(IMG_IN "object.pbm")); + ** save(oln::morpho::dilation(im1, oln::win_c8p()), IMG_OUT "oln_morpho_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html object.png + ** \image latex object.png + ** => + ** \image html oln_morpho_dilation.png + ** \image latex oln_morpho_dilation.png + */ template<class I, class E> oln_concrete_type(I) dilation(const abstract::non_vectorial_image<I> &input, @@ -89,18 +103,39 @@ return output; } - /*=processing n_dilation - * ns: morpho - * what: Morphological dilation itered n times. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * arg: unsigned, n, IN, number of iterations - * ret:oln_concrete_type(I) - * doc: - * Apply \code{morpho::dilation} \var{n} times. - * see: morpho::dilation - * see: morpho::n_erosion - =*/ + /*! + ** \brief Perform morphological dilation iterated n times. + ** + ** + ** \param I Exact type of the input image. + ** \param E Exact type of the structuring element. + ** + ** \arg input Input image. + ** \arg se Structuring element to use. + ** \arg n Number of iterations. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/dilation.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::bin> im_type; + ** + ** im_type im1(oln::load(IMG_IN "object.pbm")); + ** save(oln::morpho::n_dilation(im1, oln::win_c8p(), 5), IMG_OUT "oln_morpho_n_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html object.png + ** \image latex object.png + ** => + ** \image html oln_morpho_n_dilation.png + ** \image latex oln_morpho_n_dilation.png + ** + */ template<class I, class E> oln_concrete_type(I) n_dilation(const abstract::non_vectorial_image<I> & input, Index: olena/oln/morpho/erosion.hh --- olena/oln/morpho/erosion.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/b/4_erosion.hh 1.18 600) +++ olena/oln/morpho/erosion.hh Wed, 10 Mar 2004 20:00:55 +0100 palma_g (oln/b/4_erosion.hh 1.18 640) @@ -40,7 +40,7 @@ ** \brief Perform a morphological erosion. ** ** Compute the morphological erosion of input using se - ** as structural element. + ** as structuring element. ** ** On grey-scale images, each point is replaced by the minimum ** value of its neighbors, as indicated by se. On binary @@ -48,15 +48,15 @@ ** morpho::fast version of this function use a different ** algorithm: an histogram of the value of the neighborhood ** indicated by se is updated while iterating over all point of - ** the image. Doing so is more efficient when the structural + ** the image. Doing so is more efficient when the structuring ** element is large. ** - ** \param I: exact type of the input image. - ** \param E: exact type of the structural element. + ** \param I Exact type of the input image. + ** \param E Exact type of the structuring element. ** ** - ** \arg input: input image. - ** \arg se: structural element to use. + ** \arg input Input image. + ** \arg se Structuring element to use. ** ** \code ** #include <oln/basics2d.hh> @@ -97,15 +97,15 @@ } /*! - ** \brief Perform morphological erosion itered n times. + ** \brief Perform morphological erosion iterated n times. ** ** - ** \param I: exact type of the input image. - ** \param E: exact type of the structural element. + ** \param I Exact type of the input image. + ** \param E Exact type of the structuring element. ** - ** \arg input: input image. - ** \arg se: structural element to use. - ** \arg n: number of iterations. + ** \arg input Input image. + ** \arg se Structuring element to use. + ** \arg n Number of iterations. ** ** \code ** #include <oln/basics2d.hh> @@ -151,14 +151,14 @@ ** \brief Perform a morphological erosion. ** ** Compute the morphological erosion of input using se - ** as structural element. + ** as structuring element. ** - ** \param I: exact type of the input image. - ** \param E: exact type of the structural element. + ** \param I Exact type of the input image. + ** \param E Exact type of the structuring element. ** ** - ** \arg input: input image. - ** \arg se: structural element to use. + ** \arg input Input image. + ** \arg se Structuring element to use. ** ** \code ** #include <oln/basics2d.hh> Index: olena/oln/morpho/extrema.hh --- olena/oln/morpho/extrema.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/38_extrema.hh 1.12 600) +++ olena/oln/morpho/extrema.hh Thu, 11 Mar 2004 16:22:19 +0100 palma_g (oln/38_extrema.hh 1.12 640) @@ -38,7 +38,8 @@ /*! ** \brief oln::morpho::sure namespace. ** - ** Here come algorithms that are sure. + ** Namespace where you can find reference algorithms, i.e. those + ** that are sure. */ namespace sure { # include <oln/morpho/extrema.hxx> @@ -47,7 +48,7 @@ /*! ** \brief oln::morpho::sequential namespace. ** - ** Here come algorithms that are sequential. + ** Namespace where you can find sequential algorithms. */ namespace sequential { # include <oln/morpho/extrema.hxx> @@ -56,7 +57,7 @@ /*! ** \brief oln::morpho::hybrid namespace. ** - ** Here come algorithms that are hybrid. + ** Namespace where you can find hybrid algorithms. */ namespace hybrid { # include <oln/morpho/extrema.hxx> Index: olena/oln/morpho/extrema.hxx --- olena/oln/morpho/extrema.hxx Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/j/4_extrema.hx 1.12 600) +++ olena/oln/morpho/extrema.hxx Wed, 10 Mar 2004 20:02:35 +0100 palma_g (oln/j/4_extrema.hx 1.12 640) @@ -33,10 +33,10 @@ /*! ** \brief Create extremum image from another one. ** - ** \param DestType: type of data in the wanted image. - ** \param I: Exact type of the input image. + ** \param DestType Type of data in the wanted image. + ** \param I Exact type of the input image. ** - ** \arg input: input image. + ** \arg input Input image. */ template <class DestType, class I> typename mute<I, DestType>::ret @@ -57,9 +57,9 @@ /*! ** \brief Create binary image from another one. ** - ** \param I: exact type of the image. + ** \param I Exact type of the image. ** - ** \arg input: input image. + ** \arg input Input image. */ template <class I> typename mute<I, ntg::bin>::ret @@ -85,13 +85,13 @@ ** neighborhood. minima_map must be a bin image (true for a minimum, ** false for a non minimum). Soille p.172. ** -** \param I: exact type of the first image. -** \param I2: exact type of the second image. -** \param N: exact type of the neighborhood. -** -** \arg input: input image. -** \arg minima_map: minima map image. -** \arg Ng: neighborhood to use. +** \param I Exact type of the first image. +** \param I2 Exact type of the second image. +** \param N Exact type of the neighborhood. +** +** \arg input Input image. +** \arg minima_map Minima map image. +** \arg Ng Neighborhood to use. ** ** \ref foototo ** \code @@ -146,11 +146,11 @@ /*! ** \brief Extract regional minima. ** -** \param I: Exact type of input image. +** \param I Exact type of input image. ** \param Exact type of neighborhood. ** -** \arg input: input image. -** \arg Ng: neighborhood to use. +** \arg input Input image. +** \arg Ng Neighborhood to use. ** ** \code ** #include <oln/basics2d.hh> Index: olena/oln/morpho/extrema_killer.hh --- olena/oln/morpho/extrema_killer.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/e/19_extrema_ki 1.7.1.4.1.11 600) +++ olena/oln/morpho/extrema_killer.hh Wed, 10 Mar 2004 20:06:34 +0100 palma_g (oln/e/19_extrema_ki 1.7.1.4.1.11 640) @@ -51,12 +51,12 @@ /*! ** \brief Kill connex components smaller than a given area. ** - ** \param I: exact type of the input image. - ** \param N: exact type of the neighborhood. + ** \param I E xact type of the input image. + ** \param N Exact type of the neighborhood. ** - ** \arg input: the input image. - ** \arg area: the threshold to use. - ** \arg Ng: the neighborhood to use. + ** \arg input The input image. + ** \arg area The threshold to use. + ** \arg Ng The neighborhood to use. */ template<class I, class N> typename mute<I, ntg::bin>::ret @@ -95,16 +95,16 @@ ** \brief Maxima killer. ** ** It removes the small (in area) connected components of the upper - ** level sets of input using se as structual element. The implementation + ** level sets of input using se as structuring element. The implementation ** uses the threshold superposition principle; so it is very slow ! it works only for ** int_u8 images. ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. + ** \param I Image exact type. + ** \param N Neighborhood exact type. ** - ** \arg input: the input image. - ** \arg area: threshold to use. - ** \arg Ng: the neighborhood to use. + ** \arg input The input image. + ** \arg area Threshold to use. + ** \arg Ng The neighborhood to use. ** ** \code ** #include <oln/basics2d.hh> @@ -167,17 +167,17 @@ /*! ** \brief Minima killer. ** - ** It removes the small (in area) connected components of the lower - ** level sets of input using se as structual element. The implementation - ** uses the threshold superposition principle; so it is very slow ! it works only for - ** int_u8 images. - ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. - ** - ** \arg input: the input image. - ** \arg area: threshold to use. - ** \arg Ng: the neighborhood to use. + ** It removes the small (in area) connected components of the + ** lower level sets of input using se as structuring element. The + ** implementation uses the threshold superposition principle; so + ** it is very slow ! it works only for int_u8 images. + ** + ** \param I Image exact type. + ** \param N Neighborhood exact type. + ** + ** \arg input The input image. + ** \arg area Threshold to use. + ** \arg Ng The neighborhood to use. ** ** \code ** #include <oln/basics2d.hh> @@ -245,14 +245,14 @@ /*! ** \brief Check if a point is a strict minimum. ** - ** \param P: exact type of the point. - ** \param I: exact type of the image. - ** \param N: exact type of the neighborhood. + ** \param P Exact type of the point. + ** \param I Exact type of the image. + ** \param N Exact type of the neighborhood. ** - ** \arg p: the point to consider. - ** \arg input: the image where to get the value of the point to + ** \arg p The point to consider. + ** \arg input The image where to get the value of the point to ** consider. - ** \arg Ng: type of neighborhood to use. + ** \arg Ng Type of neighborhood to use. */ template<class P, class I, class N> // inline @@ -280,14 +280,14 @@ /*! ** \brief Check if a point is a strict maximum. ** - ** \param P: exact type of the point. - ** \param I: exact type of the image. - ** \param N: exact type of the neighborhood. + ** \param P Exact type of the point. + ** \param I Exact type of the image. + ** \param N Exact type of the neighborhood. ** - ** \arg p: the point to consider. - ** \arg input: the image where to get the value of the point to + ** \arg p The point to consider. + ** \arg input The image where to get the value of the point to ** consider. - ** \arg Ng: type of neighborhood to use. + ** \arg Ng Type of neighborhood to use. */ template<class P, class I, class N> // inline @@ -321,12 +321,12 @@ ** implementation is based on stak. Guichard and Morel, Image ** iterative smoothing and PDE's. Book in preparation. p 265. ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. + ** \param I Image exact type. + ** \param N Neighborhood exact type. ** - ** \arg input: the input image. - ** \arg area: threshold to use. - ** \arg Ng: the neighborhood to use. + ** \arg input The input image. + ** \arg area Threshold to use. + ** \arg Ng The neighborhood to use. ** ** \code ** #include <oln/basics2d.hh> @@ -446,12 +446,12 @@ ** implementation is based on stak. Guichard and Morel, Image ** iterative smoothing and PDE's. Book in preparation. p 265. ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. + ** \param I Image exact type. + ** \param N Neighborhood exact type. ** - ** \arg input: the input image. - ** \arg area: threshold to use. - ** \arg Ng: the neighborhood to use. + ** \arg input The input image. + ** \arg area Threshold to use. + ** \arg Ng The neighborhood to use. ** ** \code ** #include <oln/basics2d.hh> Index: olena/oln/morpho/fast_morpho.hh --- olena/oln/morpho/fast_morpho.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/46_fast_morph 1.8 600) +++ olena/oln/morpho/fast_morpho.hh Wed, 10 Mar 2004 17:10:53 +0100 palma_g (oln/46_fast_morph 1.8 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2004 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 @@ -33,6 +33,10 @@ namespace oln { namespace morpho { + /*! + ** Do not exist !!! + ** \todo FIXME: REMOVE ME. + */ template<class I, class E> inline oln_concrete_type(I) fast_morpho(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/fast_morpho.hxx --- olena/oln/morpho/fast_morpho.hxx Thu, 07 Aug 2003 02:08:21 +0200 david (oln/45_fast_morph 1.18 600) +++ olena/oln/morpho/fast_morpho.hxx Wed, 10 Mar 2004 19:24:52 +0100 palma_g (oln/45_fast_morph 1.18 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -40,12 +40,21 @@ namespace oln { namespace morpho { + /*! + ** \brief oln::morpho::internal namespace + ** Internal stuff. + */ namespace internal { - // Find structuring elements to be added/removed from the histogram - // when we move forward along each direction. - // FIXME: add(dp) on w_windows associates a default weight set - // to 1 + /*! + ** \brief Find structuring elements. + ** + ** Find structuring elements to be added/removed from the histogram + ** when we move forward along each direction. + ** + ** \todo FIXME: add(dp) on w_windows associates a default weight set + ** to 1 + */ template<class E1, class E2, class E3> void find_struct_elts(const abstract::struct_elt<E1>& se, @@ -101,9 +110,12 @@ postcondition(se_add[n].card() == se_rem[n].card()); } - - // Update HIST by adding elements from _SE_ADD, and removing - // those from _SE_REM. + /*! + ** \brief Update an histogram. + ** + ** Update HIST by adding elements from _SE_ADD, and removing + ** those from _SE_REM. + */ template<class I, class E1, class E2, class H> // inline void @@ -126,16 +138,20 @@ } - // We will zigzag over the image so that only one coordinate - // changes at each step. The path looks as follow on - // 2D images: - // -----------------. - // ,----------------' - // `----------------. - // ,----------------' - // `----------------- - // (The algorithm below handles the n-dimensional case.) - + /*! + ** We will zigzag over the image so that only one coordinate + ** changes at each step. The path looks as follow on + ** 2D images:\n + ** --------------\ + ** | + ** /-------------/ + ** | + ** \-------------\ + ** | + ** -------------/ + ** \n + ** (The algorithm below handles the n-dimensional case.) + */ template<unsigned NP1, unsigned Dim, typename I, @@ -145,6 +161,10 @@ typename P, typename O> struct fast_morpho_inner { + + /*! + ** Perform the action. + */ static void doit(I& input, S& size, H& hist, B* se_add, B* se_rem, B* se_add_back, B* se_rem_back, @@ -237,23 +257,60 @@ }; } // internal - + /*! + ** \brief functor to sort dimensions. + */ template<class E> struct sort_dimensions { + /*! + ** \brief Constructor. + */ sort_dimensions(abstract::struct_elt<E> se[mlc::exact<E>::ret::dim]) : se_(se) {} + /*! + ** \brief Parenthesis operator. + ** + ** Call it to use the functor. + */ bool operator()(unsigned a, unsigned b) { return se_[a].card() > se_[b].card(); } protected: - abstract::struct_elt<E>* se_; + abstract::struct_elt<E>* se_; ///< Structural element. }; - + /*! + ** \brief Fast morpho algorithm. + ** + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/erosion.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::bin> im_type; + ** + ** im_type im1(oln::load(IMG_IN "object.pbm")); + ** //save(oln::morpho::fast_morpho<im_type, oln::win_c8p(), utils::histogram_min> + ** // (im1, oln::win_c8p()), IMG_OUT "oln_morpho_fast_morpho.pbm"); + ** save(im1, IMG_OUT "oln_morpho_fast_morpho.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html object.png + ** \image latex object.png + ** => + ** \image html oln_morpho_fast_morpho.png + ** \image latex oln_morpho_fast_morpho.png + ** \todo FIXME: Correct this function and make the example use it. + */ template<class I, class E, template<typename, typename> class H> oln_concrete_type(I) fast_morpho(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/geodesic_dilation.hh --- olena/oln/morpho/geodesic_dilation.hh Wed, 08 Oct 2003 23:36:51 +0200 burrus_n (oln/37_geodesic_d 1.11.1.10 600) +++ olena/oln/morpho/geodesic_dilation.hh Thu, 11 Mar 2004 19:56:56 +0100 palma_g (oln/37_geodesic_d 1.11.1.10 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -42,28 +42,48 @@ namespace oln { namespace morpho { - /*=processing geodesic_dilation - * ns: morpho - * what: Geodesic dilation. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the geodesic dilation of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.156. - * Note mask must be greater or equal than marker. - * see: morpho::simple_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::geodesic_dilation(dark, light, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ - + /*! + ** \brief Processing a geodesic dilation. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** Compute the geodesic dilation of marker with respect to the + ** mask image using se as structuring element. Soille + ** p.156. + ** \pre Mask must be greater or equal than marker. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/geodesic_dilation.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** save(oln::morpho::geodesic_dilation(im2, im1, oln::neighb_c4()), + ** IMG_OUT "oln_morpho_geodesic_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_geodesic_dilation.png + ** \image latex oln_morpho_geodesic_dilation.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_dilation(const abstract::non_vectorial_image<I1> & marker, @@ -80,29 +100,51 @@ } namespace sure { - /*=processing simple_geodesic_dilation - * ns: morpho - * what: Geodesic dilation. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the geodesic dilation of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.156. Computation is - * performed by hand (i.e without calling dilation). - * Note mask must be greater or equal than marker. - * see: morpho::sure_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::simple_geodesic_dilation(dark, light, - * $ win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Processing a geodesic dilation. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** Compute the geodesic dilation of marker with respect to the + ** mask image using se as structuring element. Soille + ** p.156. + ** \pre Mask must be greater or equal than marker. + ** + ** \warning This version shouldn't be use, since it exists only + ** to have a reference algorithm. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/geodesic_dilation.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** save(oln::morpho::sure::geodesic_dilation(im2, im1, oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sure_geodesic_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sure_geodesic_dilation.png + ** \image latex oln_morpho_sure_geodesic_dilation.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_dilation(const abstract::non_vectorial_image<I1> & marker, Index: olena/oln/morpho/geodesic_erosion.hh --- olena/oln/morpho/geodesic_erosion.hh Wed, 08 Oct 2003 23:36:51 +0200 burrus_n (oln/36_geodesic_e 1.17 600) +++ olena/oln/morpho/geodesic_erosion.hh Thu, 11 Mar 2004 19:58:19 +0100 palma_g (oln/36_geodesic_e 1.17 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -39,27 +39,49 @@ namespace oln { namespace morpho { - /*=processing geodesic_erosion - * ns: morpho - * what: Geodesic erosion. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the geodesic erosion of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.158. - * Note marker must be greater or equal than mask. - * see: morpho::simple_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::geodesic_erosion(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Processing a geodesic erosion. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** Compute the geodesic erosion of marker with respect to the + ** mask mask image using se as structural element. Soille p.158. + ** + ** \pre Marker must be greater or equal than mask. + ** + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/geodesic_erosion.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** save(oln::morpho::geodesic_erosion(im1, im2, oln::neighb_c4()), + ** IMG_OUT "oln_morpho_geodesic_erosion.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_geodesic_erosion.png + ** \image latex oln_morpho_geodesic_erosion.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_erosion(const abstract::non_vectorial_image<I1> & marker, @@ -74,28 +96,53 @@ } namespace sure { - /*=processing simple_geodesic_erosion - * ns: morpho - * what: Geodesic erosion. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the geodesic erosion of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.156. Computation is - * performed by hand (i.e without calling dilation). - * Note marker must be greater or equal than mask. - * see: morpho::sure_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::geodesic_erosion(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Processing a geodesic erosion. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** Compute the geodesic erosion of marker with respect to the + ** mask mask image using se as structural element. Soille + ** p.156. Computation is performed by hand (i.e without calling + ** dilation). + ** + ** \pre Marker must be greater or equal than mask. + ** + ** \warning This version shouldn't be use, since it exists only + ** to have a reference algorithm. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/geodesic_erosion.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** save(oln::morpho::sure::geodesic_erosion(im1, im2, oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sure_geodesic_erosion.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sure_geodesic_erosion.png + ** \image latex oln_morpho_sure_geodesic_erosion.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_erosion(const abstract::non_vectorial_image<I1> & marker, Index: olena/oln/morpho/gradient.inc --- olena/oln/morpho/gradient.inc Thu, 07 Aug 2003 02:08:21 +0200 david (oln/43_gradient.i 1.13 600) +++ olena/oln/morpho/gradient.inc Thu, 11 Mar 2004 16:05:01 +0100 palma_g (oln/43_gradient.i 1.13 640) @@ -1,13 +1,13 @@ // -*- c++ -*- -// Copyright (C) 2001 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2004 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 // of the GNU General Public License version 2 as published by the // Free Software Foundation. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of +// This library 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. // @@ -26,28 +26,16 @@ // reasons why the executable file might be covered by the GNU General // Public License. - - -/*=processing beucher_gradient - * ns: morpho, morpho::fast - * what: Morphological Beucher Gradient. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute the arithmetic difference between the diltation and - * the erosion of \var{input} using \var{se} as structural element. Soille, p67. - * see: morpho::erosion - * see: morpho::dilation - * see: morpho::external_gradient - * see: morpho::internal_gradient - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::beucher_gradient(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Process a morphological beucher gradient. +** +** Compute the arithmetic difference between the diltation and the +** erosion of input using se as structural element. Soille, p67. +** +** \arg c Conversion functor. +** \arg input Image to process. +** \arg se Structuring element. +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret beucher_gradient(const convert::abstract::conversion<C, B>& c, @@ -57,14 +45,41 @@ return arith::minus(c, dilation(input, se), erosion(input, se)); } - -/*=processingoverload beucher_gradient - * ns: morpho, morpho::fast - * what: Morphological Beucher Gradient. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) -=*/ +/*! +** \brief Process a morphological beucher gradient. +** +** \param I Exact type of the input image. +** \param E Exact type of the structuring element. +** +** \return The beucher gradient of the input. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/gradient.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena128.pgm")); +** +** save(oln::morpho::beucher_gradient(im1, oln::win_c8p()), +** IMG_OUT "oln_morpho_beucher_gradient.pbm"); +** return 0; +** } +** \encode +** +** \image html lena128.png +** \image latex lena128.png +** => +** \image html oln_morpho_beucher_gradient.png +** \image latex oln_morpho_beucher_gradient.png +** +*/ template<class I, class E> oln_concrete_type(I) beucher_gradient(const abstract::non_vectorial_image<I>& input, @@ -74,25 +89,20 @@ } -/*=processing internal_gradient - * ns: morpho, morpho::fast - * what: Morphological Internal Gradient. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute the arithmetic difference between the original image \var{input} and - * the erosion of \var{input} using \var{se} as structural element. Soille, p67. - * see: morpho::beucher_gradient - * see: morpho::external_gradient - * see: morpho::erosion - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::internal_gradient(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Process a morphological internal gradient. +** +** \return The internal gradient of the input. +** +** +** \arg c Conversion functor. +** \arg input Image to process. +** \arg se Structuring element. +** +** Compute the arithmetic difference between the original image input and +** the erosion of input using se as structural element. Soille, p67. +** +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret internal_gradient(const convert::abstract::conversion<C, B>& c, @@ -102,13 +112,40 @@ return arith::minus(c, input, erosion(input, se)); } -/*=processingoverload internal_gradient - * ns: morpho, morpho::fast - * what: Morphological Internal Gradient. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) -=*/ +/*! +** \brief Process a morphological internal gradient. +** +** \param I Exact type of the input image. +** \param E Exact type of the structuring element. +** +** \return The internal gradient of the input. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/gradient.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** save(oln::morpho::internal_gradient(im1, oln::win_c8p()), +** IMG_OUT "oln_morpho_internal_gradient.pbm"); +** return 0; +** } +** \encode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_internal_gradient.png +** \image latex oln_morpho_internal_gradient.png +*/ template<class I, class E> oln_concrete_type(I) internal_gradient(const abstract::non_vectorial_image<I>& input, const @@ -117,26 +154,17 @@ return internal_gradient(convert::force<oln_value_type(I)>(), input, se); } -/*=processing external_gradient - * ns: morpho, morpho::fast - * what: Morphological External Gradient. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute the arithmetic difference between and the dilatation of - * \var{input} using \var{se} as structural element, and the original image - * \var{input}. Soille, p67. - * see: morpho::beucher_gradient - * see: morpho::internal_gradient - * see: morpho::dilation - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::external_gradient(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Process a morphological external gradient. +** +** Compute the arithmetic difference between and the dilatation of +** input using se as structural element, and the original image +** input. Soille, p67. +** +** \arg c Conversion functor. +** \arg input Image to process. +** \arg se Structuring element. +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret external_gradient(const convert::abstract::conversion<C, B>& c, @@ -147,13 +175,40 @@ } -/*=processingoverload external_gradient - * ns: morpho, morpho::fast - * what: Morphological External Gradient. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) -=*/ +/*! +** \brief Process morphological external gradient. +** +** \param I Exact type of the input image. +** \param E Exact type of the structuring element. +** +** \return The external gradient of the input. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/gradient.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** save(oln::morpho::internal_gradient(im1, oln::win_c8p()), +** IMG_OUT "oln_morpho_external_gradient.pbm"); +** return 0; +** } +** \encode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_external_gradient.png +** \image latex oln_morpho_external_gradient.png +*/ template<class I, class E> oln_concrete_type(I) external_gradient(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/hit_or_miss.inc --- olena/oln/morpho/hit_or_miss.inc Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/42_hit_or_mis 1.20 600) +++ olena/oln/morpho/hit_or_miss.inc Thu, 11 Mar 2004 17:32:46 +0100 palma_g (oln/42_hit_or_mis 1.20 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2001, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2003, 2004 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 @@ -30,36 +30,54 @@ // note that results depend on the type of image data when it is not bin. // you MUST be aware of it. -/*=processing hit_or_miss - * ns: morpho, morpho::fast - * what: Hit_or_Miss Transform. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute the hit_or_miss transform of \var{input} by the composite structural - * element (\var{se1}, \var{se2}). Soille p.131. - * - * By definition \var{se1} and \var{se2} must have the same origin, and need to - * be disjoint. This algorithm has been extended to every data types - * (althought it is not increasing). Beware the result depends upon the - * image data type if it is not \code{bin}. - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * $ window2d mywin; - * $ mywin - * $ .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) - * $ .add(-2,-1).add(-2,0).add(-2,1) - * $ .add(-1,0); - * $ window2d mywin2 = - mywin; - * $ save(morpho::fast::hit_or_miss(convert::bound<int_u8>(), - * $ im, mywin, mywin2), "out.pgm"); - * exh: convert/bound.hh - * exi: object.pbm - * exo: out.pgm -=*/ +/*! +** \brief Preform a 'hit or miss' transform. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** Compute the hit_or_miss transform of input by the composite structuring +** element (se1, se2). Soille p.131.\n +** +** By definition se1 and se2 must have the same origin, and need to +** be disjoint. This algorithm has been extended to every data types +** (although it is not increasing). Beware the result depends upon the +** image data type if it is not bin. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss(oln::convert::bound<ntg::int_u8>(), im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss.png +** \image latex oln_morpho_fast_hit_or_miss.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class C, class B, class I, class E1, class E2> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret hit_or_miss(const convert::abstract::conversion<C, B>& c, @@ -81,13 +99,49 @@ erosion(level::invert(input), se2)); } -/*=processingoverload hit_or_miss - * ns: morpho, morpho::fast - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret:oln_concrete_type(I) -=*/ +/*! +** \brief Preform a 'hit or miss' transform. +** +** \param I Exact type of the input image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss(im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss_overload.png +** \image latex oln_morpho_fast_hit_or_miss_overload.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class I, class E1, class E2> oln_concrete_type(I) hit_or_miss(const abstract::non_vectorial_image<I>& input, @@ -103,37 +157,57 @@ // /////////////////////////////////// -/*=processing hit_or_miss_opening - * ns: morpho, morpho::fast - * what: Hit_or_Miss opening. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the hit_or_miss opening of \var{input} by the composite structural - * element (\var{se1}, \var{se2}). Soille p.134. - * - * By definition \var{se1} and \var{se2} must have the same origin, and need to - * be disjoint. This algorithm has been extended to every data types - * (althought it is not increasing). Beware the result depends upon the - * image data type if it is not \code{bin}. - * see: morpho::hit_or_miss - * see: morpho::hit_or_miss_closing - * see: morpho::hit_or_miss_closing_bg - * see: morpho::hit_or_miss_opening_bg - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * window2d mywin; - * mywin - * .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) - * .add(-2,-1).add(-2,0).add(-2,1) - * .add(-1,0); - * window2d mywin2 = - mywin; - * $ save(morpho::hit_or_miss_opening(im, mywin, mywin2), "out.pbm"); - * exi: object.pbm - * exo: out.pbm -=*/ +/*! +** \brief Perform an hit or miss opening. +** +** Compute the hit_or_miss opening of input by the composite structuring +** element (se1, se2). Soille p.134.\n +** +** By definition se1 and se2 must have the same origin, and need to +** be disjoint. This algorithm has been extended to every data types +** (althought it is not increasing). Beware the result depends upon the +** image data type if it is not bin. +** +** \param I Exact type of the input image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss_opening(im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss_opening.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss_opening.png +** \image latex oln_morpho_fast_hit_or_miss_opening.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class I, class E1, class E2> oln_concrete_type(I) hit_or_miss_opening(const abstract::non_vectorial_image<I>& input, @@ -145,38 +219,57 @@ return dilation(hit_or_miss(input, se1, se2), -se1); } -/*=processing hit_or_miss_opening_bg - * ns: morpho, morpho::fast - * what: Hit_or_Miss opening of background. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the hit_or_miss opening of the background of - * \var{input} by the composite structural - * element (\var{se1}, \var{se2}). Soille p.135. - * - * By definition \var{se1} and \var{se2} must have the same origin, and need to - * be disjoint. This algorithm has been extended to every data types - * (althought it is not increasing). Beware the result depends upon the - * image data type if it is not \code{bin}. - * see: morpho::hit_or_miss - * see: morpho::hit_or_miss_closing - * see: morpho::hit_or_miss_closing_bg - * see: morpho::hit_or_miss_opening - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * window2d mywin; - * mywin - * .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) - * .add(-2,-1).add(-2,0).add(-2,1) - * .add(-1,0); - * window2d mywin2 = - mywin; - * $ save(morpho::hit_or_miss_opening_bg(im, mywin, mywin2), "out.pbm"); - * exi: object.pbm - * exo: out.pbm -=*/ +/*! +** \brief Perform an hit or miss opening of background. +** +** Compute the hit_or_miss opening of the background of input by the +** composite structuring element (se1, se2). Soille p.135.\n +** +** By definition se1 and se2 must have the same origin, and need to be +** disjoint. This algorithm has been extended to every data types +** (although it is not increasing). Beware the result depends upon +** the image data type if it is not bin. +** +** \param I Exact type of the input image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss_opening_bg(im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss_opening_bg.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss_opening_bg.png +** \image latex oln_morpho_fast_hit_or_miss_opening_bg.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class I, class E1, class E2> oln_concrete_type(I) hit_or_miss_opening_bg(const abstract::non_vectorial_image<I>& input, @@ -192,39 +285,59 @@ // /////////////////////////////////// -/*=processing hit_or_miss_closing - * ns: morpho, morpho::fast - * what: Hit_or_Miss closing. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the hit_or_miss closing of \var{input} by the composite structural - * element (\var{se1}, \var{se2}). This is the dual transformation of hit-or-miss opening - * with respect to - * set complementation. Soille p.135. - * - * By definition \var{se1} and \var{se2} must have the same origin, and need to - * be disjoint. This algorithm has been extended to every data types - * (althought it is not increasing). Beware the result depends upon the - * image data type if it is not \code{bin}. - * see: morpho::hit_or_miss - * see: morpho::hit_or_miss_closing_bg - * see: morpho::hit_or_miss_opening - * see: morpho::hit_or_miss_opening_bg - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * window2d mywin; - * mywin - * .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) - * .add(-2,-1).add(-2,0).add(-2,1) - * .add(-1,0); - * window2d mywin2 = - mywin; - * $ save(morpho::hit_or_miss_closing(im, mywin, mywin2), "out.pbm"); - * exi: object.pbm - * exo: out.pbm -=*/ +/*! +** \brief Perform an hit or miss closing. +** +** Compute the hit_or_miss closing of input by the composite structuring +** element (se1, se2). This is the dual transformation of hit-or-miss opening +** with respect to +** set complementation. Soille p.135.\n +** +** By definition se1 and se2 must have the same origin, and need to +** be disjoint. This algorithm has been extended to every data types +** (althought it is not increasing). Beware the result depends upon the +** image data type if it is not bin. +** +** \param I Exact type of the input image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss_closing(im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss_closing.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss_closing.png +** \image latex oln_morpho_fast_hit_or_miss_closing.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class I, class E1, class E2> oln_concrete_type(I) hit_or_miss_closing(const abstract::non_vectorial_image<I>& input, @@ -237,39 +350,59 @@ se1, se2)); } -/*=processing hit_or_miss_closing_bg - * ns: morpho, morpho::fast - * what: Hit_or_Miss closing of background. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se1, IN, structural element - * arg: const abstract::struct_elt<E>&, se2, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the hit_or_miss closing of the background of \var{input} by the composite structural - * element (\var{se1}, \var{se2}). This is the dual transformation of hit-or-miss opening - * with respect to - * set complementation. Soille p.135. - * - * By definition \var{se1} and \var{se2} must have the same origin, and need to - * be disjoint. This algorithm has been extended to every data types - * (althought it is not increasing). Beware the result depends upon the - * image data type if it is not \code{bin}. - * see: morpho::hit_or_miss - * see: morpho::hit_or_miss_closing - * see: morpho::hit_or_miss_opening - * see: morpho::hit_or_miss_opening_bg - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * window2d mywin; - * mywin - * .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) - * .add(-2,-1).add(-2,0).add(-2,1) - * .add(-1,0); - * window2d mywin2 = - mywin; - * $ save(morpho::hit_or_miss_closing_bg(im, mywin, mywin2), "out.pbm"); - * exi: object.pbm - * exo: out.pbm -=*/ +/*! +** \brief Perform an hit or miss closing of background. +** +** Compute the hit_or_miss closing of the background of input by the +** composite structuring element (se1, se2). This is the dual +** transformation of hit-or-miss opening with respect to set +** complementation. Soille p.135.\n +** +** By definition se1 and se2 must have the same origin, and need to +** be disjoint. This algorithm has been extended to every data types +** (althought it is not increasing). Beware the result depends upon the +** image data type if it is not bin. +** +** \param I Exact type of the input image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/hit_or_miss.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im1(oln::load(IMG_IN "object.pbm")); +** +** oln::window2d mywin; +** mywin +** .add(-3,-2).add(-3,-1).add(-3,0).add(-3,1).add(-3,2) +** .add(-2,-1).add(-2,0).add(-2,1) +** .add(-1,0); +** oln::window2d mywin2 = - mywin; +** +** oln::save(oln::morpho::hit_or_miss_closing_bg(im1, mywin, mywin2), +** IMG_OUT "oln_morpho_fast_hit_or_miss_closing_bg.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_hit_or_miss_closing_bg.png +** \image latex oln_morpho_fast_hit_or_miss_closing_bg.png +** +** \todo FIXME: Histogram problems (fast version do not work). +*/ template<class I, class E1, class E2> oln_concrete_type(I) hit_or_miss_closing_bg(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/laplacian.inc --- olena/oln/morpho/laplacian.inc Thu, 07 Aug 2003 02:08:21 +0200 david (oln/41_laplacian. 1.13 600) +++ olena/oln/morpho/laplacian.inc Fri, 12 Mar 2004 11:23:14 +0100 palma_g (oln/41_laplacian. 1.13 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2001 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2004 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 @@ -26,25 +26,40 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*=processing laplacian - * ns: morpho, morpho::fast - * what: Laplacian. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute the laplacian of \var{input} using \var{se} - * as structural element. - * see: morpho::dilation - * see: morpho::erosion - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::laplacian(convert::bound<int_u8>(), im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm - * exh: convert/bound.hh -=*/ +/*! +** \brief Compute the laplacian of an image. +** +** Compute the laplacian of input using se as structural element. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/laplacian.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_u8>(), +** im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_laplacian.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_laplacian.png +** \image latex oln_morpho_fast_laplacian.png +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret laplacian(const convert::abstract::conversion<C, B>& c, @@ -56,13 +71,39 @@ arith::minus(input, erosion(input, se))); } -/*=processingoverload laplacian - * ns: morpho, morpho::fast - * what: Laplacian. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I,oln_value_type(I)::slarger_t>::ret -=*/ +/*! +** \brief Compute the laplacian of an image. +** +** Compute the laplacian of input using se as structural element. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/laplacian.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_u8>(), im1, oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_laplacian_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_laplacian_overload.png +** \image latex oln_morpho_fast_laplacian_overload.png +** +** \todo FIXME: Call the good laplacian, and correct slarger_t type. +*/ template<class I, class E> typename mute<I,oln_value_type(I)::slarger_t>::ret laplacian(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/minmax.hh --- olena/oln/morpho/minmax.hh Thu, 31 Jul 2003 18:08:39 +0200 burrus_n (oln/b/0_minmax.hh 1.5 600) +++ olena/oln/morpho/minmax.hh Fri, 12 Mar 2004 13:19:34 +0100 palma_g (oln/b/0_minmax.hh 1.5 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -34,20 +34,20 @@ namespace oln { namespace morpho { - /* - Before olena v0.6, bin type was represented by "true" and - "false", so it did not make sense to implement a min and max for - it. However, morphological operatators defined on binary image - usually needs min and max operators, this is why it was previouly - implemented here. - - But since v0.6 and higher, bin type is represented by '0' and - '1', so it has min and max operators. Thus arith::min and - arith::max should be used instead of obsolete these morpho::min - and morpho::max. - - These operators are kept here for compatibility with older - versions. + /*! + ** Before olena v0.6, bin type was represented by "true" and + ** "false", so it did not make sense to implement a min and max for + ** it. However, morphological operatators defined on binary image + ** usually needs min and max operators, this is why it was previouly + ** implemented here.\n + ** + ** But since v0.6 and higher, bin type is represented by '0' and + ** '1', so it has min and max operators. Thus arith::min and + ** arith::max should be used instead of obsolete these morpho::min + ** and morpho::max.\n + ** + ** These operators are kept here for compatibility with older + ** versions. */ using arith::min; Index: olena/oln/morpho/opening.inc --- olena/oln/morpho/opening.inc Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/40_opening.in 1.13 600) +++ olena/oln/morpho/opening.inc Thu, 11 Mar 2004 19:29:17 +0100 palma_g (oln/40_opening.in 1.13 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2001, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2003, 2004 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 @@ -26,24 +26,43 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*=processing opening - * ns: morpho, morpho::fast - * what: Morphological opening. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) - * doc: - * Compute the morphological opening of \var{input} using \var{se} - * as structural element. - * see: morpho::erosion - * see: morpho::dilation - * see: morpho::closing - * ex: - * $ image2d<ntg::bin> im = load("object.pbm"); - * $ save(morpho::opening(im, win_c8p()), "out.pbm"); - * exi: object.pbm - * exo: out.pbm -=*/ +/*! +** \brief Perform a morphological opening. +** +** Compute the morphological opening of input using se as +** structuring element. +** +** \param I Exact type of the input image. +** \param E Exact type of the structuring element. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/opening.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::bin> im_type; +** +** im_type im(oln::load(IMG_IN "object.pbm")); +** +** oln::save(oln::morpho::opening(im, oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_opening.pbm"); +** return 0; +** } +** \endcode +** +** \image html object.png +** \image latex object.png +** => +** \image html oln_morpho_fast_opening.png +** \image latex oln_morpho_fast_opening.png +** +** \todo FIXME: Histogram problems (fast version do not compile). +*/ template<class I, class E> oln_concrete_type(I) opening(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/reconstruction.hh --- olena/oln/morpho/reconstruction.hh Wed, 08 Oct 2003 23:36:51 +0200 burrus_n (oln/35_reconstruc 1.13.1.11 600) +++ olena/oln/morpho/reconstruction.hh Thu, 11 Mar 2004 21:01:45 +0100 palma_g (oln/35_reconstruc 1.13.1.11 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -43,27 +43,54 @@ namespace oln { namespace morpho { namespace sure { - /*=processing sure_geodesic_reconstruction_dilation - * ns: morpho - * what: Geodesic reconstruction by dilation. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by dilation of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. This is the simplest algorithm: - * iteration is performed until stability. - * see: morpho::simple_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::sure_geodesic_reconstruction_dilation(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Perform a geodesic reconstruction dilation. + ** + ** Compute the reconstruction by dilation of marker with respect + ** to the mask mask image using se as structuring + ** element. Soille p.160. This is the simplest algorithm: + ** iteration is performed until stability. + ** + ** \warning This version is slow, since it is a sure one. + ** + ** \pre Mask must be greater or equal than marker. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::sure::geodesic_reconstruction_dilation(im2, + ** im1, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sure_geodesic_reconstruction_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sure_geodesic_reconstruction_dilation.png + ** \image latex oln_morpho_sure_geodesic_reconstruction_dilation.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_dilation(const abstract::non_vectorial_image<I1> & marker, @@ -88,30 +115,54 @@ namespace sequential { - /*=processing sequential_geodesic_reconstruction_dilation - * ns: morpho - * what: Geodesic reconstruction by dilation. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by dilation of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. The algorithm used is the - * one defined as sequential - * in Vincent(1993), Morphological grayscale reconstruction in - * image analysis: applications and efficient algorithms, itip, 2(2), - * 176--201. - * see: morpho::simple_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::sequential_geodesic_reconstruction_dilation(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Perform a geodesic reconstruction dilation. + ** + ** Compute the reconstruction by dilation of marker with respect + ** to the mask image using se as structuring element. Soille + ** p.160. The algorithm used is the one defined as sequential in + ** Vincent(1993), Morphological grayscale reconstruction in + ** image analysis: applications and efficient algorithms, itip, + ** 2(2), 176--201. + ** + ** \pre Mask must be greater or equal than marker. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::sequential::geodesic_reconstruction_dilation(im2, + ** im1, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sequential_geodesic_reconstruction_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sequential_geodesic_reconstruction_dilation.png + ** \image latex oln_morpho_sequential_geodesic_reconstruction_dilation.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_dilation(const abstract::non_vectorial_image<I1> & marker, @@ -152,6 +203,14 @@ namespace internal { + /*! + ** \brief Check if it exists initialization for dilation. + ** + ** \arg p Point to consider. + ** \arg marker Image to work on. + ** \arg mask Image used as mask. + ** \arg Ng Neighborhood to use. + */ template<class P, class I1, class I2, class E> inline static bool exist_init_dilation(const abstract::point<P>& p, @@ -172,30 +231,54 @@ } //internal - /*=processing hybrid_geodesic_reconstruction_dilation - * ns: morpho - * what: Geodesic reconstruction by dilation. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by dilation of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. The algorithm used is the - * one defined as hybrid - * in Vincent(1993), Morphological grayscale reconstruction in - * image analysis: applications and efficient algorithms, itip, 2(2), - * 176--201. - * see: morpho::simple_geodesic_dilation - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::hybrid_geodesic_reconstruction_dilation(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + /*! + ** \brief Perform a geodesic reconstruction dilation. + ** + ** Compute the reconstruction by dilation of marker with + ** respect to the mask image using se as structuring + ** element. Soille p.160. The algorithm used is the one defined + ** as hybrid in Vincent(1993), Morphological grayscale + ** reconstruction in image analysis: applications and efficient + ** algorithms, itip, 2(2), 176--201. + ** + ** \pre Mask must be greater or equal than marker. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic dilation. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::hybrid::geodesic_reconstruction_dilation(im2, + ** im1, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_hybrid_geodesic_reconstruction_dilation.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_hybrid_geodesic_reconstruction_dilation.png + ** \image latex oln_morpho_hybrid_geodesic_reconstruction_dilation.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_dilation(const abstract::non_vectorial_image<I1> & marker, @@ -252,27 +335,55 @@ //GEODESIC RECONSTRUCTION EROSION namespace sure { - /*=processing sure_geodesic_reconstruction_erosion - * ns: morpho - * what: Geodesic reconstruction by erosion. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by erosion of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. This is the simplest algorithm : - * iteration is performed until stability. - * see: morpho::simple_geodesic_erosion - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::sure_geodesic_reconstruction_erosion(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + + /*! + ** \brief Perform a geodesic reconstruction erosion. + ** + ** Compute the reconstruction by erosion of marker with respect + ** to the mask image using se as structuring element. Soille + ** p.160. This is the simplest algorithm: iteration is performed + ** until stability. + ** + ** \warning This version is slow, since it is a sure one. + ** + ** \pre Marker must be greater or equal than mask. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic erosion. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::sure::geodesic_reconstruction_erosion(im1, + ** im2, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sure_geodesic_reconstruction_erosion.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sure_geodesic_reconstruction_erosion.png + ** \image latex oln_morpho_sure_geodesic_reconstruction_erosion.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_erosion(const abstract::non_vectorial_image<I1> & marker, @@ -297,30 +408,55 @@ namespace sequential { - /*=processing sequential_geodesic_reconstruction_erosion - * ns: morpho - * what: Geodesic reconstruction by erosion. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by erosion of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. The algorithm used is the - * one defined as sequential - * in Vincent(1993), Morphological grayscale reconstruction in - * image analysis: applications and efficient algorithms, itip, 2(2), - * 176--201. - * see: morpho::simple_geodesic_erosion - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::sequential_geodesic_reconstruction_erosion(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ + + /*! + ** \brief Perform a geodesic reconstruction erosion. + ** + ** Compute the reconstruction by erosion of marker with respect + ** to the mask image using se as structuring element. Soille + ** p.160. The algorithm used is the one defined as sequential + ** in Vincent(1993), Morphological grayscale reconstruction in + ** image analysis: applications and efficient algorithms, itip, + ** 2(2), 176--201. + ** + ** \pre Marker must be greater or equal than mask. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic erosion. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::sequential::geodesic_reconstruction_erosion(im1, + ** im2, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_sequential_geodesic_reconstruction_erosion.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_sequential_geodesic_reconstruction_erosion.png + ** \image latex oln_morpho_sequential_geodesic_reconstruction_erosion.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_erosion(const abstract::non_vectorial_image<I1>& marker, @@ -358,6 +494,14 @@ namespace hybrid { namespace internal { + /*! + ** \brief Check if it exists initialization for erosion. + ** + ** \arg p Point to consider. + ** \arg marker Image to work on. + ** \arg mask Image used as mask. + ** \arg Ng Neighborhood to use. + */ template<class P, class I1, class I2, class E> inline static bool exist_init_erosion(const abstract::point<P>& p, @@ -377,31 +521,54 @@ } } // internal - /*=processing hybrid_geodesic_reconstruction_erosion - * ns: morpho - * what: Geodesic reconstruction by erosion. - * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image - * arg: const abstract::non_vectorial_image<I2>&, mask, IN, mask image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I1) - * doc: - * Compute the reconstruction by erosion of \var{marker} with respect - * to the mask \var{mask} image using \var{se} - * as structural element. Soille p.160. The algorithm used is the - * one defined as hybrid - * in Vincent(1993), Morphological grayscale reconstruction in - * image analysis: applications and efficient algorithms, itip, 2(2), - * 176--201. - * see: morpho::simple_geodesic_erosion - * ex: - * $ image2d<int_u8> light = load("light.pgm"); - * $ image2d<int_u8> dark = load("dark.pgm"); - * $ save(morpho::sequential_geodesic_reconstruction_erosion(light, dark, win_c8p()), "out.pgm"); - * exi: light.pgm dark.pgm - * exo: out.pgm - * wontcompile: fixme - =*/ - + /*! + ** \brief Perform a geodesic reconstruction erosion. + ** + ** Compute the reconstruction by erosion of marker with respect + ** to the mask mask image using se as structuring + ** element. Soille p.160. The algorithm used is the one defined + ** as hybrid in Vincent(1993), Morphological grayscale + ** reconstruction in image analysis: applications and efficient + ** algorithms, itip, 2(2), 176--201. + ** + ** \pre Marker must be greater or equal than mask. + ** + ** \param I1 Exact type of image marker. + ** \param I2 Exact type of image mask. + ** \param N Exact type of neighborhood. + ** + ** \arg marker Image to work on. + ** \arg mask Image used for geodesic erosion. + ** \arg Ng Neighborhood to use. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/opening.hh> + ** #include <oln/morpho/reconstruction.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena128.pgm")); + ** im_type im2(oln::morpho::opening(im1, oln::win_c4p())); + ** + ** oln::save(oln::morpho::hybrid::geodesic_reconstruction_erosion(im1, + ** im2, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_hybrid_geodesic_reconstruction_erosion.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena128.png + ** \image latex lena128.png + ** => + ** \image html oln_morpho_hybrid_geodesic_reconstruction_erosion.png + ** \image latex oln_morpho_hybrid_geodesic_reconstruction_erosion.png + ** + */ template<class I1, class I2, class N> oln_concrete_type(I1) geodesic_reconstruction_erosion(const abstract::non_vectorial_image<I1> & marker, Index: olena/oln/morpho/splitse.hh --- olena/oln/morpho/splitse.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/34_splitse.hh 1.7 600) +++ olena/oln/morpho/splitse.hh Thu, 11 Mar 2004 21:38:23 +0100 palma_g (oln/34_splitse.hh 1.7 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2004 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 @@ -33,6 +33,18 @@ namespace oln { namespace morpho { + /*! + ** \brief Get a sub part of a structuring element. + ** + ** \param E Exact type of the structuring element. + ** + ** \arg se The structuring element. + ** + ** A point p take part of the new structuring element if it exists + ** a i that belongs to [[0..dim-1]] like p(i) < 0 and for all j + ** that belongs to [[0..i-1]] p(j) = 0. + ** + */ template<class E> mlc_exact_type(E) get_plus_se_only(const abstract::struct_elt<E>& se) @@ -54,6 +66,19 @@ return out; } + /*! + ** \brief Get a sub part of a structuring element. + ** + ** \param E Exact type of the structuring element. + ** + ** \arg se The structuring element. + ** + ** A point p take part of the new structuring element if it exists + ** a i that belongs to [[0..dim-1]] like p(i) < 0 and for all j + ** that belongs to [[0..i-1]] p(j) = 0 or if for all i that + ** belongs to [[0..dim-1]] p(i) = 0. + ** + */ template<class E> mlc_exact_type(E) get_plus_se_p(const abstract::struct_elt<E>& se) @@ -78,6 +103,18 @@ return out; } + /*! + ** \brief Get a sub part of a structuring element. + ** + ** \param E Exact type of the structuring element. + ** + ** \arg se The structuring element. + ** + ** A point p take part of the new structuring element if it exists + ** a i that belongs to [[0..dim-1]] like p(i) > 0 and for all j + ** that belongs to [[0..i-1]] p(j) = 0. + ** + */ template<class E> mlc_exact_type(E) get_minus_se_only(const abstract::struct_elt<E>& se) @@ -99,6 +136,19 @@ return out; } + /*! + ** \brief Get a sub part of a structuring element. + ** + ** \param E Exact type of the structuring element. + ** + ** \arg se The structuring element. + ** + ** A point p take part of the new structuring element if it exists + ** a i that belongs to [[0..dim-1]] like p(i) > 0 and for all j + ** that belongs to [[0..i-1]] p(j) = 0 or if for all i that + ** belongs to [[0..dim-1]] p(i) = 0. + ** + */ template<class E> mlc_exact_type(E) get_minus_se_p(const abstract::struct_elt<E>& se) Index: olena/oln/morpho/stat.hh --- olena/oln/morpho/stat.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/50_stat.hh 1.8.1.11 600) +++ olena/oln/morpho/stat.hh Fri, 12 Mar 2004 11:04:47 +0100 palma_g (oln/50_stat.hh 1.8.1.11 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -37,12 +37,29 @@ namespace internal { - /* We need to use this inner definition in order to specialize - max and min on binary images. */ - + /*! + ** \brief Min and Max on a structuring element. + ** + ** We need to use this inner definition in order to specialize + ** max and min on binary images. + ** + ** \param I Image exact type. + ** \param E Structuring element type. + ** \param V Associated value type. + */ template <class I, class E, class V =oln_value_type(I)> struct stat_ { + /*! + ** \brief Maximum of a structuring element. + ** + ** Look for the maximum in the structuring element se disposed + ** on the image input, at the point p. + ** + ** \arg input Input image. + ** \arg p Point of the image to move the structuring element on. + ** \arg se The structuring element to use. + */ static V max(const I& input, const oln_point_type(I)& p, const E& se) { @@ -57,6 +74,16 @@ return val; } + /*! + ** \brief Minimum of a structuring element. + ** + ** Look for the minimum in the structuring element se disposed + ** on the image input, at the point p. + ** + ** \arg input Input image. + ** \arg p Point of the image to move the structuring element on. + ** \arg se The structuring element to use. + */ static V min(const I& input, const oln_point_type(I)& p, const E& se) { @@ -103,6 +130,19 @@ } // internal + /*! + ** \brief Maximum of a structuring element. + ** + ** Look for the maximum in the structuring element se disposed + ** on the image input, at the point p. + ** + ** \param I Image exact type. + ** \param E Structuring element type. + ** + ** \arg input Input image. + ** \arg p Point of the image to move the structuring element on. + ** \arg se The structuring element to use. + */ template<class I, class E> oln_value_type(I) max(const abstract::non_vectorial_image<I>& input, @@ -113,6 +153,18 @@ return internal::stat_<I, E>::max(input.exact(), p, se.exact()); } + /*! ** \brief Minimum of a structuring element. + ** + ** Look for the minimum in the structuring element se disposed + ** on the image input, at the point p. + ** + ** \param I Image exact type. + ** \param E Structuring element type. + ** + ** \arg input Input image. + ** \arg p Point of the image to move the structuring element on. + ** \arg se The structuring element to use. + */ template<class I, class E> oln_value_type(I) min(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/thickening.inc --- olena/oln/morpho/thickening.inc Thu, 07 Aug 2003 02:08:21 +0200 david (oln/e/28_thickening 1.10 600) +++ olena/oln/morpho/thickening.inc Fri, 12 Mar 2004 11:12:52 +0100 palma_g (oln/e/28_thickening 1.10 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2002 EPITA Research and Development Laboratory +// Copyright (C) 2002, 2004 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 @@ -26,7 +26,43 @@ // reasons why the executable file might be covered by the GNU General // Public License. - +/*! +** \brief Thicken an image. +** +** \param I Exact type of the image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/thickening.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::thickening(im1, +** oln::win_c8p(), +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_thickening.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_thickening.png +** \image latex oln_morpho_fast_thickening.png +** +*/ template<class I, class E1, class E2> oln_concrete_type(I) thickening(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/thinning.inc --- olena/oln/morpho/thinning.inc Thu, 07 Aug 2003 02:08:21 +0200 david (oln/e/26_thinning.i 1.11 600) +++ olena/oln/morpho/thinning.inc Fri, 12 Mar 2004 11:15:59 +0100 palma_g (oln/e/26_thinning.i 1.11 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2002, 2003, 2004 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 @@ -26,7 +26,43 @@ // reasons why the executable file might be covered by the GNU General // Public License. - +/*! +** \brief Thin an image. +** +** \param I Exact type of the image. +** \param E1 Exact type of the first structuring element. +** \param E2 Exact type of the second structuring element. +** +** \arg input Image to process. +** \arg se1 First structuring element. +** \arg se2 Second structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/thinning.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::thinning(im1, +** oln::win_c8p(), +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_thinning.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_thinning.png +** \image latex oln_morpho_fast_thinning.png +** +*/ template<class I, class E1, class E2> oln_concrete_type(I) thinning(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/top_hat.inc --- olena/oln/morpho/top_hat.inc Thu, 07 Aug 2003 02:08:21 +0200 david (oln/39_top_hat.in 1.13 600) +++ olena/oln/morpho/top_hat.inc Fri, 12 Mar 2004 12:08:33 +0100 palma_g (oln/39_top_hat.in 1.13 640) @@ -1,5 +1,5 @@ // -*- c++ -*- -// Copyright (C) 2002 EPITA Research and Development Laboratory +// Copyright (C) 2002, 2004 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 @@ -27,24 +27,41 @@ // Public License. - -/*=processing white_top_hat - * ns: morpho, morpho::fast - * what: White top hat. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute white top hat of \var{input} using \var{se} - * as structural element. Soille p.105. - * see: morpho::opening - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::white_top_hat(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Compute the white top hat of an image. +** +** Compute white top hat of input using se as structuring +** element. Soille p.105. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::white_top_hat(oln::convert::bound<ntg::int_u8>(), +** im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_white_top_hat.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_white_top_hat.png +** \image latex oln_morpho_fast_white_top_hat.png +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret white_top_hat(const convert::abstract::conversion<C, B>& c, @@ -54,13 +71,39 @@ return arith::minus(c, input, opening(input, se)); } -/*=processingoverload white_top_hat - * ns: morpho, morpho::fast - * what: White top hat. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret:oln_concrete_type(I) -=*/ +/*! +** \brief Compute the white top hat of an image. +** +** \param I Exact type of the image. +** \param E Exact type of the structuring element. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::white_top_hat(im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_white_top_hat_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_white_top_hat_overload.png +** \image latex oln_morpho_fast_white_top_hat_overload.png +*/ template<class I, class E> oln_concrete_type(I) white_top_hat(const abstract::non_vectorial_image<I>& input, @@ -72,23 +115,41 @@ // black top-hat -/*=processing black_top_hat - * ns: morpho, morpho::fast - * what: Black top hat. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute black top hat of \var{input} using \var{se} - * as structural element. Soille p.105. - * see: morpho::closing - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::black_top_hat(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Compute the black top hat of an image. +** +** Compute black top hat of input using se as structuring +** element. Soille p.105. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::black_top_hat(oln::convert::bound<ntg::int_u8>(), +** im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_black_top_hat.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_black_top_hat.png +** \image latex oln_morpho_fast_black_top_hat.png +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret black_top_hat(const convert::abstract::conversion<C, B>& c, @@ -99,13 +160,39 @@ } -/*=processingoverload balck_top_hat - * ns: morpho, morpho::fast - * what: Black top hat. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret -=*/ +/*! +** \brief Compute the black top hat of an image. +** +** \param I Exact type of the image. +** \param E Exact type of the structuring element. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::black_top_hat(im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_black_top_hat_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_black_top_hat_overload.png +** \image latex oln_morpho_fast_black_top_hat_overload.png +*/ template<class I, class E> oln_concrete_type(I) black_top_hat(const abstract::non_vectorial_image<I>& input, @@ -120,25 +207,42 @@ // = (input - opening) + (closing - input) // = closing - opening -/*=processing self_complementary_top_hat - * ns: morpho, morpho::fast - * what: Self complementary top hat. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Compute self complementary top hat of \var{input} using \var{se} - * as structural element. Soille p.106. - * see: morpho::closing - * see: morpho::opening - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::self_complementary_top_hat(im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm -=*/ +/*! +** \brief Compute the self complementary top hat of an image. +** +** Compute self complementary top hat of input using se as structuring +** element. Soille p.106. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::self_complementary_top_hat(oln::convert::bound<ntg::int_u8>(), +** im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_self_complementary_top_hat.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_self_complementary_top_hat.png +** \image latex oln_morpho_fast_self_complementary_top_hat.png +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret self_complementary_top_hat(const convert::abstract::conversion<C, B>& c, @@ -148,13 +252,38 @@ return arith::minus(c, closing(input, se), opening(input, se)); } -/*=processingoverload self_complementary_top_hat - * ns: morpho, morpho::fast - * what: Self complementary top hat. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret -=*/ +/*! +** \brief Compute the self complementary top hat of an image. +** +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::self_complementary_top_hat(im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_self_complementary_top_hat_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_self_complementary_top_hat_overload.png +** \image latex oln_morpho_fast_self_complementary_top_hat_overload.png +*/ template<class I, class E> oln_concrete_type(I) self_complementary_top_hat(const abstract::non_vectorial_image<I>& input, @@ -166,28 +295,43 @@ // top-hat contrast operator -/*=processing top_hat_contrast_op - * ns: morpho, morpho::fast - * what: Top hat contrastor operator. - * arg: const convert::abstract::conversion<C, B>&, c, IN, conversion object - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret - * doc: - * Enhance contrast \var{input} by adding the white top hat, then - * substracting the black top hat to \var{input}. Top hats are computed using - * \var{se} as structural element. Soille p.109. - * see: morpho::white_top_hat - * see: morpho::black_top_hat - * ex: - * $ image2d<int_u8> im = load("lena256.pgm"); - * $ save(morpho::top_hat_contrast_op(convert::bound<int_u8>(), - * im, win_c8p()), "out.pgm"); - * exi: lena256.pgm - * exo: out.pgm - * exh: convert/bound.hh -=*/ +/*! +** \brief Top hat contrast operator. +** +** Enhance contrast input by adding the white top hat, then +** subtracting the black top hat to input. Top hats are computed using +** se as structuring element. Soille p.109. +** +** \arg c Conversion object. +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** oln::save(oln::morpho::fast::top_hat_contrast_op(oln::convert::bound<ntg::int_u8>(), +** im1, +** oln::win_c8p()), +** IMG_OUT "oln_morpho_fast_top_hat_contrast_op.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_top_hat_contrast_op.png +** \image latex oln_morpho_fast_top_hat_contrast_op.png +*/ template<class C, class B, class I, class E> typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret top_hat_contrast_op(const convert::abstract::conversion<C, B>& c, @@ -200,13 +344,44 @@ black_top_hat(input, se))); } -/*=processingoverload top_hat_contrast_op - * ns: morpho, morpho::fast - * what: Top hat contrastor operator. - * arg: const abstract::non_vectorial_image<I>&, input, IN, input image - * arg: const abstract::struct_elt<E>&, se, IN, structural element - * ret: typename mute<I, typename convoutput<C, B,oln_value_type(I)>::ret>::ret -=*/ + +/*! +** \brief Top hat contrast operator. +** +** Enhance contrast input by adding the white top hat, then +** subtracting the black top hat to input. Top hats are computed using +** se as structuring element. Soille p.109. +** +** \arg input Image to process. +** \arg se Structuring element. +** +** \code +** #include <oln/basics2d.hh> +** #include <oln/morpho/top_hat.hh> +** #include <oln/level/compare.hh> +** #include <ntg/all.hh> +** int main() +** { +** typedef oln::image2d<ntg::int_u8> im_type; +** +** im_type im1(oln::load(IMG_IN "lena256.pgm")); +** +** //oln::save(oln::morpho::fast::top_hat_contrast_op(im1, +** // oln::win_c8p()), +** // IMG_OUT "oln_morpho_fast_top_hat_contrast_op_overload.pbm"); +** oln::save(im1, IMG_OUT "oln_morpho_fast_top_hat_contrast_op_overload.pbm"); +** return 0; +** } +** \endcode +** +** \image html lena256.png +** \image latex lena256.png +** => +** \image html oln_morpho_fast_top_hat_contrast_op_overload.png +** \image latex oln_morpho_fast_top_hat_contrast_op_overload.png +** +** \todo FIXME: Seems not to work with convert::force converter. +*/ template<class I, class E> oln_concrete_type(I) top_hat_contrast_op(const abstract::non_vectorial_image<I>& input, Index: olena/oln/morpho/watershed.hh --- olena/oln/morpho/watershed.hh Sat, 27 Sep 2003 18:30:39 +0200 burrus_n (oln/48_watershed. 1.11 600) +++ olena/oln/morpho/watershed.hh Fri, 12 Mar 2004 12:55:40 +0100 palma_g (oln/48_watershed. 1.11 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -34,95 +34,157 @@ namespace morpho { - /*=processing watershed_seg - * what: Segmented Watershed. - * ns: morpho - * tpl: class, DestValue, type of output labels - * arg: const abstract::non_vectorial_image<I>&, im, IN, image of levels - * arg: const abstract::neighborhood<N>&, ng, IN, neighborhood to consider - * ret: typename mute<I, DestValue>::ret - * doc: - * Compute the segmented watershed for image \var{im} using - * neighborhood \var{ng}. - * - * \code{watershed_seg} creates an ouput image whose values have - * type \var{DestValue} (which should be discrete). In this output - * image, \code{DestValue::max()} indicates a watershed, and all - * basins are labeled using values from \code{DestValue::min()} to - * \code{DestValue::max() - 4} (the remaining values are used internally - * by the algorithm). - * - * When there are more basins than \code{DestValue} can hold, - * wrapping occurs (i.e., the same label is used for several - * basin). - * ref: - * This is based on the original algorithm - * presented by Vincent and Soille. (FIXME: ref?) - =*/ + /*! + ** \brief Segmented watershed. + ** + ** Compute the segmented watershed for image im using + ** neighborhood ng.\n + ** + ** watershed_seg creates an ouput image whose values have type + ** DestValue (which should be discrete). In this output image, + ** DestValue::max() indicates a watershed, and all basins are + ** labeled using values from DestValue::min() to + ** DestValue::max() - 4 (the remaining values are used + ** internally by the algorithm).\n + ** + ** When there are more basins than DestValue can hold, wrapping + ** occurs (i.e., the same label is used for several basin). + ** + ** \ref This is based on the original algorithm presented by + ** Vincent and Soille. (FIXME: ref?) + ** + ** \param DestValue Type of the data in output image. + ** \param I Exact type of the image. + ** \param N Exact type of the neighborhood. + ** + ** \arg im_i Image of levels. + ** \arg Ng Neighborhood to consider. + ** + ** \pre DestValue should be large enough. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/watershed.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena256.pgm")); + ** + ** oln::save(oln::morpho::watershed_seg<ntg::int_u16>(im1, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_watershed_seg.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena256.png + ** \image latex lena256.png + ** => + ** \image html oln_morpho_watershed_seg.png + ** \image latex oln_morpho_watershed_seg.png + ** + ** \todo Find a more pertinent example. + */ template<class DestValue, class I, class N> typename mute<I, DestValue>::ret watershed_seg(const abstract::non_vectorial_image<I>& im_i, const abstract::neighborhood<N>& Ng); - /*=processing watershed_con - * what: Connected Watershed. - * ns: morpho - * tpl: class, DestValue, type of output labels - * arg: const abstract::non_vectorial_image<I>&, im, IN, image of levels - * arg: const abstract::neighborhood<N>&, ng, IN, neighborhood to consider - * ret: typename mute<I, DestValue>::ret - * doc: - * Compute the connected watershed for image \var{im} using - * neighborhood \var{ng}. - * - * \code{watershed_con} creates an ouput image whose values have - * type \var{DestValue} (which should be discrete). In this output - * all basins are labeled using values from \code{DestValue::min()} to - * \code{DestValue::max() - 4} (the remaining values are used internally - * by the algorithm). - * - * When there are more basins than \code{DestValue} can hold, wrapping - * occurs (i.e., the same label is used for several basin). This is - * potentially harmful, because if two connected basins are labeled - * with the same value they will appear as one basin. - * ref: - * This is based on the original algorithm - * presented by Vincent and Soille, but modified to not output - * watersheds. - =*/ + + /*! + ** \brief Connected watershed. + ** + ** Compute the connected watershed for image im using + ** neighborhood ng.\n + ** + ** watershed_con creates an ouput image whose values have + ** type DestValue (which should be discrete). In this output + ** all basins are labeled using values from DestValue::min() to + ** DestValue::max() - 4 (the remaining values are used internally + ** by the algorithm).\n + ** + ** When there are more basins than DestValue can hold, wrapping + ** occurs (i.e., the same label is used for several basin). This is + ** potentially harmful, because if two connected basins are labeled + ** with the same value they will appear as one basin.\n + ** + ** \ref This is based on the original algorithm + ** presented by Vincent and Soille, but modified to not output + ** watersheds. + ** + ** \param DestValue Type of the data in output image. + ** \param I Exact type of the image. + ** \param N Exact type of the neighborhood. + ** + ** \arg input Image of levels. + ** \arg Ng Neighborhood to consider. + ** + ** \pre DestValue should be large enough. + ** + ** \code + ** #include <oln/basics2d.hh> + ** #include <oln/morpho/watershed.hh> + ** #include <oln/level/compare.hh> + ** #include <ntg/all.hh> + ** int main() + ** { + ** typedef oln::image2d<ntg::int_u8> im_type; + ** + ** im_type im1(oln::load(IMG_IN "lena256.pgm")); + ** + ** oln::save(oln::morpho::watershed_con<ntg::int_u16>(im1, + ** oln::neighb_c4()), + ** IMG_OUT "oln_morpho_watershed_con.pbm"); + ** return 0; + ** } + ** \endcode + ** + ** \image html lena256.png + ** \image latex lena256.png + ** => + ** \image html oln_morpho_watershed_con.png + ** \image latex oln_morpho_watershed_con.png + ** + ** \todo Find a more pertinent example. + */ template<class DestValue, class I, class N> typename mute<I, DestValue>::ret watershed_con(const abstract::non_vectorial_image<I>& im_i, const abstract::neighborhood<N>& Ng); - /*=processing watershed_seg_or - * what: Segmented Watershed with user-supplied starting points. - * ns: morpho - * arg: const abstract::non_vectorial_image<I1>&, levels, IN, image of levels - * arg: abstract::non_vectorial_image<I2>&, markers, INOUT, image of markers - * arg: const abstract::neighborhood<N>&, ng, IN, neighborhood to consider - * ret:oln_concrete_type(I2)& - * doc: - * Compute a segmented watershed for image \var{levels} using - * neighborhood \var{ng}, and \var{markers} as starting point for - * the flooding algorithm. - * - * \var{markers} is an image of the same size as \var{levels} - * and containing discrete values indicating label associated to - * each basin. On input, fill \var{markers} with - * \code{oln_value_type(I2)::min()} (this is the \emph{unknown} label) - * and mark the starting points or regions - * (usually these are minima in \var{levels}) using a value - * between \code{oln_value_type(I2)::min()+1} and \code{oln_value_type(I2)::max()-1}. - * - * \code{watershed_seg_or} will flood \var{levels} from these - * non-\emph{unknown} starting points, labeling basins using - * the value you assigned to them, and markining watershed lines - * with \code{oln_value_type(I2)::max()}. \var{markers} should not contains - * any \code{oln_value_type(I2)::min()} value on output. - * ref: - * This is based on the original algorithm - * presented by D'Ornellas et al. (FIXME: ref?) - =*/ + /*! + ** \brief Segmented watershed with user-supplied starting points. + ** + ** Compute a segmented watershed for image levels using + ** neighborhood ng, and markers as starting point for the flooding + ** algorithm.\n + ** + ** markers is an image of the same size as levels and containing + ** discrete values indicating label associated to each basin. On + ** input, fill markers with oln_value_type(I2)::min() (this is the + ** unknown label) and mark the starting points or regions (usually + ** these are minima in levels) using a value between + ** oln_value_type(I2)::min()+1 and oln_value_type(I2)::max()-1.\n + ** + ** watershed_seg_or will flood levels from these non-unknown + ** starting points, labeling basins using the value you assigned + ** to them, and markining watershed lines with + ** oln_value_type(I2)::max(). markers should not contains any + ** oln_value_type(I2)::min() value on output. + ** + ** \ref This is based on the original algorithm presented by + ** D'Ornellas et al. (FIXME: ref?) + ** + ** \param I1 Exact type of the D image. + ** \param I2 Exact type of the M image. + ** \param N Exact type of the neighborhood. + ** + ** \arg D Input image. + ** \arg M Image of labels. + ** \arg Ng Neighborhood to consider. + */ template<class I1, class I2, class N> oln_concrete_type(I2)& watershed_seg_or(const abstract::non_vectorial_image<I1>& D, Index: olena/oln/morpho/watershed.hxx --- olena/oln/morpho/watershed.hxx Sat, 27 Sep 2003 18:30:39 +0200 burrus_n (oln/47_watershed. 1.9.1.5.1.5 600) +++ olena/oln/morpho/watershed.hxx Fri, 12 Mar 2004 12:58:17 +0100 palma_g (oln/47_watershed. 1.9.1.5.1.5 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 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 @@ -141,6 +141,10 @@ } }; + /*! + ** \brief Check if the second element of p1 is lower than the + ** second one of p2. + */ template<class Point, class T> inline bool watershed_seg_sort_(const std::pair<Point, T>& p1, @@ -149,7 +153,9 @@ return p1.second < p2.second; } - // Algorithm by Vincent and Soille + /*! + ** \brief Algorithm by Vincent and Soille. + */ template<class PointHandler, class DestValue, class I, class N> typename mute<I, DestValue>::ret soille_watershed_(const abstract::non_vectorial_image<I>& im_i, @@ -284,10 +290,12 @@ } - // cmp_queue_elt is a comparison function for the elements from - // the priority queue used in watershed_seg_or. Note that we - // return true when l is greater than r, because we when the queue - // sorted in increasing order. + /*! + ** cmp_queue_elt is a comparison function for the elements from + ** the priority queue used in watershed_seg_or. Note that we + ** return true when l is greater than r, because we when the queue + ** sorted in increasing order. + */ template <class T> struct cmp_queue_elt { Index: olena/oln/morpho/attribute_closing_opening.hh --- olena/oln/morpho/attribute_closing_opening.hh Thu, 11 Mar 2004 15:41:55 +0100 van-vl_n (oln/q/49_attribute_ 1.18 600) +++ olena/oln/morpho/attribute_closing_opening.hh Thu, 11 Mar 2004 15:44:41 +0100 palma_g (oln/q/49_attribute_ 1.18 640) @@ -58,14 +58,14 @@ /*! ** \brief Perform an attribute closing. ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. - ** \param A: Attribute exact type. - ** - ** \arg input: input image. - ** \arg Ng: neighborhood to use. - ** \arg lambda: threshold to use. - ** \arg env: environment. + ** \param I Image exact type. + ** \param N Neighborhood exact type. + ** \param A Attribute exact type. + ** + ** \arg input Input image. + ** \arg Ng Neighborhood to use. + ** \arg lambda Threshold to use. + ** \arg env Environment. */ template<class I, class N, class A> oln_concrete_type(I) @@ -82,14 +82,14 @@ /*! ** \brief Perform an attribute opening. ** - ** \param I: image exact type. - ** \param N: neighborhood exact type. - ** \param A: Attribute exact type. - ** - ** \arg input: input image. - ** \arg Ng: neighborhood to use. - ** \arg lambda: threshold to use. - ** \arg env: environment. + ** \param I Image exact type. + ** \param N Neighborhood exact type. + ** \param A Attribute exact type. + ** + ** \arg input Input image. + ** \arg Ng Neighborhood to use. + ** \arg lambda Threshold to use. + ** \arg env Environment. */ template<class I, class N, class A> oln_concrete_type(I) Index: olena/oln/morpho/attribute_union_find.hh --- olena/oln/morpho/attribute_union_find.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/q/50_attribute_ 1.14 600) +++ olena/oln/morpho/attribute_union_find.hh Wed, 10 Mar 2004 19:56:59 +0100 palma_g (oln/q/50_attribute_ 1.14 640) @@ -43,11 +43,11 @@ /*! ** \brief Struct that contains everything to compute an - ** attribute opening or closing + ** attribute opening or closing. ** - ** \param T: exact type of images to process. - ** \param ATTRIBUTE: exact type of attribute to use. - ** \param Env: type of environment to use. + ** \param T Exact type of images to process. + ** \param ATTRIBUTE Exact type of attribute to use. + ** \param Env Type of environment to use. */ template<class T, class ATTRIBUTE, class Env = attr_env_type(ATTRIBUTE)> struct tarjan_set @@ -60,8 +60,8 @@ /*! ** \brief tarjan_set constructor. - ** \param ima: image to open/close. - ** \param env: environment to use to compute attributes. + ** \param ima Image to open/close. + ** \param env Environment to use to compute attributes. */ tarjan_set(const image_type& ima, const env_type &env) : input_(ima), parent_(ima.size()), @@ -73,11 +73,11 @@ /*! ** \brief Main method to perform an attribute opening/closing. - ** \param closing: true -> a closing is performed, an opening otherwise. + ** \param closing True -> a closing is performed, an opening otherwise. ** - ** \param lambda: threshold to use for attribute growing. - ** \param Ng: neighborhood to use in the algorithm. - ** \return the resulting image. + ** \param lambda Threshold to use for attribute growing. + ** \param Ng Neighborhood to use in the algorithm. + ** \return The resulting image. */ template<bool closing, class N> image_type @@ -162,7 +162,7 @@ /*! ** \brief Make a new component from a point. - ** \arg x: root of the component. + ** \arg x Root of the component. */ void make_set(const point_type& x) @@ -174,7 +174,7 @@ /*! ** \brief find the root of a component. - ** \arg x: a point of the component. + ** \arg x A point of the component. */ point_type find_root(const point_type& x) @@ -190,8 +190,8 @@ /*! ** \brief Check if two components should be merged. - ** \arg x: a point of the first component. - ** \arg y: a point of the second component. + ** \arg x A point of the first component. + ** \arg y A point of the second component. */ bool criterion(const point_type& x, const point_type& y) @@ -203,8 +203,8 @@ /*! ** \brief Do union of two components. - ** \arg n: a point of the first component. - ** \arg p: a point of the second component. + ** \arg n A point of the first component. + ** \arg p A point of the second component. */ void uni(const point_type& n, const point_type& p) Index: olena/oln/morpho/attributes.hh --- olena/oln/morpho/attributes.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/j/45_attributes 1.6 600) +++ olena/oln/morpho/attributes.hh Wed, 10 Mar 2004 19:50:24 +0100 palma_g (oln/j/45_attributes 1.6 644) @@ -128,7 +128,7 @@ // the traits fwd declaration /*! ** Traits for attributes information. - ** \param T: exact type of the attribute. + ** \param T Exact type of the attribute. */ template <class T> struct attr_traits; @@ -728,8 +728,8 @@ *-----------*/ /*! ** \brief Max value attribute. - ** \param T: data type. - ** \param Exact: the exact type. + ** \param T Data type. + ** \param Exact The exact type. */ template <class T = unsigned, class Exact = mlc::final> class maxvalue_type: @@ -752,7 +752,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ maxvalue_type(const lambda_type &lambda): value_(lambda) { @@ -761,10 +761,10 @@ /*! ** \brief Ctor from a point and an image. ** - ** \param I: image exact type. + ** \param I Image exact type. ** - ** \arg input: input image. - ** \arg p: point to consider in the image. + ** \arg input Input image. + ** \arg p Point to consider in the image. */ template <class I> maxvalue_type(const abstract::image<I> &input, @@ -844,8 +844,8 @@ *-----------*/ /*! ** \brief Min value attribute. - ** \param T: data type. - ** \param Exact: the exact type. + ** \param T Data type. + ** \param Exact The exact type. */ template <class T = unsigned, class Exact = mlc::final> class minvalue_type: @@ -868,7 +868,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ minvalue_type(const lambda_type &lambda): value_(lambda) { @@ -877,10 +877,10 @@ /*! ** \brief Ctor from a point and an image. ** - ** \param I: image exact type. + ** \param I Image exact type. ** - ** \arg input: input image. - ** \arg p: point to consider in the image. + ** \arg input Input image. + ** \arg p Point to consider in the image. */ template <class I> minvalue_type(const abstract::image<I> &input, @@ -960,8 +960,8 @@ *-----------*/ /*! ** \brief Ball attribute. - ** \param I: exact type of images to process. - ** \param Exact: the exact type. + ** \param I Exact type of images to process. + ** \param Exact The exact type. */ template <class I, class Exact = mlc::final> class ball_type: @@ -989,7 +989,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ ball_type(const lambda_type &lambda): value_(lambda), pts_() { @@ -999,7 +999,7 @@ /*! ** \brief Ctor from a point and an image. ** - ** \arg p: point to consider in the image. + ** \arg p Point to consider in the image. */ ball_type(const im_type&, const point_type &p, const env_type &) : value_(ntg_zero_val(value_type)), pts_() @@ -1123,8 +1123,8 @@ *-----------*/ /*! ** \brief Dist attribute. - ** \param I: exact type of images to process. - ** \param Exact: the exact type. + ** \param I Exact type of images to process. + ** \param Exact The exact type. */ template <class I, class Exact = mlc::final> class dist_type: @@ -1150,7 +1150,7 @@ /*! ** \brief Ctor from a point and an image. ** - ** \arg p: point to consider in the image. + ** \arg p Point to consider in the image. */ dist_type(const im_type&, const point_type &p, @@ -1174,7 +1174,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ dist_type(const lambda_type lambda): value_(lambda) { @@ -1275,8 +1275,8 @@ *-----------*/ /*! ** \brief Cube attribute. - ** \param I: exact type of images to process. - ** \param Exact: the exact type. + ** \param I Exact type of images to process. + ** \param Exact The exact type. */ template <class I, class Exact = mlc::final> class cube_type: @@ -1304,7 +1304,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ cube_type(const lambda_type &lambda): mins_(dim), @@ -1321,7 +1321,7 @@ /*! ** \brief Ctor from a point and an image. ** - ** \arg p: point to consider in the image. + ** \arg p Point to consider in the image. */ cube_type(const im_type&, const point_type &p, @@ -1336,7 +1336,7 @@ ** \brief Accessor to minimums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th minimum. ** \see getMin_impl() */ @@ -1349,7 +1349,7 @@ ** \brief Accessor to maximums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th maximum. ** \see getMax_impl() */ @@ -1444,8 +1444,8 @@ *-----*/ /*! ** \brief Box attribute. - ** \param I: exact type of images to process. - ** \param Exact: the exact type. + ** \param I Exact type of images to process. + ** \param Exact The exact type. */ template <class I, class Exact = mlc::final> class box_type: @@ -1462,7 +1462,7 @@ /*! ** \brief Ctor from a lambda_type value. ** - ** \arg lambda: value of the attribute. + ** \arg lambda Value of the attribute. */ box_type(const lambda_type &lambda): maxs_(dim), mins_(dim) { @@ -1486,7 +1486,7 @@ /*! ** \brief Ctor from a point and an image. ** - ** \arg p: point to consider in the image. + ** \arg p Point to consider in the image. */ box_type(const im_type&, const point_type &p, const env_type &): maxs_(dim), mins_(dim) { @@ -1498,7 +1498,7 @@ ** \brief Accessor to minimums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th minimum. ** \see getMin_impl() */ @@ -1512,7 +1512,7 @@ ** \brief Accessor to maximums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th maximum. ** \see getMax_impl() */ @@ -1526,7 +1526,7 @@ ** \brief Accessor to minimums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th minimum. ** \see getMin_impl() */ @@ -1540,7 +1540,7 @@ ** \brief Accessor to maximums. ** ** Virtual method. - ** \arg i: index of the minimum wanted. + ** \arg i Index of the minimum wanted. ** \return the i th maximum. ** \see getMax_impl() */ Index: olena/oln/morpho/attribute_closing_opening_map.hh --- olena/oln/morpho/attribute_closing_opening_map.hh Thu, 11 Mar 2004 15:41:55 +0100 van-vl_n (oln/j/49_attribute_ 1.5 600) +++ olena/oln/morpho/attribute_closing_opening_map.hh Thu, 11 Mar 2004 15:43:32 +0100 palma_g (oln/j/49_attribute_ 1.5 600) @@ -60,9 +60,9 @@ ** See "Fast morphological attribute operations using Tarjan's union-find ** algorithm" by Michael H. F. Wilkinson and Jos B. T. M. Roerdink ** - ** \param I: image exact type. - ** \param D: attribute exact type. - ** \param Env: type of environment. + ** \param I Image exact type. + ** \param D Attribute exact type. + ** \param Env Type of environment. */ template <class I, class D, class Env = morpho::NullEnv> struct f_tarjan_map @@ -90,13 +90,13 @@ /*! ** \brief Perform an attribute opening/closing. ** - ** \param N: exact type of neighborhood + ** \param N Exact type of neighborhood ** - ** \arg is_closing: choose between closing and opening. - ** \arg input: input image. - ** \arg ng: neighborhood to use. - ** \arg lambda: threshold. - ** \arg env: environment. + ** \arg is_closing Choose between closing and opening. + ** \arg input Input image. + ** \arg ng Neighborhood to use. + ** \arg lambda Threshold. + ** \arg env Environment. */ template <class N> f_tarjan_map(bool is_closing, @@ -105,7 +105,7 @@ const lambda_type& lambda, const Env & env = Env()); /*! - ** \brief return the result of the opening/closing. + ** \brief Return the result of the opening/closing. */ oln_concrete_type(I) res() @@ -128,22 +128,22 @@ /*! ** \brief Make a new component from a point. - ** \arg x: root of the component. + ** \arg x Root of the component. */ void make_set(const point_type& x); /*! ** \brief link two components - ** \arg x: a point of the first component. - ** \arg y: a point of the second component. + ** \arg x A point of the first component. + ** \arg y A point of the second component. */ void link(const point_type& x, const point_type& y); /*! ** \brief find the root of a component. - ** \arg x: a point of the component. + ** \arg x A point of the component. */ point_type find_root(const point_type& x); @@ -157,8 +157,8 @@ /*! ** \brief link two components if they have to be linked - ** \arg n: a point of the first component. - ** \arg p: a point of the second component. + ** \arg n A point of the first component. + ** \arg p A point of the second component. */ void do_union(const point_type& n, const point_type& p); -- Giovanni Palma EPITA - promo 2005 - membre d'EpX - LRDE Mob. : +33 (0)6 60 97 31 74