oln::morpho::sequential Namespace Reference

Sequential algorithm implementation. More...


Functions

template<class I, class I2, class N> oln::mute< I >::ret minima_imposition (const abstract::non_vectorial_image< I > &input, const abstract::non_vectorial_image< I2 > &minima_map, const abstract::neighborhood< N > &Ng)
 Perform a minima imposition.

template<class I, class N> mute< I, ntg::bin >::ret regional_minima (const abstract::non_vectorial_image< I > &input, const abstract::neighborhood< N > &Ng)
 Extract regional minima.

template<class I1, class I2, class N> oln::mute< I1 >::ret geodesic_reconstruction_dilation (const abstract::non_vectorial_image< I1 > &marker, const abstract::non_vectorial_image< I2 > &mask, const abstract::neighborhood< N > &Ng)
 Perform a geodesic reconstruction dilation.

template<class I1, class I2, class N> oln::mute< I1 >::ret geodesic_reconstruction_erosion (const abstract::non_vectorial_image< I1 > &marker, const abstract::non_vectorial_image< I2 > &mask, const abstract::neighborhood< N > &Ng)
 Perform a geodesic reconstruction erosion.


Detailed Description

Sequential algorithm implementation.

Function Documentation

template<class I1, class I2, class N>
oln::mute< I1 >::ret geodesic_reconstruction_dilation const abstract::non_vectorial_image< I1 > &  marker,
const abstract::non_vectorial_image< I2 > &  mask,
const abstract::neighborhood< N > &  Ng
 

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.

Precondition:
Mask must be greater or equal than marker.
Parameters:
I1 Exact type of image marker.
I2 Exact type of image mask.
N Exact type of neighborhood.
  • marker Image to work on.
  • mask Image used for geodesic dilation.
  • Ng Neighborhood to use.
#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; }

lena128_pgm.png
=>
oln_morpho_sequential_geodesic_reconstruction_dilation.png

Definition at line 168 of file reconstruction.hh.

References oln::abstract::image< Exact >::clone(), oln::morpho::get_minus_se_p(), oln::morpho::get_plus_se_p(), and oln::abstract::image< Exact >::size().

00171       {
00172         mlc::eq<I1::dim, I2::dim>::ensure();
00173         mlc::eq<I1::dim, N::dim>::ensure();
00174         precondition(marker.size() == mask.size());
00175         precondition(level::is_greater_or_equal(mask, marker));
00176 
00177         // Conversion of neighborhood into a SE.
00178         typedef typename abstract::neighborhood<N>::win_type E;
00179         E se_plus = get_plus_se_p(convert::ng_to_cse(Ng));
00180         E se_minus = get_minus_se_p(convert::ng_to_cse(Ng));
00181 
00182         oln_concrete_type(I1) output = marker.clone();
00183         bool non_stability = true;
00184         typename I1::fwd_iter_type fwd_p(output);
00185         typename I1::bkd_iter_type bkd_p(output);
00186         while (non_stability)
00187           {
00188             oln_concrete_type(I1) work = output.clone();
00189             work.border_adapt_copy(Ng.delta());
00190             for_all (fwd_p)
00191               work[fwd_p] = ntg::min(morpho::max(work, fwd_p, se_plus), mask[fwd_p]);
00192             for_all (bkd_p)
00193               work[bkd_p] = ntg::min(morpho::max(work, bkd_p, se_minus), mask[bkd_p]);
00194             non_stability = !(level::is_equal(work, output));
00195             output = work;
00196           }
00197         return output;
00198       }

template<class I1, class I2, class N>
oln::mute< I1 >::ret geodesic_reconstruction_erosion const abstract::non_vectorial_image< I1 > &  marker,
const abstract::non_vectorial_image< I2 > &  mask,
const abstract::neighborhood< N > &  Ng
 

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.

Precondition:
Marker must be greater or equal than mask.
Parameters:
I1 Exact type of image marker.
I2 Exact type of image mask.
N Exact type of neighborhood.
  • marker Image to work on.
  • mask Image used for geodesic erosion.
  • Ng Neighborhood to use.
