oln::morpho::hybrid Namespace Reference

Hybrid (sure and 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

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

lena128_pgm.png
=>
oln_morpho_hybrid_geodesic_reconstruction_dilation.png

Definition at line 284 of file reconstruction.hh.

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

00287       {
00288         mlc::eq<I1::dim, I2::dim>::ensure();
00289         mlc::eq<I1::dim, N::dim>::ensure();
00290 
00291         precondition(marker.size() == mask.size());
00292         precondition(level::is_greater_or_equal(mask, marker));
00293 
00294         oln_concrete_type(I1) output = marker.clone();
00295         output.border_adapt_copy(Ng.delta());
00296         {
00297           typedef typename abstract::neighborhood<N>::win_type E;
00298           E Ng_plus = get_plus_se_p(convert::ng_to_cse(Ng));
00299           E Ng_minus = get_minus_se_p(convert::ng_to_cse(Ng));
00300           typename I1::fwd_iter_type fwd_p(output);
00301           typename I1::bkd_iter_type bkd_p(output);
00302           for_all (fwd_p)
00303             output[fwd_p] = ntg::min(morpho::max(output, fwd_p, Ng_plus),
00304                                      mask[fwd_p]);
00305 
00306           std::queue<oln_point_type(I1) > fifo;
00307           for_all (bkd_p)
00308             {
00309               output[bkd_p] = ntg::min(morpho::max(output, bkd_p, Ng_minus),
00310                                        mask[bkd_p]);
00311               if (internal::exist_init_dilation(bkd_p.cur(), output, mask, Ng_minus))
00312                 fifo.push(bkd_p);
00313             }
00314           // Propagation Step
00315           while (!fifo.empty())
00316             {
00317               oln_point_type(I1) p = fifo.front();
00318               fifo.pop();
00319               oln_neighb_type(N) q(Ng, p);
00320               for_all (q) if (output.hold(q))
00321                 {
00322                   if ((output[q] < output[p]) && (mask[q] != output[q]))
00323                     {
00324                       output[q] = ntg::min(output[p], mask[q]);
00325                       fifo.push(q);
00326                     }
00327                 }
00328             }
00329         }
00330         return output;
00331       }

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

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

lena128_pgm.png
=>
oln_morpho_hybrid_geodesic_reconstruction_erosion.png

Definition at line 574 of file reconstruction.hh.

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

00577       {
00578         mlc::eq<I1::dim, I2::dim>::ensure();
00579         mlc::eq<I1::dim, N::dim>::ensure();
00580 
00581         precondition(marker.size() == mask.size());
00582         precondition(level::is_greater_or_equal(marker, mask));
00583 
00584         oln_concrete_type(I1) output = marker.clone();
00585         output.border_adapt_copy(Ng.delta());
00586         {
00587           typedef typename abstract::neighborhood<N>::win_type E;
00588           E Ng_plus = get_plus_se_p(convert::ng_to_cse(Ng));
00589           E Ng_minus = get_minus_se_p(convert::ng_to_cse(Ng));
00590           typename I1::fwd_iter_type fwd_p(output);
00591           typename I1::bkd_iter_type bkd_p(output);
00592           for_all (fwd_p)
00593             output[fwd_p] = ntg::max(morpho::min(output, fwd_p, Ng_plus),
00594                                      mask[fwd_p]);
00595 
00596           std::queue<oln_point_type(I1) > fifo;
00597           for_all (bkd_p)
00598             {
00599               output[bkd_p] = ntg::max(morpho::min(output, bkd_p, Ng_minus),
00600                                        mask[bkd_p]);
00601               if (internal::exist_init_erosion(bkd_p.cur(), output, mask, Ng_minus))
00602                 fifo.push(bkd_p);
00603             }
00604           //     Propagation Step
00605           while (!fifo.empty())
00606             {
00607               oln_point_type(I1) p = fifo.front();
00608               fifo.pop();
00609               oln_neighb_type(N) q(Ng, p);
00610               for_all (q) if (output.hold(q))
00611                 {
00612                   if ((output[q] > output[p]) && (mask[q] != output[q]))
00613                     {
00614                       output[q] = ntg::max(output[p], mask[q]);
00615                       fifo.push(q);
00616                     }
00617                 }
00618             }
00619         }
00620         return output;
00621       }

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 547 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 599 of file extrema.hh.


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