Commit 9cf87e52 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add labeling module in documentation.

	* doc/mln/labeling/labeling.dox: New. Introduce labeling module.

	* mln/labeling/background.hh,
	* mln/labeling/colorize.hh,
	* mln/labeling/compute.hh,
	* mln/labeling/compute_image.hh,
	* mln/labeling/flat_zones.hh,
	* mln/labeling/foreground.hh,
	* mln/labeling/mean_values.hh,
	* mln/labeling/pack.hh,
	* mln/labeling/regional_maxima.hh,
	* mln/labeling/regional_minima.hh,
	* mln/labeling/relabel.hh,
	* mln/labeling/superpose.hh,
	* mln/labeling/value.hh,
	* mln/labeling/value_and_compute.hh,
	* mln/labeling/wrap.hh: Set documentation as part of the labeling
	group.
parent ce869174
2013-04-17 Guillaume Lazzara <z@lrde.epita.fr>
Add labeling module in documentation.
* doc/mln/labeling/labeling.dox: New. Introduce labeling module.
* mln/labeling/background.hh,
* mln/labeling/colorize.hh,
* mln/labeling/compute.hh,
* mln/labeling/compute_image.hh,
* mln/labeling/flat_zones.hh,
* mln/labeling/foreground.hh,
* mln/labeling/mean_values.hh,
* mln/labeling/pack.hh,
* mln/labeling/regional_maxima.hh,
* mln/labeling/regional_minima.hh,
* mln/labeling/relabel.hh,
* mln/labeling/superpose.hh,
* mln/labeling/value.hh,
* mln/labeling/value_and_compute.hh,
* mln/labeling/wrap.hh: Set documentation as part of the labeling
group.
2013-04-17 Guillaume Lazzara <z@lrde.epita.fr>
 