#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; }

lena128_pgm.png
=>
oln_morpho_sequential_geodesic_reconstruction_erosion.png

Definition at line 462 of file reconstruction.hh.

References oln::morpho::get_minus_se_p(), oln::morpho::get_plus_se_p(), and oln::abstract::image< Exact >::size().

00465       {
00466         mlc::eq<I1::dim, I2::dim>::ensure();
00467         mlc::eq<I1::dim, N::dim>::ensure();
00468         precondition(marker.size() == mask.size());
00469         precondition(level::is_greater_or_equal(marker, mask));
00470 
00471         typedef typename abstract::neighborhood<N>::win_type E;
00472         E se_plus = get_plus_se_p(convert::ng_to_cse(Ng));
00473         E se_minus = get_minus_se_p(convert::ng_to_cse(Ng));
00474         oln_concrete_type(I1) output = marker.clone();
00475 
00476         bool non_stability = true;
00477         typename I1::fwd_iter_type fwd_p(output);
00478         typename I1::bkd_iter_type bkd_p(output);
00479         while (non_stability)
00480           {
00481             oln_concrete_type(I1) work = output.clone();
00482             work.border_adapt_copy(Ng.delta());
00483             for_all (fwd_p)
00484               work[fwd_p] = ntg::max(morpho::min(work, fwd_p, se_plus), mask[fwd_p]);
00485             for_all (bkd_p)
00486               work[bkd_p] = ntg::max(morpho::min(work, bkd_p, se_minus), mask[bkd_p]);
00487             non_stability = !(level::is_equal(work, output));
00488             output = work;
00489           }
00490         return output;
00491       }

template<class I, class I2, class N>
oln::mute< I >::ret minima_imposition const abstract::non_vectorial_image< I > &  input,
const abstract::non_vectorial_image< I2 > &  minima_map,
const abstract::neighborhood< N > &  Ng
 

Perform a minima imposition.

Impose minima defined by minima_map on input using Ng as neighborhood. minima_map must be a bin image (true for a minimum, false for a non minimum). Soille p.172.

Parameters:
I Exact type of the first image.
I2 Exact type of the second image.
N Exact type of the neighborhood.
  • input Input image.
  • minima_map Minima map image.
  • Ng Neighborhood to use.
#include <oln/basics2d.hh> #include <oln/morpho/extrema.hh> #include <ntg/all.hh> #include <iostream> int main() { typedef oln::image2d<ntg::int_u8> im_type; typedef oln::image2d<ntg::bin> bin_im_type; im_type light(oln::load(IMG_IN "lena.pgm")); bin_im_type minima(oln::load(IMG_IN "map.pbm")); oln::save(oln::morpho::sequential::minima_imposition(light, minima, oln::neighb_c4()), IMG_OUT "oln_morpho_sequential_minima_imposition.pgm"); }
lena_pgm.png
and
map_pbm.png
=>
oln_morpho_sequential_minima_imposition.png

Definition at line 356 of file extrema.hh.

template<class I, class N>
mute<I, ntg::bin>::ret regional_minima const abstract::non_vectorial_image< I > &  input,
const abstract::neighborhood< N > &  Ng
 

Extract regional minima.

Parameters:
I Exact type of input image.
Exact type of neighborhood.
  • input Input image.
  • Ng Neighborhood to use.
#include <oln/basics2d.hh> #include <oln/morpho/extrema.hh> #include <ntg/all.hh> #include <iostream> int main() { typedef oln::image2d<ntg::int_u8> im_type; im_type im(oln::load(IMG_IN "lena.pgm")); oln::save(oln::morpho::sequential::regional_minima(im, oln::neighb_c4()), IMG_OUT "oln_morpho_sequential_regional_minima.pgm"); }
lena_pgm.png
=>
oln_morpho_sequential_regional_minima.png

Definition at line 408 of file extrema.hh.


Generated on Thu Apr 15 20:16:59 2004 for Olena by doxygen 1.3.6-20040222