DGtal  0.9.4beta
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator > Class Template Reference

#include <DGtal/geometry/curves/AlphaThickSegmentComputer.h>

Collaboration diagram for DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >:
[legend]

Data Structures

struct  State
 

Public Types

typedef TInputPoint InputPoint
 
typedef std::vector< InputPointInputPointContainer
 
typedef InputPointContainer::size_type Size
 
typedef InputPointContainer::const_iterator ContainerConstIterator
 
typedef DGtal::functions::Hull2D::ThicknessDefinition ThicknessDef
 
typedef InputPointContainer::iterator Iterator
 
typedef TConstIterator ConstIterator
 
typedef ParallelStrip< SpaceND< 2, DGtal::int32_t >,true, true > Primitive
 
typedef DGtal::PointVector< 2, double > PointD
 
typedef AlphaThickSegmentComputer< InputPoint, ConstIteratorSelf
 
typedef AlphaThickSegmentComputer< InputPoint, ReverseIterator< ConstIterator > > Reverse
 
typedef DGtal::InHalfPlaneBySimple3x3Matrix< InputPoint, typename InputPoint::Component > Functor
 
typedef DGtal::MelkmanConvexHull< InputPoint, Functor >::ConstIterator ConvexhullConstIterator
 

Public Member Functions

 AlphaThickSegmentComputer (const double maximalThickness=1.0, const ThicknessDef &thicknessDefinition=functions::Hull2D::HorizontalVerticalThickness, const double thickCompPrecision=1e-6)
 
 ~AlphaThickSegmentComputer ()
 
 AlphaThickSegmentComputer (const AlphaThickSegmentComputer &other)
 
AlphaThickSegmentComputeroperator= (const AlphaThickSegmentComputer &other)
 
Self getSelf () const
 
Reverse getReverse () const
 
bool operator== (const AlphaThickSegmentComputer &other) const
 
bool operator!= (const AlphaThickSegmentComputer &other) const
 
Size size () const
 
bool empty () const
 
ContainerConstIterator containerBegin () const
 
ContainerConstIterator containerEnd () const
 
ConvexhullConstIterator convexhullBegin () const
 
ConvexhullConstIterator convexhullEnd () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
Size max_size () const
 
void init (const ConstIterator &it)
 
bool extendFront ()
 
bool isExtendableFront ()
 
bool isExtendableFront (const InputPoint &aPoint)
 
bool extendFront (const InputPoint &aPoint)
 
Primitive primitive () const
 
bool isValid () const
 
std::pair< InputPoint, InputPointgetExtremityPoints () const
 
std::pair< std::pair< InputPoint, InputPoint >, InputPointgetAntipodalLeaningPoints () const
 
void computeParallelStripParams (double &mu, PointD &N, double &nu) const
 
PointD getNormal () const
 
double getThickness () const
 
double getMu () const
 
double getNu () const
 
double getSegmentLength () const
 
bool isStoringSegmentPoints () const
 
unsigned int getNumberSegmentPoints () const
 
std::vector< InputPointgetConvexHull () const
 
void getBoundingBoxFromExtremPoints (const InputPoint &aFirstPt, const InputPoint &aLastPt, PointD &pt1LongestSegment1, PointD &pt2LongestSegment1, PointD &pt3LongestSegment2, PointD &pt4LongestSegment2, double minVisibleWidthBounds=0.2) const
 
void getBoundingBox (PointD &pt1LongestSegment1, PointD &pt2LongestSegment1, PointD &pt3LongestSegment2, PointD &pt4LongestSegment2) const
 
std::string className () const
 
void selfDisplay (std::ostream &out) const
 

Protected Member Functions

bool melkmanIsConvexValid ()
 
double updateMainHeightAndAntiPodal ()
 
template<typename TPointD >
bool projectOnStraightLine (const TPointD &ptA, const TPointD &ptB, const TPointD &ptC, PointD &ptProjected) const
 
