OTB
9.0.0
Orfeo Toolbox
|
#include <otbLabelObjectToPolygonFunctor.h>
Public Types | |
typedef LabelObjectType::ConstLineIterator | ConstLineIteratorType |
typedef LineType::IndexType | IndexType |
typedef TLabelObject | LabelObjectType |
typedef LabelObjectType::LineType | LineType |
typedef itk::Point< double, 2 > | PointType |
typedef PolygonType::Pointer | PolygonPointerType |
typedef TPolygon | PolygonType |
typedef itk::Index< 2 > | RegionIndexType |
typedef itk::Vector< double, 2 > | SpacingType |
typedef PolygonType::VertexType | VertexType |
This class vectorizes a LabelObject to a Polygon.
The algorithm follows a finite states machine described in the following paper:
"An algorithm for the rapid computation of boundaries of run-length encoded regions", Francis K. H. Queck, in Pattern Recognition 33 (2000), p 1637-1649.
Lines in the RLE are first sorted in lexicographical order (to ensure ordered RLE), and the finite states machine tracks the edge following 8 canonical states given by the configuration of two consecutive raws of lines.
Iterations are done until convergence which is guaranteed to happen.
Please be aware that this functor is not thread-safe.
Definition at line 62 of file otbLabelObjectToPolygonFunctor.h.
typedef LabelObjectType::ConstLineIterator otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::ConstLineIteratorType |
Const iterator over LabelObject lines
Definition at line 69 of file otbLabelObjectToPolygonFunctor.h.
typedef LineType::IndexType otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::IndexType |
Definition at line 72 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Definition at line 160 of file otbLabelObjectToPolygonFunctor.h.
typedef TLabelObject otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectType |
Template parameters typedefs
Definition at line 66 of file otbLabelObjectToPolygonFunctor.h.
typedef LabelObjectType::LineType otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LineType |
Definition at line 71 of file otbLabelObjectToPolygonFunctor.h.
typedef itk::Point<double, 2> otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::PointType |
Definition at line 76 of file otbLabelObjectToPolygonFunctor.h.
typedef PolygonType::Pointer otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::PolygonPointerType |
Definition at line 74 of file otbLabelObjectToPolygonFunctor.h.
typedef TPolygon otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::PolygonType |
Definition at line 73 of file otbLabelObjectToPolygonFunctor.h.
typedef itk::Index<2> otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::RegionIndexType |
Definition at line 78 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal structures.
Definition at line 158 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Definition at line 159 of file otbLabelObjectToPolygonFunctor.h.
typedef itk::Vector<double, 2> otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::SpacingType |
Definition at line 77 of file otbLabelObjectToPolygonFunctor.h.
typedef PolygonType::VertexType otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::VertexType |
Definition at line 75 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Enumerator | |
---|---|
LEFT_END | |
RIGHT_END |
Definition at line 170 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Enumerator | |
---|---|
UP_LEFT | |
UP_RIGHT | |
DOWN_LEFT | |
DOWN_RIGHT |
Definition at line 163 of file otbLabelObjectToPolygonFunctor.h.
|
inline |
Constructor
Definition at line 129 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_CurrentPoint, otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_CurrentRun, otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_Origin, otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_StartIndex, and otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_StartingPoint.
|
inlinevirtual |
Destructor
Definition at line 152 of file otbLabelObjectToPolygonFunctor.h.
|
inline |
Get name of class.
Definition at line 87 of file otbLabelObjectToPolygonFunctor.h.
|
inline |
Get the origin
Definition at line 111 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_Origin.
|
inline |
Get the spacing
Definition at line 123 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_Spacing.
|
inline |
Get the start index
Definition at line 99 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_StartIndex.
|
private |
Internal enums.
Definition at line 579 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Check if the given run index (index in line, line) is valid.
Definition at line 309 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Return the left-end of the run.
Definition at line 359 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Return the left-most run whose right end lies within the range of the given run.
Index is a the left of point
right end is inside run range
Definition at line 409 of file otbLabelObjectToPolygonFunctor.hxx.
|
staticprivate |
Compare two line in the lexicographical order.
Definition at line 33 of file otbLabelObjectToPolygonFunctor.hxx.
|
inline |
labelObject | the label object to vectorize |
Definition at line 42 of file otbLabelObjectToPolygonFunctor.hxx.
References otb::ogr::Within().
|
inlineprivate |
Return the right-end of the run.
Definition at line 366 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Return the right-most run whose left end lies within the range of the given run.
Index is a the right of point
Index is inside run range
Definition at line 375 of file otbLabelObjectToPolygonFunctor.hxx.
|
inline |
Set the origin of the underlying image
Definition at line 105 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_Origin.
|
inline |
Set the spacing of the underlying image
Definition at line 117 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_Spacing.
|
inline |
Set the start index of the underlying image
Definition at line 93 of file otbLabelObjectToPolygonFunctor.h.
References otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::m_StartIndex.
|
inlineprivate |
Walk left to update the finite states machine.
Definition at line 443 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Walk right to update the finite states machine.
Definition at line 512 of file otbLabelObjectToPolygonFunctor.hxx.
|
inlineprivate |
Check if the point lies within the range of the line.
Definition at line 316 of file otbLabelObjectToPolygonFunctor.hxx.
|
private |
The current line for vectorization.
Definition at line 230 of file otbLabelObjectToPolygonFunctor.h.
|
private |
The current point for vectorization.
Definition at line 224 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor().
|
private |
The current run for vectorization.
Definition at line 227 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor().
|
private |
The current state.
Definition at line 216 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Definition at line 213 of file otbLabelObjectToPolygonFunctor.h.
|
private |
The line offset from start of the region.
Definition at line 236 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Definition at line 240 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::GetOrigin(), otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor(), and otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::SetOrigin().
|
private |
Internal enums.
Definition at line 210 of file otbLabelObjectToPolygonFunctor.h.
|
private |
The position flag.
Definition at line 218 of file otbLabelObjectToPolygonFunctor.h.
|
private |
The vector of vectorized boundaries.
Definition at line 233 of file otbLabelObjectToPolygonFunctor.h.
|
private |
Internal enums.
Definition at line 241 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::GetSpacing(), and otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::SetSpacing().
|
private |
Internal enums.
Definition at line 239 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::GetStartIndex(), otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor(), and otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::SetStartIndex().
|
private |
Internal enums.
Definition at line 221 of file otbLabelObjectToPolygonFunctor.h.
Referenced by otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor().