oln::morpho::sure Namespace Reference

Reference algorithm implementation: sure but slow. 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_dilation (const abstract::non_vectorial_image< I1 > &marker, const abstract::non_vectorial_image< I2 > &mask, const abstract::neighborhood< N > &Ng)
 Processing a geodesic dilation.

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

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

Reference algorithm implementation: sure but slow.

Function Documentation

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

Processing a geodesic dilation.

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.
Compute the geodesic dilation of marker with respect to the mask image using se as structuring element. Soille p.156.
Precondition:
Mask must be greater or equal than marker.
Warning:
This version shouldn't be use, since it exists only to have a reference algorithm.
#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; }

lena128_pgm.png
=>
oln_morpho_sure_geodesic_dilation.png

Definition at line 150 of file geodesic_dilation.hh.

References oln::abstract::image< Exact >::border_adapt_copy(), oln::abstract::neighborhood< Exact >::delta(), and oln::abstract::image< Exact >::size().

Referenced by geodesic_reconstruction_dilation().

00153       {
00154         mlc::eq<I1::dim, I2::dim>::ensure();
00155         mlc::eq<I1::dim, N::dim>::ensure();
00156         precondition(marker.size() == mask.size());
00157         precondition(level::is_greater_or_equal(mask, marker));
00158 
00159         oln_concrete_type(I1) output(marker.size());
00160         marker.border_adapt_copy(Ng.delta());
00161         oln_iter_type(I1) p(marker);
00162         for_all (p)
00163           output[p] = std::min(morpho::max(marker, p, convert::ng_to_cse(Ng)), mask[p]);
00164         return output;
00165       }

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

Processing a geodesic erosion.

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

Precondition:
Marker must be greater or equal than mask.
Warning:
This version shouldn't be use, since it exists only to have a reference algorithm.
#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; }

lena128_pgm.png
=>
oln_morpho_sure_geodesic_erosion.png

Definition at line 148 of file geodesic_erosion.hh.

References oln::abstract::neighborhood< Exact >::delta(), and oln::abstract::image< Exact >::size().

Referenced by geodesic_reconstruction_erosion().

00151       {
00152         mlc::eq<I1::dim, I2::dim>::ensure();
00153         mlc::eq<I1::dim, N::dim>::ensure();
00154         precondition(marker.size() == mask.size());
00155         precondition(level::is_greater_or_equal(marker, mask));
00156 
00157         oln_concrete_type(I1) output(marker.size());
00158         marker.border_adapt_copy(Ng.delta());
00159         oln_iter_type(I1) p(marker);
00160         for_all (p)
00161           output[p] = ntg::max(morpho::min(marker, p, convert::ng_to_cse(Ng)), mask[p]);
00162         return output;
00163       }

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 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.
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::sure::geodesic_reconstruction_dilation(im2, im1, oln::neighb_c4()), IMG_OUT "oln_morpho_sure_geodesic_reconstruction_dilation.pbm"); return 0; }

lena128_pgm.png
=>
oln_morpho_sure_geodesic_reconstruction_dilation.png

Definition at line 96 of file reconstruction.hh.

References oln::abstract::image< Exact >::clone(), geodesic_dilation(), and oln::abstract::image< Exact >::size().

00099       {
00100         mlc::eq<I1::dim, I2::dim>::ensure();
00101         mlc::eq<I1::dim, N::dim>::ensure();
00102         precondition(marker.size() == mask.size());
00103         precondition(level::is_greater_or_equal(mask, marker));
00104         oln_concrete_type(I1) output = marker.clone();
00105         bool non_stability = true;
00106         while (non_stability)
00107           {
00108             oln_concrete_type(I1) work = geodesic_dilation(output, mask, Ng);
00109             non_stability = !(level::is_equal(work, output));
00110             output = work;
00111           }
00112         return output;
00113       }

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. This is the simplest algorithm: iteration is performed until stability.

Warning:
This version is slow, since it is a sure one.
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::sure::geodesic_reconstruction_erosion(im1, im2, oln::neighb_c4()), IMG_OUT "oln_morpho_sure_geodesic_reconstruction_erosion.pbm"); return 0; }

lena128_pgm.png
=>
oln_morpho_sure_geodesic_reconstruction_erosion.png

Definition at line 389 of file reconstruction.hh.

References geodesic_erosion(), and oln::abstract::image< Exact >::size().

00392       {
00393         mlc::eq<I1::dim, I2::dim>::ensure();
00394         mlc::eq<I1::dim, N::dim>::ensure();
00395         precondition(marker.size() == mask.size());
00396         precondition(level::is_greater_or_equal(marker, mask));
00397         oln_concrete_type(I1) output = marker.clone();
00398         bool non_stability = true;
00399         while (non_stability)
00400           {
00401             oln_concrete_type(I1) work = geodesic_erosion(output, mask, Ng);
00402             non_stability = !(level::is_equal(work, output));
00403             output = work;
00404           }
00405         return output;
00406       }

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 165 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 217 of file extrema.hh.


Generated on Thu Apr 15 20:17:01 2004 for Olena by doxygen 1.3.6-20040222