template<typename TConstIteratorG >
void computeExtremaPoints (const TConstIteratorG &itBegin, const TConstIteratorG &itEnd, InputPoint &aFirstExtrPt, InputPoint &aLastExtrPt) const
 

Protected Attributes

ConstIterator myBegin
 
ConstIterator myEnd
 

Private Member Functions

 BOOST_STATIC_ASSERT ((TInputPoint::dimension==2))
 
 BOOST_CONCEPT_ASSERT ((boost_concepts::ReadableIterator< TConstIterator >))
 

Private Attributes

InputPointContainer myPointContainer
 
double myMaximalThickness
 
double myThicknessCompPrecision
 
ThicknessDef myThicknessDefinition
 
State myState
 
State myPreviousState
 
bool myIsStoringPoints
 
unsigned int myNbPointsAddedFromIterators
 

Detailed Description

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
class DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >

Aim: This class is devoted to the recognition of alpha thick segments as described in [34] . From a maximal diagonal alphaMax thickness, it recognizes thick segments and may thus take into account some noise in the input contour. Moreover points of the segment may not be (digitally) connected and may have floating point coordinates. Connection is only given by the order of the points.

Description of class 'AlphaThickSegmentComputer'

As other solutions like [30] the algorithm given here is based on the height/width computation of the convex hull computed from a given set of points. The actual implementation exploits the height/width update defined in the [34] (see [34] page 363) which reduces the complexity from \(O(n\ log\ n) \) in \(O( log\ n) \). Note that the convexhull update in linear time (with point substraction) proposed by Buzer [50] is not yet implemented.

Template Parameters
TInputPointthe type of input points: their dimension must be two but their components may be integers or floating-point values.
TConstIteratorthe type of iterator of candidate points (used in initialization) which should be readable and forward. By default the iterator is set to the const_iterator of std::vector< TInputPoint > .

This class is a model of boost::ForwardContainer and CForwardSegmentComputer. It is also default constructible, copy constructible, assignable and equality comparable.

Alpha thick segment recognition may be typically done as follows:

Note
You can also construct the segment by using an input point iterator in initialisation (see Alpha-thick Segment Recognition for more details)

The proposed implementation is mainly a backport from ImaGene with some various refactoring.

Examples:
geometry/curves/exampleAlphaThickSegment.cpp, geometry/curves/exampleAlphaThickSegmentNoisy.cpp, geometry/curves/exampleAlphaThickSegmentTgtCover.cpp, and geometry/curves/greedyAlphaThickDecomposition.cpp.

Definition at line 128 of file AlphaThickSegmentComputer.h.

Member Typedef Documentation

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef TConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::ConstIterator

Definition at line 150 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef InputPointContainer::const_iterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::ContainerConstIterator

Definition at line 146 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef DGtal::MelkmanConvexHull<InputPoint, Functor>::ConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::ConvexhullConstIterator

Definition at line 162 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef DGtal::InHalfPlaneBySimple3x3Matrix<InputPoint, typename InputPoint::Component> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Functor

Definition at line 161 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef TInputPoint DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::InputPoint

Type of input point.

Definition at line 139 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef std::vector< InputPoint > DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::InputPointContainer

The container type of Input Point

Definition at line 144 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef InputPointContainer::iterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Iterator

Definition at line 149 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef DGtal::PointVector<2, double> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::PointD

Type of embedded points

See also
getBoundingBox, getBoundingBoxFromExtremPoints

Definition at line 157 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef ParallelStrip< SpaceND< 2, DGtal::int32_t > ,true,true> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Primitive

Definition at line 151 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef AlphaThickSegmentComputer<InputPoint, ReverseIterator<ConstIterator> > DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Reverse

Definition at line 160 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef AlphaThickSegmentComputer<InputPoint, ConstIterator> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Self

Definition at line 159 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef InputPointContainer::size_type DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::Size

Definition at line 145 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
typedef DGtal::functions::Hull2D::ThicknessDefinition DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::ThicknessDef

Definition at line 147 of file AlphaThickSegmentComputer.h.

