Olena
Threads by month
- ----- 2025 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
March 2004
- 15 participants
- 44 discussions
Index: doc/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* ref/img_conv.pl: Make output image name constructed using
extension of input image.
* ref/exdoc.pl: Correct bug in command compile generation.
* ref/Makefile.am: Correct img_conv call.
Index: olena/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* oln/convol/convolution.hh: Add comments.
* oln/convol/fast_gaussian_coefficient.hh: Likewise.
* oln/convol/fast_gaussian.hh: Likewise.
* oln/convol/fast_gaussian.hxx: Likewise.
* oln/convert/stretch.hh: Correct comments.
* oln/convert/rgbhsl.hh: Likewise.
* oln/morpho/attribute_closing_opening_map.hh: Likewise.
* oln/morpho/watershed.hh: Likewise.
* oln/morpho/attribute_closing_opening.hh: Likewise.
* oln/morpho/thickening.inc: Likewise.
* oln/morpho/top_hat.inc: Likewise.
* oln/morpho/thinning.inc: Likewise.
* oln/morpho/reconstruction.hh: Likewise.
* oln/morpho/opening.inc: Likewise.
* oln/morpho/hit_or_miss.inc: Likewise.
* oln/morpho/gradient.inc: Likewise.
* oln/morpho/extrema.hxx: Likewise.
* oln/morpho/geodesic_dilation.hh: Likewise.
* oln/morpho/laplacian.inc: Likewise.
* oln/morpho/fast_morpho.hxx: Likewise.
* oln/morpho/erosion.hh: Likewise.
* oln/morpho/extrema_killer.hh: Likewise.
* oln/morpho/closing.inc: Likewise.
* oln/morpho/dilation.hh: Likewise.
* oln/level/threshold.hh: Likewise.
* oln/level/cc.hh: Likewise.
* oln/level/set_level.hh: Likewise.
* oln/core/abstract/iter.hh: Likewise.
Index: doc/ref/Makefile.am
--- doc/ref/Makefile.am Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/d/51_Makefile.a 1.27.1.12 600)
+++ doc/ref/Makefile.am Sat, 13 Mar 2004 16:50:27 +0100 palma_g (oln/d/51_Makefile.a 1.27.1.12 640)
@@ -16,8 +16,8 @@
$(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)
mkdir -p img
cd $(OUT_DIR) && make -f makefile
- $(IMG_CONV) $(top_srcdir)/olena/img img
- $(IMG_CONV) img img
+ $(IMG_CONV) $(top_srcdir)/olena/img img preserve
+ $(IMG_CONV) img img nopreserve
$(DOXYGEN) doxygen.config
html.tar.gz: doxy
Index: olena/oln/convert/stretch.hh
--- olena/oln/convert/stretch.hh Sat, 13 Mar 2004 17:45:05 +0100 van-vl_n (oln/f/51_stretch.hh 1.15 640)
+++ olena/oln/convert/stretch.hh Sun, 14 Mar 2004 15:32:35 +0100 palma_g (oln/f/51_stretch.hh 1.15 640)
@@ -59,8 +59,8 @@
** IMG_OUT "oln_convert_stretch.pgm");
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
** =>
** \image html oln_convert_stretch.png
** \image latex oln_convert_stretch.png
@@ -150,8 +150,8 @@
** IMG_OUT "oln_convert_stretch_balance.pgm");
** }
** \endcode
- ** \image html face_se.png
- ** \image latex face_se.png
+ ** \image html face_se_pbm.png
+ ** \image latex face_se_pbm.png
** => Without stretch_balance:
** \image html oln_convert_stretch_dark.png
** \image latex oln_convert_stretch_dark.png
Index: olena/oln/convol/convolution.hh
--- olena/oln/convol/convolution.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/f/39_convolutio 1.4.1.4.1.6.1.1 640)
+++ olena/oln/convol/convolution.hh Sat, 13 Mar 2004 15:15:55 +0100 palma_g (oln/f/39_convolutio 1.4.1.4.1.6.1.1 640)
@@ -1,4 +1,4 @@
-// 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
@@ -37,11 +37,33 @@
namespace oln {
+ /*!
+ ** \brief convolution namespace.
+ **
+ ** Set of algorithms related to convolution.
+ */
namespace convol {
+ /*!
+ ** \brief oln::convol::slow namespace.
+ **
+ ** The algorithms you can find here are slow. This mean there are
+ ** only basic applications of the definitions.
+ */
namespace slow {
- //FIXME : we must always specify DestValue.
+ /*!
+ ** \brief Perform a convolution of an image and a window.
+ **
+ ** \param DestValue Data type of the output image you want.
+ ** \param I Exact type of the input image.
+ ** \param Win Exact type of the window.
+ **
+ ** \arg input The image to process.
+ ** \arg win The window to convolve with.
+ **
+ ** \todo FIXME: we must always specify DestValue.
+ */
template<class DestValue, class I, class Win>
typename mute<I, DestValue>::ret
convolve(const abstract::image < I >& input,
@@ -54,7 +76,7 @@
oln_iter_type(I) p_im(input);
for_all(p_im)
{
- DestValue sum = 0;
+ DestValue sum = ntg_zero_val(DestValue);
for (unsigned i = 0; i < win.card(); ++i)
sum += static_cast<DestValue> (win.w(i)) *
static_cast<DestValue> (input[p_im - win.dp(i)]);
@@ -64,7 +86,19 @@
return output;
}
- //FIXME: don't use array1d, ..., arraynd.
+ /*!
+ ** \brief Perform a convolution of an image and a window.
+ **
+ ** \param DestValue Data type of the output image you want.
+ ** \param I Exact type of the input image.
+ ** \param Info Informations about the array.
+ ** \param Win Data type of the array.
+ **
+ ** \arg input The image to process.
+ ** \arg arr The array to convolve with.
+ **
+ ** \todo FIXME: don't use array1d, ..., arraynd.
+ */
template<class DestValue, class I, class Info, class Win>
typename mute<I, DestValue>::ret
convolve(const abstract::image < I >& input,
Index: olena/oln/convol/fast_gaussian_coefficient.hh
--- olena/oln/convol/fast_gaussian_coefficient.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/24_fast_gauss 1.5.1.6 640)
+++ olena/oln/convol/fast_gaussian_coefficient.hh Sat, 13 Mar 2004 17:57:30 +0100 palma_g (oln/24_fast_gauss 1.5.1.6 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
@@ -50,6 +50,10 @@
namespace fast {
namespace internal {
+ /*!
+ ** \brief Data structure for coefficients used for a recursive
+ ** filter call.
+ */
template < class FloatT >
struct recursivefilter_coef_
{
@@ -57,6 +61,9 @@
DericheGaussianFirstDerivative,
DericheGaussianSecondDerivative };
+ /*!
+ ** \brief Constructor.
+ */
recursivefilter_coef_(FloatT a0, FloatT a1,
FloatT b0, FloatT b1,
FloatT c0, FloatT c1,
@@ -66,8 +73,10 @@
FloatT sumA, sumC;
};
- /* Define out of the struct so the compiler don't even attempt
- to inline this. */
+ /*
+ ** Define out of the struct so the compiler don't even attempt
+ ** to inline this.
+ */
template < class FloatT >
recursivefilter_coef_<FloatT>
::recursivefilter_coef_(FloatT a0, FloatT a1,
Index: olena/oln/convol/fast_gaussian.hh
--- olena/oln/convol/fast_gaussian.hh Tue, 10 Feb 2004 15:35:04 +0100 palma_g (oln/26_fast_gauss 1.6.1.6.1.4 640)
+++ olena/oln/convol/fast_gaussian.hh Sat, 13 Mar 2004 18:15:19 +0100 palma_g (oln/26_fast_gauss 1.6.1.6.1.4 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,21 +40,79 @@
namespace oln {
namespace convol {
+ /*!
+ ** \brief oln::convol::fast namespace.
+ **
+ ** The algorithms you can find here are fast. This mean these ones
+ ** are evolved versions.
+ */
namespace fast {
// FIXME: add tests!
+ /*!
+ ** \brief Gaussian filter.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param C Exact type of the conversion object.
+ ** \param B Base type of the conversion object.
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg input_conv Converter object.
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ */
template <class C, class B, class I, class BE>
typename mute<I, typename convoutput<C, B, oln_value_type(I)>::ret>::ret
gaussian(const convert::abstract::conversion<C, B>& input_conv,
const abstract::image<I>& in, ntg::float_s sigma,
const abstract::behavior<BE> &behavior);
+ /*!
+ ** \brief Derivative gaussian filter.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param C Exact type of the conversion object.
+ ** \param B Base type of the conversion object.
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg input_conv Converter object.
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ */
template <class C, class B, class I, class BE>
typename mute<I, typename convoutput<C, B, oln_value_type(I)>::ret>::ret
gaussian_derivative(const convert::abstract::conversion<C, B>& input_conv,
const abstract::image<I>& in, ntg::float_s sigma,
const abstract::behavior<BE> &behavior);
+
+ /*!
+ ** \brief Second derivative gaussian filter.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param C Exact type of the conversion object.
+ ** \param B Base type of the conversion object.
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg input_conv Converter object.
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ */
template <class C, class B, class I, class BE>
typename mute<I, typename convoutput<C, B, oln_value_type(I)>::ret>::ret
gaussian_second_derivative(const convert::abstract::conversion<C, B>& input_conv,
@@ -64,6 +122,43 @@
/* Same functions, with a default conversion. */
+ /*
+ ** \brief Gaussian filter with a default conversion.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2,
+ ** oln::value_behavior<oln_value_type_(im_type)>(0)),
+ ** IMG_OUT "oln_convol_fast_gaussian.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian.png
+ ** \image latex oln_convol_fast_gaussian.png
+ */
template <class I, class BE> inline
oln_concrete_type(I)
gaussian(const abstract::image<I>& in, ntg::float_s sigma,
@@ -71,13 +166,90 @@
{ return gaussian(convert::force<oln_value_type(I)>(), in, sigma,
behavior); }
+ /*!
+ ** \brief Derivative gaussian filter with a default conversion.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2,
+ ** oln::value_behavior<oln_value_type_(im_type)>(0)),
+ ** IMG_OUT "oln_convol_fast_gaussian_derivative.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian_derivative.png
+ ** \image latex oln_convol_fast_gaussian_derivative.png
+ **
+ ** \todo FIXME: Make the example use the good function.
+ */
template <class I, class BE> inline
oln_concrete_type(I)
gaussian_derivative(const abstract::image<I>& in, ntg::float_s sigma,
const abstract::behavior<BE> &behavior)
{ return gaussian_derivative(convert::force<oln_value_type(I)>(), in, sigma,
behavior); }
-
+ /*!
+ ** \brief Second derivative gaussian filter with a default conversion.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2,
+ ** oln::value_behavior<oln_value_type_(im_type)>(0)),
+ ** IMG_OUT "oln_convol_fast_gaussian_second_derivative.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian_second_derivative.png
+ ** \image latex oln_convol_fast_gaussian_second_derivative.png
+ **
+ ** \todo FIXME: Make the example use the good function.
+ */
template <class I, class BE> inline
oln_concrete_type(I)
gaussian_second_derivative(const abstract::image<I>& in,
@@ -87,18 +259,140 @@
in, sigma, behavior); }
/* Same functions, with a default behavior (mirror_behavior). */
+ /*!
+ ** \brief Gaussian filter with a default conversion and a
+ ** default behavior.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.\n
+ **
+ ** \warning The content of the border is the mirror of the
+ ** image.
+ **
+ ** \param I Exact type of the image.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2),
+ ** IMG_OUT "oln_convol_fast_gaussian_default.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian_default.png
+ ** \image latex oln_convol_fast_gaussian_default.png
+ */
template <class I> inline
oln_concrete_type(I)
gaussian(const abstract::image<I>& in, ntg::float_s sigma)
{ return gaussian(convert::force<oln_value_type(I)>(), in, sigma,
mirror_bhv()); }
+ /*!
+ ** \brief Derivative gaussian filter with a default conversion
+ ** and a default behavior.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \warning The content of the border is the mirror of the
+ ** image.
+ **
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2),
+ ** IMG_OUT "oln_convol_fast_gaussian_derivative_default.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian_derivative_default.png
+ ** \image latex oln_convol_fast_gaussian_derivative_default.png
+ **
+ ** \todo FIXME: Make the example use the good function.
+ */
template <class I> inline
oln_concrete_type(I)
gaussian_derivative(const abstract::image<I>& in, ntg::float_s sigma)
{ return gaussian_derivative(convert::force<oln_value_type(I)>(), in, sigma,
mirror_bhv()); }
+ /*!
+ ** \brief Second derivative gaussian filter with a default
+ ** conversion and a default behavior.
+ **
+ ** Gaussian filter implementation from "Recursively implementing
+ ** the gaussian and its derivatives" Deriche 93 INRIA REPORT.
+ **
+ ** \warning The content of the border is the mirror of the
+ ** image.
+ **
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/convol/fast_gaussian.hh>
+ ** #include <oln/core/behavior.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::convol::fast::gaussian(im1, 2),
+ ** IMG_OUT "oln_convol_fast_gaussian_second_derivative_default.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
+ ** =>
+ ** \image html oln_convol_fast_gaussian_second_derivative_default.png
+ ** \image latex oln_convol_fast_gaussian_second_derivative_default.png
+ **
+ ** \todo FIXME: Make the example use the good function.
+ */
template <class I> inline
oln_concrete_type(I)
gaussian_second_derivative(const abstract::image<I>& in, ntg::float_s sigma)
Index: olena/oln/convol/fast_gaussian.hxx
--- olena/oln/convol/fast_gaussian.hxx Tue, 10 Feb 2004 15:35:04 +0100 palma_g (oln/25_fast_gauss 1.7.1.8.1.6 640)
+++ olena/oln/convol/fast_gaussian.hxx Sat, 13 Mar 2004 17:52:59 +0100 palma_g (oln/25_fast_gauss 1.7.1.8.1.6 640)
@@ -38,12 +38,32 @@
namespace oln {
namespace convol {
namespace fast {
+ /*!
+ ** \brief oln::convol::fast::internal namespace.
+ **
+ ** You can find here function used for fast algorithms.
+ */
namespace internal {
- // Recursive filter, works on a line.
- // FIXME: Until something clever is designed, the line is
- // defined by two points (START and FINISH) and a displacement
- // dpoint (D).
+ /*!
+ ** \brief Recursive filter.
+ **
+ ** Recursive filter, works on a line.
+ ** FIXME: Until something clever is designed, the line is
+ ** defined by two points (START and FINISH) and a displacement
+ ** dpoint (D).
+ **
+ ** \param Worktype Type the algorithm work on.
+ ** \param FloatType Type of coefficients.
+ ** \param I Type of image.
+ **
+ ** \arg image Image to process.
+ ** \arg c Coefficients.
+ ** \arg start Start of the line.
+ ** \arg finish End point of the line.
+ ** \arg len Length of data to process.
+ ** \arg d Displacement dpoint.
+ */
template <class WorkType, class FloatType, class I>
void
recursivefilter_(I& image,
@@ -143,7 +163,11 @@
}
}
-
+ /*!
+ ** \brief Compute the gaussian filter.
+ **
+ ** Look at specialization for details.
+ */
template<unsigned dim>
struct gaussian_ {};
@@ -230,6 +254,20 @@
}
};
+ /*!
+ ** \brief Common code for filter (derivative,
+ ** second derivative, etc.).
+ **
+ ** \param C Exact type of the conversion object.
+ ** \param B Base type of the conversion object.
+ ** \param I Exact type of the image.
+ ** \param BE Exact type of the behavior.
+ **
+ ** \arg input_conv Converter object.
+ ** \arg in Input image.
+ ** \arg sigma Value of sigma when computing the gaussian.
+ ** \arg behavior Object to know how to work on borders.
+ */
template <class C, class B, class I, class F, class BE>
typename mute<I, typename convoutput<C,B,oln_value_type(I)>::ret>::ret
gaussian_common_(const convert::abstract::conversion<C,B>& c,
Index: olena/oln/core/abstract/iter.hh
--- olena/oln/core/abstract/iter.hh Fri, 12 Mar 2004 17:51:04 +0100 odou_s (oln/c/40_iter.hh 1.18 640)
+++ olena/oln/core/abstract/iter.hh Sun, 14 Mar 2004 15:35:19 +0100 palma_g (oln/c/40_iter.hh 1.18 640)
@@ -170,8 +170,8 @@
** return 0;
** }
** \endcode
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_abstract_iter.png
** \image latex oln_abstract_iter.png
Index: olena/oln/level/cc.hh
--- olena/oln/level/cc.hh Thu, 11 Mar 2004 16:11:20 +0100 van-vl_n (oln/e/20_cc.hh 1.11.1.10 640)
+++ olena/oln/level/cc.hh Sun, 14 Mar 2004 15:36:00 +0100 palma_g (oln/e/20_cc.hh 1.11.1.10 640)
@@ -94,8 +94,8 @@
** std::cout << card << " connected components" << std::endl;
** }
** \endcode
- ** \image html face_se.png
- ** \image latex face_se.png
+ ** \image html face_se_pbm.png
+ ** \image latex face_se_pbm.png
** =>
** \image html oln_level_frontp_connected_component.png
** \image latex oln_level_frontp_connected_component.png
Index: olena/oln/level/set_level.hh
--- olena/oln/level/set_level.hh Thu, 11 Mar 2004 16:11:20 +0100 van-vl_n (oln/p/1_set_level. 1.10 640)
+++ olena/oln/level/set_level.hh Sun, 14 Mar 2004 15:36:21 +0100 palma_g (oln/p/1_set_level. 1.10 640)
@@ -72,8 +72,8 @@
** save(in, IMG_OUT "oln_level_set_level.pgm");
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
** =>
** \image html oln_level_set_level.png
** \image latex oln_level_set_level.png
Index: olena/oln/level/threshold.hh
--- olena/oln/level/threshold.hh Thu, 11 Mar 2004 16:11:20 +0100 van-vl_n (oln/f/15_threshold. 1.13 640)
+++ olena/oln/level/threshold.hh Sun, 14 Mar 2004 15:36:44 +0100 palma_g (oln/f/15_threshold. 1.13 640)
@@ -55,8 +55,8 @@
** save(out, IMG_OUT "oln_level_threshold.ppm");
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
** =>
** \image html oln_level_threshold.png
** \image latex oln_level_threshold.png
Index: olena/oln/morpho/closing.inc
--- olena/oln/morpho/closing.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/44_closing.in 1.16 640)
+++ olena/oln/morpho/closing.inc Sat, 13 Mar 2004 16:57:39 +0100 palma_g (oln/44_closing.in 1.16 640)
@@ -73,8 +73,8 @@
** return 0;
** }
** \endcode
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_closing.png
** \image latex oln_morpho_closing.png
Index: olena/oln/morpho/dilation.hh
--- olena/oln/morpho/dilation.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/b/5_dilation.h 1.17 640)
+++ olena/oln/morpho/dilation.hh Sat, 13 Mar 2004 17:05:17 +0100 palma_g (oln/b/5_dilation.h 1.17 640)
@@ -81,8 +81,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_dilation.png
** \image latex oln_morpho_dilation.png
@@ -129,8 +129,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_n_dilation.png
** \image latex oln_morpho_n_dilation.png
Index: olena/oln/morpho/erosion.hh
--- olena/oln/morpho/erosion.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/b/4_erosion.hh 1.19 640)
+++ olena/oln/morpho/erosion.hh Sat, 13 Mar 2004 17:05:41 +0100 palma_g (oln/b/4_erosion.hh 1.19 640)
@@ -73,8 +73,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_erosion.png
** \image latex oln_morpho_erosion.png
@@ -122,8 +122,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_n_erosion.png
** \image latex oln_morpho_n_erosion.png
@@ -175,8 +175,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_erosion.png
** \image latex oln_morpho_fast_erosion.png
Index: olena/oln/morpho/extrema.hxx
--- olena/oln/morpho/extrema.hxx Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/j/4_extrema.hx 1.13 640)
+++ olena/oln/morpho/extrema.hxx Sat, 13 Mar 2004 17:06:49 +0100 palma_g (oln/j/4_extrema.hx 1.13 640)
@@ -112,11 +112,11 @@
** return 0;
** }
** \endcode
-** \image html lena.png
-** \image latex lena.png
+** \image html lena_pgm.png
+** \image latex lena_pgm.png
** and
-** \image html map.png
-** \image latex map.png
+** \image html map_pbm.png
+** \image latex map_pbm.png
** =>
** \image html oln_morpho_sequential_minima_imposition.png
** \image latex oln_morpho_sequential_minima_imposition.png
@@ -168,8 +168,8 @@
** return 0;
** }
** \endcode
-** \image html lena.png
-** \image latex lena.png
+** \image html lena_pgm.png
+** \image latex lena_pgm.png
** =>
** \image html oln_morpho_sequential_regional_minima.png
** \image latex oln_morpho_sequential_regional_minima.png
Index: olena/oln/morpho/extrema_killer.hh
--- olena/oln/morpho/extrema_killer.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/e/19_extrema_ki 1.7.1.4.1.12 640)
+++ olena/oln/morpho/extrema_killer.hh Sat, 13 Mar 2004 17:07:43 +0100 palma_g (oln/e/19_extrema_ki 1.7.1.4.1.12 640)
@@ -121,8 +121,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_maxima_killer.png
** \image latex oln_morpho_sure_maxima_killer.png
@@ -194,8 +194,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_minima_killer.png
** \image latex oln_morpho_sure_minima_killer.png
@@ -343,8 +343,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_minima_killer.png
** \image latex oln_morpho_fast_minima_killer.png
@@ -468,8 +468,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_maxima_killer.png
** \image latex oln_morpho_fast_maxima_killer.png
Index: olena/oln/morpho/fast_morpho.hxx
--- olena/oln/morpho/fast_morpho.hxx Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/45_fast_morph 1.19 640)
+++ olena/oln/morpho/fast_morpho.hxx Sat, 13 Mar 2004 17:08:14 +0100 palma_g (oln/45_fast_morph 1.19 640)
@@ -304,8 +304,8 @@
** }
** \endcode
**
- ** \image html object.png
- ** \image latex object.png
+ ** \image html object_pbm.png
+ ** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_morpho.png
** \image latex oln_morpho_fast_morpho.png
Index: olena/oln/morpho/geodesic_dilation.hh
--- olena/oln/morpho/geodesic_dilation.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/37_geodesic_d 1.11.1.11 640)
+++ olena/oln/morpho/geodesic_dilation.hh Sat, 13 Mar 2004 17:08:56 +0100 palma_g (oln/37_geodesic_d 1.11.1.11 640)
@@ -77,8 +77,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_geodesic_dilation.png
** \image latex oln_morpho_geodesic_dilation.png
@@ -138,8 +138,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_geodesic_dilation.png
** \image latex oln_morpho_sure_geodesic_dilation.png
Index: olena/oln/morpho/geodesic_erosion.hh
--- olena/oln/morpho/geodesic_erosion.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/36_geodesic_e 1.18 640)
+++ olena/oln/morpho/geodesic_erosion.hh Sat, 13 Mar 2004 17:09:29 +0100 palma_g (oln/36_geodesic_e 1.18 640)
@@ -75,8 +75,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_geodesic_erosion.png
** \image latex oln_morpho_geodesic_erosion.png
@@ -136,8 +136,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_geodesic_erosion.png
** \image latex oln_morpho_sure_geodesic_erosion.png
Index: olena/oln/morpho/gradient.inc
--- olena/oln/morpho/gradient.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/43_gradient.i 1.14 640)
+++ olena/oln/morpho/gradient.inc Sat, 13 Mar 2004 17:10:29 +0100 palma_g (oln/43_gradient.i 1.14 640)
@@ -73,8 +73,8 @@
** }
** \encode
**
-** \image html lena128.png
-** \image latex lena128.png
+** \image html lena128_pgm.png
+** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_beucher_gradient.png
** \image latex oln_morpho_beucher_gradient.png
@@ -140,8 +140,8 @@
** }
** \encode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_internal_gradient.png
** \image latex oln_morpho_internal_gradient.png
@@ -203,8 +203,8 @@
** }
** \encode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_external_gradient.png
** \image latex oln_morpho_external_gradient.png
Index: olena/oln/morpho/hit_or_miss.inc
--- olena/oln/morpho/hit_or_miss.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/42_hit_or_mis 1.21 640)
+++ olena/oln/morpho/hit_or_miss.inc Sat, 13 Mar 2004 17:11:19 +0100 palma_g (oln/42_hit_or_mis 1.21 640)
@@ -70,8 +70,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss.png
** \image latex oln_morpho_fast_hit_or_miss.png
@@ -134,8 +134,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss_overload.png
** \image latex oln_morpho_fast_hit_or_miss_overload.png
@@ -200,8 +200,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss_opening.png
** \image latex oln_morpho_fast_hit_or_miss_opening.png
@@ -262,8 +262,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss_opening_bg.png
** \image latex oln_morpho_fast_hit_or_miss_opening_bg.png
@@ -330,8 +330,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss_closing.png
** \image latex oln_morpho_fast_hit_or_miss_closing.png
@@ -395,8 +395,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_hit_or_miss_closing_bg.png
** \image latex oln_morpho_fast_hit_or_miss_closing_bg.png
Index: olena/oln/morpho/laplacian.inc
--- olena/oln/morpho/laplacian.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/41_laplacian. 1.14 640)
+++ olena/oln/morpho/laplacian.inc Sat, 13 Mar 2004 17:11:47 +0100 palma_g (oln/41_laplacian. 1.14 640)
@@ -54,8 +54,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_laplacian.png
** \image latex oln_morpho_fast_laplacian.png
@@ -96,8 +96,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_laplacian_overload.png
** \image latex oln_morpho_fast_laplacian_overload.png
Index: olena/oln/morpho/opening.inc
--- olena/oln/morpho/opening.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/40_opening.in 1.14 640)
+++ olena/oln/morpho/opening.inc Sat, 13 Mar 2004 17:12:13 +0100 palma_g (oln/40_opening.in 1.14 640)
@@ -55,8 +55,8 @@
** }
** \endcode
**
-** \image html object.png
-** \image latex object.png
+** \image html object_pbm.png
+** \image latex object_pbm.png
** =>
** \image html oln_morpho_fast_opening.png
** \image latex oln_morpho_fast_opening.png
Index: olena/oln/morpho/reconstruction.hh
--- olena/oln/morpho/reconstruction.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/35_reconstruc 1.13.1.12 640)
+++ olena/oln/morpho/reconstruction.hh Sat, 13 Mar 2004 17:12:50 +0100 palma_g (oln/35_reconstruc 1.13.1.12 640)
@@ -84,8 +84,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_geodesic_reconstruction_dilation.png
** \image latex oln_morpho_sure_geodesic_reconstruction_dilation.png
@@ -156,8 +156,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sequential_geodesic_reconstruction_dilation.png
** \image latex oln_morpho_sequential_geodesic_reconstruction_dilation.png
@@ -272,8 +272,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_hybrid_geodesic_reconstruction_dilation.png
** \image latex oln_morpho_hybrid_geodesic_reconstruction_dilation.png
@@ -377,8 +377,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sure_geodesic_reconstruction_erosion.png
** \image latex oln_morpho_sure_geodesic_reconstruction_erosion.png
@@ -450,8 +450,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_sequential_geodesic_reconstruction_erosion.png
** \image latex oln_morpho_sequential_geodesic_reconstruction_erosion.png
@@ -562,8 +562,8 @@
** }
** \endcode
**
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_hybrid_geodesic_reconstruction_erosion.png
** \image latex oln_morpho_hybrid_geodesic_reconstruction_erosion.png
Index: olena/oln/morpho/thickening.inc
--- olena/oln/morpho/thickening.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/e/28_thickening 1.11 640)
+++ olena/oln/morpho/thickening.inc Sat, 13 Mar 2004 17:13:33 +0100 palma_g (oln/e/28_thickening 1.11 640)
@@ -56,8 +56,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_thickening.png
** \image latex oln_morpho_fast_thickening.png
Index: olena/oln/morpho/thinning.inc
--- olena/oln/morpho/thinning.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/e/26_thinning.i 1.12 640)
+++ olena/oln/morpho/thinning.inc Sat, 13 Mar 2004 17:13:51 +0100 palma_g (oln/e/26_thinning.i 1.12 640)
@@ -56,8 +56,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_thinning.png
** \image latex oln_morpho_fast_thinning.png
Index: olena/oln/morpho/top_hat.inc
--- olena/oln/morpho/top_hat.inc Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/39_top_hat.in 1.14 640)
+++ olena/oln/morpho/top_hat.inc Sat, 13 Mar 2004 17:14:37 +0100 palma_g (oln/39_top_hat.in 1.14 640)
@@ -56,8 +56,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_white_top_hat.png
** \image latex oln_morpho_fast_white_top_hat.png
@@ -98,8 +98,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_white_top_hat_overload.png
** \image latex oln_morpho_fast_white_top_hat_overload.png
@@ -144,8 +144,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_black_top_hat.png
** \image latex oln_morpho_fast_black_top_hat.png
@@ -187,8 +187,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_black_top_hat_overload.png
** \image latex oln_morpho_fast_black_top_hat_overload.png
@@ -237,8 +237,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_self_complementary_top_hat.png
** \image latex oln_morpho_fast_self_complementary_top_hat.png
@@ -278,8 +278,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_self_complementary_top_hat_overload.png
** \image latex oln_morpho_fast_self_complementary_top_hat_overload.png
@@ -326,8 +326,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_top_hat_contrast_op.png
** \image latex oln_morpho_fast_top_hat_contrast_op.png
@@ -374,8 +374,8 @@
** }
** \endcode
**
-** \image html lena256.png
-** \image latex lena256.png
+** \image html lena256_pgm.png
+** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_fast_top_hat_contrast_op_overload.png
** \image latex oln_morpho_fast_top_hat_contrast_op_overload.png
Index: olena/oln/morpho/watershed.hh
--- olena/oln/morpho/watershed.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/48_watershed. 1.12 640)
+++ olena/oln/morpho/watershed.hh Sat, 13 Mar 2004 17:15:16 +0100 palma_g (oln/48_watershed. 1.12 640)
@@ -50,8 +50,8 @@
** 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?)
+ ** 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.
@@ -80,8 +80,8 @@
** }
** \endcode
**
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_watershed_seg.png
** \image latex oln_morpho_watershed_seg.png
@@ -111,7 +111,7 @@
** 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
+ ** This is based on the original algorithm
** presented by Vincent and Soille, but modified to not output
** watersheds.
**
@@ -142,8 +142,8 @@
** }
** \endcode
**
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena256_pgm.png
+ ** \image latex lena256_pgm.png
** =>
** \image html oln_morpho_watershed_con.png
** \image latex oln_morpho_watershed_con.png
@@ -166,7 +166,8 @@
** 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
+ ** 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
@@ -174,7 +175,7 @@
** 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
+ ** This is based on the original algorithm presented by
** D'Ornellas et al. (FIXME: ref?)
**
** \param I1 Exact type of the D image.
Index: olena/oln/morpho/attribute_closing_opening.hh
--- olena/oln/morpho/attribute_closing_opening.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/q/49_attribute_ 1.19 640)
+++ olena/oln/morpho/attribute_closing_opening.hh Sat, 13 Mar 2004 17:02:39 +0100 palma_g (oln/q/49_attribute_ 1.19 640)
@@ -166,8 +166,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_card_closing.png
** \image latex oln_morpho_fast_card_closing.png
@@ -193,8 +193,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_card_opening.png
** \image latex oln_morpho_fast_card_opening.png
@@ -220,8 +220,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_integral_closing.png
** \image latex oln_morpho_fast_integral_closing.png
@@ -247,8 +247,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_integral_opening.png
** \image latex oln_morpho_fast_integral_opening.png
@@ -274,8 +274,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_height_opening.png
** \image latex oln_morpho_fast_height_opening.png
@@ -302,8 +302,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_height_closing.png
** \image latex oln_morpho_fast_height_closing.png
@@ -331,8 +331,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_maxvalue_closing.png
** \image latex oln_morpho_fast_maxvalue_closing.png
@@ -359,8 +359,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_maxvalue_opening.png
** \image latex oln_morpho_fast_maxvalue_opening.png
@@ -387,8 +387,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_minvalue_opening.png
** \image latex oln_morpho_fast_minvalue_opening.png
@@ -415,8 +415,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_minvalue_closing.png
** \image latex oln_morpho_fast_minvalue_closing.png
@@ -443,8 +443,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_ball_opening.png
** \image latex oln_morpho_fast_ball_opening.png
@@ -471,8 +471,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_ball_closing.png
** \image latex oln_morpho_fast_ball_closing.png
@@ -499,8 +499,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_dist_opening.png
** \image latex oln_morpho_fast_dist_opening.png
@@ -527,8 +527,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_dist_closing.png
** \image latex oln_morpho_fast_dist_closing.png
@@ -555,8 +555,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_cube_closing.png
** \image latex oln_morpho_fast_cube_closing.png
@@ -583,8 +583,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_cube_opening.png
** \image latex oln_morpho_fast_cube_opening.png
@@ -612,8 +612,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_box_closing.png
** \image latex oln_morpho_fast_box_closing.png
@@ -641,8 +641,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_box_opening.png
** \image latex oln_morpho_fast_box_opening.png
Index: olena/oln/convert/rgbhsl.hh
--- olena/oln/convert/rgbhsl.hh Sat, 13 Mar 2004 17:45:05 +0100 van-vl_n (oln/j/36_rgbhsl.hh 1.2 644)
+++ olena/oln/convert/rgbhsl.hh Sun, 14 Mar 2004 15:33:36 +0100 palma_g (oln/j/36_rgbhsl.hh 1.2 644)
@@ -73,8 +73,8 @@
** IMG_OUT "oln_convert_f_rgb_to_hsl.pgm");
** }
** \endcode
- ** \image html lena.png
- ** \image latex lena.png
+ ** \image html lena_ppm.png
+ ** \image latex lena_ppm.png
** =>
** \image html oln_convert_f_rgb_to_hsl.png
** \image latex oln_convert_f_rgb_to_hsl.png
Index: olena/oln/morpho/attribute_closing_opening_map.hh
--- olena/oln/morpho/attribute_closing_opening_map.hh Fri, 12 Mar 2004 13:29:59 +0100 palma_g (oln/j/49_attribute_ 1.6 600)
+++ olena/oln/morpho/attribute_closing_opening_map.hh Sat, 13 Mar 2004 16:56:59 +0100 palma_g (oln/j/49_attribute_ 1.6 600)
@@ -262,8 +262,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_card_closing.png
** \image latex oln_morpho_fast_card_closing.png
@@ -289,8 +289,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_card_opening.png
** \image latex oln_morpho_fast_card_opening.png
@@ -316,8 +316,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_integral_closing.png
** \image latex oln_morpho_fast_integral_closing.png
@@ -343,8 +343,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_integral_opening.png
** \image latex oln_morpho_fast_integral_opening.png
@@ -370,8 +370,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_height_opening.png
** \image latex oln_morpho_fast_height_opening.png
@@ -398,8 +398,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_height_closing.png
** \image latex oln_morpho_fast_height_closing.png
@@ -427,8 +427,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_maxvalue_closing.png
** \image latex oln_morpho_fast_maxvalue_closing.png
@@ -455,8 +455,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_maxvalue_opening.png
** \image latex oln_morpho_fast_maxvalue_opening.png
@@ -483,8 +483,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_minvalue_opening.png
** \image latex oln_morpho_fast_minvalue_opening.png
@@ -511,8 +511,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_minvalue_closing.png
** \image latex oln_morpho_fast_minvalue_closing.png
@@ -539,8 +539,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_ball_opening.png
** \image latex oln_morpho_fast_ball_opening.png
@@ -567,8 +567,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_ball_closing.png
** \image latex oln_morpho_fast_ball_closing.png
@@ -595,8 +595,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_dist_opening.png
** \image latex oln_morpho_fast_dist_opening.png
@@ -623,8 +623,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_dist_closing.png
** \image latex oln_morpho_fast_dist_closing.png
@@ -651,8 +651,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_cube_closing.png
** \image latex oln_morpho_fast_cube_closing.png
@@ -679,8 +679,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_cube_opening.png
** \image latex oln_morpho_fast_cube_opening.png
@@ -708,8 +708,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_box_closing.png
** \image latex oln_morpho_fast_box_closing.png
@@ -737,8 +737,8 @@
** return 0;
** }
** \endcode
- ** \image html lena128.png
- ** \image latex lena128.png
+ ** \image html lena128_pgm.png
+ ** \image latex lena128_pgm.png
** =>
** \image html oln_morpho_fast_box_opening.png
** \image latex oln_morpho_fast_box_opening.png
Index: doc/ref/exdoc.pl
--- doc/ref/exdoc.pl Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/v/26_exdoc.pl 1.3 700)
+++ doc/ref/exdoc.pl Sat, 13 Mar 2004 16:26:55 +0100 palma_g (oln/v/26_exdoc.pl 1.3 755)
@@ -111,7 +111,10 @@
my ($i, $prog) = @_;
my $cmd = get_alias $i, $config[$i]{"captions"};
$cmd = "$cmd ".$config[$i]{"options"};
- return $cmd." && ./$prog > $prog.".$config[$i]{"std_out"}." 2> $prog.".$config[$i]{"err_out"}."\nexit \$?\n";
+ $cmd = $cmd." && ./$prog > $prog.".$config[$i]{"std_out"}." 2> $prog.";
+ $cmd = $cmd.$config[$i]{"err_out"}."\nret=\$?\n";
+ $cmd = $cmd. "if [ \$ret -ne 0 ]\n then\n rm \$2\nfi\nexit \$ret\n";
+ return $cmd;
}
# Dependencies of KEY as a simple string.
Index: doc/ref/img_conv.pl
--- doc/ref/img_conv.pl Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/k/6_img_conv.p 1.2 700)
+++ doc/ref/img_conv.pl Sat, 13 Mar 2004 18:04:14 +0100 palma_g (oln/k/6_img_conv.p 1.2 700)
@@ -23,25 +23,39 @@
use Pod::Usage qw(pod2usage);
-sub conv($ $)
+sub conv($ $ $)
{
my $file;
my $d = $_[0];
my $o = $_[1];
+ my $preserve_name = 0;
+ if ($_[2] =~ /^preserve$/)
+ {
+ $preserve_name = 1;
+ }
+
opendir DIR, "$d" or die "Unable to open $d.\n";
foreach $file(readdir DIR)
{
if ($file =~ /(.*)\.(pgm|ppm|ppgm|pppgm|pbm)$/)
{
+ if ($preserve_name == 1)
+ {
+ print "convert $d/$file to $o/$1_$2.png\n";
+ system "convert $d/$file $o/$1_$2.png";
+ }
+ else
+ {
print "convert $d/$file to $o/$1.png\n";
system "convert $d/$file $o/$1.png";
}
}
+ }
closedir DIR or die "unable to close $d.";
}
my $argc=@ARGV;
-if ($argc != 2)
+if ($argc != 3)
{
- die "usage: img_conv.pl input-dir output-dir\n";
+ die "usage: img_conv.pl input-dir output-dir preserve|nopreserve\n";
}
-conv $ARGV[0], $ARGV[1];
+conv $ARGV[0], $ARGV[1], $ARGV[2];
--
Giovanni Palma
EPITA - promo 2005 - membre d'EpX - LRDE
Mob. : +33 (0)6 60 97 31 74
1
0
The directory oln/topo/combinatorial-map is not well documented.
Index: olena/ChangeLog
from Niels Van Vliet <niels(a)lrde.epita.fr>
* olena/oln/core/abstract/iter1d.hh: Fix a bug.
* olena/oln/core/abstract/iter2d.hh: Fix a bug.
* olena/oln/core/abstract/iter3d.hh: Fix a bug.
* olena/oln/morpho/attribute_union_find.hh: Add a FIXME.
* olena/oln/topo/dmap.hh: Add comments.
* olena/oln/topo/tarjan/union.hh: Likewise.
* olena/oln/topo/inter-pixel/inter-pixel.hh: Likewise.
* olena/oln/topo/tarjan/flat-zone.hh: Likewise.
* olena/oln/topo/combinatorial-map/cmap.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/zeta.hh: Likewise.
* olena/oln/topo/inter-pixel/fwd-dir-iter.hh: Likewise.
* olena/oln/topo/inter-pixel/bkd-dir-iter.hh: Likewise.
* olena/oln/topo/inter-pixel/node.hh: Likewise.
* olena/oln/topo/inter-pixel/internal/dir-iter.hh: Likewise.
* olena/oln/topo/inter-pixel/internal/dir.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/alpha.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/anyfunc.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/beta.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/lambda.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/level.hh: Likewise.
* olena/oln/topo/combinatorial-map/internal/sigma.hh : Likewise.
Index: olena/oln/core/abstract/iter1d.hh
--- olena/oln/core/abstract/iter1d.hh Fri, 12 Mar 2004 17:51:04 +0100
odou_s (oln/d/10_iter1d.hh 1.17 640)
+++ olena/oln/core/abstract/iter1d.hh Sun, 14 Mar 2004 16:55:35 +0100
van-vl_n (oln/d/10_iter1d.hh 1.17 640)
@@ -119,6 +119,12 @@
/*!
** \brief Constructor
+ */
+ iter1d() : super_type(), ncols_(0)
+ {}
+
+ /*!
+ ** \brief Constructor
** \arg size The size of the image to iterate.
** \pre size.ncols() > 0.
**
Index: olena/oln/core/abstract/iter2d.hh
--- olena/oln/core/abstract/iter2d.hh Fri, 12 Mar 2004 17:51:04 +0100
odou_s (oln/d/9_iter2d.hh 1.17 640)
+++ olena/oln/core/abstract/iter2d.hh Sun, 14 Mar 2004 16:59:19 +0100
van-vl_n (oln/d/9_iter2d.hh 1.17 640)
@@ -134,6 +134,12 @@
}
/*!
+ ** \brief Constructor
+ */
+ iter2d() : super_type(), nrows_(0), ncols_(0)
+ {}
+
+ /*!
** \brief Construct an iterator (2d) on an inamge (2d).
** \arg size The size of the image to iterate.
** \pre size.ncols() > 0.
Index: olena/oln/core/abstract/iter3d.hh
--- olena/oln/core/abstract/iter3d.hh Fri, 12 Mar 2004 17:51:04 +0100
odou_s (oln/d/8_iter3d.hh 1.17 640)
+++ olena/oln/core/abstract/iter3d.hh Sun, 14 Mar 2004 16:59:54 +0100
van-vl_n (oln/d/8_iter3d.hh 1.17 640)
@@ -150,6 +150,12 @@
}
/*!
+ ** \brief Constructor
+ */
+ iter3d() : super_type(), nslices_(0), nrows_(0), ncols_(0)
+ {}
+
+ /*!
** \brief Construct an iterator (3d) on an image (3d).
** \arg size The size of the image to iterate.
** \pre size.ncols() > 0.
Index: olena/oln/topo/dmap.hh
--- olena/oln/topo/dmap.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n
(oln/p/2_dmap.hh 1.7 640)
+++ olena/oln/topo/dmap.hh Sun, 14 Mar 2004 14:37:47 +0100 van-vl_n
(oln/p/2_dmap.hh 1.7 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
@@ -36,10 +36,21 @@
// # include <math.h>
# include <utility>
+/*! \file dmap.hh
+**
+** \ref B.J.H. Verwer, Local distances for distance transformations
+** in two and three dimensions, Pattern Recognition Letters 12 (1991)
671-682
+*/
+
namespace oln {
+ /// Namespce topo.
namespace topo {
-
+ /*! Chamfer mask.
+ **
+ ** The Chamfer mask is a weighted masks that provides an approximation
+ ** of the real Euclidean distance in the discrete space.
+ */
template<class T>
struct chamfer
{
@@ -55,80 +66,634 @@
const float coef;
};
+ /*! Produce a chamfer mask 3x3
+ **
+ ** \bug FIXME: This highly not thread safe !
+ **
+ ** \verbatim
+ ** Example of oln::topo::mk_chamfer_3x3<1,2>(3) w;
+ ** w.delta(): 1
+ ** w.coef: 3
+ ** w.fwd:
+ ** 2 1 2
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 2 1 2
+ ** \endverbatim
+ */
template<int d10, int d11> inline
const chamfer<int>&
mk_chamfer_3x3(float coef = 1.f);
+ /*! Produce a chamfer mask 3x3
+ **
+ ** \bug FIXME: This highly not thread safe !
+ **
+ ** \verbatim
+ ** Example of oln::topo::mk_chamfer_3x3(1.5, 2.5) w;
+ ** w.delta(): 1
+ ** w.coef: 1
+ ** w.fwd:
+ ** 2.5 1.5 2.5
+ ** 1.5 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1.5
+ ** 2.5 1.5 2.5
+ ** \endverbatim
+ */
inline
const chamfer<float>&
mk_chamfer_3x3(float d10, float d11);
+ /*! Chamfer 5x5
+ **
+ ** \verbatim
+ ** Example of oln::topo::mk_chamfer_5x5<1, 2, 3>(4) w;
+ ** w.delta(): 2
+ ** w.coef: 4
+ ** w.fwd:
+ ** . 3 . 3 .
+ ** 3 2 1 2 3
+ ** . 1 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 1 .
+ ** 3 2 1 2 3
+ ** . 3 . 3 .
+ ** \endverbatim
+ */
template<int d10, int d11, int d21> inline
const chamfer<int>&
mk_chamfer_5x5(float coef = 1.f);
+ /*! Chamfer 5x5 using float
+ **
+ ** \see mk_chamfer_5x5
+ */
inline
const chamfer<float>&
mk_chamfer_5x5(float d10, float d11, float d21);
- // REF: B.J.H. Verwer, Local distances for distance transformations
- // in two and three dimensions, Pattern Recognition Letters 12
(1991) 671-682
+ /*! Chamfer_1_1
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_1_1() w;
+ ** w.delta(): 1
+ ** w.coef: 0.9003
+ ** w.fwd:
+ ** 1 1 1
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 1 1 1
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_1_1();
+
+ /*! Chamfer_1_2
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_1_2() w;
+ ** w.delta(): 1
+ ** w.coef: 1.2732
+ ** w.fwd:
+ ** 2 1 2
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 2 1 2
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_1_2();
+ /*! Chamfer_2_3
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_2_3() w;
+ ** w.delta(): 1
+ ** w.coef: 2.1736
+ ** w.fwd:
+ ** 3 2 3
+ ** 2 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 2
+ ** 3 2 3
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_2_3();
+ /*! Chamfer_5_7
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_5_7() w;
+ ** w.delta(): 1
+ ** w.coef: 5.2474
+ ** w.fwd:
+ ** 7 5 7
+ ** 5 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 5
+ ** 7 5 7
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_5_7();
+ /*! Chamfer_12_17
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_12_17() w;
+ ** w.delta(): 1
+ ** w.coef: 12.6684
+ ** w.fwd:
+ ** 17 12 17
+ ** 12 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 12
+ ** 17 12 17
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_12_17();
+ /*! Chessboard
+ **
+ ** \verbatim
+ ** Example of oln::topo::chessboard() w;
+ ** w.delta(): 1
+ ** w.coef: 0.9003
+ ** w.fwd:
+ ** 1 1 1
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 1 1 1
+ ** \endverbatim
+ */
inline const chamfer<int>& chessboard();
+ /*! Cityblock
+ **
+ ** \verbatim
+ ** Example of oln::topo::cityblock() w;
+ ** w.delta(): 1
+ ** w.coef: 1.2732
+ ** w.fwd:
+ ** 2 1 2
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 2 1 2
+ ** \endverbatim
+ */
inline const chamfer<int>& cityblock();
+ /*! Chamfer_4_6_9
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_4_6_9() w;
+ ** w.delta(): 2
+ ** w.coef: 4.1203
+ ** w.fwd:
+ ** . 9 . 9 .
+ ** 9 6 4 6 9
+ ** . 4 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 4 .
+ ** 9 6 4 6 9
+ ** . 9 . 9 .
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_4_6_9();
+ /*! Chamfer_5_7_11
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_5_7_11() w;
+ ** w.delta(): 2
+ ** w.coef: 5.0206
+ ** w.fwd:
+ ** . 11 . 11 .
+ ** 11 7 5 7 11
+ ** . 5 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 5 .
+ ** 11 7 5 7 11
+ ** . 11 . 11 .
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_5_7_11();
+ /*! Chamfer_9_13_20
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_9_13_20() w;
+ ** w.delta(): 2
+ ** w.coef: 9.1409
+ ** w.fwd:
+ ** . 20 . 20 .
+ ** 20 13 9 13 20
+ ** . 9 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 9 .
+ ** 20 13 9 13 20
+ ** . 20 . 20 .
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_9_13_20();
+ /*! Chamfer_16_23_36
+ **
+ ** \verbatim
+ ** Example of oln::topo::chamfer_16_23_36() w;
+ ** w.delta(): 2
+ ** w.coef: 16.3351
+ ** w.fwd:
+ ** . 36 . 36 .
+ ** 36 23 16 23 36
+ ** . 16 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 16 .
+ ** 36 23 16 23 36
+ ** . 36 . 36 .
+ ** \endverbatim
+ */
inline const chamfer<int>& chamfer_16_23_36();
+ /*! Best set 3x3
+ **
+ ** \verbatim
+ ** Example of oln::topo::best_set_3x3() w;
+ ** w.delta(): 1
+ ** w.coef: 1
+ ** w.fwd:
+ ** 1.3408 0.9481 1.3408
+ ** 0.9481 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 0.9481
+ ** 1.3408 0.9481 1.3408
+ ** \endverbatim
+ */
inline const chamfer<float>& best_set_3x3();
+ /*! Best set 5x5
+ **
+ ** \verbatim
+ ** Example of oln::topo::best_set_5x5() w;
+ ** w.delta(): 2
+ ** w.coef: 1
+ ** w.fwd:
+ ** . 2.2044 . 2.2044 .
+ ** 2.2044 1.406 0.9801 1.406 2.2044
+ ** . 0.9801 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 0.9801 .
+ ** 2.2044 1.406 0.9801 1.406 2.2044
+ ** . 2.2044 . 2.2044 .
+ ** \endverbatim
+ */
inline const chamfer<float>& best_set_5x5();
// maximum absolute error for integer local distances (Table 2)
+ /* Maximum absolute error for integer local distances for chamfer_1_1.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_1_1() =
+ ** w.delta(): 1
+ ** w.coef: 0.8536
+ ** w.fwd:
+ ** 1 1 1
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 1 1 1
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_1_1();
+ /* Maximum absolute error for integer local distances for chamfer_1_2.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_1_2() =
+ ** w.delta(): 1
+ ** w.coef: 1.2071
+ ** w.fwd:
+ ** 2 1 2
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 2 1 2
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_1_2();
+ /* Maximum absolute error for integer local distances for chamfer_2_3.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_2_3() =
+ ** w.delta(): 1
+ ** w.coef: 2.118
+ ** w.fwd:
+ ** 3 2 3
+ ** 2 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 2
+ ** 3 2 3
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_2_3();
+ /* Maximum absolute error for integer local distances for chamfer_5_7.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_5_7() =
+ ** w.delta(): 1
+ ** w.coef: 5.1675
+ ** w.fwd:
+ ** 7 5 7
+ ** 5 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 5
+ ** 7 5 7
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_5_7();
+ /* Maximum absolute error for integer local distances for
chamfer_12_17.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_12_17() =
+ ** w.delta(): 1
+ ** w.coef: 12.5
+ ** w.fwd:
+ ** 17 12 17
+ ** 12 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 12
+ ** 17 12 17
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_12_17();
+ /* Maximum absolute error for integer local distances for chessboard.
+ **
+ ** \verbatim
+ ** oln::topo::mchessboard() =
+ ** w.delta(): 1
+ ** w.coef: 0.8536
+ ** w.fwd:
+ ** 1 1 1
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 1 1 1
+ ** \endverbatim
+ */
inline const chamfer<int>& mchessboard();
+ /* Maximum absolute error for integer local distances for cityblock.
+ **
+ ** \verbatim
+ ** oln::topo::mcityblock() =
+ ** w.delta(): 1
+ ** w.coef: 1.2071
+ ** w.fwd:
+ ** 2 1 2
+ ** 1 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 1
+ ** 2 1 2
+ ** \endverbatim
+ */
inline const chamfer<int>& mcityblock();
+ /* Maximum absolute error for integer local distances for
chamfer_4_6_9.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_4_6_9() =
+ ** w.delta(): 2
+ ** w.coef: 4.1213
+ ** w.fwd:
+ ** . 9 . 9 .
+ ** 9 6 4 6 9
+ ** . 4 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 4 .
+ ** 9 6 4 6 9
+ ** . 9 . 9 .
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_4_6_9();
+ /* Maximum absolute error for integer local distances for
chamfer_5_7_11.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_5_7_11() =
+ ** w.delta(): 2
+ ** w.coef: 5.0092
+ ** w.fwd:
+ ** . 11 . 11 .
+ ** 11 7 5 7 11
+ ** . 5 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 5 .
+ ** 11 7 5 7 11
+ ** . 11 . 11 .
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_5_7_11();
+ /* Maximum absolute error for integer local distances for
chamfer_9_13_20.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_9_13_20() =
+ ** w.delta(): 2
+ ** w.coef: 9.0819
+ ** w.fwd:
+ ** . 20 . 20 .
+ ** 20 13 9 13 20
+ ** . 9 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 9 .
+ ** 20 13 9 13 20
+ ** . 20 . 20 .
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_9_13_20();
+ /* Maximum absolute error for integer local distances for
chamfer_17_24_38.
+ **
+ ** \verbatim
+ ** oln::topo::mchamfer_17_24_38() =
+ ** w.delta(): 2
+ ** w.coef: 17.2174
+ ** w.fwd:
+ ** . 38 . 38 .
+ ** 38 24 17 24 38
+ ** . 17 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 17 .
+ ** 38 24 17 24 38
+ ** . 38 . 38 .
+ ** \endverbatim
+ */
inline const chamfer<int>& mchamfer_17_24_38();
+ /* Maximum absolute error for integer local distances for best_set_3x3.
+ **
+ ** \verbatim
+ ** oln::topo:mbest_set_3x3() =
+ ** w.delta(): 1
+ ** w.coef: 1
+ ** w.fwd:
+ ** 1.35825 0.96043 1.35825
+ ** 0.96043 . .
+ ** . . .
+ ** w.bkd:
+ ** . . .
+ ** . . 0.96043
+ ** 1.35825 0.96043 1.35825
+ ** \endverbatim
+ */
inline const chamfer<float>& mbest_set_3x3();
+ /* Maximum absolute error for integer local distances for best_set_5x5.
+ **
+ ** \verbatim
+ ** oln::topo:mbest_set_5x5() =
+ ** w.delta(): 2
+ ** w.coef: 1
+ ** w.fwd:
+ ** . 2.20585 . 2.20585 .
+ ** 2.20585 1.3951 0.986485 1.3951 2.20585
+ ** . 0.986485 . . .
+ ** . . . . .
+ ** . . . . .
+ ** w.bkd:
+ ** . . . . .
+ ** . . . . .
+ ** . . . 0.986485 .
+ ** 2.20585 1.3951 0.986485 1.3951 2.20585
+ ** . 2.20585 . 2.20585 .
+ ** \endverbatim
+ */
inline const chamfer<float>& mbest_set_5x5();
+ /*! Distance map
+ **
+ ** \param T Type of the distance.
+ ** \param T2 Type of the chamfer distance.
+ **
+ ** \note Do not forget to call \a compute.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/topo/dmap.hh>
+ ** #include <oln/convert/stretch.hh>
+ **
+ ** int main()
+ ** {
+ ** oln::image2d<ntg::bin> in = oln::load(IMG_IN "face_se.pbm");
+ **
+ ** oln::topo::dmap<ntg::int_u<16>, int> m(in.size(),
oln::topo::chessboard());
+ ** m.compute(in);
+ ** save(oln::convert::stretch_balance<ntg::int_u8>(m.imap()),
+ ** IMG_OUT "oln_topo_dmap.pgm");
+ ** }
+ ** \endcode
+ ** \image html face_se.png
+ ** \image latex face_se.png
+ ** =>
+ ** \image html oln_topo_dmap.png
+ ** \image latex oln_topo_dmap.png
+ */
template<class T, class T2>
class dmap
{
public:
typedef image2d<ntg::bin>::point_type point_type;
+ /*! Constructor.
+ **
+ ** \arg size Size of the image on which the dmap will be compute.
+ ** \arg ch Chamfer distance used.
+ */
dmap(const image2d_size& size, const chamfer<T2>& ch);
+ /// Compute the distance map.
template <class V>
void
compute(const image2d<V>& input, float infty = 0.f);
+ /// Compute the distance map.
template <class V>
void
compute(const image2d<V>& input,
image2d<point2d>& nearest_point_map,
float infty = 0.f);
+ /// Return the distance map of type T.
const image2d<T>&
imap() const;
+ /// Return the distance map divided by the Chamfer coefficient.
image2d<float>
to_image() const;
+ /// Distance of a point p.
const T&
operator[](const point_type& p) const;
+ /// Distance of a point2d(row, col).
const T&
operator()(coord row, coord col) const;
@@ -138,7 +703,7 @@
float inFty_;
T infTy_;
};
-
+ /// Distance map using the Euclidean distance.
template <class I>
image2d<float> exact_dmap(const abstract::image<I>& input);
Index: olena/oln/morpho/attribute_union_find.hh
--- olena/oln/morpho/attribute_union_find.hh Fri, 12 Mar 2004 13:29:59
+0100 palma_g (oln/q/50_attribute_ 1.15 640)
+++ olena/oln/morpho/attribute_union_find.hh Sun, 14 Mar 2004 14:26:36
+0100 van-vl_n (oln/q/50_attribute_ 1.15 640)
@@ -48,6 +48,9 @@
** \param T Exact type of images to process.
** \param ATTRIBUTE Exact type of attribute to use.
** \param Env Type of environment to use.
+ **
+ ** \Note FIXME: a similar class is defined in oln/topo/tarjan/union.hh
+ ** (oln::topo::tarjan::tarjan_set).
*/
template<class T, class ATTRIBUTE, class Env = attr_env_type(ATTRIBUTE)>
struct tarjan_set
Index: olena/oln/topo/tarjan/union.hh
--- olena/oln/topo/tarjan/union.hh Thu, 07 Aug 2003 10:35:19 +0200
sylvain (oln/r/33_union.hh 1.8 640)
+++ olena/oln/topo/tarjan/union.hh Sun, 14 Mar 2004 14:29:23 +0100
van-vl_n (oln/r/33_union.hh 1.8 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
@@ -35,12 +35,19 @@
namespace oln {
namespace topo {
-
+ /// Namespace Tarjan
namespace tarjan {
struct empty_class
{};
+ /*! Tarjan set.
+ **
+ ** \attention FIXME: a similar class is defined in
+ ** oln/morpho/attribute_union_find.hh
(oln::morpho::tarjan::tarjan_set).
+ ** The one in morpho is more general. I think that this class should
+ ** be removed.
+ */
template< class I, class aux_data_type>
struct tarjan_set
{
Index: olena/oln/topo/inter-pixel/inter-pixel.hh
--- olena/oln/topo/inter-pixel/inter-pixel.hh Thu, 07 Aug 2003 02:37:23
+0200 burrus_n (oln/r/34_inter-pixe 1.12 640)
+++ olena/oln/topo/inter-pixel/inter-pixel.hh Sun, 14 Mar 2004 17:13:37
+0100 van-vl_n (oln/r/34_inter-pixe 1.12 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,10 +40,36 @@
namespace topo {
namespace inter_pixel {
-
+ /// Return the inter pixel type of an image type.
# define oln_interpixel_type(ImgType) \
typename oln::mute< ImgType, oln_node_type(ImgType) >::ret
+ /*! Inter pixel class.
+ **
+ ** This example give the node of the black connected component
(bottom left).
+ ** \code
+ ** #include <ntg/int.hh>
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/topo/inter-pixel/inter-pixel.hh>
+ ** #include <iostream>
+ ** using namespace oln::topo::inter_pixel;
+ **
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> img_type;
+ ** img_type in = oln::load(IMG_IN "test-cmap.pgm");
+ ** interpixel<oln::image2d<ntg::int_u8> > ip(in);
+ ** std::cout << ip << std::endl;
+ ** // Print:
+ ** // (5,0): east north south
+ ** // (5,5): north west south
+ ** // (7,5): east north west
+ ** // (10,9): east north west
+ ** // (10,11): north west south
+ ** // (11,14): north west south
+ ** }
+ ** \todo FIXME: Test the output values in the tests.
+ */
template <class I>
class interpixel
{
@@ -59,6 +85,7 @@
typedef oln_interpixel_type(I) inter_pixel_type;
public:
+ /// Construct an inter pixel map of the image \a img.
interpixel(const I & img) :
data_(img.nrows() + 1, img.ncols() + 1)
{
@@ -77,12 +104,17 @@
}
}
+ /// FIXME: add doc.
const node_type&
operator[](const point_type & p) const
{
return data_[p];
}
+ /*! FIXME: add doc.
+ **
+ ** \pre precondition(data_[in.first].get(in.second) == true)
+ */
head_type
folw(const head_type& in) const
{
@@ -111,6 +143,7 @@
return out;
}
+ /// Print the inter pixel map.
std::ostream&
print(std::ostream & ostr) const
{
Index: olena/oln/topo/tarjan/flat-zone.hh
--- olena/oln/topo/tarjan/flat-zone.hh Thu, 07 Aug 2003 02:37:23 +0200
burrus_n (oln/r/35_flat-zone. 1.9 640)
+++ olena/oln/topo/tarjan/flat-zone.hh Sun, 14 Mar 2004 16:27:18 +0100
van-vl_n (oln/r/35_flat-zone. 1.9 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,10 +39,30 @@
namespace tarjan {
- /*----------.
- | flat_zone |
- `----------*/
-
+ /*! Create an image of label of the flat zones.
+ **
+ ** \todo FIXME: many assertions are missing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/topo/tarjan/flat-zone.hh>
+ ** #include <oln/convert/stretch.hh>
+ **
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> img_type;
+ ** img_type in = oln::load(IMG_IN "test-cmap.pgm");
+ ** oln::topo::tarjan::flat_zone<img_type> z(in);
+ ** save(oln::convert::stretch_balance<ntg::int_u8>(z.label, 0,
255),
+ ** IMG_OUT "oln_topo_flat_zone.pgm");
+ ** }
+ ** \endcode
+ ** \image html test-cmap.png width=6cm
+ ** \image latex test-cmap.png width=6cm
+ ** =>
+ ** \image html oln_topo_flat_zone.png width=6cm
+ ** \image latex oln_topo_flat_zone.png width=6cm
+ */
template <class I>
struct flat_zone
{
@@ -54,6 +74,7 @@
const image_type &input;
tarjan_cc cc;
+ /// output image.
image2d<unsigned> label;
std::vector<point_type> look_up_table;
@@ -61,7 +82,10 @@
image2d< std::vector<oln::point2d> > ima_region;
unsigned nlabels_;
-
+ /*! Initialize the flat-zone with an image.
+ **
+ ** \a doit is called.
+ */
flat_zone(const image_type& input_) : input(input_), cc(input_),
label(input_.size()),
ima_region(input_.size()),
@@ -69,7 +93,7 @@
{
doit();
}
-
+ /// Compute the image of label.
void
doit()
{
@@ -158,25 +182,29 @@
}
}
-
+ /// Get the label of a point \a p.
const unsigned
get_label(const point_type & p) const
{
return label[p];
}
-
+ /// Get the root point of a label \a l.
const point_type&
get_root(unsigned l) const
{
return look_up_table[l];
}
-
+ /// Number of label.
const unsigned
nlabels() const
{
return nlabels_;
}
+ /*! Merge two flat zone.
+ **
+ ** \note FIMXE: should be protected, shouldn't it?
+ */
void
merge(const int l1, const int l2)
{
Index: olena/oln/topo/combinatorial-map/cmap.hh
--- olena/oln/topo/combinatorial-map/cmap.hh Thu, 07 Aug 2003 10:35:19
+0200 sylvain (oln/r/36_cmap.hh 1.11 640)
+++ olena/oln/topo/combinatorial-map/cmap.hh Sun, 14 Mar 2004 17:54:55
+0100 van-vl_n (oln/r/36_cmap.hh 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,16 +37,27 @@
# include <algorithm>
# include <iterator>
+/*! \file cmap.hh
+**
+** \attention FIXME: There is some problems in the directory
topo/combinatorial-map/,
+** such as non static functions, or the redefinition of the class any.\n
+** FIXME: The documentation is not good enough.\n
+** FIXME: Real test are missing.
+** FIXME: Some part of this file are inside "#if 0" comments.
+*/
+
namespace oln {
namespace topo {
-
+ /// Namespace for combinatorial map.
namespace combinatorial_map {
- // REF: Braquelaire, J. P. and Brun, L. Image Segmentation with
- // Topological Maps and Inter-pixel Representation}, Journal of
- // Visual Communication and Image representation, 1998, vol. 9
-
+ /*! Combinatorial map.
+ **
+ ** \ref Braquelaire, J. P. and Brun, L. Image Segmentation with
+ ** Topological Maps and Inter-pixel Representation}, Journal of
+ ** Visual Communication and Image representation, 1998, vol. 9
+ */
template <class I>
class cmap
{
@@ -135,10 +146,7 @@
# endif
- /*------------------.
- | merging algorithm |
- `------------------*/
-
+ /// Merging algorithm.
void
merge(const unsigned l1, const unsigned l2)
{
@@ -167,10 +175,7 @@
inter.clear();
}
- /*------.
- | print |
- `------*/
-
+ /// Print
std::ostream&
print(std::ostream & ostr) const
{
@@ -185,10 +190,7 @@
private:
- /*---------------------------.
- | building combinatorial map |
- `---------------------------*/
-
+ /// Building combinatorial map.
void
build_zeta_(const inter_pixel::interpixel<I> & ip)
{
@@ -272,10 +274,8 @@
}
}
- /*---------------------------.
- | Internal methods for merge |
- `---------------------------*/
+ ///Internal methods for merge
bool
make_inter1_(const unsigned l1,
const unsigned l2,
Index: olena/oln/topo/combinatorial-map/internal/zeta.hh
--- olena/oln/topo/combinatorial-map/internal/zeta.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/r/43_zeta.hh 1.3 640)
+++ olena/oln/topo/combinatorial-map/internal/zeta.hh Sun, 14 Mar 2004
17:36:42 +0100 van-vl_n (oln/r/43_zeta.hh 1.3 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
@@ -36,6 +36,12 @@
namespace internal {
+ /* zeta function.
+ **
+ ** Tabular of 4 elements.
+ **
+ ** \todo FIXME: Add doc.
+ */
struct zeta
{
zeta() : empty_(true)
Index: olena/oln/topo/inter-pixel/fwd-dir-iter.hh
--- olena/oln/topo/inter-pixel/fwd-dir-iter.hh Thu, 07 Aug 2003 02:37:23
+0200 burrus_n (oln/r/44_fwd-dir-it 1.4 640)
+++ olena/oln/topo/inter-pixel/fwd-dir-iter.hh Sun, 14 Mar 2004 16:29:01
+0100 van-vl_n (oln/r/44_fwd-dir-it 1.4 640)
@@ -1,5 +1,5 @@
-// 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
@@ -54,7 +54,7 @@
namespace topo {
namespace inter_pixel {
-
+ /// Backward iterator on direction.
template<unsigned Dim, class Exact>
class fwd_dir_iter
: public internal::dir_iter_<Dim, typename
mlc::exact_vt<fwd_dir_iter<Dim, Exact>, Exact>::ret>
@@ -67,6 +67,10 @@
fwd_dir_iter() : super(), begin_(internal::dir_traits<Dim>::first()) {}
fwd_dir_iter(dir_type i) : super(i), begin_(i) {}
+ /*! Assignment.
+ **
+ ** \bug FIXME: I am not sure that this respect the new paradigm.
+ */
template<class U>
U
operator=(U u)
@@ -74,12 +78,14 @@
return super::operator=(u);
}
+ /// Next direction.
dir_type
next()
{
return internal::dir_traits<Dim>::next(this->cur_);
}
+ /// First direction.
dir_type
begin()
{
@@ -89,7 +95,7 @@
private:
dir_type begin_;
};
-
+/// Type of direction inter pixel iterator of an image type \a ImgType.
# define oln_fwd_dir_iter_type(ImgType) \
oln::topo::inter_pixel::fwd_dir_iter< ImgType::dim >
Index: olena/oln/topo/inter-pixel/bkd-dir-iter.hh
--- olena/oln/topo/inter-pixel/bkd-dir-iter.hh Thu, 07 Aug 2003 02:37:23
+0200 burrus_n (oln/r/45_bkd-dir-it 1.4 640)
+++ olena/oln/topo/inter-pixel/bkd-dir-iter.hh Sun, 14 Mar 2004 15:40:27
+0100 van-vl_n (oln/r/45_bkd-dir-it 1.4 640)
@@ -1,5 +1,5 @@
-// 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
@@ -52,7 +52,7 @@
namespace topo {
namespace inter_pixel {
-
+ /// Backward iterator on direction.
template<unsigned Dim, class Exact>
class bkd_dir_iter
: public internal::dir_iter_<Dim, typename
mlc::exact_vt<bkd_dir_iter<Dim, Exact>, Exact>::ret>
@@ -65,16 +65,22 @@
bkd_dir_iter() : super(), begin_(internal::dir_traits<Dim>::last()) {}
bkd_dir_iter(dir_type i) : super(i), begin_(i) {}
+ /*! Assignment.
+ **
+ ** \bug FIXME: I am not sure that this respect the new paradigm.
+ */
template<class U>
U
operator=(U u) { return super::operator=(u); }
+ /// Next direction.
dir_type
next()
{
return internal::dir_traits<Dim>::prev(this->cur_);
}
+ /// First direction.
dir_type
begin()
{
@@ -85,6 +91,7 @@
dir_type begin_;
};
+/// Type of direction inter pixel backward iterator of an image type \a
ImgType.
# define oln_bkd_dir_iter_type(ImgType) \
oln::topo::inter_pixel::bkd_dir_iter< ImgType::dim >
Index: olena/oln/topo/inter-pixel/node.hh
--- olena/oln/topo/inter-pixel/node.hh Thu, 07 Aug 2003 02:37:23 +0200
burrus_n (oln/r/46_node.hh 1.4 640)
+++ olena/oln/topo/inter-pixel/node.hh Sun, 14 Mar 2004 15:35:11 +0100
van-vl_n (oln/r/46_node.hh 1.4 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
@@ -33,9 +33,15 @@
namespace oln {
namespace topo {
-
+ /// Namespace for inter pixel,
namespace inter_pixel {
-
+ /*! Inter pixel node.
+ **
+ ** A node is a junction of edge; the edge are
+ ** represented by the directions.
+ **
+ ** \param I image.
+ */
template<class I>
class node
{
@@ -51,6 +57,7 @@
data_[i] = false;
}
+ /// Add an adge (a direction).
void
set(dir_type i)
{
@@ -60,12 +67,13 @@
data_[i] = true;
}
+ /// Return true if the direction \i joins the node.
bool
get(dir_type i) const
{
return data_[i];
}
-
+ /// Degree of the node.
unsigned
rank() const
{
@@ -76,10 +84,11 @@
unsigned rank_;
bool data_[dim * 2];
};
-
+/// Type of node of a given image type.
# define oln_node_type(ImgType) \
oln::topo::inter_pixel::node< ImgType >
+/// A pair of a point and a direction.
# define oln_head_type(ImgType) \
typename std::pair<oln_point_type(ImgType), oln_dir_type(ImgType) >
Index: olena/oln/topo/inter-pixel/internal/dir-iter.hh
--- olena/oln/topo/inter-pixel/internal/dir-iter.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/r/47_dir-iter.h 1.5 640)
+++ olena/oln/topo/inter-pixel/internal/dir-iter.hh Sun, 14 Mar 2004
15:26:31 +0100 van-vl_n (oln/r/47_dir-iter.h 1.5 640)
@@ -47,6 +47,7 @@
}
}
+ /// Traits for iterator for 1D directions.
template<class Exact>
struct iter_traits<topo::inter_pixel::internal::dir_iter_<1, Exact> >
: public iter_traits<abstract::iter1d<Exact> >
@@ -56,6 +57,7 @@
typedef dpoint1d dpoint_type;
};
+ /// Traits for iterator for 2D directions.
template<class Exact>
struct iter_traits<topo::inter_pixel::internal::dir_iter_<2, Exact> >
: public iter_traits<abstract::iter2d<Exact> >
@@ -65,6 +67,7 @@
typedef dpoint2d dpoint_type;
};
+ /// Traits for iterator for 3D directions.
template<class Exact>
struct iter_traits<topo::inter_pixel::internal::dir_iter_<3, Exact> >
: public iter_traits<abstract::iter3d<Exact> >
Index: olena/oln/topo/inter-pixel/internal/dir.hh
--- olena/oln/topo/inter-pixel/internal/dir.hh Thu, 07 Aug 2003 02:37:23
+0200 burrus_n (oln/r/48_dir.hh 1.2 640)
+++ olena/oln/topo/inter-pixel/internal/dir.hh Sun, 14 Mar 2004 15:21:33
+0100 van-vl_n (oln/r/48_dir.hh 1.2 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,53 +37,61 @@
namespace topo {
namespace inter_pixel {
-
+ /// oln::topo::inter_pixel Internal namespace.
namespace internal {
-
+ /// Provides the enum dir.
template<unsigned Dim>
struct dir_traits
{};
-
+ /// Provides the enum dir for 2D.
template<>
struct dir_traits<2>
{
+ //// Direction in 2D.
typedef enum dir { east, north, west, south } ret;
+ /// First direction.
static ret
first()
{
return east;
}
+ /// Last direction.
static ret
last()
{
return south;
}
-
+ /// Prev direction (with Prev(first()) == last()).
static ret
prev(ret i)
{
return i == first() ? last() : ret(i - 1);
}
+ /// Next direction (with next(last()) == first()).
static ret
next(ret i)
{
return i == last() ? first() : ret(i + 1);
}
- // FIXME: no modulus
+ /*! Opposit direction.
+ **
+ ** \note FIXME: no modulus.
+ */
static ret
opposite(ret i)
{
return ret((i + 2) % 4);
}
};
-
+/// Direction trait for an image \a ImgType.
# define oln_dir_traits_type(ImgType) \
oln::topo::inter_pixel::internal::dir_traits< ImgType::dim >
+/// Direction for an image \a ImgType.
# define oln_dir_type(ImgType) \
typename oln_dir_traits_type(ImgType)::ret
Index: olena/oln/topo/combinatorial-map/internal/alpha.hh
--- olena/oln/topo/combinatorial-map/internal/alpha.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/v/2_alpha.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/alpha.hh Sun, 14 Mar 2004
17:39:38 +0100 van-vl_n (oln/v/2_alpha.hh 1.2 600)
@@ -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
@@ -35,10 +35,14 @@
namespace combinatorial_map {
namespace internal {
-
+ /*! Alpha function.
+ **
+ ** Returns (d + ((d % 2) * 2 ) - 1).
+ */
template <class U>
struct alpha
{
+ /// Returns (d + ((d % 2) * 2 ) - 1).
static U
result(const U & d)
{
Index: olena/oln/topo/combinatorial-map/internal/anyfunc.hh
--- olena/oln/topo/combinatorial-map/internal/anyfunc.hh Thu, 07 Aug
2003 02:37:23 +0200 burrus_n (oln/v/3_anyfunc.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/anyfunc.hh Sun, 14 Mar
2004 18:08:30 +0100 van-vl_n (oln/v/3_anyfunc.hh 1.2 600)
@@ -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
@@ -31,16 +31,19 @@
# include <mlc/contract.hh>
# include <vector>
-
namespace oln {
namespace topo {
namespace combinatorial_map {
+ /// oln::combinatorial_map::internal
namespace internal {
- // any
+ /*! any
+ **
+ ** \deprecated FIXME: totally obsolete.
+ */
template <class Inf>
class any
{
@@ -49,37 +52,46 @@
Inf & self() { return static_cast<Inf &>(*this); }
};
+ /*! Function stored in a vector.
+ **
+ **
+ ** \warning FIXME: It has nothing to do there.
+ */
template <class U, class V, class Inf>
class anyfunc : public any<Inf>
{
protected:
anyfunc() : f_(1) {}
+ /// Construct a function on [0..n].
anyfunc(unsigned n) : f_(n+1) { assertion(n); }
public:
+ /// Retrieve the value f(e).
V operator()(const U & e) const
{
assertion(e < f_.size());
return f_[e];
}
+ /// Resize the domain of f.
void resize(unsigned n)
{
self().resize_(n);
}
-
+ /// Assign a value \e to f(i).
void assign(const U & i, const V & e)
{
assertion(i < f_.size());
self().assign_(i, e);
}
+ /// f(i) = 0.
void erase(const U & i)
{
assertion(i < f_.size());
self().erase_(i);
}
-
+ /// Print the function.
std::ostream & print(std::ostream & ostr) const
{
for (unsigned i = 1; i < f_.size(); ++i)
Index: olena/oln/topo/combinatorial-map/internal/beta.hh
--- olena/oln/topo/combinatorial-map/internal/beta.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/v/5_beta.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/beta.hh Sun, 14 Mar 2004
17:31:51 +0100 van-vl_n (oln/v/5_beta.hh 1.2 600)
@@ -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
@@ -38,6 +38,7 @@
namespace internal {
+ /// This function must be built using assign.
template<class U, class V = U>
class beta : public anyfunc<U, V, beta<U, V> >
{
Index: olena/oln/topo/combinatorial-map/internal/lambda.hh
--- olena/oln/topo/combinatorial-map/internal/lambda.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/v/6_lambda.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/lambda.hh Sun, 14 Mar 2004
17:41:58 +0100 van-vl_n (oln/v/6_lambda.hh 1.2 600)
@@ -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,6 +39,10 @@
namespace internal {
+ /* lambda function.
+ **
+ ** \todo FIXNE: add doc.
+ */
template <class U, class V = U>
class lambda : public anyfunc<U, V, lambda<U, V> >
{
Index: olena/oln/topo/combinatorial-map/internal/level.hh
--- olena/oln/topo/combinatorial-map/internal/level.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/v/7_level.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/level.hh Sun, 14 Mar 2004
17:34:56 +0100 van-vl_n (oln/v/7_level.hh 1.2 600)
@@ -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
@@ -38,7 +38,13 @@
namespace combinatorial_map {
namespace internal {
-
+ /* Node of a tree
+ **
+ ** \var node::lb left brother.
+ ** \var node::rb right brother.
+ ** \var node::fchild first child.
+ ** \var node::father father.
+ */
template <class U>
struct node
{
@@ -47,6 +53,10 @@
U fchild, lb, rb, father;
};
+ /* Level function.
+ **
+ ** \todo FIXME: add doc.
+ */
template <class U>
class level
{
Index: olena/oln/topo/combinatorial-map/internal/sigma.hh
--- olena/oln/topo/combinatorial-map/internal/sigma.hh Thu, 07 Aug 2003
02:37:23 +0200 burrus_n (oln/v/9_sigma.hh 1.2 600)
+++ olena/oln/topo/combinatorial-map/internal/sigma.hh Sun, 14 Mar 2004
17:40:57 +0100 van-vl_n (oln/v/9_sigma.hh 1.2 600)
@@ -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,6 +43,10 @@
namespace internal {
+ /* sigma function
+ **
+ ** \todo Add doc.
+ */
template <class U>
class sigma : public anyfunc< U, U, sigma<U> >
{
1
0
Index: olena/ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* olena/oln/core/abstract/dpoint.hh: Add comments.
* olena/oln/core/abstract/image_size.hh: Add comments.
* olena/oln/core/abstract/point.hh: Add comments.
* olena/oln/core/abstract/image.hh: Add comments.
* olena/oln/core/abstract/image_with_dim.hh: Add comments.
* olena/oln/core/abstract/image_with_impl.hh: Add comments.
* olena/oln/core/abstract/image_with_type.hh: Add comments.
* olena/oln/core/abstract/image_with_type_with_dim.hh: Add comments.
* olena/oln/core/abstract/behavior.hh: Add comments.
Index: olena/oln/core/abstract/dpoint.hh
--- olena/oln/core/abstract/dpoint.hh Fri, 23 Jan 2004 16:23:03 +0100 astrid (oln/d/28_dpoint.hh 1.18 640)
+++ olena/oln/core/abstract/dpoint.hh Thu, 11 Mar 2004 16:55:50 +0100 thivol_d (oln/d/28_dpoint.hh 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
@@ -35,16 +35,22 @@
namespace oln {
+
namespace abstract {
template<class Exact>
struct dpoint; // fwd_decl
template<class Exact>
- struct point;
+ struct point; // fwd_decl
} // end of abstract
template<class Exact>
- struct dpoint_traits;
+ struct dpoint_traits; // fwd_decl
+
+ /*! \class dpoint_traits<abstract::dpoint<Exact> >
+ **
+ ** The specialized version for abstract::dpoint<Exact>.
+ */
template<class Exact>
struct dpoint_traits<abstract::dpoint<Exact> >
@@ -52,7 +58,15 @@
};
+
namespace abstract {
+
+ /*! \class dpoint
+ **
+ ** The abstract dpoint class from whom derives
+ ** all the others dpoint classes.
+ */
+
template<class Exact>
struct dpoint : public mlc_hierarchy::any<Exact>
{
@@ -62,54 +76,93 @@
enum { dim = dpoint_traits<exact_type>::dim };
typedef typename dpoint_traits<exact_type>::point_type point_type;
+ /*! \brief Construct a dpoint with the same coordinates
+ ** a the point \a p.
+ */
+
explicit dpoint(const abstract::point<point_type>& p)
{
for (unsigned i = 0; i < dim; ++i)
nth(i) = p.exact().nth(i);
}
+ /// Return the dth coordinate of the current dpoint.
+
coord
nth(const unsigned d) const
{
return coord_[d];
}
+ /// Return a reference to the dth coordinate of the current dpoint.
coord&
nth(const unsigned d)
{
return coord_[d];
}
+ /*! \brief Return a dpoint whose coordinates are the opposite
+ ** of the current dpoint coordinates.
+ */
+
exact_type
operator-() const
{
return this->exact().minus();
}
+ /*! \brief Add a dpoint \a dp to the current dpoint.
+ **
+ ** \return A reference to the current dpoint plus \a dp.
+ */
+
exact_type&
operator+=(const self_type& dp)
{
return this->exact().plus_assign_dp(dp.exact());
}
+ /*! \brief Subtract a dpoint \a dp from the current dpoint.
+ **
+ ** \return A reference to the current point minus \a dp.
+ */
+
exact_type&
operator-=(const self_type& dp)
{
return this->exact().minus_assign_dp(dp.exact());
}
+ /*! \brief Add a dpoint \a dp to the current dpoint.
+ **
+ ** \return The value of the current point plus \a dp.
+ */
+
exact_type
operator+(const self_type& dp) const
{
return this->exact().plus_dp(dp.exact());
}
+ /*! \brief Subtract a dpoint \a dp from the current dpoint.
+ **
+ ** \return The value of the current point minus \a dp.
+ */
+
exact_type
operator-(const self_type& dp) const
{
return this->exact().minus_dp(dp.exact());
}
+ /*! \brief Test if two dpoints have the same coordinates.
+ **
+ ** \arg dp A dpoint.
+ **
+ ** \return True if \a dp and the current point have the same
+ ** coordinate, false otherwise.
+ */
+
bool
operator==(const self_type& dp) const
{
@@ -119,6 +172,14 @@
return true;
}
+ /*! \brief Test if two dpoints do not have the same coordinates.
+ **
+ ** \arg dp A dpoint.
+ **
+ ** \return False if \a dp and the current point have the same
+ ** coordinate, true otherwise.
+ */
+
bool
operator!=(const self_type& dp) const
{
@@ -128,6 +189,12 @@
return false;
}
+ /*! \brief Test if all the dpoint coordinates are set to zero.
+ **
+ ** \return True if all the coordinates of the current dpoint
+ ** are set to zero.
+ */
+
bool
is_centered(void) const
{
@@ -137,6 +204,8 @@
return true;
}
+ /// Return the norm of the current dpoint.
+
ntg::float_d
norm2(void) const
{
@@ -147,6 +216,8 @@
return sqrt(norm);
}
+ /// Return the square of the norm of the current dpoint.
+
ntg::float_d
sqr_norm2(void) const
{
@@ -176,11 +247,30 @@
} // end of abstract
+ /*! \namespace oln::internal
+ ** \brief internal namespace.
+ */
+
+
namespace internal
{
+
+ /*! \class default_less< abstract::dpoint<Exact> >
+ **
+ ** The specialized version for < abstract::dpoint<Exact> >.
+ */
+
+
template<class Exact>
struct default_less< abstract::dpoint<Exact> >
{
+
+ /*! \brief Test if the coordinates of a dpoint l
+ ** are not greater than the coordinates of a dpoint r.
+ **
+ ** \return True if the coordinates of l are not greater
+ ** than the coordinates of r.
+ */
bool operator()(const abstract::dpoint<Exact>& l,
const abstract::dpoint<Exact>& r) const
{
Index: olena/oln/core/abstract/image_size.hh
--- olena/oln/core/abstract/image_size.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/c/41_image_size 1.10 640)
+++ olena/oln/core/abstract/image_size.hh Thu, 11 Mar 2004 16:55:46 +0100 thivol_d (oln/c/41_image_size 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
@@ -34,10 +34,14 @@
# include <ntg/utils/debug.hh>
# include <sstream>
+
+
namespace oln {
namespace abstract {
+
+
template<class Exact>
struct image_size; // fwd_decl
@@ -46,13 +50,28 @@
template<class Exact>
struct image_size_traits;
+ /*! \class image_size_traits<abstract::image_size<Exact> >
+ **
+ ** A class specialized for each image type
+ ** which gives the dimension of the template
+ ** parameter.
+ */
+
template<class Exact>
struct image_size_traits<abstract::image_size<Exact> >
{
};
+
namespace abstract {
+
+ /*! \class image_size
+ **
+ ** The class that defines the image size
+ ** according to its dimension.
+ */
+
template<class Exact>
struct image_size : public mlc_hierarchy::any< Exact >
{
@@ -61,6 +80,10 @@
enum { dim = image_size_traits<Exact>::dim };
+ /*! \brief Return the number of coordinates
+ ** in the nth section of the image.
+ */
+
coord
nth(unsigned n) const
{
@@ -68,6 +91,11 @@
return coord_[n];
}
+ /*! \brief Return a reference to the number of coordinates
+ ** in the nth section of the image.
+ */
+
+
coord&
nth(unsigned n)
{
@@ -75,18 +103,27 @@
return coord_[n];
}
+ /// Return the value border width of the current image.
coord
border() const
{
return border_;
}
+ /// Return a reference to the border width of the current image.
+
coord&
border()
{
return border_;
}
+ /*! \brief Test if two images
+ ** have compatible size.
+ **
+ ** \return True if the two images have compatible size, false otherwise.
+ */
+
template< class S >
bool
operator==(const image_size<S>& size) const
@@ -97,6 +134,11 @@
return true;
}
+ /*! \brief Test if two images do not have compatible size
+ **
+ ** \return False if the two images have compatible size, true otherwise.
+ */
+
template< class S >
bool
operator!=(const image_size<S>& size) const
@@ -108,6 +150,7 @@
}
+
static std::string
name()
{
@@ -117,13 +160,25 @@
protected:
+
image_size()
{}
+ /*! border_ represents the width of the image border
+ ** such a mecanism allow algorithm to perform operation
+ ** on the points at the edge of the image as if they were
+ ** normally surrounded by points
+ */
+
coord border_;
private:
+
+ /*! \brief An array that contains the number
+ ** of coordinates for each dimension.
+ */
+
coord coord_[dim];
};
Index: olena/oln/core/abstract/point.hh
--- olena/oln/core/abstract/point.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/c/33_point.hh 1.15 640)
+++ olena/oln/core/abstract/point.hh Thu, 11 Mar 2004 16:55:53 +0100 thivol_d (oln/c/33_point.hh 1.15 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
@@ -35,19 +35,23 @@
# include <iostream>
# include <sstream>
-
namespace oln
{
namespace abstract {
template<class Exact>
- struct point;
+ struct point; // fwd declaration
template<class Exact>
- struct dpoint;
+ struct dpoint; // fwd declaration
} // end of abstract
template<class Exact>
- struct point_traits;
+ struct point_traits; // fwd declaration
+
+ /*! \class point_traits<abstract::point<Exact> >
+ **
+ ** The specialized implementation for abstract::point.
+ */
template<class Exact>
struct point_traits<abstract::point<Exact> >
@@ -56,6 +60,13 @@
};
namespace abstract {
+
+ /*! \class point
+ **
+ ** The abstract class from whom derives all the others
+ ** point classes.
+ */
+
template<class Exact>
struct point : public mlc_hierarchy::any<Exact>
{
@@ -65,56 +76,97 @@
typedef point<Exact> self_type;
typedef Exact exact_type;
typedef typename point_traits<Exact>::dpoint_type dpoint_type;
+
enum { dim = point_traits<Exact>::dim };
+ /// Return the current point casted in exact_type.
+
const exact_type&
point_ref() const
{
return this->exact();
}
+ /// Give the value of the nth coordinate of the point.
+
coord
nth(const unsigned dim) const
{
return coord_[dim];
}
+ /// Return a reference to the nth coordinate of the point.
+
coord&
nth(const unsigned dim)
{
return coord_[dim];
}
+ /*! \brief Add a delta point \a dp to the current point
+ **
+ ** \return The current point plus \a dp.
+ */
+
exact_type&
operator+=(const abstract::dpoint<dpoint_type>& dp)
{
return this->exact().plus_assign_dp(dp.exact());
}
+ /*! \brief Subtract a delta point \a dp from the current point.
+ **
+ ** \return The current point minus \a dp.
+ */
+
+
exact_type&
operator-=(const abstract::dpoint<dpoint_type>& dp)
{
return this->exact().minus_assign_dp(dp.exact());
}
+ /*! \brief Subtract a point \a p from the current point.
+ **
+ ** \return A reference to this current point minus \a p.
+ */
+
dpoint_type
operator-(const self_type& p) const
{
return this->exact().minus_p(p.exact());
}
+
+ /*! \brief Give the result of the addition of
+ ** a delta point \a dp and the current point
+ **
+ ** \return The result of the addition of \a dp and the current point.
+ */
+
exact_type
operator+(const abstract::dpoint<dpoint_type>& dp) const
{
return this->exact().plus_dp(dp.exact());
}
+ /*! \brief Give the result of the subtraction of
+ ** a delta point \a dp and the current point.
+ **
+ ** \return The result of the subtraction of \a dp and the current point.
+ */
+
+
exact_type
operator-(const abstract::dpoint<dpoint_type>& dp) const
{
return this->exact().minus_dp(dp.exact());
}
+ /*! \brief Return a point whose coordinates are
+ ** the opposite of the current point coordinates
+ */
+
exact_type
operator-() const
{
@@ -122,6 +174,12 @@
}
+ /*! \brief Test if \a p and the current point have the same coordinates
+ **
+ ** \return True if \a p and the current point have the same coordinates,
+ ** false otherwise.
+ */
+
bool
operator==(const self_type& p) const
{
@@ -131,6 +189,14 @@
return true;
}
+
+ /*! \brief Test if \a p and the current point do
+ ** not have the same coordinates.
+ **
+ ** \return False if \a p and the current point have
+ ** the same coordinates, true otherwise.
+ */
+
bool
operator!=(const self_type& p) const
{
@@ -153,17 +219,40 @@
private:
+ /*! \brief The coordinates of the point are stored
+ ** in this array.
+ */
+
coord coord_[dim];
};
} // end of abstract
+
namespace internal
{
+
+ /*! \class default_less< abstract::point<Exact> >
+ **
+ ** The specialized version for abstract::point.
+ */
+
template<class Exact>
struct default_less< abstract::point<Exact> >
{
+
+ /*! \brief Test if the coordinates of a point l
+ ** are not greater than the coordinates of a point r.
+ **
+ ** \arg l A point.
+ **
+ ** \arg r Another point.
+ **
+ ** \return True if the coordinates of l are not greater
+ ** than the coordinates of r.
+ */
+
bool operator()(const abstract::point<Exact>& l,
const abstract::point<Exact>& r) const
{
Index: olena/oln/core/abstract/image.hh
--- olena/oln/core/abstract/image.hh Wed, 11 Feb 2004 11:51:35 +0100 van-vl_n (oln/t/25_image.hh 1.20 640)
+++ olena/oln/core/abstract/image.hh Thu, 11 Mar 2004 17:01:49 +0100 thivol_d (oln/t/25_image.hh 1.20 640)
@@ -34,7 +34,10 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/abstract/iter.hh>
+
namespace oln {
+
+
namespace abstract {
// fwd_decl
@@ -49,55 +52,119 @@
template<class Ima>
struct image_traits;
+ /*! \class image_traits
+ **
+ ** A helping structure to find the
+ ** exact_type of a given class.
+ */
+
template <class Exact>
struct image_traits<abstract::image<Exact> >
{
typedef Exact exact_type;
};
+
+
namespace abstract {
+ /*! \class image
+ **
+ ** The image class whom derives all
+ ** other image classes.
+ */
+
template <class Exact>
class image : public mlc_hierarchy::any_with_diamond<Exact>
{
public:
typedef typename image_traits<Exact>::point_type point_type;
+ /*!< Prefer the macro oln_point_type(I) to retrieve the point_type
+ ** of an image.
+ **
+ ** \see point
+ */
typedef typename image_traits<Exact>::dpoint_type dpoint_type;
+ /*!< Prefer the macro oln_dpoint_type(I) to retrieve the dpoint_type
+ ** of an image.
+ **
+ ** \see dpoint
+ */
typedef typename image_traits<Exact>::iter_type iter_type;
+ /*!< Prefer the macro oln_iter_type(I) to retrieve the iter_type
+ ** of an image
+ **
+ ** \see iter
+ */
typedef typename image_traits<Exact>::fwd_iter_type fwd_iter_type;
+ /*!< Forward iterator type. */
typedef typename image_traits<Exact>::bkd_iter_type bkd_iter_type;
+ /*!< Backward iterator type. */
typedef typename image_traits<Exact>::value_type value_type;
+ /*!< Prefer the macro oln_value_type(I) to retrieve the value_type
+ ** of an image.
+ */
typedef typename image_traits<Exact>::size_type size_type;
+ /*!< Indicate how the image size is handled.
+ **
+ ** \see image_size
+ */
typedef typename image_traits<Exact>::impl_type impl_type;
+ /*!< Underlying implementation. */
typedef image<Exact> self_type;
typedef Exact exact_type;
enum { dim = image_traits<Exact>::dim };
+
+ /*! \brief Return a reference to the value stored
+ ** at \a p in the current image.
+ */
+
const value_type&
operator[](const abstract::point<point_type>& p) const
{
return this->exact().at(p.exact());
}
+ /*! \brief Return the value stored stored at \a p
+ ** in the current image.
+ */
+
value_type&
operator[](const abstract::point<point_type>& p)
{
return this->exact().at(p.exact());
}
+ /*! \brief Indicate if the image can be processed.
+ **
+ ** \return True if the image can be processed, false otherwise.
+ */
+
bool
has_impl() const
{
return this->exact().impl() != 0;
}
+ /*! \brief Clone the image, all the points are
+ ** duplicated.
+ **
+ ** \return A real copy of the current image.
+ */
+
exact_type
clone() const
{
return this->exact().clone_();
}
+ /*! \brief Test if the point \a p belong to the image.
+ **
+ ** \return True if p belong to the image, false otherwise.
+ */
+
bool
hold(const abstract::point<point_type>& p) const
{
@@ -105,6 +172,8 @@
return this->exact().impl()->hold(p.exact());
}
+ /// Return a reference to the image size.
+
const size_type&
size() const
{
@@ -112,18 +181,32 @@
return this->exact().impl()->size();
}
+ /// Return the value of the border width.
+
coord
border() const
{
return size().border();
}
+ /*! \brief Return the total number of points
+ ** in the current image.
+ */
+
+
size_t
npoints() const
{
return this->exact().npoints_();
}
+ /*! \brief Perform a shallow copy from \rhs to
+ ** the current image, the points are not duplicated
+ ** but shared between the two images.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
@@ -140,6 +223,17 @@
// borders
+
+ /*! \brief Set the width of the border to perform
+ ** operations on the image sides.
+ **
+ ** \arg new_border The new value of the border width.
+ **
+ ** \arg copy_border Its default value is false.
+ **
+ ** \see image_size::border_
+ */
+
void
border_set_width(coord new_border, bool copy_border = false) const
{
@@ -151,6 +245,17 @@
const_cast<impl_type *>(this->exact().impl())->border_reallocate_and_copy(new_border, copy_border);
}
+ /*! \brief Adapt the border if min_border is
+ ** less or equal to the current border
+ ** value.
+ **
+ ** \arg min_border The new value of the border width.
+ **
+ ** \arg copy_border Its default value is false.
+ **
+ ** \see image_size::border_
+ */
+
void
border_adapt_width(coord min_border, bool copy_border =
false) const
@@ -162,6 +267,14 @@
this->exact().border_set_width(min_border, copy_border);
}
+ /*! \brief The border points will have the same
+ ** value as the nearer real point of the image.
+ **
+ ** \arg min_border The new value of the border width.
+ **
+ ** \see image_size::border_
+ */
+
void
border_adapt_copy(coord min_border) const
{
@@ -169,6 +282,13 @@
const_cast<impl_type *>(this->exact().impl())->border_replicate();
}
+ /*! \brief The border points value are set according
+ ** to the value of the points on the image sides.
+ **
+ ** \arg min_border The new value of the border width.
+ **
+ ** \see image_size::border_
+ */
void
border_adapt_mirror(coord min_border) const
@@ -177,6 +297,16 @@
const_cast<impl_type *>(this->exact().impl())->border_mirror();
}
+ /*! \brief The border points value will be equal to
+ ** the \a val parameters.
+ **
+ ** \arg min_border The new value of the border width.
+ **
+ ** \arg val The new value of the border points.
+ **
+ ** \see image_size::border_
+ */
+
void
border_adapt_assign(coord min_border, value_type val) const
{
@@ -185,6 +315,7 @@
}
protected:
+
image()
{}
Index: olena/oln/core/abstract/image_with_dim.hh
--- olena/oln/core/abstract/image_with_dim.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/t/26_image_with 1.18 640)
+++ olena/oln/core/abstract/image_with_dim.hh Thu, 11 Mar 2004 16:55:46 +0100 thivol_d (oln/t/26_image_with 1.18 640)
@@ -1,4 +1,4 @@
-// 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
@@ -40,6 +40,8 @@
# include <cstdlib>
+
+
namespace oln {
// fwd decl
@@ -66,59 +68,129 @@
} // end of namespace abstract
+
+ /*! \class image_traits<abstract::image_with_dim<1, Exact> >
+ **
+ ** The specialized version for 1d image.
+ */
+
template <class Exact>
struct image_traits<abstract::image_with_dim<1, Exact> >
: public image_traits<abstract::image<Exact> >
{
+
enum {dim = 1};
+ /*!< Image1d dimension = 1. */
typedef point1d point_type;
+ /*!< Image1d point_type is point1d. */
typedef dpoint1d dpoint_type;
+ /*!< Image1d dpoint_type is dpoint1d. */
typedef fwd_iter1d<mlc::final> iter_type;
+ /*!< Image1d iter_type is fwd_iter1d<mlc::final>. */
typedef fwd_iter1d<mlc::final> fwd_iter_type;
+ /*!< Image1d fwd_iter_type is fwd_iter1d<mlc::final>. */
typedef bkd_iter1d<mlc::final> bkd_iter_type;
+ /*!< Image1d bkd_iter_type is bkd_iter1d<mlc::final>. */
typedef image1d_size size_type;
+ /*!< Image1d size_type is image1d_size. */
};
+
+ /*! \class image_traits<abstract::image_with_dim<2, Exact> >
+ **
+ ** The specialized version for 2d image.
+ **
+ */
+
template <class Exact>
struct image_traits<abstract::image_with_dim<2, Exact> >
: public image_traits<abstract::image<Exact> >
{
enum {dim = 2};
+ /*!< Imaged2 dimension = 2. */
typedef point2d point_type;
+ /*!< Imaged2 point_type is point2d. */
typedef dpoint2d dpoint_type;
+ /*!< Image2d dpoint_type is dpoint2d. */
typedef fwd_iter2d<mlc::final> iter_type;
+ /*!< Image2d iter_type is fwd_iter2d<mlc::final>. */
typedef fwd_iter2d<mlc::final> fwd_iter_type;
+ /*!< Image2d fwd_iter_type is fwd_iter2d<mlc::final>. */
typedef bkd_iter2d<mlc::final> bkd_iter_type;
+ /*!< Image2d bkd_iter_type is bkd_iter2d<mlc::final>. */
typedef image2d_size size_type;
+ /*!< Image2d size_type is image2d_size. */
};
+ /*! \class image_traits<abstract::image_with_dim<3, Exact> >
+ **
+ ** The specialized version for 3d image.
+ */
+
template <class Exact>
struct image_traits<abstract::image_with_dim<3, Exact> >
: public image_traits<abstract::image<Exact> >
{
enum {dim = 3};
+ /*!< Image3d dimension = 3. */
typedef point3d point_type;
+ /*!< Image3d point_type is point3d. */
typedef dpoint3d dpoint_type;
+ /*!< Image3d dpoint_type is dpoint3d. */
typedef fwd_iter3d<mlc::final> iter_type;
+ /*!< Image3d iter_type is fwd_iter3d<mlc::final>. */
typedef fwd_iter3d<mlc::final> fwd_iter_type;
+ /*!< Image3d fwd_iter_type is fwd_iter3d<mlc::final>. */
typedef bkd_iter3d<mlc::final> bkd_iter_type;
+ /*!< Image3d bkd_iter_type is bkd_iter3d<mlc::final>. */
typedef image3d_size size_type;
+ /*!< Image3d size_type is image3d_size. */
};
+
namespace abstract {
- // one-dimensional specialization
+
+ /*! \class image_with_dim<1, Exact>: virtual public image<Exact>
+ **
+ ** The specialized version for image1d.
+ */
+
template <class Exact>
class image_with_dim<1, Exact>: virtual public image<Exact>
{
public:
typedef typename image_traits<Exact>::point_type point_type;
+ /*!< Prefer the macro oln_point_type(I) to retrieve the point_type
+ ** of an image.
+ **
+ ** \see oln::point1d
+ */
typedef typename image_traits<Exact>::point_type dpoint_type;
+ /*!< Prefer the macro oln_dpoint_type(I) to retrieve the dpoint_type
+ ** of an image.
+ **
+ ** \see oln::dpoint1d
+ */
typedef typename image_traits<Exact>::iter_type iter_type;
+ /*!< Prefer the macro oln_iter_type(I) to retrieve the iter_type
+ ** of an image.
+ **
+ ** \see iter1d
+ */
typedef typename image_traits<Exact>::fwd_iter_type fwd_iter_type;
+ /*!< Forward iterator type. */
typedef typename image_traits<Exact>::bkd_iter_type bkd_iter_type;
+ /*!< Backward iterator type. */
typedef typename image_traits<Exact>::value_type value_type;
+ /*!< Prefer the macro oln_value_type(I) to retrieve the value_type
+ ** of an image.
+ */
typedef typename image_traits<Exact>::size_type size_type;
+ /*!< Indicate how the image size is handled.
+ **
+ ** \see oln::image1d_size
+ */
typedef image<Exact> super_type;
typedef image_with_dim<1, Exact> self_type;
@@ -126,18 +198,29 @@
friend class image<exact_type>;
+
+ /// Return the number of columns in the current image.
+
coord
ncols() const
{
return this->size().ncols();
}
+ /*! \brief Return the value stored at \a col coordinate
+ ** in the current image.
+ */
+
const value_type
operator()(coord col) const
{
return this->exact()[point_type(col)];
}
+ /*! \brief Return a reference to the value stored
+ ** at \a col coordinate in the current image.
+ */
+
value_type&
operator()(coord col)
{
@@ -146,12 +229,26 @@
using super_type::hold;
+ /*! \brief Test if a point belongs to the current image.
+ **
+ ** \arg col Column coordinate of the point.
+ **
+ ** \return True if the point belongs to the image, false otherwise.
+ */
+
bool
hold(coord col) const
{
return hold(point_type(col));
}
+ /*! \brief Perform a shallow copy from \a rhs to
+ ** the current image, the points are not duplicated
+ ** but shared between the two images
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
@@ -169,6 +266,7 @@
protected:
+ /// Return the total number of points in the current image.
size_t
npoints_() const
{
@@ -180,43 +278,88 @@
}; // end of one-dimensional specialization
- // bi-dimensional specialization
+
+
+ /*! \class image_with_dim<2, Exact>: virtual public image<Exact>
+ **
+ ** The specialized version for image2d.
+ */
+
+
template <class Exact>
class image_with_dim<2, Exact>: virtual public image<Exact>
{
public:
+
typedef typename image_traits<Exact>::point_type point_type;
- typedef typename image_traits<Exact>::dpoint_type dpoint_type;
+ /*!< Prefer the macro oln_point_type(I) to retrieve the point_type
+ ** of an image.
+ **
+ ** \see oln::point2d
+ */
+ typedef typename image_traits<Exact>::point_type dpoint_type;
+ /*!< Prefer the macro oln_dpoint_type(I) to retrieve the dpoint_type
+ ** of an image.
+ **
+ ** \see oln::dpoint2d
+ */
typedef typename image_traits<Exact>::iter_type iter_type;
+ /*!< Prefer the macro oln_iter_type(I) to retrieve the iter_type
+ ** of an image.
+ **
+ ** \see iter2d
+ */
typedef typename image_traits<Exact>::fwd_iter_type fwd_iter_type;
+ /*!< Forward iterator type. */
typedef typename image_traits<Exact>::bkd_iter_type bkd_iter_type;
+ /*!< Backward iterator type. */
typedef typename image_traits<Exact>::value_type value_type;
+ /*!< Prefer the macro oln_value_type(I) to retrieve the value_type
+ ** of an image.
+ */
typedef typename image_traits<Exact>::size_type size_type;
+ /*!< Indicate how the image size is handled.
+ **
+ ** \see oln::image2d_size
+ */
+ typedef image<Exact> super_type;
typedef image_with_dim<2, Exact> self_type;
typedef Exact exact_type;
- typedef image<Exact> super_type;
friend class image<exact_type>;
+
+ /// Return the number of rows in the current image.
coord
nrows() const
{
return this->size().nrows();
}
+
+ /// Return the number of columns in the current image.
+
coord
ncols() const
{
return this->size().ncols();
}
+ /*! \brief Return the value stored at \a row, \a col
+ ** coordinates on the current image.
+ */
+
const value_type
operator()(coord row, coord col) const
{
return this->exact()[point_type(row, col)];
}
+ /*! \brief Return a reference to the value stored
+ ** at \a row, \a col coordinates on the current image.
+ */
+
value_type&
operator()(coord row, coord col)
{
@@ -225,12 +368,29 @@
using super_type::hold;
+ /*! \brief Test if a point belongs to the current image.
+ **
+ ** \arg row Row coordinate of the point.
+ **
+ ** \arg col Column coordinate of the point.
+ **
+ ** \return True if the point belongs to the image, false otherwise.
+ */
+
bool
hold(coord row, coord col) const
{
return hold(point_type(row, col));
}
+ /*! \brief Perform a shallow copy from \a rhs
+ ** to the current image, the points are not
+ ** duplicated but shared between the two
+ ** image.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
@@ -248,6 +408,9 @@
protected:
+
+ /// Return the total number of points in the current image.
+
size_t
npoints_() const
{
@@ -259,49 +422,97 @@
}; // end of bi-dimensional specialization
- // tri-dimensional specialization
+
+ /*! \class image_with_dim<3, Exact>: virtual public image<Exact>
+ **
+ ** The specialized version for image3d.
+ */
+
template <class Exact>
class image_with_dim<3, Exact>: virtual public image<Exact>
{
public:
typedef typename image_traits<Exact>::point_type point_type;
+ /*!< Prefer the macro oln_point_type(I) to retrieve the point_type
+ ** of an image.
+ **
+ ** \see oln::point3d
+ */
typedef typename image_traits<Exact>::point_type dpoint_type;
+ /*!< Prefer the macro oln_dpoint_type(I) to retrieve the dpoint_type
+ ** of an image.
+ **
+ ** \see oln::dpoint3d
+ */
typedef typename image_traits<Exact>::iter_type iter_type;
+ /*!< Prefer the macro oln_iter_type(I) to retrieve the iter_type
+ ** of an image.
+ **
+ ** \see iter3d
+ */
typedef typename image_traits<Exact>::fwd_iter_type fwd_iter_type;
+ /*!< Forward iterator type. */
typedef typename image_traits<Exact>::bkd_iter_type bkd_iter_type;
+ /*!< Backward iterator type. */
typedef typename image_traits<Exact>::value_type value_type;
+ /*!< Prefer the macro oln_value_type(I) to retrieve the value_type
+ ** of an image.
+ */
typedef typename image_traits<Exact>::size_type size_type;
- typedef image<Exact> super_type;
+ /*!< Indicate how the image size is handled.
+ **
+ ** \see oln::image3d_size
+ */
+ typedef image<Exact> super_type;
typedef image_with_dim<3, Exact> self_type;
typedef Exact exact_type;
friend class image<exact_type>;
+
+
+ /// Return the number of slices in the current image.
+
coord
nslices() const
{
return this->size().nslices();
}
+
+ /// Return the number of rows in the current image.
+
coord
nrows() const
{
return this->size().nrows();
}
+ /// Return the number of columns in the image.
+ */
+
coord
ncols() const
{
return this->size().ncols();
}
+ /*! \brief Return the value stored at \a slice, \a row
+ ** and \a col coordinates on the current image.
+ */
+
const value_type
operator()(coord slice, coord row, coord col) const
{
return this->exact()[point_type(slice, row, col)];
}
+ /*! \brief Return a reference to the value stored
+ ** at \a slice, \a row and \a col coordinates on
+ ** the current image.
+ */
+
value_type&
operator()(coord slice, coord row, coord col)
{
@@ -310,12 +521,31 @@
using super_type::hold;
+ /*! \brief Test if a point belongs to the current image.
+ **
+ ** \arg slice Slice coordinate of the point.
+ **
+ ** \arg row Row coordinate of the point.
+ **
+ ** \arg col Column coordinate of the point.
+ **
+ ** \return True if the point belongs to the image, false otherwise.
+ */
+
bool
hold(coord slice, coord row, coord col) const
{
return hold(point_type(slice, row, col));
}
+ /*! \brief Perform a shallow copy from \a rhs
+ ** to the current image, the points are not
+ ** duplicated but shared between the two
+ ** image.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
@@ -333,12 +563,17 @@
protected:
+
+
+ /// Return the total number of points in the current image.
+
size_t
npoints_() const
{
return size_t(nslices()) * size_t(nrows()) * size_t(ncols());
}
+
image_with_dim() : super_type()
{}
@@ -349,6 +584,7 @@
} // end of namespace oln
+/// Print all the values contained in the image on an output stream.
template<class Exact>
inline std::ostream&
@@ -362,6 +598,9 @@
return o;
}
+
+/// Print all the values contained in the image on an output stream.
+
template<class Exact>
inline std::ostream&
operator<<(std::ostream& o, const oln::abstract::image_with_dim<2, Exact>& ima)
@@ -382,6 +621,8 @@
return o;
}
+/// Print all the values contained in the image on an output stream.
+
template<class Exact>
inline std::ostream&
operator<<(std::ostream& o, const oln::abstract::image_with_dim<3, Exact>& ima)
Index: olena/oln/core/abstract/image_with_impl.hh
--- olena/oln/core/abstract/image_with_impl.hh Mon, 25 Aug 2003 11:47:33 +0200 burrus_n (oln/t/27_image_with 1.14.1.8 640)
+++ olena/oln/core/abstract/image_with_impl.hh Thu, 11 Mar 2004 16:55:46 +0100 thivol_d (oln/t/27_image_with 1.14.1.8 640)
@@ -1,4 +1,4 @@
-// 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
@@ -31,6 +31,7 @@
# include <oln/core/abstract/image_with_type_with_dim.hh>
# include <oln/core/impl/image_impl.hh>
+
namespace oln {
namespace abstract {
@@ -40,6 +41,13 @@
} // end of namespace abstract
+ /*! \class image_traits<abstract::image_with_impl<Impl, Exact> >
+ **
+ ** The specialized version for image_with_impl,
+ ** give the impl_type of an image.
+ **
+ */
+
template<class Impl, class Exact>
struct image_traits<abstract::image_with_impl<Impl, Exact> > :
public image_traits<typename abstract::image_with_dim<image_id<Exact>::dim, Exact> >,
@@ -48,30 +56,66 @@
typedef Impl impl_type;
};
+
+
namespace abstract {
+ /*! \class image_with_impl
+ **
+ ** This class contains all the implementation relative methods.
+ */
+
template<class Impl, class Exact>
class image_with_impl:
public image_with_type_with_dim_switch<Exact>::ret
{
public:
+
typedef typename image_traits<Exact>::point_type point_type;
+ /*!< Prefer the macro oln_point_type(I) to retrieve the point_type
+ ** of an image.
+ **
+ ** \see point
+ */
typedef typename image_traits<Exact>::iter_type iter_type;
+ /*!< Prefer the macro oln_iter_type(I) to retrieve the iter_type
+ ** of an image.
+ **
+ ** \see iter
+ */
typedef typename image_traits<Exact>::fwd_iter_type fwd_iter_type;
+ /*!< Forward iterator type. */
typedef typename image_traits<Exact>::bkd_iter_type bkd_iter_type;
+ /*!< Backward iterator type. */
typedef typename image_traits<Exact>::value_type value_type;
+ /*!< Prefer the macro oln_value_type(I) to retrieve the value_type
+ ** of an image.
+ */
typedef typename image_traits<Exact>::size_type size_type;
+ /*!< Indicate how the image size is handled.
+ **
+ ** \see image_size
+ */
typedef typename image_traits<Exact>::impl_type impl_type;
+ /*!< Underlying implementation. */
typedef image_with_impl<Impl, Exact> self_type;
typedef Exact exact_type;
typedef typename image_with_type_with_dim_switch<Exact>::ret super_type;
-
friend class image<exact_type>;
friend class image_with_dim<image_id<Exact>::dim, exact_type>;
friend class image_with_type<typename image_id<Exact>::value_type, Exact>;
// shallow copy
+
+ /*! /brief Construct a new image by performing
+ ** a shallow copy, the points will not be
+ ** duplicated but shared between \a rhs and the
+ ** current image.
+ **
+ ** \see image::clone()
+ */
+
image_with_impl(self_type& rhs)
: super_type(rhs)
{
@@ -80,18 +124,29 @@
impl_->ref();
}
+ /*! \brief Perform a shallow copy from rhs to
+ ** the current image, the points will not be
+ ** duplicated but shared between the two images.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
return this->exact().assign(rhs.exact());
}
+ /// Return the core data of the image.
+
const impl_type*
impl() const
{
return impl_;
}
+ /// Return the core data of the image.
+
impl_type*
impl()
{
@@ -107,6 +162,10 @@
+ Exact::name() + ">";
}
+ /*! \brief Create a copy of the current image data,
+ ** at the \a output_data address.
+ */
+
void
clone_to(impl_type* output_data) const
{
@@ -114,6 +173,8 @@
impl()->clone_to(output_data);
}
+ /// Free the image data.
+
void
clear()
{
@@ -126,18 +187,44 @@
protected:
+ /*! \brief Return a reference to the value stored
+ ** at \a p in the current image.
+ **
+ ** \warning This method must not be overloaded,
+ ** unlike operator[].
+ **
+ ** \see image::operator[]()
+ */
+
const value_type&
at(const point_type& p) const
{
return impl_->at(p);
}
+
+ /*! \brief Return the value stored at \a p in the
+ ** current image.
+ **
+ ** \warning This method must not be overloaded,
+ ** unlike operator[].
+ **
+ ** \see image::operator[]()
+ */
+
value_type&
at(const point_type& p)
{
return impl_->at(p);
}
+ /*! \brief Perform a shallow copy from \a rhs to
+ ** the current image, the points will not be
+ ** duplicated but shared between the two images.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
assign(exact_type rhs) // shallow assignment
{
@@ -156,9 +243,15 @@
clear();
}
+ /*! \brief Empty constructor for image_with_impl,
+ ** set \a impl_ to 0
+ */
+
image_with_impl() : impl_(0)
{}
+ /// Assign \a impl to \a this->impl_.
+
image_with_impl(impl_type* impl) :
super_type(),
impl_(impl)
@@ -168,7 +261,12 @@
private:
+ /*! \brief Implementation type of the image.
+ ** It can be an array, a std::vector, ...
+ */
+
impl_type* impl_;
+
image_with_impl(const self_type& rhs); // w/o impl
};
Index: olena/oln/core/abstract/image_with_type.hh
--- olena/oln/core/abstract/image_with_type.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/t/28_image_with 1.11 640)
+++ olena/oln/core/abstract/image_with_type.hh Thu, 11 Mar 2004 16:55:46 +0100 thivol_d (oln/t/28_image_with 1.11 640)
@@ -1,4 +1,4 @@
-// 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
@@ -38,10 +38,19 @@
namespace abstract {
template<class T, class Exact>
- class image_with_type;
+ class image_with_type; //fwd declaration
} // end of namespace abstract
+
+ /*! \class image_traits<abstract::image_with_type<T, Exact> >
+ **
+ ** The specialized version for image_with_type
+ **
+ ** \warning This class may change, prefer the macro oln_value_type(I)
+ ** to retrieve the value_type of an image.
+ */
+
template <class T, class Exact>
struct image_traits<abstract::image_with_type<T, Exact> >
: public image_traits<abstract::image<Exact> >
@@ -49,17 +58,31 @@
typedef T value_type;
};
+
namespace abstract {
+
+ /*! \class image_with_type
+ **
+ ** The template parameter T gives the value_type of the image.
+ */
+
template<class T, class Exact>
class image_with_type: virtual public image<Exact>
{
public:
- typedef image<Exact> super_type;
+ typedef image<Exact> super_type; /*!< The base class whom derives image_with_type. */
typedef image_with_type<T, Exact> self_type;
typedef Exact exact_type;
+ /*! \brief Shallow copy from \a rhs to the current image,
+ ** the points will not be duplicated but shared between
+ ** the two images.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
Index: olena/oln/core/abstract/image_with_type_with_dim.hh
--- olena/oln/core/abstract/image_with_type_with_dim.hh Sun, 02 Nov 2003 17:27:23 +0100 burrus_n (oln/v/11_image_with 1.4 600)
+++ olena/oln/core/abstract/image_with_type_with_dim.hh Thu, 11 Mar 2004 16:55:46 +0100 thivol_d (oln/v/11_image_with 1.4 600)
@@ -1,4 +1,4 @@
-// Copyright (C) 2003 EPITA Research and Development Laboratory
+// Copyright (C) 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,11 +34,13 @@
# include <oln/core/abstract/image_with_type.hh>
# include <oln/core/abstract/image_with_dim.hh>
+// oln_label_image_(Name, Super)
// Define a type label image This macro create two classes,
// Name<Exact> and Name##_with_dim<N, Exact>. Super is used to
// determine the parent class of Name##_with_dim and is suffixed with
// _with_dim.
+
# define oln_label_image_(Name, Super) \
template <class Exact> \
class Name \
@@ -87,21 +89,28 @@
<< Exact::name() << ">"; \
return s.str(); \
} \
- }
+ };
namespace oln {
namespace abstract {
+
// The label images here were defined because they appeared to be
// quite handy. They are different than using image_with_type<T>,
// because it handle categories of types, not only one.
-
+ //
// With each label image, another label_with_dim<Dim, Exact> class
// is defined.
-
+ //
// Proxy towards image_with_type
+ /*! \class data_type_image
+ **
+ ** This class is used as a proxy towards image_with_type.
+ ** \note This shouldn't be used.
+ */
+
template <class Exact>
struct data_type_image
: virtual public image_with_type<typename image_id<Exact>::value_type, Exact>
@@ -111,6 +120,14 @@
typedef data_type_image<Exact> self_type;
typedef Exact exact_type;
+ /*! \brief Perform a shallow copy between \a rhs and the
+ ** current point, the points will not be duplicated but
+ ** shared between the two images.
+ **
+ ** \see image::clone()
+ */
+
+
exact_type&
operator=(self_type rhs)
{
@@ -126,6 +143,15 @@
}
};
+ /*! \class data_type_image_with_dim
+ **
+ **
+ ** This class when used in a function declaration,
+ ** force the function to only accept images with a
+ ** dimension equal to \a Dim.
+ */
+
+
template <unsigned Dim, class Exact>
struct data_type_image_with_dim :
virtual public data_type_image<Exact>,
@@ -136,6 +162,13 @@
typedef data_type_image<Exact> self_type;
typedef Exact exact_type;
+ /*! \brief Perform a shallow copy between \a rhs and the
+ ** current point, the points will not be duplicated but
+ ** shared between the two images.
+ **
+ ** \see image::clone()
+ */
+
exact_type&
operator=(self_type rhs)
{
@@ -151,12 +184,90 @@
}
};
+ /*! This class, when used in a function declaration,
+ ** forces the function to only accept vectorial images.
+ */
+
oln_label_image_(vectorial_image, data_type_image);
+
+ /*! This class, when used in a function declaration,
+ ** forces the function to only accept vectorial images
+ ** with a dimension equal to 'Dim'.
+ */
+
+
+ /*! \class non_vectorial_image
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept non vectorial images.
+ */
+
oln_label_image_(non_vectorial_image, data_type_image);
+
+ /*! \class non_vectorial_image_with_dim
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept non vectorial images.
+ ** with a dimension equal to 'Dim'
+ */
+
+
+ /*! \class binary_image
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept binary images.
+ */
+
oln_label_image_(binary_image, non_vectorial_image);
+
+ /*! \class binary_image_with_dim
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept binary images
+ ** with a dimension equal to 'Dim'.
+ */
+
+
+ /*! \class integer_image
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept integer images.
+ */
+
oln_label_image_(integer_image, non_vectorial_image);
+
+ /*! \class integer_image_with_dim
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept integer images
+ ** with a dimension of 'Dim'.
+ */
+
+
+ /*! \class decimal_image
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept decimal images.
+ */
+
oln_label_image_(decimal_image, non_vectorial_image);
+ /*! \class decimal_image_with_dim
+ **
+ ** This class, when used in a function declaration,
+ ** forces the function to only accept decimal images
+ ** with a dimension of 'Dim'.
+ */
+
+
+
+ /*! \class image_with_type_with_dim_switch
+ **
+ ** A metaswitch that return the right type of
+ ** an image regarding its dimension and
+ ** value_type.
+ */
+
template<class Exact>
struct image_with_type_with_dim_switch
{
@@ -164,6 +275,8 @@
typedef typename image_id<Exact>::value_type T;
+
+
typedef typename mlc::bool_switch_<
mlc::bool_case_<ntg_is_a(T, ntg::binary)::ret,
@@ -184,7 +297,15 @@
mlc::bool_case_<true,
data_type_image_with_dim<Dim, Exact> >
- > > > > > >::ret ret;
+ > > > > > >::ret ret; /*!< Translated in pseudo code :\n
+ ** switch (T)\n
+ ** case ntg::binary : ret = binary_image_with_dim<Dim, Exact>\n
+ ** case ntg::integer : ret = integer_image_with_dim<Dim, Exact>\n
+ ** case ntg::decimal : ret = decimal_image_with_dim<Dim, Exact>\n
+ ** case ntg::vectorial : ret = vectorial_image_with_dim<Dim, Exact>\n
+ ** case ntg::non_vectorial : ret = non_vectorial_image_with_dim<Dim, Exact>\n
+ ** default : ret = data_type_image_with_dim<Dim, Exact>\n
+ */
};
} // end of namespace abstract
Index: olena/oln/core/abstract/behavior.hh
--- olena/oln/core/abstract/behavior.hh Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/j/46_behavior.h 1.2 644)
+++ olena/oln/core/abstract/behavior.hh Thu, 11 Mar 2004 16:56:00 +0100 thivol_d (oln/j/46_behavior.h 1.2 644)
@@ -31,30 +31,29 @@
# include <oln/core/abstract/image.hh>
# include <oln/core/coord.hh>
-/*! \namespace oln
-** \brief oln namespace
-*/
+
namespace oln {
- /*! \namespace abstract
- ** \brief abstract namespace
- */
+
+
namespace abstract {
/*! \class behavior
- ** behavior hierarchy
+ ** Behavior hierarchy.
**
- ** the aim of this one is to describe how an algorithm should work
- ** on borders
+ ** The aim of this one is to describe how an algorithm should work
+ ** on borders.
*/
template <class Exact>
class behavior: public mlc_hierarchy::any<Exact>
{
public:
- typedef behavior<Exact> self_type; /*!< the self type*/
- typedef mlc_exact_vt_type(self_type, Exact) exact_type; /*!< the exact type*/
+ typedef behavior<Exact> self_type;
+ /*!< The self type.*/
+ typedef mlc_exact_vt_type(self_type, Exact) exact_type;
+ /*!< The exact type.*/
/*!
- ** \brief Adapt the border of an image
+ ** \brief Adapt the border of an image.
**
** Adapt the border of an image regarding the kind of behavior wanted.
*/
@@ -67,7 +66,7 @@
/*!
** \brief CTor
**
- ** Do nothing, used only by sub-classes
+ ** Do nothing, used only by sub-classes.
*/
behavior() {};
};
--
Damien Thivolle
damien.thivolle(a)lrde.epita.fr
2
2
Index: olena/ChangeLog
from Giovanni Palma <giovanni(a)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
2
1
Index: olena/ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* olena/oln/core/abstract/image.hh: Add comments.
* olena/oln/core/abstract/image_with_dim.hh: Correct comments.
Index: olena/oln/core/abstract/image.hh
--- olena/oln/core/abstract/image.hh Thu, 11 Mar 2004 17:41:14 +0100 odou_s (oln/t/25_image.hh 1.22 600)
+++ olena/oln/core/abstract/image.hh Thu, 11 Mar 2004 20:18:22 +0100 thivol_d (oln/t/25_image.hh 1.22 600)
@@ -200,7 +200,7 @@
return this->exact().npoints_();
}
- /*! \brief Perform a shallow copy from \rhs to
+ /*! \brief Perform a shallow copy from \a rhs to
** the current image, the points are not duplicated
** but shared between the two images.
**
@@ -231,6 +231,10 @@
**
** \arg copy_border Its default value is false.
**
+ ** \pre new_border >= 0
+ **
+ ** \pre has_impl() == true
+ **
** \see image_size::border_
*/
@@ -253,6 +257,8 @@
**
** \arg copy_border Its default value is false.
**
+ ** \pre min_border >= 0
+ **
** \see image_size::border_
*/
@@ -346,7 +352,7 @@
# define oln_dpoint_type(DPointable) \
mlc_exact_type(DPointable)::dpoint_type
# define oln_dpoint_type_(Pointable) \
-mlc_exact_type_(Pointable)::point_type
+mlc_exact_type_(Pointable)::dpoint_type
} // end of namespace oln
Index: olena/oln/core/abstract/image_with_dim.hh
--- olena/oln/core/abstract/image_with_dim.hh Thu, 11 Mar 2004 17:12:19 +0100 thivol_d (oln/t/26_image_with 1.19 600)
+++ olena/oln/core/abstract/image_with_dim.hh Thu, 11 Mar 2004 20:06:20 +0100 thivol_d (oln/t/26_image_with 1.19 600)
@@ -490,7 +490,6 @@
}
/// Return the number of columns in the image.
- */
coord
ncols() const
--
Damien Thivolle
damien.thivolle(a)lrde.epita.fr
1
0
Need for doc's examples.
Index: olena/ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* olena/oln/core/abstract/image.hh: Add same macros without the
'template' keyword.
Index: olena/oln/core/abstract/image.hh
--- olena/oln/core/abstract/image.hh Thu, 11 Mar 2004 17:12:19 +0100 thivol_d (oln/t/25_image.hh 1.21 600)
+++ olena/oln/core/abstract/image.hh Thu, 11 Mar 2004 17:36:10 +0100 odou_s (oln/t/25_image.hh 1.21 600)
@@ -327,18 +327,26 @@
# define oln_value_type(ImgType) \
mlc_exact_type(ImgType)::value_type
+# define oln_value_type_(ImgType) \
+mlc_exact_type_(ImgType)::value_type
# define oln_concrete_type(ImgType) \
typename mute<ImgType>::ret
# define oln_iter_type(Iterable) \
mlc_exact_type(Iterable)::iter_type
+# define oln_iter_type_(Iterable) \
+mlc_exact_type_(Iterable)::iter_type
# define oln_point_type(Pointable) \
mlc_exact_type(Pointable)::point_type
+# define oln_point_type_(Pointable) \
+mlc_exact_type_(Pointable)::point_type
# define oln_dpoint_type(DPointable) \
mlc_exact_type(DPointable)::dpoint_type
+# define oln_dpoint_type_(Pointable) \
+mlc_exact_type_(Pointable)::point_type
} // end of namespace oln
--
Simon Odou
simon(a)lrde.epita.fr
1
0
Index: olena/ChangeLog
from Niels Van Vliet <niels(a)lrde.epita.fr>
* olena/oln/level/compare.hh: Add comments.
* olena/oln/level/connected.hh: Add comments.
* olena/oln/level/fill.hh: Add comments.
* olena/oln/level/invert.hh: Add comments.
* olena/oln/level/lut.hh: Add comments.
* olena/oln/level/set_level.hh: Add comments.
* olena/oln/level/threshold.hh: Add comments.
+2004-03-10 Niels Van Vliet <niels(a)lrde.epita.fr>
+
+ * olena/oln/snakes/snakes_base.hh: Add comments.
+ * olena/oln/snakes/energies.hh: Add comments.
+ * olena/oln/snakes/greedy.hh: Add comments.
+ * olena/oln/snakes/node.hh: Add comments.
+ * olena/oln/snakes/segment.hh: Add comments.
+ * olena/oln/snakes/snakes_base.hh: Add comments.
+ * olena/oln/morpho/attribute_closing_opening.hh: Fix bug in doc.
+ * olena/oln/morpho/attribute_closing_opening_map.hh: Fix bug in doc.
2004-03-10 Giovanni Palma <giovanni(a)lrde.epita.fr>
Index: olena/oln/level/cc.hh
--- olena/oln/level/cc.hh Fri, 07 Nov 2003 17:26:19 +0100 burrus_n
(oln/e/20_cc.hh 1.11.1.9 640)
+++ olena/oln/level/cc.hh Thu, 11 Mar 2004 15:45:41 +0100 van-vl_n
(oln/e/20_cc.hh 1.11.1.9 640)
@@ -1,4 +1,4 @@
-// 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
@@ -40,49 +40,75 @@
# include <oln/level/fill.hh>
# include <oln/level/invert.hh>
# include <oln/level/compare.hh>
+
# include <set>
# include <list>
# include <vector>
+# include <ntg/core/macros.hh>
+# include <mlc/is_a.hh>
namespace oln {
+ /*! \namespace oln::level
+ ** \brief level namespace.
+ */
namespace level {
// optional behavior for this algorithm.
struct update_label;
- /*=processing frontp_connected_component
- * ns: level
- * what: Connected Component.
- * arg: const abstract::image<I>&, marker, IN, marker image
- * arg: const abstract::neighborhood<E>&, se, IN, neighbourhood
- * arg: numeric_value&, nb, IN, nb_label (optional)
- * ret: typename mute<I, DestType>::ret
- * doc: It removes the small (in area) connected components of the
upper
- * level sets of \var{input} using \var{se} as structural element.
- * The implementation
- * uses front propagation.
- * see: level::connected_component
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(level::frontp_connected_component<int_u16>(light, win_c8p()),
- * $ "out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
-
-
- // Number the connected components i.e label true. background(i.e
- // label false) has the label 0; in the output
- // FIXME: Should probably be turned into a class.
+ /*! \brief Processing frontp_connected_component extract
+ ** the connected components.
+ **
+ ** It removes the small (in area) connected components of the upper
+ ** level sets of \var{input} using \var{se} as structural element.
+ **
+ ** \ref The implementation uses front propagation.
+ **
+ ** \pre the input must be a binary image.
+ **
+ ** \arg input Image of markers.
+ ** \arg se Neighbourhood.
+ ** \arg nb_label Returns the number of label (optional).
+ **
+ ** \return An image of type \a DestType.
+ **
+ **
+ ** \see level::connected_component
+ ** \todo FIXME: Should probably be turned into a class.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/level/cc.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ **
+ ** int main()
+ ** {
+ ** unsigned card;
+ ** oln::image2d<ntg::bin> light = oln::load(IMG_IN "face_se.pbm");
+ ** save(oln::level::frontp_connected_component<ntg::int_u8>(light,
+ ** oln::neighb_c8(),
+ ** card),
+ ** IMG_OUT "oln_level_frontp_connected_component.pgm");
+ ** std::cout << card << " connected components" << std::endl;
+ ** }
+ ** \endcode
+ ** \image html face_se.png
+ ** \image latex face_se.png
+ ** =>
+ ** \image html oln_level_frontp_connected_component.png
+ ** \image latex oln_level_frontp_connected_component.png
+ */
+
template <class DestType, class I, class E>
typename mute<I, DestType>::ret
frontp_connected_component(const abstract::image<I>& input,
const abstract::neighborhood<E>& se,
unsigned& nb_label)
{
- // FIXME: ensure the oln_value_type(I) is ntg::bin.
+ ntg_is_a(oln_value_type(I), ntg::binary)::ensure();
+
typename mute<I, DestType>::ret output(input.size());
level::fill(output, 0);
Index: olena/oln/level/compare.hh
--- olena/oln/level/compare.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n
(oln/31_compare.hh 1.8 640)
+++ olena/oln/level/compare.hh Thu, 11 Mar 2004 15:45:41 +0100 van-vl_n
(oln/31_compare.hh 1.8 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,6 +34,10 @@
namespace level {
+ /*! \brief Tests if all pixels of input1 are greater or equal than
input2.
+ **
+ ** \pre input1.size() == input2.size()
+ **/
template<class I1, class I2> inline
bool
is_greater_or_equal(const abstract::image<I1>& input1,
@@ -47,6 +51,10 @@
return true;
}
+ /*! \brief Tests if all pixels of input1 are greater than input2.
+ **
+ ** \pre input1.size() == input2.size()
+ **/
template<class I1, class I2> inline
bool
is_greater(const abstract::image<I1>& input1,
@@ -60,6 +68,10 @@
return true;
}
+ /*! \brief Tests if all pixels of input1 are lower or equal than
input2.
+ **
+ ** \pre input1.size() == input2.size()
+ **/
template<class I1, class I2> inline
bool
is_lower_or_equal(const abstract::image<I1>& input1,
@@ -73,6 +85,10 @@
return true;
}
+ /*! \brief Tests if all pixel of input1 are lower than input2.
+ **
+ ** \pre input1.size() == input2.size()
+ **/
template<class I1, class I2> inline
bool
is_lower(const abstract::image<I1>& input1,
@@ -86,6 +102,11 @@
return true;
}
+
+ /*! \brief Tests if input1 is equal to input2.
+ **
+ ** \pre input1.size() == input2.size()
+ **/
template<class I1, class I2> inline
bool
is_equal(const abstract::image<I1>& input1,
Index: olena/oln/level/connected.hh
--- olena/oln/level/connected.hh Thu, 07 Aug 2003 02:37:23 +0200
burrus_n (oln/30_connected. 1.9.1.11 640)
+++ olena/oln/level/connected.hh Thu, 11 Mar 2004 15:45:41 +0100
van-vl_n (oln/30_connected. 1.9.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
@@ -38,27 +38,24 @@
namespace level {
- /*=processing connected_component
- * ns: level
- * what: Connected Component.
- * arg: const abstract::image<I1>&, marker, IN, marker image
- * arg: const abstract::neighborhood<E>&, se, IN, structural element
- * ret: typename mute<I, DestType>::ret
- * doc: It removes the small (in area) connected components of the
upper
- * level sets of \var{input} using \var{se} as structural element. The
- * implementation comes from \emph{Cocquerez et Philipp, Analyse
d'images,
- * filtrages et segmentations} p.62.
- * see: level::frontp_connected_component
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(level::connected_component<int_u8>(light, win_c8p()),
"out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
-
+ /* \brief Processing connected_component extract the connected
components.
+ **
+ ** \arg: input image
+ ** \arg: Ng neighborhood
+ **
+ ** \return Returns a labeled image
+ **
+ ** It removes the small (in area) connected components of the upper
+ ** level sets of \var{input} using \var{se} as structural element.
+ **
+ ** \ref The implementation comes from Cocquerez et Philipp, Analyse
+ ** d'images, filtrages et segmentations p.62.
+ **
+ ** \see level::frontp_connected_component
+ ** \todo FIXME: The type of input shoud be a binary 2d image.
+ */
// Number the connected components i.e label true. background(i.e
- // label false) has the label 0; This algorithm works only for 2D
images
+ // label false) has the label 0; This algorithm works only for 2D
images.
template <class DestType, class I, class N>
typename mute<I, DestType>::ret
connected_component(const abstract::image<I>& input,
Index: olena/oln/level/fill.hh
--- olena/oln/level/fill.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n
(oln/32_fill.hh 1.9 640)
+++ olena/oln/level/fill.hh Thu, 11 Mar 2004 15:45:41 +0100 van-vl_n
(oln/32_fill.hh 1.9 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,6 +34,8 @@
namespace level {
+ /*! \brief Fill the image with a value.
+ */
template <class I>
oln_concrete_type(I)
fill(abstract::image<I>& im, const oln_value_type(I)& val)
Index: olena/oln/level/invert.hh
--- olena/oln/level/invert.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n
(oln/33_invert.hh 1.5.2.2.1.10 640)
+++ olena/oln/level/invert.hh Thu, 11 Mar 2004 15:45:41 +0100 van-vl_n
(oln/33_invert.hh 1.5.2.2.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
@@ -39,8 +39,11 @@
namespace level {
- // ftors
-
+ /*! \brief Fctor to invert a value
+ **
+ ** \see invert.
+ ** \note FIXME: the specialisation is done within the class.
+ */
template<class T>
struct f_invert : public std::unary_function<const ntg::value<T>&, T>
{
@@ -90,8 +93,7 @@
}
};
- // procs
-
+ /*! \brief Return the image inverted. */
template<class I>
inline oln_concrete_type(I)
invert(const abstract::image<I>& input)
@@ -99,6 +101,7 @@
return apply(f_invert<oln_value_type(I)>(), input);
}
+ /*! \brief Invert an image. */
template<class I>
inline void
invert_self(abstract::image<I>& input)
Index: olena/oln/level/lut.hh
--- olena/oln/level/lut.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n
(oln/29_lut.hh 1.9 640)
+++ olena/oln/level/lut.hh Thu, 11 Mar 2004 15:45:41 +0100 van-vl_n
(oln/29_lut.hh 1.9 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
@@ -36,9 +36,20 @@
namespace level {
- // few values -> new values
- // otherwise -> id
-
+ /*! \brief Look up table "id" version.
+ **
+ ** If the value has not been set, return id (see the example).
+ **
+ ** \see hlut_def
+ ** \verbatim
+ ** hlut<int> l;
+ **
+ ** l.set(16, 64);
+ **
+ ** cout << l(16) << "," // print 64,
+ ** << l(51) << endl; // print 51
+ ** \endverbatim
+ */
template<class T, class T2 = T>
class hlut
{
@@ -50,6 +61,11 @@
hlut()
{}
+ /*! Register a value.
+ **
+ ** \arg val Key.
+ ** \arg newval Value corresponding to the key.
+ */
hlut&
set(const T& val, const T2& newval)
{
@@ -57,6 +73,10 @@
return *this;
}
+ /*! Get the value corresponding to the key.
+ **
+ ** Return the key if the key has not been set.
+ **/
const T2
operator()(const T& val) const
{
@@ -70,9 +90,23 @@
};
- // few values -> new values
- // otherwise -> default value
-
+ /*! \brief Look up table "default" version.
+ **
+ ** If the value has not been set, return the default value.
+ ** \note The default value can be redefined.
+ **
+ ** \see hlut_def
+ ** \verbatim
+ ** hlut_def<int> l;
+ **
+ ** l.set(16, 64);
+ **
+ ** cout << l(16) << "," // print "64,"
+ ** << l(51) << endl; // print "0"
+ ** l.set_default(42);
+ ** cout << l(51) << endl; // print "42"
+ ** \endverbatim
+ */
template<class T, class T2 = T>
class hlut_def
{
@@ -86,6 +120,11 @@
defaultval_ = T2();
}
+ /*! Register a value.
+ **
+ ** \arg val Key.
+ ** \arg newval Value corresponding to the key.
+ */
hlut_def&
set(const T& val, const T2& newval)
{
@@ -93,6 +132,7 @@
return *this;
}
+ //! Set a default value.
hlut_def&
set_default(const T2& defaultval)
{
@@ -100,6 +140,10 @@
return *this;
}
+ /*! Get the value corresponding to the key.
+ **
+ ** Return defaultval_ if the key has not been set.
+ */
const T2
operator()(const T& val) const
{
Index: olena/oln/level/set_level.hh
--- olena/oln/level/set_level.hh Thu, 07 Aug 2003 02:37:23 +0200
burrus_n (oln/p/1_set_level. 1.9 640)
+++ olena/oln/level/set_level.hh Thu, 11 Mar 2004 15:45:41 +0100
van-vl_n (oln/p/1_set_level. 1.9 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
@@ -35,6 +35,49 @@
namespace level {
+
+ /*!
+ ** \brief Draw a line between two points in the image.
+ **
+ ** \arg inout a 2d image.
+ ** \arg p1 A point in the image.
+ ** \arg p2 A point in the image (p1 and p2 can be swaped).
+ ** \arg level Value of the line.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/level/set_level.hh>
+ ** #include <ntg/all.hh>
+ **
+ ** int main()
+ ** {
+ ** oln::image2d<ntg::int_u8> in = oln::load(IMG_IN "lena256.pgm");
+ ** oln::coord R = in.nrows();
+ ** oln::coord C = in.ncols();
+ **
+ ** //Draw the line
+ ** oln::level::set_level(in,
+ ** oln::point2d(R * 1/4, C* 1/2),
+ ** oln::point2d(R * 4/5, C* 7/8),
+ ** 0);
+ **
+ **
+ ** oln::box<oln::point2d> b;
+ ** b.add(oln::point2d(R * 1/6, C * 1/6));
+ ** b.add(oln::point2d(R * 4/5, C * 1/3));
+ **
+ ** //Draw the box
+ ** oln::level::set_level(in, b, 255);
+ **
+ ** save(in, IMG_OUT "oln_level_set_level.pgm");
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html oln_level_set_level.png
+ ** \image latex oln_level_set_level.png
+ */
template <class I>
void
set_level(abstract::image_with_dim<2,I>& inout,
@@ -89,7 +132,10 @@
inout(iRow,iCol) = level;
}
-
+ /*! Draw a box in the image.
+ **
+ ** \see set_level for an example.
+ */
template <class I, class BoxType>
void
set_level(abstract::image_with_dim<2,I>& inout,
Index: olena/oln/level/threshold.hh
--- olena/oln/level/threshold.hh Tue, 09 Sep 2003 13:53:41 +0200 palma_g
(oln/f/15_threshold. 1.12 640)
+++ olena/oln/level/threshold.hh Thu, 11 Mar 2004 15:45:41 +0100
van-vl_n (oln/f/15_threshold. 1.12 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
@@ -35,11 +35,42 @@
namespace level {
- /* Threshold the value of the image. */
+ /*! \brief Threshold the value of the image.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/level/threshold.hh>
+ ** #include <ntg/all.hh>
+ ** using namespace ntg;
+ ** int main()
+ ** {
+ ** oln::image2d<int_u8> in = oln::load(IMG_IN "lena256.pgm");
+ ** int_u8 th = 127;
+ ** rgb_8 low = rgb_8(100, 0, 0);
+ ** rgb_8 height = rgb_8(0, 200, 255);
+ **
+ ** oln::image2d<rgb_8> out
+ ** = apply(oln::level::threshold<int_u8, rgb_8 >(th, low, height),
+ ** in);
+ ** save(out, IMG_OUT "oln_level_threshold.ppm");
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html oln_level_threshold.png
+ ** \image latex oln_level_threshold.png
+ */
template<class Input, class Output, class Exact = mlc::final>
class threshold : public std::unary_function<const Input&, Output>
{
public:
+ /*! \arg Threshold any value heigher or equal to this value will
+ ** return \a min.
+ ** \arg min Value returned if the input is smaller than threshold.
+ ** \arg max Value returned if the input is greater or equal to the
+ ** threshold.
+ */
threshold(const Input& threshold,
const Output& min = ntg_min_val(Output),
const Output& max = ntg_max_val(Output)) :
1
0
Index: olena/ChangeLog
from Niels Van Vliet <niels(a)lrde.epita.fr>
* olena/oln/snakes/snakes_base.hh: Add comments
* olena/oln/snakes/energies.hh: Add comments
* olena/oln/snakes/greedy.hh: Add comments
* olena/oln/snakes/node.hh: Add comments
* olena/oln/snakes/segment.hh: Add comments
* olena/oln/snakes/snakes_base.hh: Add comments
* olena/oln/morpho/attribute_closing_opening.hh: Fix bug in doc
* olena/oln/morpho/attribute_closing_opening_map.hh: Fix bug in doc
Index: olena/oln/morpho/attribute_closing_opening.hh
--- olena/oln/morpho/attribute_closing_opening.hh Wed, 10 Mar 2004
16:20:23 +0100 palma_g (oln/q/49_attribute_ 1.17 640)
+++ olena/oln/morpho/attribute_closing_opening.hh Thu, 11 Mar 2004
15:14:01 +0100 van-vl_n (oln/q/49_attribute_ 1.17 640)
@@ -327,7 +327,7 @@
**
** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::maxvalue_closing(im1,
oln::neighb_c4(), 5);
- ** oln::save(im1, IMG_OUT
"oln_morpho_fast_maxvalue_closing.png.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.ppm");
** return 0;
** }
** \endcode
Index: olena/oln/snakes/snakes_base.hh
--- olena/oln/snakes/snakes_base.hh Wed, 21 Jan 2004 05:11:16 +0100
astrid (oln/f/50_snakes_bas 1.1 644)
+++ olena/oln/snakes/snakes_base.hh Wed, 10 Mar 2004 18:51:37 +0100
van-vl_n (oln/f/50_snakes_bas 1.1 644)
@@ -32,8 +32,15 @@
namespace oln {
+ /*! \namespace oln::snakes
+ ** Namespace snakes.
+ */
namespace snakes {
-
+ /*! Snake algorithm.
+ **
+ ** \attention FIXME: Do not work due to the function node::energy.
+ ** \todo FIXME: Add doc & test.
+ */
template <class algorithm>
class snake
{
@@ -57,6 +64,7 @@
ntg::float_s
energy(void) const;
///< Return the snake energy. This is not algorithm-dependant.
+ ///< \attention FIXME: Do not work due to the function node::energy
public:
int
Index: olena/oln/snakes/energies.hh
--- olena/oln/snakes/energies.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid
(oln/j/22_energies.h 1.1 644)
+++ olena/oln/snakes/energies.hh Wed, 10 Mar 2004 18:51:37 +0100
van-vl_n (oln/j/22_energies.h 1.1 644)
@@ -32,6 +32,8 @@
namespace snakes {
+ /*! Base class for energy.
+ */
template <class I>
class energy
{
@@ -40,6 +42,11 @@
energy(void *) {}
public:
+ /*! Return the energy.
+ **
+ ** The first arg is the gradient of the image;
+ ** the 3 nodes are the previous, the current and the next node.
+ */
ntg::float_s
compute(const I&, const node<I>&, const node<I>&, const node<I>&)
{
@@ -52,6 +59,7 @@
}
public:
+ //! FIXME: What is that?
static void* cookie() { return 0; };
private:
@@ -59,6 +67,14 @@
};
+ /*! Energy of continuity.
+ **
+ ** The goal of this energy is to avoid pack of nodes an lack
+ ** of nodes in some part of the snake. The average distance
+ ** between two consecutive points is \a average_dist. The
+ ** more the distance between \a prev and \a current is
+ ** far from \a average_dist, the higher the energy is.
+ */
template <class I>
class continuity_energy : public energy<I>
{
@@ -82,6 +98,13 @@
};
+ /*! Energy of curvature.
+ **
+ ** The snake is supposed to be applied on object that
+ ** have smooth edge (example: an egg). The more the
+ ** \a prev \a current \a next nodes are aligned, the
+ ** less the energy is.
+ */
template <class I>
class curvature_energy : public energy<I>
{
@@ -101,6 +124,11 @@
};
+ /*! Energy of the gradient.
+ **
+ ** The snake should follow the edge of the object.
+ ** The higher the gradient is, the less the energy is.
+ */
template <class I>
class image_energy : public energy<I>
{
@@ -120,7 +148,10 @@
};
- // This macro allows the user to define his own external energy.
+ /*! This macro allows the user to define his own external energy.
+ **
+ ** \see dummy_energy
+ */
#define oln_snakes_define_external_energy(Energy, Gradient, PrevNode,
CurrentNode, NextNode) \
\
template<class I> \
@@ -148,7 +179,7 @@
const ::oln::snakes::node<I>& NextNode)
- // Default external energy.
+ //! Default external energy.
oln_snakes_define_external_energy(dummy_energy,,,,)
{
return 0;
Index: olena/oln/snakes/greedy.hh
--- olena/oln/snakes/greedy.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid
(oln/j/25_greedy.hh 1.1 644)
+++ olena/oln/snakes/greedy.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n
(oln/j/25_greedy.hh 1.1 644)
@@ -36,7 +36,13 @@
namespace snakes {
- /// N is the size of the neighborhood.
+ /*! This class can be use as the algorithm of snake.
+ **
+ ** \param N is the size of the neighborhood.
+ ** \pre N must be odd.
+ ** \see snake
+ */
+
template <int N, class I, template<typename> class external_energy
= dummy_energy>
class greedy
{
Index: olena/oln/snakes/node.hh
--- olena/oln/snakes/node.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid
(oln/j/32_node.hh 1.1 644)
+++ olena/oln/snakes/node.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n
(oln/j/32_node.hh 1.1 644)
@@ -34,6 +34,10 @@
namespace snakes {
+ /*! A node is a point used in ring.
+ **
+ ** \attention FIXME: Do not work due to the function energy.
+ */
template<class I>
class node : public I::point_type
{
@@ -48,6 +52,10 @@
}
public:
+ /*! Return the energy
+ **
+ ** FIXME: not implemented, do not work
+ */
inline
ntg::float_s
energy(const I& gradient, point_type prev, point_type next) const;
@@ -61,7 +69,7 @@
} // end oln
-
+//! Print the position of a node \a n
template <class I>
std::ostream& operator<<(std::ostream& os, const oln::snakes::node<I>& n)
{
Index: olena/oln/snakes/segment.hh
--- olena/oln/snakes/segment.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid
(oln/j/34_segment.hh 1.1 644)
+++ olena/oln/snakes/segment.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n
(oln/j/34_segment.hh 1.1 644)
@@ -37,6 +37,10 @@
namespace snakes {
+ /*! A segment is a list of node.
+ **
+ ** \attention FIXME: Do not work due to the function node::energy.
+ */
template <class I>
class segment
{
@@ -53,6 +57,9 @@
ntg::float_s
energy(const I& gradient) const;
///< Just iterate through the vector and sums up point energies.
+ ///<
+ ///< \attention FIXME: Do not work due to the function node::energy.
+
public:
std::list<point_type>
Index: olena/oln/morpho/attribute_closing_opening_map.hh
--- olena/oln/morpho/attribute_closing_opening_map.hh Wed, 10 Mar 2004
16:20:23 +0100 palma_g (oln/j/49_attribute_ 1.4 600)
+++ olena/oln/morpho/attribute_closing_opening_map.hh Thu, 11 Mar 2004
15:13:57 +0100 van-vl_n (oln/j/49_attribute_ 1.4 600)
@@ -423,7 +423,7 @@
**
** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::slow::maxvalue_closing(im1,
oln::neighb_c4(), 5);
- ** oln::save(im1, IMG_OUT
"oln_morpho_fast_maxvalue_closing.png.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.ppm");
** return 0;
** }
** \endcode
1
0
Index: doc/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* ref/out/exdoc.config.in: Correct autotools variable problems.
* ref/img_conv.pl: Add file extension.
* ref/Makefile.am: Fix compilation problems
Index: olena/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* tests/morpho/tests/attr_op_cl: Initialize uninitialized variable.
* tests/morpho/tests/attribute: Correct name of called functions.
* oln/morpho/extrema.hh: Add comments.
* oln/morpho/attribute_closing_opening_map.hh: Likewise.
* oln/morpho/attributes.hh: Likewise.
* oln/morpho/attribute_union_find.hh: Likewise.
* oln/morpho/attribute_closing_opening.hh: Likewise.
* oln/morpho/extrema_killer.hh: Likewise.
* oln/morpho/extrema.hxx: Likewise.
* oln/morpho/erosion.hh: Likewise.
* oln/morpho/closing.inc: Likewise.
Index: doc/ref/Makefile.am
--- doc/ref/Makefile.am Mon, 08 Mar 2004 13:27:07 +0100 palma_g (oln/d/51_Makefile.a 1.27.1.11 640)
+++ doc/ref/Makefile.am Wed, 10 Mar 2004 11:04:21 +0100 palma_g (oln/d/51_Makefile.a 1.27.1.11 640)
@@ -12,7 +12,7 @@
doc: html.tar.gz oln-ref.pdf
-html:
+doxy:
$(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)
mkdir -p img
cd $(OUT_DIR) && make -f makefile
@@ -20,10 +20,10 @@
$(IMG_CONV) img img
$(DOXYGEN) doxygen.config
-html.tar.gz:
+html.tar.gz: doxy
$(TAR) -czf $@ html
-oln-ref.pdf: html
+oln-ref.pdf: doxy
cd latex && make && cp refman.pdf ../$@
dist_noinst_DATA = oln-ref.pdf html.tar.gz $(srcdir)/exdoc.pl $(srcdir)/img_conv.pl
Index: olena/oln/morpho/closing.inc
--- olena/oln/morpho/closing.inc Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/44_closing.in 1.14 640)
+++ olena/oln/morpho/closing.inc Wed, 10 Mar 2004 11:43:18 +0100 palma_g (oln/44_closing.in 1.14 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
@@ -44,6 +44,41 @@
* exi: object.pbm
* exo: out.pbm
=*/
+/*!
+** \brief Processing closing.
+**
+** Compute the morphological closing of input using se as structural
+** element.
+**
+** \param I: exact type of the input image.
+** \param E: exact type of the structural element.
+**
+** \arg input: input image to close.
+** \arg se: structural element to use.
+**
+** \warning This code is the same for morpho and morpho::fast
+** namespaces.
+**
+** \code
+** #include <oln/basics2d.hh>
+** #include <oln/morpho/closing.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::closing(im1, oln::win_c8p()), IMG_OUT "oln_morpho_closing.pbm");
+** return 0;
+** }
+** \endcode
+** \image html object.png
+** \image latex object.png
+** =>
+** \image html oln_morpho_closing.png
+** \image latex oln_morpho_closing.png
+*/
template<class I, class E>
oln_concrete_type(I)
closing(const abstract::non_vectorial_image<I>& input,
Index: olena/oln/morpho/erosion.hh
--- olena/oln/morpho/erosion.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/b/4_erosion.hh 1.17 640)
+++ olena/oln/morpho/erosion.hh Wed, 10 Mar 2004 11:58:38 +0100 palma_g (oln/b/4_erosion.hh 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
@@ -36,35 +36,51 @@
namespace oln {
namespace morpho {
-
- /*=processing erosion
- * ns: morpho, morpho::fast
- * what: Morphological erosion.
- * 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 erosion of \var{input} using \var{se}
- * as structural element.
- *
- * On grey-scale images, each point is replaced by the minimum value
- * of its neighbors, as indicated by \var{se}. On binary images,
- * a logical \code{and} is performed between neighbors.
- * The \code{morpho::fast} version of this function use a different
- * algorithm: 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_erosion
- * see: morpho::dilation
- * ex:
- * $ image2d<ntg::bin> im = load("object.pbm");
- * $ save(morpho::erosion(im, win_c8p()), "out.pbm");
- * exi: object.pbm
- * exo: out.pbm
- =*/
+ /*!
+ ** \brief Perform a morphological erosion.
+ **
+ ** Compute the morphological erosion of input using se
+ ** as structural element.
+ **
+ ** On grey-scale images, each point is replaced by the minimum
+ ** value of its neighbors, as indicated by se. On binary
+ ** images, a logical and is performed between neighbors. The
+ ** 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
+ ** element is large.
+ **
+ ** \param I: exact type of the input image.
+ ** \param E: exact type of the structural element.
+ **
+ **
+ ** \arg input: input image.
+ ** \arg se: structural element to use.
+ **
+ ** \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::erosion(im1, oln::win_c8p()), IMG_OUT "oln_morpho_erosion.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html object.png
+ ** \image latex object.png
+ ** =>
+ ** \image html oln_morpho_erosion.png
+ ** \image latex oln_morpho_erosion.png
+ **
+ ** \see oln::morpho::fast::erosion()
+ */
template<class I, class E>
oln_concrete_type(I)
erosion(const abstract::non_vectorial_image<I>& input,
@@ -80,19 +96,39 @@
return output;
}
- /*=processing n_erosion
- * ns: morpho
- * what: Morphological erosion 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::erosion} \var{n} times.
- * see: morpho::erosion
- * see: morpho::n_dilation
- =*/
-
+ /*!
+ ** \brief Perform morphological erosion itered n times.
+ **
+ **
+ ** \param I: exact type of the input image.
+ ** \param E: exact type of the structural element.
+ **
+ ** \arg input: input image.
+ ** \arg se: structural element to use.
+ ** \arg n: number of iterations.
+ **
+ ** \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::n_erosion(im1, oln::win_c8p(), 5), IMG_OUT "oln_morpho_n_erosion.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html object.png
+ ** \image latex object.png
+ ** =>
+ ** \image html oln_morpho_n_erosion.png
+ ** \image latex oln_morpho_n_erosion.png
+ **
+ */
template<class I, class E>
oln_concrete_type(I)
n_erosion(const abstract::non_vectorial_image<I> & input,
@@ -111,6 +147,41 @@
}
namespace fast {
+ /*!
+ ** \brief Perform a morphological erosion.
+ **
+ ** Compute the morphological erosion of input using se
+ ** as structural element.
+ **
+ ** \param I: exact type of the input image.
+ ** \param E: exact type of the structural element.
+ **
+ **
+ ** \arg input: input image.
+ ** \arg se: structural element to use.
+ **
+ ** \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::erosion(im1, oln::win_c8p()), IMG_OUT "oln_morpho_fast_erosion.pbm");
+ ** return 0;
+ ** }
+ ** \endcode
+ **
+ ** \image html object.png
+ ** \image latex object.png
+ ** =>
+ ** \image html oln_morpho_fast_erosion.png
+ ** \image latex oln_morpho_fast_erosion.png
+ ** \todo FIXME: Correct this function and make the example use it.
+ */
template<class I, class E>
oln_concrete_type(I)
erosion(const abstract::non_vectorial_image<I>& input,
Index: olena/oln/morpho/extrema.hh
--- olena/oln/morpho/extrema.hh Thu, 16 Jan 2003 18:13:46 +0100 akim (oln/38_extrema.hh 1.11 640)
+++ olena/oln/morpho/extrema.hh Wed, 10 Mar 2004 12:08:41 +0100 palma_g (oln/38_extrema.hh 1.11 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
@@ -35,12 +35,29 @@
namespace oln {
namespace morpho {
+ /*!
+ ** \brief oln::morpho::sure namespace.
+ **
+ ** Here come algorithms that are sure.
+ */
namespace sure {
# include <oln/morpho/extrema.hxx>
}
+
+ /*!
+ ** \brief oln::morpho::sequential namespace.
+ **
+ ** Here come algorithms that are sequential.
+ */
namespace sequential {
# include <oln/morpho/extrema.hxx>
}
+
+ /*!
+ ** \brief oln::morpho::hybrid namespace.
+ **
+ ** Here come algorithms that are hybrid.
+ */
namespace hybrid {
# include <oln/morpho/extrema.hxx>
}
Index: olena/oln/morpho/extrema.hxx
--- olena/oln/morpho/extrema.hxx Sat, 27 Sep 2003 18:30:39 +0200 burrus_n (oln/j/4_extrema.hx 1.11 640)
+++ olena/oln/morpho/extrema.hxx Wed, 10 Mar 2004 14:59:44 +0100 palma_g (oln/j/4_extrema.hx 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
@@ -25,8 +25,19 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-
+/*!
+** \brief internal namespace
+*/
namespace internal {
+
+ /*!
+ ** \brief Create extremum image from another one.
+ **
+ ** \param DestType: type of data in the wanted image.
+ ** \param I: Exact type of the input image.
+ **
+ ** \arg input: input image.
+ */
template <class DestType, class I>
typename mute<I, DestType>::ret
create_minima_image_from_bin_(const abstract::non_vectorial_image<I>& input)
@@ -43,7 +54,13 @@
return output;
}
-
+ /*!
+ ** \brief Create binary image from another one.
+ **
+ ** \param I: exact type of the image.
+ **
+ ** \arg input: input image.
+ */
template <class I>
typename mute<I, ntg::bin>::ret
ima_to_bin_(const abstract::non_vectorial_image<I>& input)
@@ -61,28 +78,50 @@
// Minima Imposition
-
-
-/*=processing sure_minima_imposition
- * ns: morpho
- * what: Minima Imposition.
- * arg: const abstract::non_vectorial_image<I1>&, input, IN, input image
- * arg: const abstract::non_vectorial_image<I2>&, minima_map, IN, bin image
- * arg: const abstract::neighborhood<N>& Ng, IN, neighborhood
- * ret:oln_concrete_type(I)
- * doc:
- * Impose minima defined by \var{minima_map} on \var{input}
- * using \var{Ng} as neighborhood. \var{minima_map} must
- * be a bin image (true for a minimum, false for a non minimum).
- * Soille p.172.
- * see: morpho::sure_geodesic_reconstruction_erosion
- * ex:
- * $ image2d<int_u8> light = load("lena.pgm");
- * $ image2d<ntg::bin> minima = load("map.pbm");
- * $ save(morpho::sure_minima_imposition(light, minima, neighb_c4()), "out.pgm");
- * exi: lena.pgm map.pbm
- * exo: out.pgm
- =*/
+/*!
+** \brief Perform a minima imposition.
+**
+** Impose minima defined by minima_map on input using Ng as
+** 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.
+**
+** \ref foototo
+** \code
+** #include <oln/basics2d.hh>
+** #include <oln/morpho/extrema.hh>
+** #include <ntg/all.hh>
+** #include <iostream>
+** int main()
+** {
+** typedef oln::image2d<ntg::int_u8> im_type;
+** typedef oln::image2d<ntg::bin> bin_im_type;
+**
+** im_type light(oln::load(IMG_IN "lena.pgm"));
+** bin_im_type minima(oln::load(IMG_IN "map.pbm"));
+**
+** oln::save(oln::morpho::sequential::minima_imposition(light, minima, oln::neighb_c4()),
+** IMG_OUT "oln_morpho_sequential_minima_imposition.pgm");
+** return 0;
+** }
+** \endcode
+** \image html lena.png
+** \image latex lena.png
+** and
+** \image html map.png
+** \image latex map.png
+** =>
+** \image html oln_morpho_sequential_minima_imposition.png
+** \image latex oln_morpho_sequential_minima_imposition.png
+**
+*/
template<class I, class I2, class N>
oln_concrete_type(I)
minima_imposition(const abstract::non_vectorial_image<I>& input,
@@ -104,25 +143,38 @@
// Regional minima
-
-/*=processing sure_regional_minima
- * ns: morpho
- * what: Regional minima.
- * arg: const abstract::non_vectorial_image<I1>&, input, IN, input image
- * arg: const abstract::struct_elt<E>&, se, IN, structural element
- * ret: typename mute<I, ntg::bin>::ret
- * doc:
- * Extract regional minima of \var{input}
- * using \var{Ng}
- * as neighborhhod. Soille p.169. The algorithm uses
- * sure_geodesic_reconstruction_erosion.
- * see: morpho::sure_geodesic_reconstruction_erosion
- * ex:
- * $ image2d<int_u8> light = load("lena.pgm");
- * $ save(morpho::sure_regional_minima(lena,neighb_c4()), "out.pgm");
- * exi: lena.pgm
- * exo: out.pgm
- =*/
+/*!
+** \brief Extract regional minima.
+**
+** \param I: Exact type of input image.
+** \param Exact type of neighborhood.
+**
+** \arg input: input image.
+** \arg Ng: neighborhood to use.
+**
+** \code
+** #include <oln/basics2d.hh>
+** #include <oln/morpho/extrema.hh>
+** #include <ntg/all.hh>
+** #include <iostream>
+** int main()
+** {
+** typedef oln::image2d<ntg::int_u8> im_type;
+**
+** im_type im(oln::load(IMG_IN "lena.pgm"));
+**
+** oln::save(oln::morpho::sequential::regional_minima(im, oln::neighb_c4()),
+** IMG_OUT "oln_morpho_sequential_regional_minima.pgm");
+** return 0;
+** }
+** \endcode
+** \image html lena.png
+** \image latex lena.png
+** =>
+** \image html oln_morpho_sequential_regional_minima.png
+** \image latex oln_morpho_sequential_regional_minima.png
+**
+*/
template<class I, class N>
typename mute<I, ntg::bin>::ret
regional_minima(const abstract::non_vectorial_image<I>& input,
Index: olena/oln/morpho/extrema_killer.hh
--- olena/oln/morpho/extrema_killer.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/e/19_extrema_ki 1.7.1.4.1.10 640)
+++ olena/oln/morpho/extrema_killer.hh Wed, 10 Mar 2004 15:51:50 +0100 palma_g (oln/e/19_extrema_ki 1.7.1.4.1.10 640)
@@ -1,4 +1,4 @@
-// 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
@@ -48,6 +48,16 @@
namespace morpho {
+ /*!
+ ** \brief Kill connex components smaller than a given area.
+ **
+ ** \param I: exact 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.
+ */
template<class I, class N>
typename mute<I, ntg::bin>::ret
internal_kill_cc_area(const abstract::non_vectorial_image<I>& input,
@@ -81,25 +91,42 @@
// SURE VERSIONS
- /*=processing sure_maxima_killer
- * ns: morpho
- * what: Maxima killer.
- * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image
- * arg: const unsigned int area, area, IN, area
- * arg: const abstract::struct_elt<E>&, se, IN, structural element
- * ret:oln_concrete_type(I1)
- * doc: It removes the small (in area) connected components of the upper
- * level sets of \var{input} using \var{se} as structual element. The implementation
- * uses the threshold superposition principle; so it is very slow ! it works only for
- * int_u8 images.
- * see: morpho::fast_maxima_killer
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(morpho::sure_maxima_killer(light, 20, win_c8p()), "out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
+ /*!
+ ** \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
+ ** 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>
+ ** #include <oln/morpho/extrema_killer.hh>
+ ** #include <ntg/all.hh>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im(oln::load(IMG_IN "lena128.pgm"));
+ **
+ ** oln::save(oln::morpho::sure_maxima_killer(im, 200, oln::neighb_c4()),
+ ** IMG_OUT "oln_morpho_sure_maxima_killer.pgm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_sure_maxima_killer.png
+ ** \image latex oln_morpho_sure_maxima_killer.png
+ */
template<class I, class N>
oln_concrete_type(I)
sure_maxima_killer(const abstract::non_vectorial_image<I>& input,
@@ -137,25 +164,42 @@
}
- /*=processing sure_minima_killer
- * ns: morpho
- * what: Minima killer.
- * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image
- * arg: const unsigned int area, area, IN, area
- * arg: const abstract::struct_elt<E>&, se, IN, structural element
- * ret:oln_concrete_type(I1)
- * doc: It removes the small (in area) connected components of the lower
- * level sets of \var{input} using \var{se} as structual element. The implementation
- * uses the threshold superposition principle; so it is very slow ! it works only for
- * int_u8 images.
- * see: morpho::fast_maxima_killer
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(morpho::sure_minima_killer(light, 20, win_c8p()), "out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
+ /*!
+ ** \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.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/extrema_killer.hh>
+ ** #include <ntg/all.hh>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im(oln::load(IMG_IN "lena128.pgm"));
+ **
+ ** oln::save(oln::morpho::sure_minima_killer(im, 200, oln::neighb_c4()),
+ ** IMG_OUT "oln_morpho_sure_minima_killer.pgm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_sure_minima_killer.png
+ ** \image latex oln_morpho_sure_minima_killer.png
+ */
template<class I, class N>
image2d<ntg::int_u8>
sure_minima_killer(const abstract::non_vectorial_image<I>& input,
@@ -198,6 +242,18 @@
// FAST VERSIONS
+ /*!
+ ** \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.
+ **
+ ** \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.
+ */
template<class P, class I, class N>
// inline
static bool
@@ -221,7 +277,18 @@
return (is_p_lower && is_p_at_least_one_stricly_lower);
}
-
+ /*!
+ ** \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.
+ **
+ ** \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.
+ */
template<class P, class I, class N>
// inline
static bool
@@ -246,27 +313,45 @@
}
-
- /*=processing fast_minima_killer
- * ns: morpho
- * what: Minima killer.
- * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image
- * arg: const unsigned int area, area, IN, area
- * arg: const abstract::neighborhood<N>&, Ng, IN, neighboorhood
- * ret:oln_concrete_type(I1)
- * doc: It removes the small (in area) connected components of the lower
- * level sets of \var{input} using \var{Ng} as neighboorhood. The implementation
- * is based on stak. Guichard and Morel, Image iterative smoothing and PDE's.
- * Book in preparation. p 265.
- * see: morpho::sure_minima_killer
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(morpho::fast_minima_killer(light, 20, win_c8p()), "out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
- // Guichard and Morel, Image iterative smoothing and PDE's. Book in preparation. p 265.
+ /*!
+ ** \brief Minima killer.
+ **
+ ** It removes the small (in area) connected components of the
+ ** lower level sets of input using Ng as neighboorhood. The
+ ** 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.
+ **
+ ** \arg input: the input image.
+ ** \arg area: threshold to use.
+ ** \arg Ng: the neighborhood to use.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/extrema_killer.hh>
+ ** #include <ntg/all.hh>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im(oln::load(IMG_IN "lena128.pgm"));
+ **
+ ** oln::save(oln::morpho::fast_minima_killer(im, 200, oln::neighb_c4()),
+ ** IMG_OUT "oln_morpho_fast_minima_killer.pgm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_minima_killer.png
+ ** \image latex oln_morpho_fast_minima_killer.png
+ **
+ ** \warning Even if it is called fast minima killer, this algorithm
+ ** is slow. Please use card opening instead.
+ */
template<class I, class N>
oln_concrete_type(I)
fast_minima_killer(const abstract::non_vectorial_image<I>& input,
@@ -353,25 +438,45 @@
return working_input;
}
- /*=processing fast_maxima_killer
- * ns: morpho
- * what: Maxima killer.
- * arg: const abstract::non_vectorial_image<I1>&, marker, IN, marker image
- * arg: const unsigned int area, area, IN, area
- * arg: const abstract::neighborhood<N>&, Ng, IN, neighboorhood
- * ret:oln_concrete_type(I1)
- * doc: It removes the small (in area) connected components of the upper
- * level sets of \var{input} using \var{Ng} as neighboorhood. The implementation
- * is based on stak. Guichard and Morel, Image iterative smoothing and PDE's. Book in preparation. p 265.
- * see: morpho::sure_maxima_killer
- * ex:
- * $ image2d<int_u8> light = load("light.pgm");
- * $ save(morpho::fast_maxima_killer(light, 20, win_c8p()), "out.pgm");
- * exi: light.pgm
- * exo: out.pgm
- * wontcompile: fixme
- =*/
- // Guichard and Morel, Image iterative smoothing and PDE's. Book in preparation. p 265.
+ /*!
+ ** \brief Maxima killer.
+ **
+ ** It removes the small (in area) connected components of the
+ ** upper level sets of input using Ng as neighboorhood. The
+ ** 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.
+ **
+ ** \arg input: the input image.
+ ** \arg area: threshold to use.
+ ** \arg Ng: the neighborhood to use.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/extrema_killer.hh>
+ ** #include <ntg/all.hh>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im(oln::load(IMG_IN "lena128.pgm"));
+ **
+ ** oln::save(oln::morpho::fast_maxima_killer(im, 200, oln::neighb_c4()),
+ ** IMG_OUT "oln_morpho_fast_maxima_killer.pgm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_maxima_killer.png
+ ** \image latex oln_morpho_fast_maxima_killer.png
+ **
+ ** \warning Even if it is called fast maxima killer, this algorithm
+ ** is slow. Please use card closing instead.
+ */
template<class I, class N>
oln_concrete_type(I)
fast_maxima_killer(const abstract::non_vectorial_image<I>& input,
Index: olena/oln/morpho/attribute_closing_opening.hh
--- olena/oln/morpho/attribute_closing_opening.hh Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/q/49_attribute_ 1.16 640)
+++ olena/oln/morpho/attribute_closing_opening.hh Wed, 10 Mar 2004 12:05:08 +0100 palma_g (oln/q/49_attribute_ 1.16 640)
@@ -38,19 +38,35 @@
** \brief oln::morpho namespace
*/
namespace morpho {
- /*! \namespace oln::morpho::fast
+ /*!
** \brief oln::morpho::fast namespace
+ **
+ ** In this namespace, you will find fast algorithms, but with intensive memory usage
*/
namespace fast {
- /*! \namespace oln::morpho::fast::tarjan
+ /*!
** \brief oln::morpho::fast::tarjan namespace
*/
namespace tarjan {
- /*! \namespace oln::morpho::fast::tarjan::internal
+ /*!
** \brief oln::morpho::fast::tarjan::internal namespace
+ **
+ ** Internal usage only.
*/
namespace internal {
+ /*!
+ ** \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.
+ */
template<class I, class N, class A>
oln_concrete_type(I)
attr_closing_(const abstract::non_vectorial_image<I>& input,
@@ -63,7 +79,18 @@
return attr_closing.template get_comptute<true>(lambda, Ng);
}
- // attribute opening
+ /*!
+ ** \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.
+ */
template<class I, class N, class A>
oln_concrete_type(I)
attr_opening_(const abstract::non_vectorial_image<I>& input,
@@ -129,19 +156,18 @@
** #include <oln/morpho/attribute_closing_opening.hh>
** #include <oln/level/compare.hh>
** #include <ntg/all.hh>
- ** #include <iostream>
** int main()
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::card_closing(im1, oln::neighb_c4(), 200);
** oln::save(im1, IMG_OUT "oln_morpho_fast_card_closing.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
** \image html oln_morpho_fast_card_closing.png
** \image latex oln_morpho_fast_card_closing.png
@@ -157,19 +183,18 @@
** #include <oln/morpho/attribute_closing_opening.hh>
** #include <oln/level/compare.hh>
** #include <ntg/all.hh>
- ** #include <iostream>
** int main()
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::card_opening(im1, oln::neighb_c4(), 200);
** oln::save(im1, IMG_OUT "oln_morpho_fast_card_opening.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
** \image html oln_morpho_fast_card_opening.png
** \image latex oln_morpho_fast_card_opening.png
@@ -185,22 +210,21 @@
** #include <oln/morpho/attribute_closing_opening.hh>
** #include <oln/level/compare.hh>
** #include <ntg/all.hh>
- ** #include <iostream>
** int main()
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::integral_closing(im1, oln::neighb_c4(), 200);
- ** oln::save(im1, IMG_OUT "olena_attribute_closing_opening_hh_integral_clo.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_integral_closing.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
- ** \image html olena_attribute_closing_opening_hh_integral_clo.png
- ** \image latex olena_attribute_closing_opening_hh_integral_clo.png
+ ** \image html oln_morpho_fast_integral_closing.png
+ ** \image latex oln_morpho_fast_integral_closing.png
**
*/
xxx_closing_decl(integral);
@@ -213,22 +237,21 @@
** #include <oln/morpho/attribute_closing_opening.hh>
** #include <oln/level/compare.hh>
** #include <ntg/all.hh>
- ** #include <iostream>
** int main()
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::integral_opening(im1, oln::neighb_c4(), 200);
- ** oln::save(im1, IMG_OUT "olena_attribute_closing_opening_hh_integral_op.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_integral_opening.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
- ** \image html olena_attribute_closing_opening_hh_integral_op.png
- ** \image latex olena_attribute_closing_opening_hh_integral_op.png
+ ** \image html oln_morpho_fast_integral_opening.png
+ ** \image latex oln_morpho_fast_integral_opening.png
**
*/
xxx_opening_decl(integral);
@@ -241,22 +264,21 @@
** #include <oln/morpho/attribute_closing_opening.hh>
** #include <oln/level/compare.hh>
** #include <ntg/all.hh>
- ** #include <iostream>
** int main()
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::height_opening(im1, oln::neighb_c4(), 5);
- ** oln::save(im1, IMG_OUT "olena_attribute_closing_opening_hh_height_op.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_height_opening.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
- ** \image html olena_attribute_closing_opening_hh_height_op.png
- ** \image latex olena_attribute_closing_opening_hh_height_op.png
+ ** \image html oln_morpho_fast_height_opening.png
+ ** \image latex oln_morpho_fast_height_opening.png
**
*/
xxx_opening_decl(height);
@@ -274,31 +296,358 @@
** {
** typedef oln::image2d<ntg::int_u8> im_type;
**
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
** im1 = oln::morpho::fast::height_closing(im1, oln::neighb_c4(), 5);
- ** oln::save(im1, IMG_OUT "olena_attribute_closing_opening_hh_height_clo.ppm");
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_height_closing.ppm");
** return 0;
** }
** \endcode
- ** \image html lena256.png
- ** \image latex lena256.png
+ ** \image html lena128.png
+ ** \image latex lena128.png
** =>
- ** \image html olena_attribute_closing_opening_hh_height_clo.png
- ** \image latex olena_attribute_closing_opening_hh_height_clo.png
+ ** \image html oln_morpho_fast_height_closing.png
+ ** \image latex oln_morpho_fast_height_closing.png
**
*/
xxx_closing_decl(height);
- xxx_opening_decl(maxvalue);
+
+
+ /*!
+ ** \brief Perform a maxvalue closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::maxvalue_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.png.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_maxvalue_closing.png
+ ** \image latex oln_morpho_fast_maxvalue_closing.png
+ **
+ */
xxx_closing_decl(maxvalue);
+
+ /*!
+ ** \brief Perform a maxvalue opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::maxvalue_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_maxvalue_opening.png
+ ** \image latex oln_morpho_fast_maxvalue_opening.png
+ **
+ */
+ xxx_opening_decl(maxvalue);
+
+ /*!
+ ** \brief Perform a minvalue opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::minvalue_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_minvalue_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_minvalue_opening.png
+ ** \image latex oln_morpho_fast_minvalue_opening.png
+ **
+ */
xxx_opening_decl(minvalue);
+
+ /*!
+ ** \brief Perform a minvalue closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::minvalue_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_minvalue_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_minvalue_closing.png
+ ** \image latex oln_morpho_fast_minvalue_closing.png
+ **
+ */
xxx_closing_decl(minvalue);
+
+ /*!
+ ** \brief Perform a ball opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::ball_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_ball_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_ball_opening.png
+ ** \image latex oln_morpho_fast_ball_opening.png
+ **
+ */
xxx_opening_im_decl(ball);
+
+ /*!
+ ** \brief Perform a ball closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::ball_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_ball_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_ball_closing.png
+ ** \image latex oln_morpho_fast_ball_closing.png
+ **
+ */
xxx_closing_im_decl(ball);
+
+ /*!
+ ** \brief Perform a dist opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::dist_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_dist_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_dist_opening.png
+ ** \image latex oln_morpho_fast_dist_opening.png
+ **
+ */
xxx_opening_im_decl(dist);
+
+ /*!
+ ** \brief Perform a dist closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::dist_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_dist_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_dist_closing.png
+ ** \image latex oln_morpho_fast_dist_closing.png
+ **
+ */
xxx_closing_im_decl(dist);
+
+ /*!
+ ** \brief Perform a cube closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::cube_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_cube_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_cube_closing.png
+ ** \image latex oln_morpho_fast_cube_closing.png
+ **
+ */
xxx_closing_im_decl(cube);
+
+ /*!
+ ** \brief Perform a cube opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::cube_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_cube_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_cube_opening.png
+ ** \image latex oln_morpho_fast_cube_opening.png
+ **
+ */
xxx_opening_im_decl(cube);
+
+ /*!
+ ** \brief Perform a box closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ ** ntg::vec<2, unsigned, mlc::final> lambda;
+ ** lambda[0] = lambda[1] = 50;
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::box_closing(im1, oln::neighb_c4(), lambda);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_box_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_box_closing.png
+ ** \image latex oln_morpho_fast_box_closing.png
+ **
+ */
xxx_closing_im_decl(box);
+
+ /*!
+ ** \brief Perform a box opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ ** ntg::vec<2, unsigned, mlc::final> lambda;
+ ** lambda[0] = lambda[1] = 50;
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::fast::box_opening(im1, oln::neighb_c4(), lambda);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_box_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_box_opening.png
+ ** \image latex oln_morpho_fast_box_opening.png
+ **
+ */
xxx_opening_im_decl(box);
} // !fast
Index: olena/oln/morpho/attribute_union_find.hh
--- olena/oln/morpho/attribute_union_find.hh Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/q/50_attribute_ 1.13 640)
+++ olena/oln/morpho/attribute_union_find.hh Wed, 10 Mar 2004 16:11:39 +0100 palma_g (oln/q/50_attribute_ 1.13 640)
@@ -41,17 +41,89 @@
namespace fast {
namespace tarjan {
+ /*!
+ ** \brief Struct that contains everything to compute an
+ ** 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.
+ */
template<class T, class ATTRIBUTE, class Env = attr_env_type(ATTRIBUTE)>
struct tarjan_set
{
- typedef oln_point_type(T) point_type;
- typedef oln_value_type(T) data_type;
- typedef oln_concrete_type(T) image_type;
- typedef typename ATTRIBUTE::lambda_type lambda_type;
- typedef Env env_type;
+ typedef oln_point_type(T) point_type; ///< Associated point type.
+ typedef oln_value_type(T) data_type; ///< Associated data_type.
+ typedef oln_concrete_type(T) image_type; ///< Image type to open/close
+ typedef typename ATTRIBUTE::lambda_type lambda_type; ///< Threshold type.
+ typedef Env env_type; ///< Environment type.
+
+ /*!
+ ** \brief tarjan_set constructor.
+ ** \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()),
+ aux_data_(ima.size()),
+ env_(env)
+ {
+ level::fill(parent_, INACTIVE());
+ }
+
+ /*!
+ ** \brief Main method to perform an attribute opening/closing.
+ ** \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.
+ */
+ template<bool closing, class N>
+ image_type
+ get_comptute(const lambda_type & lambda,
+ const abstract::neighborhood<N>& Ng)
+ {
+ lambda_ = λ
+
+ std::vector<point_type> I(input_.npoints());
+
+ oln::utils::select_distrib_sort<closing>()(input_, I);
+
+ level::fill(aux_data_, ntg_sup_val(lambda_type));
+ aux_data_.border_adapt_assign(Ng.delta(), ntg_sup_val(lambda_type));
+
+ // We are ready to perform stuff
+ for (unsigned int p = 0; p < I.size(); ++p)
+ {
+ point_type p_p = I[p];
+ make_set(p_p);
+ oln_neighb_type(N) Q_prime(Ng, p_p);
+ for_all (Q_prime)
+ if (is_proc(Q_prime))
+ uni(Q_prime.cur(), p_p);
+ }
- // ACTIVE and INACTIVE are defined with a hook to be static
- // and initialized ionly once.
+ // Resolving phase
+ image_type output(input_.size());
+ for (int p = I.size() - 1; p >= 0; --p)
+ {
+ point_type p_p = I[p];
+ if ((parent_[p_p] == ACTIVE()) || (parent_[p_p] == INACTIVE()))
+ output[p_p] = input_[p_p];
+ else
+ output[p_p] = output[parent_[p_p]];
+ // this code is equivalent to
+ // output[I[p].first] = input_[find_root(I[p].first)];
+
+ }
+ return output;
+ }
+
+ protected:
+ /*!
+ ** \brief Return the value of an active point.
+ */
static const point_type&
ACTIVE()
{
@@ -69,6 +141,9 @@
return tmp.elt;
}
+ /*!
+ ** \brief Return the value of an inactive point.
+ */
static const point_type&
INACTIVE()
{
@@ -85,14 +160,10 @@
return tmp.elt;
}
- tarjan_set(const image_type& ima, const env_type &env) : input_(ima),
- parent_(ima.size()),
- aux_data_(ima.size()),
- env_(env)
- {
- level::fill(parent_, INACTIVE());
- }
-
+ /*!
+ ** \brief Make a new component from a point.
+ ** \arg x: root of the component.
+ */
void
make_set(const point_type& x)
{
@@ -101,6 +172,10 @@
aux_data_[x] = ATTRIBUTE(input_, x, env_);
}
+ /*!
+ ** \brief find the root of a component.
+ ** \arg x: a point of the component.
+ */
point_type
find_root(const point_type& x)
{
@@ -113,6 +188,11 @@
return x;
}
+ /*!
+ ** \brief Check if two components should be merged.
+ ** \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)
{
@@ -121,6 +201,11 @@
return ( (input_[x] == input_[y]) || (aux_data_[x] < *lambda_));
}
+ /*!
+ ** \brief Do union of two components.
+ ** \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)
{
@@ -137,67 +222,25 @@
}
}
- // bool closing = true -> a closing is performed,
- // an opening otherwise.
- template<bool closing, class N>
- image_type
- get_comptute(const lambda_type & lambda,
- const abstract::neighborhood<N>& Ng)
- {
- lambda_ = λ
-
- std::vector<point_type> I(input_.npoints());
-
- oln::utils::select_distrib_sort<closing>()(input_, I);
-
- level::fill(aux_data_, ntg_sup_val(lambda_type));
- aux_data_.border_adapt_assign(Ng.delta(), ntg_sup_val(lambda_type));
-
- // We are ready to perform stuff
- for (unsigned int p = 0; p < I.size(); ++p)
- {
- point_type p_p = I[p];
- make_set(p_p);
- oln_neighb_type(N) Q_prime(Ng, p_p);
- for_all (Q_prime)
- if (is_proc(Q_prime))
- uni(Q_prime.cur(), p_p);
- }
-
- // Resolving phase
- image_type output(input_.size());
- for (int p = I.size() - 1; p >= 0; --p)
- {
- point_type p_p = I[p];
- if ((parent_[p_p] == ACTIVE()) || (parent_[p_p] == INACTIVE()))
- output[p_p] = input_[p_p];
- else
- output[p_p] = output[parent_[p_p]];
- // this code is equivalent to
- // output[I[p].first] = input_[find_root(I[p].first)];
-
- }
- return output;
- }
-
- protected:
- // tells if a point has been proceded
+ /*!
+ ** \brief Tells if a point has been proceded.
+ */
bool is_proc(const point_type &p) const
{
//FIXME: odd way to call !=, but it is to help the compiler
//to find the good one when ATTRIBUTE is templeted by types
- //in other namepaces.
+ //in other namespaces.
// return aux_data_[p] != ntg_max_val(lambda_type);
return aux_data_[p].operator!=(ntg_sup_val(lambda_type));
};
- const image_type & input_;
- typename mute<T, point_type>::ret parent_;
- typename mute<T, ATTRIBUTE>::ret aux_data_;
- const lambda_type *lambda_;
- const env_type env_;
+ const image_type &input_; ///< Input image.
+ typename mute<T, point_type>::ret parent_; ///< Give a parent of a point.
+ typename mute<T, ATTRIBUTE>::ret aux_data_; ///< Image to store attributes.
+ const lambda_type *lambda_; ///< Threshold.
+ const env_type env_; ///< Environment.
};
} // !tarjan
} // !fast
Index: olena/oln/morpho/attributes.hh
--- olena/oln/morpho/attributes.hh Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/j/45_attributes 1.5 644)
+++ olena/oln/morpho/attributes.hh Wed, 10 Mar 2004 11:09:44 +0100 palma_g (oln/j/45_attributes 1.5 644)
@@ -48,8 +48,15 @@
namespace oln {
namespace morpho {
+ /*!
+ ** \brief oln::morpho::tools namespace
+ */
namespace tools {
- // should be moved elsewhere
+
+ /*!
+ ** \brief Absolute value of difference between v1 and v2.
+ ** \warning Should be moved elsewhere.
+ */
template <class T>
T diffabs(const T &v1, const T &v2)
{
@@ -57,8 +64,9 @@
}
} // !tools
- // environment herarchy
- // not used yet
+ /*!
+ ** \brief Top of environment hierarchy.
+ */
template <class Exact>
struct env: public mlc_hierarchy::any<Exact>
{
@@ -95,7 +103,33 @@
const im_type &im_;
};
+ /*!
+ ** \brief Environment containing point.
+ **
+ ** Used for point substitution in other_point attribute.
+ */
+ template <class I>
+ struct OtherPointEnv: public env<OtherPointEnv<I> >
+ {
+ typedef abstract::image<I> im_type;
+
+// OtherImageEnv(const abstract::image<I> &im): im_(im)
+// {};
+
+ const oln_point_type(I) &getPoint(const oln_point_type(I) &p) const
+ {
+ return p;
+ }
+
+// protected:
+// const im_type &im_;
+ };
+
// the traits fwd declaration
+ /*!
+ ** Traits for attributes information.
+ ** \param T: exact type of the attribute.
+ */
template <class T>
struct attr_traits;
@@ -173,9 +207,9 @@
/*!
** \brief >= operator implementation.
**
- ** This is an implementation of the >= operator. override this
+ ** This is an implementation of the >= operator. Override this
** method to provide a new implementation of this operator.
- ** This method SHOULDN'T be called.
+ ** \warning This method SHOULDN'T be called.
*/
bool ge_impl(const lambda_type &lambda) const
{
@@ -191,49 +225,88 @@
| card |
*-----------*/
+ /*!
+ ** \brief Cardinal attribute.
+ **
+ ** It is equivalent to an area in 2d, and a volume in 3D.
+ */
template <class T = unsigned, class Exact = mlc::final>
class card_type:
public attribute<mlc_2_exact_vt_type(card_type, T, Exact)>
{
public:
- typedef card_type<T, Exact> self_type;
+ typedef card_type<T, Exact> self_type; /*!< Self type of the class. */
attr_type_decl(self_type);
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
card_type()
{
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ */
card_type(const lambda_type &lambda): value_(lambda)
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ **
+ ** Every parameters are useless.
+ */
template <class I>
card_type(const abstract::image<I>&,
const oln_point_type(I)&,
const env_type&):
- value_(1)
+ value_(ntg_unit_val(value_type))
{
};
+
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T be called.
+ */
void pe_impl(const self_type &rhs)
{
value_ += rhs.value_;
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the < operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the != operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type value_;
- // const client_data_type &client_data;
- // FIXME: client_data is usefull when attribute is computed from other data
+ value_type value_; /*!< Value used inside the class. */
};
@@ -241,95 +314,162 @@
| integral |
*-----------*/
+ /*!
+ ** \brief Integral attribute.
+ **
+ ** It is equivalent to volume in 2D, and weight in 3D.
+ */
template <class T = unsigned, class Exact = mlc::final>
class integral_type:
public attribute<mlc_2_exact_vt_type(integral_type, T, Exact)>
{
public:
- typedef integral_type<T, Exact> self_type;
+ typedef integral_type<T, Exact> self_type; /*!< Self type of the class. */
attr_type_decl(self_type);
- // Ctors
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
integral_type()
{
};
-
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ */
integral_type(const lambda_type &lambda): value_(lambda)
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ */
template <class I>
integral_type(const abstract::image<I> &input,
const oln_point_type(I) &p,
const env_type &) :
reflevel_(input[p]),
- area_(1),
- value_(1)
+ area_(ntg_unit_val(value_type)),
+ value_(ntg_unit_val(value_type))
{
};
- /*
- template <class I>
- integral_type(const abstract::image<I> &input,
- const oln_point_type(I) &p
- ):
- reflevel_(input[p]),
- area_(1),
- value_(1)
- {
- };*/
+
// interface part
+ /*!
+ ** \brief Accessor to value_.
+ **
+ ** Virtual method.
+ ** \see getValue_impl()
+ */
const value_type &getValue() const
{
mlc_dispatch(getValue)();
};
+ /*!
+ ** \brief Accessor to the reference level.
+ **
+ ** \see getReflevel_impl()
+ */
const value_type &getReflevel() const
{
mlc_dispatch(getReflevel)();
};
+ /*!
+ ** \brief Accessor to the current area.
+ **
+ ** \see getArea_impl()
+ */
const value_type &getArea() const
{
mlc_dispatch(getArea)();
};
// impl part
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getValue().
+ **
+ ** \warning Do not call this method, use getValue() instead.
+ */
const value_type &getValue_impl() const
{
return value_;
};
+ /*!
+ ** \brief Implementation of getReflevel().
+ **
+ ** Override this method in order to provide a new version of
+ ** getReflevel().
+ **
+ ** \warning Do not call this method, use getReflevel() instead.
+ */
const value_type &getReflevel_impl() const
{
return reflevel_;
};
+ /*!
+ ** \brief Implementation of getArea().
+ **
+ ** Override this method in order to provide a new version of
+ ** getArea().
+ **
+ ** \warning Do not call this method, use getArea() instead.
+ */
const value_type &getArea_impl() const
{
return area_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const self_type &rhs)
{
value_ += rhs.getValue() + area_ * tools::diffabs(reflevel_, rhs.getReflevel());
area_ += rhs.getArea();
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type reflevel_;
- value_type area_;
- value_type value_;
+ value_type reflevel_; ///< Reference level.
+ value_type area_; ///< Current area.
+ value_type value_; ///< Current value (deduced from area and level).
};
/*-------------------*
@@ -340,7 +480,7 @@
**
** \brief Metaclass used to change attribute behavior.
**
- ** This class do the same job the its Dad parameter, but force it
+ ** This class do the same job that its Dad parameter, but force it
** to work on other data.
*/
template <class Dad, class I, class Exact = mlc::final>
@@ -387,10 +527,67 @@
};
};
+ /*--------------*
+ | other_point |
+ *------------*/
+// /*!
+// ** \class other_point
+// **
+// ** \brief Metaclass used to change attribute behavior.
+// **
+// ** This class do the same job that its Dad parameter, but force it
+// ** to work on other data.
+// */
+// template <class Dad, class I, class Exact = mlc::final>
+// class other_point:
+// public change_exact<Dad, typename mlc::exact_vt<other_point<Dad, I, Exact>, Exact>::ret >::ret
+// {
+// public:
+// typedef other_image<Dad, I, Exact> self_type; /*< Self type of the class.*/
+// typedef typename abstract::image<mlc_exact_type(I)> im_type; /*< Type of substituted image.*/
+// attr_type_decl(self_type);
+// typedef typename change_exact<Dad,
+// typename mlc::exact_vt<other_point<Dad, I, Exact>,
+// Exact>::ret >::ret super_type; /*< Mother class type.*/
+
+// /*!
+// ** \brief Constructor.
+// **
+// ** Dispatch to Dad constructor.
+// */
+// other_point(): super_type()
+// {
+// };
+
+// /*!
+// ** \brief lambda_type Constructor.
+// **
+// ** Dispatch to Dad constructor.
+// */
+// other_point(const lambda_type &lambda): super_type(lambda)
+// {
+// };
+
+// /*!
+// ** \brief Image Constructor.
+// **
+// ** Dispatch to Dad constructor but substitute image argument with
+// ** the image contained in the environment.
+// */
+// template <typename IM>
+// other_point(const abstract::image<IM> &im,
+// const oln_point_type(I) &p,
+// const env_type &e): super_type(im, e.getPoint(p), e)
+// {
+// };
+// };
+
/*-----------*
| height |
*-----------*/
-
+ /*!
+ ** \brief Attribute working on height between components.
+ */
template <class T = unsigned, class Exact = mlc::final>
class height_type:
public attribute<mlc_2_exact_vt_type(height_type, T, Exact)>
@@ -399,10 +596,19 @@
typedef height_type<T, Exact> self_type;
attr_type_decl(self_type);
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
height_type()
{
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ */
height_type(const lambda_type &lambda):
value_(lambda),
min_(ntg_zero_val(value_type)),
@@ -410,6 +616,9 @@
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ */
template <class I>
height_type(const abstract::image<I> &input,
const oln_point_type(I) &p,
@@ -420,27 +629,62 @@
{
};
-
+ /*!
+ ** \brief Accessor to min value.
+ **
+ ** Virtual method.
+ ** \see getMin_impl()
+ */
const value_type &getMin() const
{
mlc_dispatch(getMin)();
};
+ /*!
+ ** \brief Accessor to max value.
+ **
+ ** Virtual method.
+ ** \see getMax_impl()
+ */
const value_type &getMax() const
{
mlc_dispatch(getMax)();
};
+
// impl part
+ /*!
+ ** \brief Implementation of getMin().
+ **
+ ** Override this method in order to provide a new version of
+ ** getMin().
+ **
+ ** \warning Do not call this method, use getMin() instead.
+ */
const value_type &getMin_impl() const
{
return min_;
};
+ /*!
+ ** \brief Implementation of getMax().
+ **
+ ** Override this method in order to provide a new version of
+ ** getMax().
+ **
+ ** \warning Do not call this method, use getMax() instead.
+ */
const value_type &getMax_impl() const
{
return max_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const height_type &rhs)
{
min_ = ntg::min(min_, rhs.getMin());
@@ -448,43 +692,80 @@
value_ = max_ - min_;
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type value_;
- value_type min_;
- value_type max_;
+ value_type value_; ///< Current value.
+ value_type min_; ///< Current minimum.
+ value_type max_; ///< Current maximum.
};
/*-----------*
| maxvalue |
*-----------*/
-
+ /*!
+ ** \brief Max value attribute.
+ ** \param T: data type.
+ ** \param Exact: the exact type.
+ */
template <class T = unsigned, class Exact = mlc::final>
class maxvalue_type:
public attribute<mlc_2_exact_vt_type(maxvalue_type, T, Exact)>
{
public:
- typedef maxvalue_type<T, Exact> self_type;
+ typedef maxvalue_type<T, Exact> self_type; ///< Self type of the class.
attr_type_decl(self_type);
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
maxvalue_type()
{
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
maxvalue_type(const lambda_type &lambda): value_(lambda)
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ **
+ ** \param I: image exact type.
+ **
+ ** \arg input: input image.
+ ** \arg p: point to consider in the image.
+ */
template <class I>
maxvalue_type(const abstract::image<I> &input,
const oln_point_type(I) &p,
@@ -493,40 +774,79 @@
{
};
+ /*!
+ ** \brief Accessor to value_.
+ **
+ ** Virtual method.
+ ** \see getValue_impl()
+ */
const value_type &getValue() const
{
mlc_dispatch(getValue)();
};
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getValue().
+ **
+ ** \warning Do not call this method, use getValue() instead.
+ */
const value_type &getValue_impl() const
{
return value_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const maxvalue_type &rhs)
{
value_ = ntg::max(value_, rhs.getValue());
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type value_;
+ value_type value_; ///< Value of the attribute.
};
/*-----------*
| minvalue |
*-----------*/
-
+ /*!
+ ** \brief Min value attribute.
+ ** \param T: data type.
+ ** \param Exact: the exact type.
+ */
template <class T = unsigned, class Exact = mlc::final>
class minvalue_type:
public attribute<mlc_2_exact_vt_type(minvalue_type, T, Exact)>
@@ -535,14 +855,33 @@
typedef minvalue_type<T, Exact> self_type;
attr_type_decl(self_type);
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
minvalue_type()
{
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
minvalue_type(const lambda_type &lambda): value_(lambda)
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ **
+ ** \param I: image exact type.
+ **
+ ** \arg input: input image.
+ ** \arg p: point to consider in the image.
+ */
template <class I>
minvalue_type(const abstract::image<I> &input,
const oln_point_type(I) &p,
@@ -551,62 +890,117 @@
{
};
+ /*!
+ ** \brief Accessor to value_.
+ **
+ ** Virtual method.
+ ** \see getValue_impl()
+ */
const value_type &getValue() const
{
mlc_dispatch(getValue)();
};
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getValue().
+ **
+ ** \warning Do not call this method, use getValue() instead.
+ */
const value_type &getValue_impl() const
{
return value_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const minvalue_type &rhs)
{
value_ = ntg::min(value_, rhs.getValue());
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ > lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type value_;
+ value_type value_; ///< Value of the attribute.
};
/*-----------*
| ball |
*-----------*/
-
+ /*!
+ ** \brief Ball attribute.
+ ** \param I: exact type of images to process.
+ ** \param Exact: the exact type.
+ */
template <class I, class Exact = mlc::final>
class ball_type:
public attribute<mlc_2_exact_vt_type(ball_type, I, Exact)>
{
public:
- typedef ball_type<I, Exact> self_type;
+ typedef ball_type<I, Exact> self_type; ///< Self type of the class.
attr_type_decl(self_type);
- typedef abstract::image<mlc_exact_type(I)> im_type;
- typedef oln_point_type(im_type) point_type;
- typedef oln_dpoint_type(im_type) dpoint_type;
- typedef std::vector<point_type> pts_type;
- typedef typename pts_type::const_iterator cst_iter_type;
+ typedef abstract::image<mlc_exact_type(I)> im_type; ///< Image type.
+ typedef oln_point_type(im_type) point_type; ///< Point type associated to im_type.
+ typedef oln_dpoint_type(im_type) dpoint_type; ///< Dpoint type associated to im_type.
+ typedef std::vector<point_type> pts_type; ///< Point vector type.
+ typedef typename pts_type::const_iterator cst_iter_type; ///< const iterator on Point vector.
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
ball_type()
{
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
ball_type(const lambda_type &lambda): value_(lambda), pts_()
{
};
+ /*!
+ ** \brief Ctor from a point and an 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_()
@@ -614,28 +1008,63 @@
pts_.push_back(p);
};
+ /*!
+ ** \brief Accessor to value_.
+ **
+ ** Virtual method.
+ ** \see getValue_impl()
+ */
const value_type &getValue() const
{
mlc_dispatch(getValue)();
};
+ /*!
+ ** \brief Accessor to pts_.
+ **
+ ** Virtual method.
+ ** \see getPts_impl()
+ */
const pts_type &getPts() const
{
mlc_dispatch(getPts)();
};
// impl
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getValue().
+ **
+ ** \warning Do not call this method, use getValue() instead.
+ */
const value_type &getValue_impl() const
{
return value_;
};
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getPts().
+ **
+ ** \warning Do not call this method, use getPts() instead.
+ */
const pts_type &getPts_impl() const
{
return pts_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const ball_type &rhs)
{
value_type last = value_;
@@ -658,19 +1087,33 @@
value_ = ntg::max(value_, rhs.getValue());
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return lambda != value_;
};
protected:
- value_type value_;
- pts_type pts_;
+ value_type value_; ///< Value of the attribute.
+ pts_type pts_; ///< List of point in the ball.
};
@@ -678,22 +1121,37 @@
/*-----------*
| dist |
*-----------*/
-
+ /*!
+ ** \brief Dist attribute.
+ ** \param I: exact type of images to process.
+ ** \param Exact: the exact type.
+ */
template <class I, class Exact = mlc::final>
class dist_type:
public attribute<mlc_2_exact_vt_type(dist_type, I, Exact)>
{
public:
- typedef dist_type<I, Exact> self_type;
+ typedef dist_type<I, Exact> self_type; ///< Self type of the class.
attr_type_decl(self_type);
- typedef abstract::image<mlc_exact_type(I)> im_type;
- typedef oln_point_type(im_type) point_type;
- typedef oln_dpoint_type(im_type) dpoint_type;
+ typedef abstract::image<mlc_exact_type(I)> im_type; ///< Image type.
+ typedef oln_point_type(im_type) point_type; ///< Point type associated to im_type.
+ typedef oln_dpoint_type(im_type) dpoint_type; ///< Dpoint type associated to im_type.
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
dist_type()
{
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ **
+ ** \arg p: point to consider in the image.
+ */
dist_type(const im_type&,
const point_type &p,
const env_type &) :
@@ -702,31 +1160,71 @@
{
};
+ /*!
+ ** \brief Accessor to value_.
+ **
+ ** Virtual method.
+ ** \see getValue_impl()
+ */
const value_type &getValue() const
{
mlc_dispatch(getValue)();
};
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
dist_type(const lambda_type lambda): value_(lambda)
{
};
+ /*!
+ ** \brief Accessor to center_.
+ **
+ ** Virtual method.
+ ** \see getCenter_impl()
+ */
const point_type &getCenter() const
{
mlc_dispatch(getCenter)();
};
// impl
+ /*!
+ ** \brief Implementation of getCenter().
+ **
+ ** Override this method in order to provide a new version of
+ ** getCenter().
+ **
+ ** \warning Do not call this method, use getCenter() instead.
+ */
const point_type &getCenter_impl() const
{
return center_;
};
+ /*!
+ ** \brief Implementation of getValue().
+ **
+ ** Override this method in order to provide a new version of
+ ** getValue().
+ **
+ ** \warning Do not call this method, use getValue() instead.
+ */
const value_type &getValue_impl() const
{
return value_;
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const dist_type &rhs)
{
value_type last = value_;
@@ -740,19 +1238,33 @@
value_ = ntg::max(value_, rhs.getValue());
};
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
};
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return value_ != lambda;
};
protected:
- value_type value_;
- point_type center_;
+ value_type value_; ///< Current value of the attribute.
+ point_type center_; ///< Center of the attribute.
};
@@ -761,24 +1273,39 @@
/*-----------*
| cube |
*-----------*/
-
+ /*!
+ ** \brief Cube attribute.
+ ** \param I: exact type of images to process.
+ ** \param Exact: the exact type.
+ */
template <class I, class Exact = mlc::final>
class cube_type:
public attribute<mlc_2_exact_vt_type(cube_type, I, Exact)>
{
public:
- typedef cube_type<I, Exact> self_type;
+ typedef cube_type<I, Exact> self_type; ///< Self type of the class.
attr_type_decl(self_type);
- typedef abstract::image<mlc_exact_type(I)> im_type;
- typedef oln_point_type(im_type) point_type;
- typedef oln_dpoint_type(im_type) dpoint_type;
+ typedef abstract::image<mlc_exact_type(I)> im_type; ///< Image type.
+ typedef oln_point_type(im_type) point_type; ///< Point type associated to im_type.
+ typedef oln_dpoint_type(im_type) dpoint_type; ///< Dpoint type associated to im_type.
enum {dim = point_traits<point_type>::dim};
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
cube_type()
{
}
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
cube_type(const lambda_type &lambda):
mins_(dim),
maxs_(dim),
@@ -791,6 +1318,11 @@
}
};
+ /*!
+ ** \brief Ctor from a point and an image.
+ **
+ ** \arg p: point to consider in the image.
+ */
cube_type(const im_type&,
const point_type &p,
const env_type &):
@@ -800,29 +1332,68 @@
mins_[i] = maxs_[i] = p.nth(i);
}
+ /*!
+ ** \brief Accessor to minimums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th minimum.
+ ** \see getMin_impl()
+ */
int getMin(int i) const
{
mlc_dispatch(getMin)(i);
};
+ /*!
+ ** \brief Accessor to maximums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th maximum.
+ ** \see getMax_impl()
+ */
int getMax(int i) const
{
mlc_dispatch(getMax)(i);
};
// impl
+ /*!
+ ** \brief Implementation of getMin(int i).
+ **
+ ** Override this method in order to provide a new version of
+ ** getMin(int i).
+ **
+ ** \warning Do not call this method, use getMin() instead.
+ */
int getMin_impl(int i) const
{
precondition(i < dim);
return mins_[i];
};
+ /*!
+ ** \brief Implementation of getMax(int i).
+ **
+ ** Override this method in order to provide a new version of
+ ** getMax(int i).
+ **
+ ** \warning Do not call this method, use getMax() instead.
+ */
int getMax_impl(int i) const
{
precondition(i < dim);
return maxs_[i];
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const cube_type &rhs)
{
for (int i = 0; i < dim; ++i)
@@ -836,11 +1407,25 @@
value_ = maxs_[i] - mins_[i];
}
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
return value_ < lambda;
}
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
return value_ != lambda;
@@ -857,18 +1442,28 @@
/*------*
| box |
*-----*/
+ /*!
+ ** \brief Box attribute.
+ ** \param I: exact type of images to process.
+ ** \param Exact: the exact type.
+ */
template <class I, class Exact = mlc::final>
class box_type:
public attribute<mlc_2_exact_vt_type(box_type, I, Exact)>
{
public:
- typedef box_type<I, Exact> self_type;
+ typedef box_type<I, Exact> self_type; ///< Self type of the class.
attr_type_decl(self_type);
- typedef abstract::image<mlc_exact_type(I)> im_type;
- typedef oln_point_type(im_type) point_type;
- typedef oln_dpoint_type(im_type) dpoint_type;
+ typedef abstract::image<mlc_exact_type(I)> im_type; ///< Image type.
+ typedef oln_point_type(im_type) point_type; ///< Point type associated to im_type.
+ typedef oln_dpoint_type(im_type) dpoint_type; ///< Dpoint type associated to im_type.
enum {dim = point_traits<point_type>::dim };
+ /*!
+ ** \brief Ctor from a lambda_type value.
+ **
+ ** \arg lambda: value of the attribute.
+ */
box_type(const lambda_type &lambda): maxs_(dim), mins_(dim)
{
for (int i = 0; i < dim; ++i)
@@ -878,39 +1473,90 @@
}
};
+ /*!
+ ** \brief Basic Ctor.
+ **
+ ** \warning After this call, the object is only instantiated
+ ** (not initialized).
+ */
box_type()
{
- }
+ };
+ /*!
+ ** \brief Ctor from a point and an 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)
{
for (int i = 0; i < dim; ++i)
mins_[i] = maxs_[i] = p.nth(i);
- }
+ };
+ /*!
+ ** \brief Accessor to minimums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th minimum.
+ ** \see getMin_impl()
+ */
value_type getMin(int i) const
{
mlc_dispatch(getMin)(i);
};
+
+ /*!
+ ** \brief Accessor to maximums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th maximum.
+ ** \see getMax_impl()
+ */
value_type getMax(int i) const
{
mlc_dispatch(getMax)(i);
};
// impl
+ /*!
+ ** \brief Accessor to minimums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th minimum.
+ ** \see getMin_impl()
+ */
value_type getMin_impl(int i) const
{
precondition(i < point_traits<point_type>::dim);
return mins_[i];
};
+ /*!
+ ** \brief Accessor to maximums.
+ **
+ ** Virtual method.
+ ** \arg i: index of the minimum wanted.
+ ** \return the i th maximum.
+ ** \see getMax_impl()
+ */
value_type getMax_impl(int i) const
{
precondition(i < point_traits<point_type>::dim);
return maxs_[i];
};
+ /*!
+ ** \brief += operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
void pe_impl(const box_type &rhs)
{
for (int i = 0; i < dim; ++i)
@@ -920,6 +1566,13 @@
}
}
+ /*!
+ ** \brief < operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool less_impl(const lambda_type &lambda) const
{
for (int i = 0; i < dim; ++i)
@@ -928,6 +1581,13 @@
return true;
}
+ /*!
+ ** \brief != operator implementation.
+ **
+ ** This is an implementation of the += operator. Override this
+ ** method to provide a new implementation of this operator.
+ ** \warning This method SHOULDN'T directly be called.
+ */
bool ne_impl(const lambda_type &lambda) const
{
for (int i = 0; i < dim; ++i)
@@ -937,12 +1597,12 @@
};
protected:
- std::vector<value_type> maxs_;
- std::vector<value_type> mins_;
+ std::vector<value_type> maxs_; ///< List of minimums.
+ std::vector<value_type> mins_; ///< List of maximums.
};
/*-------------------------
- | traits specialisations |
+ | traits specializations |
\------------------------*/
@@ -1039,6 +1699,20 @@
typedef attr_lambda_type(super_type) lambda_type;
typedef OtherImageEnv<I> env_type;
};
+
+// // other_point traits
+// template <class Dad, class I, class Exact>
+// struct attr_traits<other_point<Dad, I, Exact> >
+// {
+// //typedef typename change_exact<Dad, other_image<Dad, I, Exact> >::ret super_type;
+// typedef typename change_exact<Dad,
+// typename mlc::exact_vt<other_point<Dad, I, Exact>,
+// Exact>::ret>::ret super_type;
+// typedef attr_value_type(super_type) value_type;
+// typedef attr_lambda_tye(super_type) lambda_type;
+// typedef OtherPointEnv<I> env_type;
+// };
+
// traits for other_image derivation
/*!
@@ -1051,6 +1725,18 @@
{
typedef integral_type<T, NewExact> ret;
};
+
+// /*!
+// ** \brief Change the exact type of an attribute.
+// **
+// ** Traits to change dist_type exact type.
+// */
+// template <class NewExact, class OldExact, class T>
+// struct change_exact<dist_type<T, OldExact>, NewExact>
+// {
+// typedef dist_type<T, NewExact> ret;
+// };
+
} // !morpho
} //!oln
Index: olena/oln/morpho/attribute_closing_opening_map.hh
--- olena/oln/morpho/attribute_closing_opening_map.hh Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/j/49_attribute_ 1.3 600)
+++ olena/oln/morpho/attribute_closing_opening_map.hh Wed, 10 Mar 2004 12:05:48 +0100 palma_g (oln/j/49_attribute_ 1.3 600)
@@ -46,26 +46,36 @@
{
namespace morpho
{
+ /*!
+ ** \brief oln::morpho::slow namespace
+ **
+ ** In this namespace you will find algorithm slower than those you
+ ** can find in oln::morpho::fast, but with less memory needs.
+ */
namespace slow
{
/*! Attribute closing using map. Smaller memory usage, but
- * slower computation than the attribute_closing_opening
- *
- * See "Fast morphological attribute operations using Tarjan's union-find
- * algorithm" by Michael H. F. Wilkinson and Jos B. T. M. Roerdink
+ ** slower computation than the attribute_closing_opening
+ **
+ ** 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.
*/
template <class I, class D, class Env = morpho::NullEnv>
struct f_tarjan_map
{
public:
- typedef abstract::image<I> input_type;
- typedef oln_concrete_type(I) img_type;
+ typedef abstract::image<I> input_type; ///< Image type (abstract).
+ typedef oln_concrete_type(I) img_type; ///< Image type (concrete).
- typedef oln_point_type(input_type) point_type;
- typedef oln_value_type(input_type) value_type;
- typedef typename mute<input_type, point_type>::ret parent_type;
- typedef typename mute<input_type, bool>::ret is_proc_type;
- typedef attr_lambda_type(D) lambda_type;
+ typedef oln_point_type(input_type) point_type; ///< Associated point type.
+ typedef oln_value_type(input_type) value_type; ///< Value type fo the image.
+ typedef typename mute<input_type, point_type>::ret parent_type; ///< Image of points.
+ typedef typename mute<input_type, bool>::ret is_proc_type; ///< Image of bool.
+ typedef attr_lambda_type(D) lambda_type; ///< dTthreshold type.
// e.g.,
// when I is image2d<int_u8> and D is area_type, we've got:
@@ -77,13 +87,26 @@
// | lambda_type | int |
// +--------------+------------------+
+ /*!
+ ** \brief Perform an attribute opening/closing.
+ **
+ ** \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.
+ */
template <class N>
f_tarjan_map(bool is_closing,
const input_type& input,
const abstract::neighborhood<N>& ng,
const lambda_type& lambda,
const Env & env = Env());
-
+ /*!
+ ** \brief return the result of the opening/closing.
+ */
oln_concrete_type(I)
res()
{
@@ -91,43 +114,71 @@
}
protected:
+ /*!
+ ** \brief Return the value of an inactive point.
+ */
static const point_type
inactive();
+ /*!
+ ** \brief Return the value of an active point.
+ */
static const point_type
active();
+ /*!
+ ** \brief Make a new component from a point.
+ ** \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.
+ */
void
link(const point_type& x, const point_type& y);
+ /*!
+ ** \brief find the root of a component.
+ ** \arg x: a point of the component.
+ */
point_type
find_root(const point_type& x);
+ /*!
+ ** \brief check if two components are equivalent.
+ */
bool
equiv(const point_type& x, const point_type& y) const;
+
+ /*!
+ ** \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.
+ */
void
do_union(const point_type& n, const point_type& p);
- const bool is_closing;
- const input_type& input;
- lambda_type lambda;
- parent_type parent;
- is_proc_type is_proc;
- img_type output;
- std::map<point_type, D, oln::internal::default_less<point_type> > auxdata;
- Env env;
+ const bool is_closing; ///< Do you want a closing or an openng ?
+ const input_type& input; ///< Input image.
+ lambda_type lambda; ///< Trheshold.
+ parent_type parent; ///< Give a parent of a point.
+ is_proc_type is_proc; ///< Tell if a point has already been preceded
+ img_type output; ///< Image to store the result
+ std::map<point_type, D, oln::internal::default_less<point_type> > auxdata; ///< Map to store attributes.
+ Env env; ///< The envronment.
};
/*! Attribute closing using map. Smaller memory usage, but
- * slower computation than the attribute_closing_opening
- *
- * See "Fast morphological attribute operations using Tarjan's union-find
- * algorithm" by Michael H. F. Wilkinson and Jos B. T. M. Roerdink
+ ** slower computation than the attribute_closing_opening
+ **
+ ** See "Fast morphological attribute operations using Tarjan's union-find
+ ** algorithm" by Michael H. F. Wilkinson and Jos B. T. M. Roerdink
*/
template <class D, class I, class N>
oln_concrete_type(I)
@@ -145,9 +196,8 @@
return t.res();
}
- /*! Some macro to declare friendly function for different attributes
- * opening/closing
- */
+// Some macro to declare friendly function for different attributes
+// opening/closing
# define xxx_opening_map_decl(T) \
template <class I, class N> \
oln_concrete_type(I) \
@@ -194,23 +244,506 @@
return tarjan_map<T##_type<I>, I, N>(true, input, ng, lambda, attr_env_type(T##_type<I>)()); \
}
- xxx_opening_map_decl(card);
+ /*!
+ ** \brief Perform a cardinal closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.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"));
+ ** im1 = oln::morpho::slow::card_closing(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_card_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_card_closing.png
+ ** \image latex oln_morpho_fast_card_closing.png
+ **
+ */
xxx_closing_map_decl(card);
- xxx_opening_map_decl(integral);
+
+ /*!
+ ** \brief Perform a cardinal opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.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"));
+ ** im1 = oln::morpho::slow::card_opening(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_card_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_card_opening.png
+ ** \image latex oln_morpho_fast_card_opening.png
+ **
+ */
+ xxx_opening_map_decl(card);
+
+ /*!
+ ** \brief Perform an integral closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.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"));
+ ** im1 = oln::morpho::slow::integral_closing(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_integral_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_integral_closing.png
+ ** \image latex oln_morpho_fast_integral_closing.png
+ **
+ */
xxx_closing_map_decl(integral);
+
+ /*!
+ ** \brief Perform an integral opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.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"));
+ ** im1 = oln::morpho::slow::integral_opening(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_integral_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_integral_opening.png
+ ** \image latex oln_morpho_fast_integral_opening.png
+ **
+ */
+ xxx_opening_map_decl(integral);
+
+ /*!
+ ** \brief Perform a height closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.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"));
+ ** im1 = oln::morpho::slow::height_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_height_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_height_opening.png
+ ** \image latex oln_morpho_fast_height_opening.png
+ **
+ */
xxx_opening_map_decl(height);
+
+ /*!
+ ** \brief Perform a height closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::height_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_height_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_height_closing.png
+ ** \image latex oln_morpho_fast_height_closing.png
+ **
+ */
xxx_closing_map_decl(height);
- xxx_opening_map_decl(maxvalue);
+
+
+ /*!
+ ** \brief Perform a maxvalue closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::maxvalue_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.png.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_maxvalue_closing.png
+ ** \image latex oln_morpho_fast_maxvalue_closing.png
+ **
+ */
xxx_closing_map_decl(maxvalue);
+
+ /*!
+ ** \brief Perform a maxvalue opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::maxvalue_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_maxvalue_opening.png
+ ** \image latex oln_morpho_fast_maxvalue_opening.png
+ **
+ */
+ xxx_opening_map_decl(maxvalue);
+
+ /*!
+ ** \brief Perform a minvalue opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::minvalue_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_minvalue_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_minvalue_opening.png
+ ** \image latex oln_morpho_fast_minvalue_opening.png
+ **
+ */
xxx_opening_map_decl(minvalue);
+
+ /*!
+ ** \brief Perform a minvalue closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::minvalue_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_minvalue_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_minvalue_closing.png
+ ** \image latex oln_morpho_fast_minvalue_closing.png
+ **
+ */
xxx_closing_map_decl(minvalue);
+
+ /*!
+ ** \brief Perform a ball opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::ball_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_ball_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_ball_opening.png
+ ** \image latex oln_morpho_fast_ball_opening.png
+ **
+ */
xxx_opening_im_map_decl(ball);
+
+ /*!
+ ** \brief Perform a ball closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::ball_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_ball_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_ball_closing.png
+ ** \image latex oln_morpho_fast_ball_closing.png
+ **
+ */
xxx_closing_im_map_decl(ball);
+
+ /*!
+ ** \brief Perform a dist opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::dist_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_dist_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_dist_opening.png
+ ** \image latex oln_morpho_fast_dist_opening.png
+ **
+ */
xxx_opening_im_map_decl(dist);
+
+ /*!
+ ** \brief Perform a dist closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::dist_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_dist_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_dist_closing.png
+ ** \image latex oln_morpho_fast_dist_closing.png
+ **
+ */
xxx_closing_im_map_decl(dist);
+
+ /*!
+ ** \brief Perform a cube closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::cube_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_cube_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_cube_closing.png
+ ** \image latex oln_morpho_fast_cube_closing.png
+ **
+ */
xxx_closing_im_map_decl(cube);
+
+ /*!
+ ** \brief Perform a cube opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::cube_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_cube_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_cube_opening.png
+ ** \image latex oln_morpho_fast_cube_opening.png
+ **
+ */
xxx_opening_im_map_decl(cube);
+
+ /*!
+ ** \brief Perform a box closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ ** ntg::vec<2, unsigned, mlc::final> lambda;
+ ** lambda[0] = lambda[1] = 50;
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::box_closing(im1, oln::neighb_c4(), lambda);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_box_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_box_closing.png
+ ** \image latex oln_morpho_fast_box_closing.png
+ **
+ */
xxx_closing_im_map_decl(box);
+
+ /*!
+ ** \brief Perform a box opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening_map.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ ** ntg::vec<2, unsigned, mlc::final> lambda;
+ ** lambda[0] = lambda[1] = 50;
+ ** im_type im1(oln::load(IMG_IN "lena128.pgm"));
+ ** im1 = oln::morpho::slow::box_opening(im1, oln::neighb_c4(), lambda);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_box_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena128.png
+ ** \image latex lena128.png
+ ** =>
+ ** \image html oln_morpho_fast_box_opening.png
+ ** \image latex oln_morpho_fast_box_opening.png
+ **
+ */
xxx_opening_im_map_decl(box);
Index: olena/tests/morpho/tests/attribute
--- olena/tests/morpho/tests/attribute Mon, 16 Feb 2004 19:06:24 +0100 palma_g (oln/j/51_attribute 1.2 644)
+++ olena/tests/morpho/tests/attribute Mon, 08 Mar 2004 17:26:07 +0100 palma_g (oln/j/51_attribute 1.2 644)
@@ -28,7 +28,7 @@
bool fail(false);
typedef image2d<int_u8> img_type;
- typedef oln::morpho::area_type<unsigned> area_type;
+ typedef oln::morpho::cart_type<unsigned> area_type;
const area_type::lambda_type area = 100;
const neighborhood2d nb = neighb_c8();
// const oln::morpho::NullEnv env;
@@ -43,8 +43,8 @@
std::cerr << "testing tarjan_map..." << std::endl;
// lena_tst_closing = morpho::slow::tarjan_map<area_type,ntg::int_u8,img_type>(true, lena, nb, area, env);
// lena_tst_opening= morpho::slow::tarjan_map<area_type,ntg::int_u8,img_type>(false, lena, nb, area, env);
- lena_tst_closing = morpho::slow::area_closing(lena, nb, area);
- lena_tst_opening = morpho::slow::area_opening(lena, nb, area);
+ lena_tst_closing = morpho::slow::card_closing(lena, nb, area);
+ lena_tst_opening = morpho::slow::card_opening(lena, nb, area);
fail = fail ||
!level::is_equal(lena_sure_closing, lena_tst_closing)||
@@ -60,8 +60,8 @@
std::cerr << "fail:" << fail << std::endl;
std::cerr << "testing area_closin and area_opeing..." << std::endl;
- lena_tst_closing = morpho::fast::area_closing(lena, nb, area);
- lena_tst_opening = morpho::fast::area_opening(lena, nb, area);
+ lena_tst_closing = morpho::fast::card_closing(lena, nb, area);
+ lena_tst_opening = morpho::fast::card_opening(lena, nb, area);
fail = fail ||
!level::is_equal(lena_sure_closing, lena_tst_closing)||
!level::is_equal(lena_sure_opening, lena_tst_opening);
Index: olena/tests/morpho/tests/attr_op_cl
--- olena/tests/morpho/tests/attr_op_cl Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/k/0_attr_op_cl 1.2 644)
+++ olena/tests/morpho/tests/attr_op_cl Tue, 09 Mar 2004 15:20:21 +0100 palma_g (oln/k/0_attr_op_cl 1.2 644)
@@ -73,6 +73,7 @@
test_op_cl(int_u8, cube, lena, 50);
ntg::vec<2, unsigned, mlc::final> lambda;
+ lambda[0] = lambda[1] = 50;
test_op_cl(int_u8, box, lena, lambda);
return fail;
Index: doc/ref/img_conv.pl
--- doc/ref/img_conv.pl Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/k/6_img_conv.p 1.1 700)
+++ doc/ref/img_conv.pl Wed, 10 Mar 2004 11:25:27 +0100 palma_g (oln/k/6_img_conv.p 1.1 700)
@@ -31,7 +31,7 @@
opendir DIR, "$d" or die "Unable to open $d.\n";
foreach $file(readdir DIR)
{
- if ($file =~ /(.*)\.(pgm|ppm|ppgm|pppgm)$/)
+ if ($file =~ /(.*)\.(pgm|ppm|ppgm|pppgm|pbm)$/)
{
print "convert $d/$file to $o/$1.png\n";
system "convert $d/$file $o/$1.png";
Index: doc/ref/out/exdoc.config.in
--- doc/ref/out/exdoc.config.in Mon, 08 Mar 2004 08:12:15 +0100 palma_g (oln/k/7_exdoc.conf 1.1 644)
+++ doc/ref/out/exdoc.config.in Wed, 10 Mar 2004 15:18:31 +0100 palma_g (oln/k/7_exdoc.conf 1.1 644)
@@ -4,7 +4,7 @@
TAG_CLOSE = endcode
CAPTIONS = cxx # We want to run cxx on the extracted files (see line below)
ALIAS cxx = @CXX@ # Here, cxx means g++ but you can choose other compilers
- OPTIONS = @CXXFLAGS@ -I@top_srcdir@/integre -I@top_srcdir@/olena -I@top_srcdir@/metalic $1 -o $2 -DIMG_OUT=\"../img/\" -DIMG_IN=\"@top_srcdir@/olena/img/\" # tell how to use the soft, i.e. where to put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME: $* should have explicit name, chek flags
+ OPTIONS = @CXXFLAGS_OPTIMIZE@ @CXXFLAGS_STRICT_ERRORS@ -I@top_srcdir@/integre -I@top_srcdir@/olena -I@top_srcdir@/metalic $1 -o $2 -DIMG_OUT=\"../img/\" -DIMG_IN=\"@top_srcdir@/olena/img/\" # tell how to use the soft, i.e. where to put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME: $* should have explicit name, chek flags
OUT = out # FIXME: should be obsolete
EXT = cc # Extension of generated file
STD_OUT_EXT = std # Extension of generated file standard output
--
Giovanni Palma
EPITA - promo 2005 - membre d'EpX - LRDE
Mob. : +33 (0)6 60 97 31 74
2
1
1
0