#include <labeled_image.hh>
Public Types | |
typedef accu::shape::bbox < typename I::psite >::result | bbox_t |
Type of the bounding component bounding boxes. | |
typedef labeled_image < tag::image_< I > > | skeleton |
Skeleton. | |
Public Member Functions | |
const bbox_t & | bbox (const typename I::value &label) const |
Return the bounding box of the component label . | |
const util::array< bbox_t > & | bboxes () const |
Return the component bounding boxes. | |
I::value | nlabels () const |
Return the number of labels;. | |
p_if< mln_box(I), fun::eq_v2b_expr_< pw::value_ < I >, pw::cst_< typename I::value > > > | subdomain (const typename I::value &label) const |
Return the domain of the component with label label . | |
labeled_image (const I &ima, const typename I::value &nlabels, const util::array< mln_box(I)> &bboxes) | |
Constructor from an image ima , the number of labels nlabels and the object bounding boxes. | |
labeled_image (const I &ima, const typename I::value &nlabels) | |
Constructor from an image ima and the number of labels nlabels . | |
labeled_image () | |
Constructors | |
template<typename F> | |
void | relabel (const Function_v2b< F > &f) |
Labels may be removed. | |
template<typename F> | |
void | relabel (const Function_v2v< F > &f) |
Relabel according to a function. | |
Protected Member Functions | |
void | update_data (const fun::i2v::array< typename I::value > &relabel_fun) |
Update bounding boxes information. |
I | The label image type. |
This image type guaranties that labels are contiguous (from 1 to n).
typedef accu::shape::bbox<typename I ::psite>::result mln::labeled_image_base< I, E >::bbox_t [inherited] |
Type of the bounding component bounding boxes.
typedef labeled_image< tag::image_<I> > mln::labeled_image< I >::skeleton |
Skeleton.
mln::labeled_image< I >::labeled_image | ( | ) | [inline] |
Constructors
Constructor without argument.
mln::labeled_image< I >::labeled_image | ( | const I & | ima, | |
const typename I::value & | nlabels | |||
) | [inline] |
Constructor from an image ima
and the number of labels nlabels
.
mln::labeled_image< I >::labeled_image | ( | const I & | ima, | |
const typename I::value & | nlabels, | |||
const util::array< mln_box(I)> & | bboxes | |||
) | [inline] |
Constructor from an image ima
, the number of labels nlabels
and the object bounding boxes.
References mln::labeled_image_base< I, E >::bboxes(), and mln::data::compute().
const labeled_image_base< I, E >::bbox_t & mln::labeled_image_base< I, E >::bbox | ( | const typename I::value & | label | ) | const [inline, inherited] |
Return the bounding box of the component label
.
Referenced by mln::labeled_image_base< I, E >::subdomain().
const util::array< typename labeled_image_base< I, E >::bbox_t > & mln::labeled_image_base< I, E >::bboxes | ( | ) | const [inline, inherited] |
I::value mln::labeled_image_base< I, E >::nlabels | ( | ) | const [inline, inherited] |
Return the number of labels;.
void mln::labeled_image_base< I, E >::relabel | ( | const Function_v2b< F > & | f | ) | [inline, inherited] |
Labels may be removed.
This overload make sure the labeling is still contiguous.
References mln::labeling::relabel_inplace(), mln::make::relabelfun(), and mln::labeled_image_base< I, E >::update_data().
void mln::labeled_image_base< I, E >::relabel | ( | const Function_v2v< F > & | f | ) | [inline, inherited] |
Relabel according to a function.
Merge or delete labels according to the given function. This method ensures that the labeling remains contiguous.
References mln::labeling::relabel_inplace(), mln::make::relabelfun(), and mln::labeled_image_base< I, E >::update_data().
p_if< mln_box(I), fun::eq_v2b_expr_< pw::value_< I >, pw::cst_< typename I::value > > > mln::labeled_image_base< I, E >::subdomain | ( | const typename I::value & | label | ) | const [inline, inherited] |
Return the domain of the component with label label
.
References mln::labeled_image_base< I, E >::bbox().
void mln::labeled_image_base< I, E >::update_data | ( | const fun::i2v::array< typename I::value > & | relabel_fun | ) | [inline, protected, inherited] |
Update bounding boxes information.
References mln::util::array< T >::size().
Referenced by mln::labeled_image_base< I, E >::relabel().