Constructor & Destructor Documentation

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::AlphaThickSegmentComputer ( const double  maximalThickness = 1.0,
const ThicknessDef thicknessDefinition = functions::Hull2D::HorizontalVerticalThickness,
const double  thickCompPrecision = 1e-6 
)

Constructor.

Parameters
[in]maximalThicknessthe maximal thickness of the segment (default 1).
[in]thicknessDefinitionthe definition of the thickness used in the segment extension (can be DGtal::functions::Hull2D::HorizontalVerticalThickness (default) or DGtal::functions::Hull2D::EuclideanThickness).
[in]thickCompPrecisionto adjust the precision of the thickness estimation used in the comparison during the segment extension (default set to 1e-6).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::~AlphaThickSegmentComputer ( )

Destructor.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::AlphaThickSegmentComputer ( const AlphaThickSegmentComputer< TInputPoint, TConstIterator > &  other)

Copy constructor.

Parameters
[in]otherthe object to clone.

Member Function Documentation

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::begin ( ) const
Returns
a const iterator pointing on the first point of the current alpha thick segment. Useful only if the initialisation was done with a contour iterator (else, it is empty).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::BOOST_CONCEPT_ASSERT ( (boost_concepts::ReadableIterator< TConstIterator >)  )
private
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::BOOST_STATIC_ASSERT ( (TInputPoint::dimension==2)  )
private
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
std::string DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::className ( ) const
Returns
the style name used for drawing this object.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
template<typename TConstIteratorG >
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::computeExtremaPoints ( const TConstIteratorG &  itBegin,
const TConstIteratorG &  itEnd,
InputPoint aFirstExtrPt,
InputPoint aLastExtrPt 
) const
protected

From an point iterator (itBegin and itEnd) it computes the two extrem points (aFirstExtrPt and aLastExtrPt) defined according to the direction of the current segment.

Parameters
[in]itBeginthe start iterator of the input points.
[in]itEndthe end iterator of the input points.
[out]aFirstExtrPtthe first extrem point.
[out]aLastExtrPtthe last extrem point.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::computeParallelStripParams ( double &  mu,
PointD N,
double &  nu 
) const

Computes the paralell strip params from the current state of the segment.

Parameters
[out]muthe minimal value of N.X (with N is the normal vector of the segment).
[out]Nthe normal of the vector (not normalized).
[out]nuthe width of the strip.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ContainerConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::containerBegin ( ) const
Returns
a const iterator pointing on the first point given in the container associated to the current alpha thick segment (is empty if the saving option is not selected in the init method).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ContainerConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::containerEnd ( ) const
Returns
a const iterator pointing after the last point given in the container associated to the current alpha thick segment (is empty if the saving option is not selected in the init method).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConvexhullConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::convexhullBegin ( ) const
Returns
a const iterator pointing on the first point of the convex hull associated to the current alpha thick segment.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConvexhullConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::convexhullEnd ( ) const
Returns
a const iterator pointing after the last point of the convex hull associated to the current alpha thick segment.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::empty ( ) const
Returns
'true' if and only if the container contains no point.
Note
: returns always 'true' if the segment computer is initialized with a curve const iterator without the option of saving samples).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::end ( ) const
Returns
a const iterator pointing after the last point stored in the current alpha thick segment container. Useful only if the initialisation was done with a contour iterator (else, it is empty).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::extendFront ( )

Tries to extend front the current alpha thick segment with the next contour point and checks if we have still an alpha thick segment of thickness less or equal to the initial value alpha_max. If it is the case the new point is added and the segment parameters are updated, otherwise the alpha thick segment is keep in its original state.

Returns
'true' if the segment has been extended and 'false' otherwise (the object is then in its original state).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::extendFront ( const InputPoint aPoint)

Tries to add the point aPoint at the front of the current alpha thick segment and checks if we have still an alpha thick segment of thickness less or equal to the initial value alpha_max. If it is the case the new point is added and the segment parameters are updated, otherwise the alpha thick segment is keep in its original state.

