Commit d46e2e70 authored by Edwin Carlinet's avatar Edwin Carlinet
Browse files

Add mintree_indexes computation algorithm.

    * mln/morpho/maxtree/maxtree.hpp: min-tree entry.
parent b8d43e2b
......@@ -12,13 +12,27 @@ namespace mln
namespace morpho
{
///
/// \brief Compute a maxtree as a component tree where nodes contain indexes instead of points.
///
/// \brief Compute a maxtree as a component tree where nodes
/// contain indexes instead of points.
///
/// \param ima The image
/// \param nbh The neighborhood
/// \param cmp A strict weak order on values
template <typename I, typename N, typename StrictWeakOrdering = std::less<mln_value(I)> >
component_tree<typename I::size_type, mln_ch_value(I, unsigned)>
maxtree_indexes(const Image<I>& ima, const Neighborhood<N>& nbh,
StrictWeakOrdering cmp = StrictWeakOrdering());
StrictWeakOrdering cmp = StrictWeakOrdering());
///
/// \brief Compute a mintree as a component tree where nodes
/// contain indexes instead of points.
///
/// \param ima The image
/// \param nbh The neighborhood
/// \param cmp A strict weak order on values
template <typename I, typename N>
component_tree<typename I::size_type, mln_ch_value(I, unsigned)>
mintree_indexes(const Image<I>& ima, const Neighborhood<N>& nbh);
/*****************************/
......@@ -35,6 +49,17 @@ namespace mln
return res;
}
template <typename I, typename N>
component_tree<typename I::size_type, mln_ch_value(I, unsigned)>
mintree_indexes(const Image<I>& ima, const Neighborhood<N>& nbh)
{
mln_entering("mln::morpho::mintree_indexes");
auto res = impl::maxtree_queue_indexes(exact(ima), exact(nbh), std::greater<mln_value(I)> ());
mln_exiting();
return res;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment