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
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
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