Parameters
[in]aPointthe new point to extend the current segment.
Returns
'true' if the segment has been extended and 'false' otherwise (the object is then in its original state).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
std::pair<std::pair<InputPoint, InputPoint>, InputPoint> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getAntipodalLeaningPoints ( ) const
Returns
the antipodal leaning points of the segment (given in the convexhull). The result is given as a pair for which the first element is the pair containing the edge antipodal points and the second element is the vertex of the antipodal pair (see section Alpha-thick Segment for an illustration of such an antipodal pair).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getBoundingBox ( PointD pt1LongestSegment1,
PointD pt2LongestSegment1,
PointD pt3LongestSegment2,
PointD pt4LongestSegment2 
) const

Computes the segment bounding box defined from the extremity points computed after a scan of the current convexhull. Note that this bouding box differs from the begin/end points bounding box when a large amount of noise is present in the initial curve. The sequence of resulting points (pt1LongestSegment1, pt2LongestSegment1, pt3LongestSegment2, pt4LongestSegment4) are ccw oriented.

Parameters
[out]pt1LongestSegment1the first point of one of the longest segment.
[out]pt2LongestSegment1the second point of one of the longest segment.
[out]pt3LongestSegment2the first point of one of the second longest segment.
[out]pt4LongestSegment2the second point of one of the second longest segment.
Note
the segment bounding box can be drawn with the sequence of out parameters pt1LongestSegment1, pt2LongestSegment1, pt3LongestSegment1, pt4LongestSegment1.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getBoundingBoxFromExtremPoints ( const InputPoint aFirstPt,
const InputPoint aLastPt,
PointD pt1LongestSegment1,
PointD pt2LongestSegment1,
PointD pt3LongestSegment2,
PointD pt4LongestSegment2,
double  minVisibleWidthBounds = 0.2 
) const

Computes the segment bounding box according to two extremity points (aFirstPt, aLastPt).

Parameters
[in]aFirstPtthe first extrem point.
[in]aLastPtthe last extrem point.
[out]pt1LongestSegment1the first point of one of the longest segment.
[out]pt2LongestSegment1the second point of one of the longest segment.
[out]pt3LongestSegment2the first point of one of the second longest segment.
[out]pt4LongestSegment2the second point of one of the second longest segment.
[in]minVisibleWidthBoundsthe minimal width of the resulting bounding box (for drawing issue when the segment thickness is 0). The sequence of resulting points (pt1LongestSegment1, pt2LongestSegment1, pt3LongestSegment2, pt4LongestSegment4) are ccw oriented.
Note
the segment bounding box can be drawn with the sequence of out parameters pt1LongestSegment1, pt2LongestSegment1, pt3LongestSegment1, pt4LongestSegment1.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
std::vector<InputPoint> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getConvexHull ( ) const
Returns
the current alpha thick segment convexhull given as a vector containing the vertex points.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
std::pair<InputPoint, InputPoint> DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getExtremityPoints ( ) const

Get the extremity points of the segment. These points are not necessary the last point of the segment.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getMu ( ) const
Returns
the mu parameter of the current segment (given from the segment ParalellStrip primitive).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
PointD DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getNormal ( ) const
Returns
the two values of the normal vector given as a Point(a,b) (the normal is oriented toward the segment by considering the edge PQ of the convexhull antipodal pair).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getNu ( ) const
Returns
the nu parameter the of the current segment (given from the segment ParalellStrip primitive).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
unsigned int DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getNumberSegmentPoints ( ) const
Returns
the total number of points beeing recognized through in the segment construction.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
Reverse DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getReverse ( ) const
Returns
a default-constructed instance of Reverse
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getSegmentLength ( ) const
Returns
the segment length defined from the bouding box (
See also
getBoundingBox).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
Self DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getSelf ( ) const
Returns
a default-constructed instance of Self
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::getThickness ( ) const
Returns
the thickness of the current segment.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::init ( const ConstIterator it)

Initialisation with an ConstIterator (to conform to CForwardSegmentComputer). The maximal thickness corresponds to the width of the ParallelStrip primitive (set to 1 by default).

Parameters
[in]itan iterator on input points.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::isExtendableFront ( )

Tests whether the current alpha thick segment can be extended at the front with the next contour point i.e checks if we have still an alpha thick segment of width alpha_max after adding the given point aPoint. The segment parameters are keep in its original state.

Returns
'true' if the segment can be extended with the given point, 'false' otherwise.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::isExtendableFront ( const InputPoint aPoint)

Tests whether the current alpha thick segment can be extended, i.e checks if we have still an alpha thick segment of width alpha_max after adding the given point aPoint. The segment parameters are keep in its original state.

Parameters
[in]aPointthe point to be tested for the segment extension.
Returns
'true' if the segment can be extended with the given point, 'false' otherwise.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::isStoringSegmentPoints ( ) const
Returns
'true' if the points of the segment computer are stored in the main container.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
Size DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::max_size ( ) const
Returns
the maximal allowed number of points in the current alpha thick segment.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::melkmanIsConvexValid ( )
protected

Depending on connexity, return true if a convex is valid.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::operator!= ( const AlphaThickSegmentComputer< TInputPoint, TConstIterator > &  other) const

Difference operator.

Parameters
otherthe object to compare with.
Returns
'false' if equal 'true' otherwise
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
AlphaThickSegmentComputer& DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::operator= ( const AlphaThickSegmentComputer< TInputPoint, TConstIterator > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::operator== ( const AlphaThickSegmentComputer< TInputPoint, TConstIterator > &  other) const

Equality operator.

Parameters
otherthe object to compare with.
Returns
'true' if the AlphaThickSegment representations and the ranges of the two objects match, 'false' otherwise
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
Primitive DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::primitive ( ) const

Returns the current primitive recognized by this computer, which is a ParallelStrip of axis width smaller than the one specified at instanciation.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
template<typename TPointD >
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::projectOnStraightLine ( const TPointD &  ptA,
const TPointD &  ptB,
const TPointD &  ptC,
PointD ptProjected 
) const
protected

Computes the projection of a Point ptC on the real line defined by the two points (ptA, ptB), and return true if the projected point is inside the segment closed interval [A,B].

Parameters
[in]ptAone of the two points defining the straight line.
[in]ptBone of the two points defining the straight line.
[in]ptCthe point to be projected.
[out]ptProjectedthe projected point.
Returns
true if ptProjected is inside the segment [A,B].
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
void DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
[out]outthe output stream where the object is written.
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
Size DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::size ( ) const
Returns
the number of distinct points stored in the container.
Note
it returns 0 if segment computer is initialized with a curve iterator without the option of saving samples).
template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::updateMainHeightAndAntiPodal ( )
protected

Updates the main height of the melkman convex hull and update the antipodal pairs.

Returns
the thickness of the segment (thickness defined by default as the vertical/horizontal width (see Alpha-thick Segment Recognition for more details).

Field Documentation

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myBegin
protected

begin iterator (associated to input data)

Definition at line 578 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ConstIterator DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myEnd
protected

begin iterator (associated to input data)

Definition at line 583 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myIsStoringPoints
private

Definition at line 623 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myMaximalThickness
private

The maximal thickness of the segment.

Definition at line 599 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
unsigned int DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myNbPointsAddedFromIterators
private

Used by the size method.

Definition at line 628 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
InputPointContainer DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myPointContainer
mutableprivate

The set of points contained in the alpha thick segment which can be changed during computations.

Definition at line 594 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
State DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myPreviousState
mutableprivate

Previous saved computer state

Definition at line 621 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
State DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myState
private

State of the actual computer

Definition at line 616 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
double DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myThicknessCompPrecision
private

To adjust the precision of the thickness estimation used in the comparison during the segment extension.

Definition at line 604 of file AlphaThickSegmentComputer.h.

template<typename TInputPoint, typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
ThicknessDef DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::myThicknessDefinition
private

To set a specific thickness definition.

Definition at line 610 of file AlphaThickSegmentComputer.h.


The documentation for this class was generated from the following file: