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. |
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:
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().
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] |
Compute a tree using union-find method.
f | The original image. | |
m | The connectivity mask. | |
s_f | The sorted site set of f | |
s_m | The sorted site set of m . | |
nbh | The neighborhood of the mask. |
Definition at line 187 of file dual_union_find.hh.
References mln::p_array< P >::append(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::data::fill(), mln::morpho::tree::internal::find_root(), mln::initialize(), mln::geom::nsites(), mln::p_array< P >::reserve(), mln::util::timer::reset(), mln::util::timer::restart(), mln::util::timer::start(), mln::morpho::tree::internal::t_prop, mln::geom::translate(), mln::morpho::tree::internal::update_m_parent(), and mln::literal::zero.
Referenced by mln::morpho::tree::internal::dual_input_max_tree_dispatch().