DGtal
0.6.devel
|
#include <ArithmeticalDSS.h>
Data Structures | |
struct | Tools |
struct | Tools< TInt, 4 > |
Public Types | |
typedef TInteger | Integer |
typedef TIterator | ConstIterator |
typedef ArithmeticalDSS < ConstIterator, TInteger, connectivity > | Self |
typedef ArithmeticalDSS < ReverseIterator < ConstIterator >, TInteger, connectivity > | Reverse |
typedef IteratorCirculatorTraits < ConstIterator >::Value | Point |
typedef IteratorCirculatorTraits < ConstIterator >::Value | Vector |
typedef PointVector< 2, double > | PointD |
Data Fields | |
Point | myUf |
Point | myUl |
Point | myLf |
Point | myLl |
ConstIterator | myF |
ConstIterator | myL |
Protected Attributes | |
Integer | myA |
Integer | myB |
Integer | myMu |
Integer | myOmega |
Integer | myNbUpPat |
Integer | myNbLowPat |
std::vector< Vector > | mySteps |
Private Member Functions | |
bool | isExtendableForward (const Point &lastPoint, const Vector &lastMove) |
bool | extendForward (const ConstIterator &it, ConstIterator &lastIt, const Vector &lastMove, Point &Uf, Point &Ul, Point &Lf, Point &Ll) |
bool | retractForward (ConstIterator &firstIt, ConstIterator &lastIt, ConstIterator &nextIt, Point &Uf, Point &Ul, Point &Lf, Point &Ll, const Integer &s) |
bool | hasLessThanTwoSteps (const Vector &aStep) const |
Vector | vectorFrom0ToOmega () const |
Aim: Dynamic recognition of a digital straight segment (DSS) defined as the sequence of simply connected points (x,y) such that mu <= ax - by < mu + omega.
Description of class 'ArithmeticalDSS' <p> @note I. DEBLED-RENNESSON, J.-P. REVEILLES, A linear algorithm for segmentation of digital curves, International Journal of Pattern Recognition and Artificial Intelligence, Volume 9, N. 6, December 1995. This class is a model of the concept CDynamicBidirectionalSegmentComputer. Here is a short example of how to use this class: @snippet geometry/curves/ArithmeticalDSS.cpp ArithmeticalDSS4Usage You must get: @code
[ArithmeticalDSS] Parameters (a,b,mu,omega)=(2, 5, -4, 7) Number of upper patterns: 0 Number of lower patterns: 1 First point [PointVector] {0, 0} Last point [PointVector] {6, 3} Leaning points: Uf [PointVector] {3, 2} Ul [PointVector] {3, 2} Lf [PointVector] {1, 0} Ll [PointVector] {6, 2} Steps: [PointVector] {1, 0} [PointVector] {0, 1} [End ArithmeticalDSS]
'TIterator' | type ConstIterator on 2D points, |
'TInteger' | type of scalars used for the DSS parameters (satisfying CInteger) |
'connectivity' | an integer equal to 4 for standard (4-connected) DSS or 8 for naive (8-connected) DSS. (Any other integers act as 8). |
Definition at line 116 of file ArithmeticalDSS.h.
typedef TIterator DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::ConstIterator |
Definition at line 201 of file ArithmeticalDSS.h.
typedef TInteger DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::Integer |
Definition at line 198 of file ArithmeticalDSS.h.
typedef IteratorCirculatorTraits<ConstIterator>::Value DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::Point |
Definition at line 206 of file ArithmeticalDSS.h.
typedef PointVector<2,double> DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::PointD |
Definition at line 214 of file ArithmeticalDSS.h.
typedef ArithmeticalDSS<ReverseIterator<ConstIterator>,TInteger,connectivity> DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::Reverse |
Definition at line 203 of file ArithmeticalDSS.h.
typedef ArithmeticalDSS<ConstIterator,TInteger,connectivity> DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::Self |
Definition at line 202 of file ArithmeticalDSS.h.
typedef IteratorCirculatorTraits<ConstIterator>::Value DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::Vector |
Definition at line 207 of file ArithmeticalDSS.h.
|
inline |
|
inline |
Constructor with initialisation
it | an iterator on 2D points |
Definition at line 66 of file ArithmeticalDSS.ih.
DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::ArithmeticalDSS | ( | const Self & | other | ) |
Copy constructor.
other | the object to clone. |
|
inline |
|
inline |
Definition at line 887 of file ArithmeticalDSS.ih.
DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::BOOST_CONCEPT_ASSERT | ( | (CInteger< TInteger >) | ) |
DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::BOOST_STATIC_ASSERT | ( | (Point::dimension==2) | ) |
|
inline |
Default drawing style object.
mode | the drawing mode. |
Definition at line 1002 of file ArithmeticalDSS.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Definition at line 894 of file ArithmeticalDSS.ih.
|
inline |
Tests whether the union between a point (adding to the back of the DSS with respect to the scan orientaion) and a DSS is a DSS. Computes the parameters of the new DSS with the adding point if true.
itb | an iterator on a sequence of points |
Definition at line 356 of file ArithmeticalDSS.ih.
Referenced by DGtal::FP< TIterator, TInteger, connectivity >::FP().
|
inline |
Tests whether the current DSS can be extended at the back. Computes the parameters of the extended DSS if yes.
Definition at line 380 of file ArithmeticalDSS.ih.
|
inline |
Tests whether the union between a point (adding to the front of the DSS with respect to the scan orientaion) and a DSS is a DSS. Computes the parameters of the new DSS with the adding point if true.
itf | an iterator on a sequence of points |
Definition at line 344 of file ArithmeticalDSS.ih.
Referenced by DGtal::FP< TIterator, TInteger, connectivity >::FP().
|
inline |
Tests whether the current DSS can be extended at the front. Computes the parameters of the extended DSS if yes.
Definition at line 368 of file ArithmeticalDSS.ih.
|
inlineprivate |
Tests whether the union between a point (pointing to by it) and the DSS is a DSS. Computes the parameters of the new DSS with the adding point if true.
it | an iterator on a 2D point |
lastIt | an iterator pointing to the end of the DSS |
lastMove | shift vector to the point pointed to by it |
Uf | first upper leaning point |
Ul | last upper leaning point |
Lf | first lower leaning point |
Ll | last lower leaning point |
Definition at line 186 of file ArithmeticalDSS.ih.
|
inline |
|
inline |
|
inline |
Accessor to the iterator at the back of the DSS
Definition at line 873 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 845 of file ArithmeticalDSS.ih.
|
inline |
Accessor to the first added point to the DSS
Definition at line 859 of file ArithmeticalDSS.ih.
|
inline |
Accessor to the iterator at the front of the DSS
Definition at line 880 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 852 of file ArithmeticalDSS.ih.
|
inline |
Accessor to the last added point to the DSS
Definition at line 866 of file ArithmeticalDSS.ih.
|
inline |
Accessor to the first lower leaning point
Definition at line 831 of file ArithmeticalDSS.ih.
Referenced by DGtal::Adapter4ConcavePart< ArithmeticalDSS >::firstLeaningPoint(), and DGtal::FP< TIterator, TInteger, connectivity >::FP().
|
inline |
Accessor to the last lower leaning point
Definition at line 838 of file ArithmeticalDSS.ih.
Referenced by DGtal::Adapter4ConcavePart< ArithmeticalDSS >::lastLeaningPoint().
|
inline |
Definition at line 804 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 811 of file ArithmeticalDSS.ih.
|
inline |
Computes the position of a point (that does not necessarily belong to the DSS)
it | an iterator on points |
Definition at line 739 of file ArithmeticalDSS.ih.
|
inline |
Computes the position of a point (that does not necessarily belong to the DSS)
aPoint | the point whose position is returned |
Definition at line 730 of file ArithmeticalDSS.ih.
|
inline |
Computes the remainder of a point (that does not necessarily belong to the DSS)
it | an iterator on points |
Definition at line 721 of file ArithmeticalDSS.ih.
|
inline |
Computes the remainder of a point (that does not necessarily belong to the DSS)
aPoint | the point whose remainder is returned |
Definition at line 711 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 138 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 146 of file ArithmeticalDSS.ih.
|
inline |
Accessor to the first upper leaning point
Definition at line 818 of file ArithmeticalDSS.ih.
Referenced by DGtal::Adapter4ConvexPart< ArithmeticalDSS >::firstLeaningPoint(), and DGtal::FP< TIterator, TInteger, connectivity >::FP().
|
inline |
Accessor to the last upper leaning point
Definition at line 824 of file ArithmeticalDSS.ih.
Referenced by DGtal::Adapter4ConvexPart< ArithmeticalDSS >::lastLeaningPoint().
|
inlineprivate |
Checks whether the DSS has less or more than two shift vectors (steps) between two consecutive points (must be called only in the main stage)
aStep | the last shift vector. |
Definition at line 1040 of file ArithmeticalDSS.ih.
|
inline |
|
inline |
Tests whether the current DSS can be extended at the back.
Definition at line 628 of file ArithmeticalDSS.ih.
|
inline |
Tests whether the union between a point (adding to the front of the DSS with respect to the scan orientaion) and a DSS is a DSS.
itf | an iterator on a sequence of points |
Definition at line 543 of file ArithmeticalDSS.ih.
|
inline |
Tests whether the current DSS can be extended at the front.
Definition at line 616 of file ArithmeticalDSS.ih.
|
inlineprivate |
Tests whether the union between lastPoint and the DSS is a DSS. Computes the parameters of the new DSS with the adding point if true.
lastPoint | the point to add |
lastMove | shift vector to the point to add |
Definition at line 639 of file ArithmeticalDSS.ih.
|
inline |
Checks whether a point is in the DSL of parameters ( myA, myB, myMu, myOmega )
aPoint | the point to be checked |
Definition at line 748 of file ArithmeticalDSS.ih.
|
inline |
Checks whether a point is in the DSL of parameters ( myA, myB, myMu, myOmega )
it | an iterator on the point to be checked |
Definition at line 758 of file ArithmeticalDSS.ih.
|
inline |
Checks whether a point belongs to the DSS or not
aPoint | the point to be checked |
Definition at line 767 of file ArithmeticalDSS.ih.
|
inline |
Checks whether a point belongs to the DSS or not
it | an iterator on the point to be checked |
Definition at line 779 of file ArithmeticalDSS.ih.
|
inline |
Checks the validity/consistency of the object.
Definition at line 903 of file ArithmeticalDSS.ih.
|
inline |
Difference operator.
other | the object to compare with. |
Definition at line 176 of file ArithmeticalDSS.ih.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 112 of file ArithmeticalDSS.ih.
References DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myA, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myB, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myF, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myL, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLf, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLl, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myMu, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myNbLowPat, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myNbUpPat, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myOmega, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::mySteps, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUf, and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUl.
|
inline |
Equality operator.
other | the object to compare with. |
Definition at line 155 of file ArithmeticalDSS.ih.
References DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myF, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myL, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLf, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLl, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myOmega, DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUf, and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUl.
|
inline |
Projects the point m onto the straight line of slope ( myA / myB) and intercept myMu + ( myOmega - 1 )/2 ).
m | any point (may not be part of the DSS). |
Definition at line 938 of file ArithmeticalDSS.ih.
Referenced by DGtal::Display2DFactory::drawAsBoundingBox().
|
inline |
Projects the point m onto the straight line whose points have remainder r.
m | any point (may not be part of the DSS). |
r | the remainder (may not be an integer). |
Definition at line 959 of file ArithmeticalDSS.ih.
|
inline |
Projects the point m onto the straight line going through point p.
m | any point (may not be part of the DSS). |
p | any point (may not be part of the DSS). |
Definition at line 979 of file ArithmeticalDSS.ih.
|
inline |
Definition at line 990 of file ArithmeticalDSS.ih.
References DGtal::PointVector< dim, TEuclideanRing >::norm().
|
inline |
Removes the last point of the DSS (at front) if it has more than two points
Definition at line 526 of file ArithmeticalDSS.ih.
|
inline |
Removes the first point of the DSS (at back) if it has more than two points
Definition at line 509 of file ArithmeticalDSS.ih.
|
inlineprivate |
Removes the end point of a DSS (pointing to by firstIt)
firstIt | an iterator pointing to the end of the DSS |
lastIt | an iterator pointing to the other end of the DSS |
nextIt | an iterator pointing to the point of the DSS close to the one pointing to by firstIt |
Uf | first upper leaning point |
Ul | last upper leaning point |
Lf | first lower leaning point |
Ll | last lower leaning point |
s | a signed integer equal to 1 or -1 |
Definition at line 394 of file ArithmeticalDSS.ih.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 1015 of file ArithmeticalDSS.ih.
|
inlineprivate |
Returns the 2D vector starting at a point of remainder 0 and pointing to the closer point of remainder omega
Definition at line 1055 of file ArithmeticalDSS.ih.
|
protected |
y-component of the direction vector
Definition at line 630 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
|
protected |
x-component of the direction vector
Definition at line 634 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
ConstIterator DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myF |
ConstIterator pointing to the back of the DSS
Definition at line 691 of file ArithmeticalDSS.h.
Referenced by DGtal::Display2DFactory::drawAsBoundingBox(), DGtal::Display2DFactory::drawAsDigitalPoints(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
ConstIterator DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myL |
ConstIterator pointing to the front of the DSS
Definition at line 695 of file ArithmeticalDSS.h.
Referenced by DGtal::Display2DFactory::drawAsBoundingBox(), DGtal::Display2DFactory::drawAsDigitalPoints(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
Point DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLf |
First lower leaning point ( of remainder myMu + myOmega - 1 )
Definition at line 680 of file ArithmeticalDSS.h.
Referenced by DGtal::Display2DFactory::drawAsBoundingBox(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
Point DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myLl |
Last lower leaning point ( of remainder myMu + myOmega - 1 )
Definition at line 684 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
|
protected |
Intercept
Definition at line 638 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
|
protected |
Number of lower patterns ( myLf = myNbLowPat . ( myB , myA ) + myLl )
Definition at line 652 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
|
protected |
Number of upper patterns ( myUf = myNbUpPat . ( myB , myA ) + myUl )
Definition at line 648 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
|
protected |
Thickness
Definition at line 642 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
|
protected |
Steps of the DSS (eg. right and up in the first octant)
Definition at line 658 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=().
Point DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUf |
First upper leaning point ( of remainder myMu )
Definition at line 672 of file ArithmeticalDSS.h.
Referenced by DGtal::Display2DFactory::drawAsBoundingBox(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().
Point DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::myUl |
Last upper leaning point ( of remainder myMu )
Definition at line 676 of file ArithmeticalDSS.h.
Referenced by DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator=(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::operator==().