oln::morpho::sure Namespace Reference

Reference algorithm implementation: sure but slow. More...


Namespaces

namespace  internal

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 oln::morpho::sure::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.
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 151 of file geodesic_dilation.hh.

References mlc::eq< i, j >::ensure(), oln::level::is_greater_or_equal(), oln::morpho::max(), and oln::convert::ng_to_cse().

Referenced by geodesic_reconstruction_dilation().

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

template<class I1, class I2, class N>
oln::mute< I1 >::ret oln::morpho::sure::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.
Compute the geodesic erosion of marker with respect to the mask image using se as structural element. Soille p.156. Computation is performed by hand (i.e without calling erosion).

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 151 of file geodesic_erosion.hh.

References mlc::eq< i, j >::ensure(), oln::level::is_greater_or_equal(), oln::morpho::min(), and oln::convert::ng_to_cse().

Referenced by geodesic_reconstruction_erosion().

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

template<class I1, class I2, class N>
oln::mute< I1 >::ret oln::morpho::sure::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.
 #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 mlc::eq< i, j >::ensure(), geodesic_dilation(), oln::level::is_equal(), and oln::level::is_greater_or_equal().

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 oln::morpho::sure::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.
 #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 mlc::eq< i, j >::ensure(), geodesic_erosion(), oln::level::is_equal(), and oln::level::is_greater_or_equal().

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 oln::morpho::sure::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.
 #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 oln::morpho::sure::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.
 #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 Tue Feb 20 20:29:18 2007 for Olena by  doxygen 1.5.1