DGtal  1.5.beta
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator > Class Template Reference

Aim: This class is devoted to the recognition of alpha thick segments as described in [51] . 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. More...

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

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 TPoint , typename TPointD >
bool projectOnStraightLine (const TPoint &ptA, const TPoint &ptB, const TPoint &ptC, TPointD &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 [51] . 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 [47] 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 [51] (see [51] 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 [86] 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:

  • If you consider input point with floating coordinates, you can define this type:
    typedef AlphaThickSegmentComputer< Z2i::RealPoint > AlphaThickSegmentComputer2D;
  • Then import possibly a vector containing the input points by using the PointListReader class:
    std::vector<Z2i::RealPoint> aContour = PointListReader<Z2i::RealPoint>::getPointsFromFile(file);
    static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
  • Finally apply the segment recognition (here of maximal thickness 15) by adding the sequence (forward) of contour points:
    AlphaThickSegmentComputer2D anAlphaSegment(15);
    std::vector<Z2i::RealPoint>::const_iterator it = aContour.begin();
    while (anAlphaSegment.extendFront(*it)) {
    it++;
    }
    Note
    The maximal thickness given in initialization is the same than the width given by the method width() of the ParallelStrip primitive (not the vertical/horizontal width of the convex hull).
  • If you use a Board2D display, you can draw the resulting segment like other 2D objects:
    aBoard << anAlphaSegment;
    The complete example of segment recognition is given in exampleAlphaThickSegmentNoisy.cpp
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.

Definition at line 127 of file AlphaThickSegmentComputer.h.

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 149 of file AlphaThickSegmentComputer.h.

◆ ContainerConstIterator

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

Definition at line 145 of file AlphaThickSegmentComputer.h.

◆ ConvexhullConstIterator

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 161 of file AlphaThickSegmentComputer.h.

◆ Functor

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 160 of file AlphaThickSegmentComputer.h.

◆ InputPoint

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 138 of file AlphaThickSegmentComputer.h.

◆ InputPointContainer

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 143 of file AlphaThickSegmentComputer.h.

◆ Iterator

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

Definition at line 148 of file AlphaThickSegmentComputer.h.

◆ PointD

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 156 of file AlphaThickSegmentComputer.h.

◆ Primitive

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 150 of file AlphaThickSegmentComputer.h.

◆ Reverse

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

Definition at line 159 of file AlphaThickSegmentComputer.h.

◆ Self

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

Definition at line 158 of file AlphaThickSegmentComputer.h.

◆ Size

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

Definition at line 144 of file AlphaThickSegmentComputer.h.

◆ ThicknessDef

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

Definition at line 146 of file AlphaThickSegmentComputer.h.

Constructor & Destructor Documentation

◆ AlphaThickSegmentComputer() [1/2]

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).

◆ ~AlphaThickSegmentComputer()

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

Destructor.

◆ AlphaThickSegmentComputer() [2/2]

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

◆ begin()

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).

◆ BOOST_CONCEPT_ASSERT()

template<typename TInputPoint , typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::BOOST_CONCEPT_ASSERT ( (boost_concepts::ReadableIterator< TConstIterator >)  )
private

◆ BOOST_STATIC_ASSERT()

template<typename TInputPoint , typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::BOOST_STATIC_ASSERT ( (TInputPoint::dimension==2)  )
private

◆ className()

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.

◆ computeExtremaPoints()

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.

◆ computeParallelStripParams()

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.

◆ containerBegin()

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).

◆ containerEnd()

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).

◆ convexhullBegin()

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.

◆ convexhullEnd()

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.

◆ empty()

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).

◆ end()

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).

◆ extendFront() [1/2]

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).

◆ extendFront() [2/2]

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).

◆ getAntipodalLeaningPoints()

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).

◆ getBoundingBox()

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.

◆ getBoundingBoxFromExtremPoints()

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.

◆ getConvexHull()

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.

◆ getExtremityPoints()

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.

◆ getMu()

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).

◆ getNormal()

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).

◆ getNu()

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).

◆ getNumberSegmentPoints()

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.

◆ getReverse()

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

◆ getSegmentLength()

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).

◆ getSelf()

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

◆ getThickness()

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.

◆ init()

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.

◆ isExtendableFront() [1/2]

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.

◆ isExtendableFront() [2/2]

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.

◆ isStoringSegmentPoints()

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.

◆ isValid()

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.

◆ max_size()

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.

◆ melkmanIsConvexValid()

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.

◆ operator!=()

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

◆ operator=()

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'.

◆ operator==()

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

◆ primitive()

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.

◆ projectOnStraightLine()

template<typename TInputPoint , typename TConstIterator = typename std::vector< TInputPoint >::const_iterator>
template<typename TPoint , typename TPointD >
bool DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator >::projectOnStraightLine ( const TPoint &  ptA,
const TPoint &  ptB,
const TPoint &  ptC,
TPointD &  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].

◆ selfDisplay()

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.

◆ size()

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).

◆ updateMainHeightAndAntiPodal()

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

◆ myBegin

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 577 of file AlphaThickSegmentComputer.h.

◆ myEnd

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 582 of file AlphaThickSegmentComputer.h.

◆ myIsStoringPoints

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

Definition at line 622 of file AlphaThickSegmentComputer.h.

◆ myMaximalThickness

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 598 of file AlphaThickSegmentComputer.h.

◆ myNbPointsAddedFromIterators

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 627 of file AlphaThickSegmentComputer.h.

◆ myPointContainer

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 593 of file AlphaThickSegmentComputer.h.

◆ myPreviousState

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 620 of file AlphaThickSegmentComputer.h.

◆ myState

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 615 of file AlphaThickSegmentComputer.h.

◆ myThicknessCompPrecision

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 603 of file AlphaThickSegmentComputer.h.

◆ myThicknessDefinition

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 609 of file AlphaThickSegmentComputer.h.


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