mln::morpho::tree::impl::generic Namespace Reference


Functions

template<typename I, typename N, typename S>
mln::trait::ch_value< I,
typename I::psite >::ret 
compute_parent (const Image< I > &f_, const Neighborhood< N > &nbh_, const Site_Set< S > &s_)
 Compute a tree with a parent relationship between sites.
template<typename I, typename S, typename N>
data< I, p_array< typename
I::psite > > 
dual_union_find (const Image< I > &f, const Image< I > &m, const Site_Set< S > &s_f, const Site_Set< S > &s_m, const Neighborhood< N > &nbh)
 Compute a tree using union-find method.


Function Documentation

template<typename I, typename N, typename S>
mln::trait::ch_value< I , typename I ::psite >::ret mln::morpho::tree::impl::generic::compute_parent ( const Image< I > &  f_,
const Neighborhood< N > &  nbh_,
const Site_Set< S > &  s_ 
) [inline]

Compute a tree with a parent relationship between sites.

Warning: s translates the ordering related to the "natural" childhood relationship. The parenthood is thus inverted w.r.t. to s.

It is very convenient since most processing routines upon the parent tree are performed following s (in the default "forward" way). Indeed that is the way to propagate information from parents to children.

The parent result image verifies:

  • p is root iff parent(p) == p
  • p is a node iff either p is root or f(parent(p)) != f(p).

The choice "s means childhood" is consistent with labeling in binary images. In that particular case, while browsing the image in forward scan (video), we expect to find first a tree root (a first point, representative of a component) and then the other component points. Please note that it leads to increasing values of labels in the "natural" video scan.

Since mathematical morphology on functions is related to morphology on sets, we clearly want to keep the equivalence between "component labeling" and "component filtering" using trees.

FIXME: Put it more clearly... Insert pictures!

A binary image:

  • | | - -
  • | | - |
  • - - - -
  • - | | -

where '|' means true and '-' means false.

Its labeling:

0 1 1 0 0
0 1 1 0 2
0 0 0 0 0
0 0 3 3 0

The corresponding forest:

x o . x x
x . . x o
x x x x x
x x o . x

where 'x' means "no data", 'o' is a tree root (representative point for a component), and '.' is a tree regular (non-root) point (in a component by not its representative point).

The forest, with the parent relationship looks like:

o < .
^ r
. . o


o < .

Definition at line 193 of file compute_parent.hh.

References mln::morpho::tree::internal::compute_parent_dispatch(), mln::morpho::tree::internal::compute_parent_tests(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::data::fill(), mln::initialize(), and mln::morpho::tree::internal::zfind_root().

Referenced by mln::morpho::tree::internal::compute_parent_dispatch(), mln::morpho::tree::data< I, S >::data(), and mln::morpho::tree::max().

template<typename I, typename S, typename N>
data< I, p_array< typename I::psite > > mln::morpho::tree::impl::generic::dual_union_find ( const Image< I > &  f,
const Image< I > &  m,
const Site_Set< S > &  s_f,
const Site_Set< S > &  s_m,
const Neighborhood< N > &  nbh 
) [inline]


Generated on Sun May 16 01:59:58 2010 for Milena (Olena) by  doxygen 1.5.6