DGtal
0.6.devel
|
#include <SaturatedSegmentation.h>
Data Structures | |
class | SegmentComputerIterator |
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation. More... |
Public Types | |
typedef TSegmentComputer | SegmentComputer |
typedef SegmentComputer::ConstIterator | ConstIterator |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((CForwardSegmentComputer< TSegmentComputer >)) | |
SaturatedSegmentation () | |
SaturatedSegmentation (const ConstIterator &itb, const ConstIterator &ite, const SegmentComputer &aSegmentComputer) | |
void | setSubRange (const ConstIterator &itb, const ConstIterator &ite) |
void | setMode (const std::string &aMode) |
~SaturatedSegmentation () | |
SaturatedSegmentation::SegmentComputerIterator | begin () const |
SaturatedSegmentation::SegmentComputerIterator | end () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Types | |
typedef TSegmentComputer::Reverse | ReverseSegmentComputer |
typedef ReverseSegmentComputer::ConstIterator | ConstReverseIterator |
Private Member Functions | |
SaturatedSegmentation (const SaturatedSegmentation &other) | |
SaturatedSegmentation & | operator= (const SaturatedSegmentation &other) |
Private Attributes | |
ConstIterator | myBegin |
ConstIterator | myEnd |
ConstIterator | myStart |
ConstIterator | myStop |
std::string | myMode |
SegmentComputer | mySegmentComputer |
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range given by a pair of ConstIterators (maximal segments are segments that cannot be included in greater segments).
Description of template class 'SaturatedSegmentation'
This class is a model of CSegmentation.
TSegmentComputer | at least a model of CForwardSegmentComputer (an online algorithm for the recognition of a given class of segments). |
In the short example below, a digital curve stored in a STL vector is decomposed into maximal 8-connected DSSs whose parameters are sent to the standard output.
If you want to get the saturated segmentation of a part of the digital curve (not the whole digital curve), you can give the range to process as a pair of iterators when calling the setSubRange() method as follow:
Obviously, [beginIt, endIt) has to be a valid range included in the wider range [curve.begin(), curve.end()).
Moreover, the segmentation at the ends depends of the underlying digital curve. Among the whole set of maximal segments that pass through the first (resp. last) element of the range, one maximal segment must be chosen as the first (resp. last) retrieved maximal segments. Several processing modes are therefore available:
The mode i indicates that the segmentation begins with the i maximal segment passing through the first element and ends with the i maximal segment passing through the last element. The last retrieved segment of the segmentation is not included in the simple "XXX" modes, but is included in the "XXX++" modes.
For instance, in the default mode "MostCentered", the segmentation begins with the most centered maximal segment passing through the first element and ends (without including it) with the most centered maximal segment passing through the last element. This mode is basically used to process a whole circular structure so that the first maximal segment is not retrieved twice. However, in order to include the most centered maximal segment passing through the last element in a subpart, you should use the "MostCentered++" mode.
In order to set a mode (before getting a SegmentComputerIterator), use the setMode() method as follow:
Definition at line 153 of file SaturatedSegmentation.h.
typedef SegmentComputer::ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::ConstIterator |
Definition at line 160 of file SaturatedSegmentation.h.
|
private |
Definition at line 165 of file SaturatedSegmentation.h.
|
private |
Definition at line 164 of file SaturatedSegmentation.h.
typedef TSegmentComputer DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputer |
Definition at line 159 of file SaturatedSegmentation.h.
|
inline |
DGtal::SaturatedSegmentation< TSegmentComputer >::SaturatedSegmentation | ( | const ConstIterator & | itb, |
const ConstIterator & | ite, | ||
const SegmentComputer & | aSegmentComputer | ||
) |
Constructor.
itb | begin iterator of the underlying range |
ite | end iterator of the underlying range |
aSegmentComputer | an online segment recognition algorithm. |
Definition at line 409 of file SaturatedSegmentation.ih.
|
inline |
|
private |
Copy constructor.
other | the object to clone. |
|
inline |
ConstIterator service.
Definition at line 459 of file SaturatedSegmentation.ih.
References DGtal::SaturatedSegmentation< TSegmentComputer >::mySegmentComputer.
Referenced by DGtal::MostCenteredMaximalSegmentEstimator< SegmentComputer, SCEstimator >::eval().
DGtal::SaturatedSegmentation< TSegmentComputer >::BOOST_CONCEPT_ASSERT | ( | (CForwardSegmentComputer< TSegmentComputer >) | ) |
|
inline |
ConstIterator service.
Definition at line 468 of file SaturatedSegmentation.ih.
References DGtal::SaturatedSegmentation< TSegmentComputer >::mySegmentComputer.
Referenced by DGtal::MostCenteredMaximalSegmentEstimator< SegmentComputer, SCEstimator >::eval().
|
inline |
Checks the validity/consistency of the object.
Definition at line 487 of file SaturatedSegmentation.ih.
Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator==().
|
private |
Assignment.
other | the object to copy. |
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 478 of file SaturatedSegmentation.ih.
|
inline |
Set processing mode
aMode | one of the 3 available modes : "Truncate" (default), "Truncate+1", "DoNotTruncate". |
Definition at line 435 of file SaturatedSegmentation.ih.
References DGtal::SaturatedSegmentation< TSegmentComputer >::myMode.
Referenced by DGtal::MostCenteredMaximalSegmentEstimator< SegmentComputer, SCEstimator >::eval().
|
inline |
Set a subrange to process
itb | begin iterator the range to processed |
ite | end iterator the range to processed |
Nb: must be a valid range included in the underlying range.
Definition at line 424 of file SaturatedSegmentation.ih.
References DGtal::SaturatedSegmentation< TSegmentComputer >::myMode, DGtal::SaturatedSegmentation< TSegmentComputer >::myStart, and DGtal::SaturatedSegmentation< TSegmentComputer >::myStop.
Referenced by DGtal::MostCenteredMaximalSegmentEstimator< SegmentComputer, SCEstimator >::eval().
|
private |
Begin iterator of the underlying range
Definition at line 475 of file SaturatedSegmentation.h.
|
private |
End iterator of the underlying range
Definition at line 480 of file SaturatedSegmentation.h.
|
private |
Mode: either "First", "MostCentered" (default), "Last"
Definition at line 495 of file SaturatedSegmentation.h.
Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::setMode(), and DGtal::SaturatedSegmentation< TSegmentComputer >::setSubRange().
|
private |
the segment computer.
Definition at line 500 of file SaturatedSegmentation.h.
Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::begin(), DGtal::SaturatedSegmentation< TSegmentComputer >::begin(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::end(), DGtal::SaturatedSegmentation< TSegmentComputer >::end(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::get(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::initFirstMaximalSegment(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::initLastMaximalSegment(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::nextMaximalSegment(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator*(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator->(), DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator=(), and DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator==().
|
private |
Begin iterator of the subrange to segment
Definition at line 485 of file SaturatedSegmentation.h.
Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::setSubRange().
|
private |
End iterator of the subrange to segment
Definition at line 490 of file SaturatedSegmentation.h.
Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::setSubRange().