Add documentation for mln_concrete and mln_ch_value.
/*! \defgroup labeling Image Labeling
*
* \brief All labeling routines provided in Milena.
*
* \ingroup modroutines
*/
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -54,6 +55,7 @@ namespace mln
* value set to \c false.
*
* \see mln::labeling::value
* \ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
......
......@@ -57,17 +57,19 @@ namespace mln
}
/// Create a new color image from a labeled image and fill each component
/// with a random color.
/*!
* litera::black is used for component 0, e.g. the background.
* Min and max values for RGB values can be set through the global
* variables mln::labeling::colorize_::min_value and
* mln::labeling::colorize_::max_value.
*
* \param[in] value value type used in the returned image.
* \param[in] labeled_image A labeled image (\sa labeling::blobs).
* \param[in] nlabels Number of labels.
/*! \brief Create a new color image from a labeled image and fill each component
with a random color.
litera::black is used for component 0, e.g. the background.
Min and max values for RGB values can be set through the global
variables mln::labeling::colorize_::min_value and
mln::labeling::colorize_::max_value.
\param[in] value value type used in the returned image.
\param[in] labeled_image A labeled image (\sa labeling::blobs).
\param[in] nlabels Number of labels.
\ingroup labeling
*/
template <typename V, typename L>
mln_ch_value(L, V)
......@@ -76,16 +78,26 @@ namespace mln
const mln_value(L)& nlabels);
/// \overload
//
/*! \overload
The number of labels is re-computed.
\warning Computing the number of labels shall add extra
computation time.
\ingroup labeling
*/
template <typename V, typename L>
mln_ch_value(L, V)
colorize(const V& value,
const Image<L>& labeled_image);
/// \overload
//
/*! \overload
Colorize labeled image with value::rgb8.
\ingroup labeling
*/
template <typename L>
mln_ch_value(L, mln::value::rgb8)
colorize(const Image<L>& input,
......
// Copyright (C) 2008, 2009, 2010, 2012 EPITA Research and Development
// Laboratory (LRDE)
// Copyright (C) 2008, 2009, 2010, 2012, 2013 EPITA Research and
// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -60,15 +60,17 @@ namespace mln
namespace labeling
{
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] a An accumulator.
/// \param[in] input The input image.
/// \param[in] label The labeled image.
/// \param[in] nlabels The number of labels in \p label.
/// \return A util::array of accumulator result (one result per label).
//
/*! \brief Compute an accumulator onto the pixel values of the image \p input.
for each component of the image \p label.
\param[in] a An accumulator.
\param[in] input The input image.
\param[in] label The labeled image.
\param[in] nlabels The number of labels in \p label.
\return A util::array of accumulator result (one result per label).
\ingroup labeling
*/
template <typename A, typename I, typename L>
util::array<mln_result(A)>
compute(const Accumulator<A>& a,
......@@ -77,15 +79,17 @@ namespace mln
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] a A meta-accumulator.
/// \param[in] input The input image.
/// \param[in] label The labeled image.
/// \param[in] nlabels The number of labels in \p label.
/// \return A util::array of accumulator result (one result per label).
//
/*! \brief Compute an accumulator onto the pixel values of the image \p input.
for each component of the image \p label.
\param[in] a A meta-accumulator.
\param[in] input The input image.
\param[in] label The labeled image.
\param[in] nlabels The number of labels in \p label.
\return A util::array of accumulator result (one result per label).
\ingroup labeling
*/
template <typename A, typename I, typename L>
util::array<mln_meta_accu_result(A, mln_value(I))>
compute(const Meta_Accumulator<A>& a,
......@@ -94,14 +98,16 @@ namespace mln
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel sites of each component domain of
/// \p label.
///
/// \param[in] a An accumulator.
/// \param[in] label The labeled image.
/// \param[in] nlabels The number of labels in \p label.
/// \return A util::array of accumulator result (one result per label).
//
/*! Compute an accumulator onto the pixel sites of each component domain of
\p label.
\param[in] a An accumulator.
\param[in] label The labeled image.
\param[in] nlabels The number of labels in \p label.
\return A util::array of accumulator result (one result per label).
\ingroup labeling
*/
template <typename A, typename L>
util::array<mln_result(A)>
compute(const Accumulator<A>& a,
......@@ -109,14 +115,16 @@ namespace mln
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel sites of each component domain of
/// \p label.
///
/// \param[in] a A meta-accumulator.
/// \param[in] label The labeled image.
/// \param[in] nlabels The number of labels in \p label.
/// \return A util::array of accumulator result (one result per label).
//
/*! \brief Compute an accumulator onto the pixel sites of each component domain of
\p label.
\param[in] a A meta-accumulator.
\param[in] label The labeled image.
\param[in] nlabels The number of labels in \p label.
\return A util::array of accumulator result (one result per label).
\ingroup labeling
*/
template <typename A, typename L>
util::array<mln_meta_accu_result(A, mln_psite(L))>
compute(const Meta_Accumulator<A>& a,
......@@ -124,15 +132,17 @@ namespace mln
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] a An array of accumulator.
/// \param[in] input The input image.
/// \param[in] label The labeled image.
/// \param[in] nlabels The number of labels in \p label.
/// \return A util::array of accumulator result (one result per label).
//
/*! \brief Compute an accumulator onto the pixel values of the image \p input.
for each component of the image \p label.
\param[in] a An array of accumulator.
\param[in] input The input image.
\param[in] label The labeled image.
\param[in] nlabels The number of labels in \p label.
\return A util::array of accumulator result (one result per label).
\ingroup labeling
*/
template <typename A, typename I, typename L>
util::array<mln_result(A)>
compute(util::array<A>& a,
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -49,16 +50,19 @@ namespace mln
namespace labeling
{
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] a The mln::p_array of accumulator result.
/// \param[in] input The input image (values).
/// \param[in] labels The label image.
/// \param[in] nlabels The count of labels.
///
/// \return The image where labels are replaced by the result of
/// the accumulator.
/*! Compute an accumulator onto the pixel values of the image \p input.
for each component of the image \p label.
\param[in] a The mln::p_array of accumulator result.
\param[in] input The input image (values).
\param[in] labels The label image.
\param[in] nlabels The count of labels.
\return The image where labels are replaced by the result of
the accumulator.
\ingroup labeling
*/
template <typename A, typename I, typename L>
mln_ch_value(L, mln_result(A))
compute_image(const util::array<mln_result(A)>& a,
......@@ -66,17 +70,19 @@ namespace mln
const Image<L>& labels,
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] accu The accumulator.
/// \param[in] input The input image (values).
/// \param[in] labels The label image.
/// \param[in] nlabels The count of labels.
///
/// \return The image where labels are replaced by the result of
/// the accumulator.
///
/*! \brief Compute an accumulator onto the pixel values of the
image \p input. for each component of the image \p label.
\param[in] accu The accumulator.
\param[in] input The input image (values).
\param[in] labels The label image.
\param[in] nlabels The count of labels.
\return The image where labels are replaced by the result of
the accumulator.
\ingroup labeling
*/
template <typename A, typename I, typename L>
inline
mln_ch_value(L, mln_result(A))
......@@ -86,17 +92,19 @@ namespace mln
const mln_value(L)& nlabels);
/// Compute an accumulator onto the pixel values of the image \p input.
/// for each component of the image \p label.
///
/// \param[in] accu The meta-accumulator.
/// \param[in] input The input image (values).
/// \param[in] labels The label image.
/// \param[in] nlabels The count of labels.
///
/// \return The image where labels are replaced by the result of
/// the accumulator.
///
/*! \brief Compute an accumulator onto the pixel values of the
image \p input. for each component of the image \p label.
\param[in] accu The meta-accumulator.
\param[in] input The input image (values).
\param[in] labels The label image.
\param[in] nlabels The count of labels.
\return The image where labels are replaced by the result of
the accumulator.
\ingroup labeling
*/
template <typename A, typename I, typename L>
inline
mln_ch_value(L, mln_meta_accu_result(A, mln_value(I)))
......
// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013 EPITA Research and
// Development Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -42,13 +42,15 @@ namespace mln
namespace labeling
{
/// Connected component labeling of the flat zones of an image.
///
/// \param[in] input The input image.
/// \param[in] nbh The connexity of the flat zones.
/// \param[out] nlabels The number of labels.
/// \return The label image.
///
/*! \brief Connected component labeling of the flat zones of an image.
\param[in] input The input image.
\param[in] nbh The connexity of the flat zones.
\param[out] nlabels The number of labels.
\return The label image.
\ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
flat_zones(const Image<I>& input, const Neighborhood<N>& nbh,
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -40,8 +41,8 @@ namespace mln
namespace labeling
{
/*! Connected component labeling of the object part in a binary
* image.
/*! \brief Connected component labeling of the object part in a
* binary image.
*
* \param[in] input The input image.
* \param[in] nbh The connexity of the foreground.
......@@ -54,6 +55,7 @@ namespace mln
* value set to \c true.
*
* \see mln::labeling::value
* \ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -60,6 +61,14 @@ namespace mln
namespace labeling
{
/*! \brief Construct an image of mean values from a labeled image.
\param[in] input An image.
\param[in] lbl A labeled image.
\param[in] nlabels The number of computed labels.
\ingroup labeling
*/
template <typename I, typename L>
mln_concrete(I)
mean_colors(const Image<I>& input,
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -48,21 +49,34 @@ namespace mln
namespace labeling
{
/// Relabel a labeled image in order to have a contiguous labeling.
///
/// \param[in] label The labeled image.
/// \param[out] new_nlabels The number of labels after relabeling.
/// \param[out] repack_fun The function used to repack the labels.
///
/// \return The relabeled image.
//
/*! \brief Relabel a labeled image in order to have a contiguous
labeling.
\param[in] label The labeled image.
\param[out] new_nlabels The number of labels after relabeling.
\param[out] repack_fun The function used to repack the labels.
\return The relabeled image.
\ingroup labeling
*/
template <typename I>
mln_concrete(I)
pack(const Image<I>& label, mln_value(I)& new_nlabels,
fun::i2v::array<mln_value(I)>& repack_fun);
/// \overload
/*! \overload
Rely on a default relabeling function that guaranty contiguous
labeling.
\warning Don't expect any label from \p label to be preserved.
\sa make::relabelfun
\ingroup labeling
*/
template <typename I>
mln_concrete(I)
pack(const Image<I>& label, mln_value(I)& new_nlabels);
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -44,14 +44,15 @@ namespace mln
namespace labeling
{
/*! Connected component labeling of the regional maxima of an
* image.
*
* \param[in] input The input image.
* \param[in] nbh The connexity of the regional maxima.
* \param[out] nlabels The number of labeled regions.
* \return The label image.
*
/*! \brief Connected component labeling of the regional maxima of an
image.
\param[in] input The input image.
\param[in] nbh The connexity of the regional maxima.
\param[out] nlabels The number of labeled regions.
\return The label image.
\ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -44,14 +44,15 @@ namespace mln
namespace labeling
{
/*! Connected component labeling of the regional minima of an
* image.
*
* \param[in] input The input image.
* \param[in] nbh The connexity of the regional minima.
* \param[out] nlabels The number of labeled regions.
* \return The label image.
*
/*! \brief Connected component labeling of the regional minima of
an image.
\param[in] input The input image.
\param[in] nbh The connexity of the regional minima.
\param[out] nlabels The number of labeled regions.
\return The label image.
\ingroup labeling
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
......
// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
// Copyright (C) 2008, 2009, 2010, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -47,15 +47,18 @@ namespace mln
namespace labeling
{
/// Remove components and relabel a labeled image.
/// \param[in] label the labeled image.
/// \param[in] nlabels the number of labels in \p label.
/// \param[out] new_nlabels the number of labels after relabeling.
/// \param[in] fv2b function returning whether a label must be replaced
/// by the background.
///
/// \return the relabeled image.
//
/*! \brief Remove components and relabel a labeled image.
\param[in] label the labeled image.
\param[in] nlabels the number of labels in \p label.
\param[out] new_nlabels the number of labels after relabeling.
\param[in] fv2b function returning whether a label must be replaced
by the background.
\return the relabeled image.
\ingroup labeling
*/
template <typename I, typename F>
mln_concrete(I)
relabel(const Image<I>& label,
......@@ -64,14 +67,16 @@ namespace mln
const Function_v2b<F>& fv2b);
/// Remove components and relabel a labeled image.
/// \param[in] label the labeled image.
/// \param[in] nlabels the number of labels in \p label.
/// \param[in] fv2v function returning the new component id for each pixel
/// value.
///
/// \return the relabeled image.
//
/*! \brief Remove components and relabel a labeled image.
\param[in] label the labeled image.
\param[in] nlabels the number of labels in \p label.
\param[in] fv2v function returning the new component id for each pixel
value.
\return the relabeled image.
\ingroup labeling
*/
template <typename I, typename F>
mln_concrete(I)
relabel(const Image<I>& label,
......@@ -79,12 +84,15 @@ namespace mln
const Function_v2v<F>& fv2v);
/// Remove components and relabel a labeled image inplace.
/// \param[in, out] label the labeled image.
/// \param[in] nlabels the number of labels in \p label.
/// \param[in] fv2b function returning whether a label must be replaced
/// by the background.
//
/*! \brief Remove components and relabel a labeled image inplace.
\param[in, out] label the labeled image.
\param[in] nlabels the number of labels in \p label.
\param[in] fv2b function returning whether a label must be replaced
by the background.
\ingroup labeling
*/
template <typename I, typename F>
void
relabel_inplace(Image<I>& label,
......@@ -92,12 +100,15 @@ namespace mln
const Function_v2b<F>& fv2b);
/// Remove components and relabel a labeled image inplace.
/// \param[in, out] label the labeled image.
/// \param[in] nlabels the number of labels in \p label.
/// \param[in] fv2v function returning the new component id for each
/// pixel value.
//
/*! \brief Remove components and relabel a labeled image inplace.
\param[in, out] label the labeled image.
\param[in] nlabels the number of labels in \p label.
\param[in] fv2v function returning the new component id for each
pixel value.
\ingroup labeling
*/
template <typename I, typename F>
void
relabel_inplace(Image<I>& label,
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory