DGtal
1.5.beta
|
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edges such that there is at least one (Euclidean) circle that separates the centers of the two incident pixels of each grid edge. More...
#include <DGtal/geometry/curves/StabbingCircleComputer.h>
Public Types | |
typedef TConstIterator | ConstIterator |
typedef StabbingCircleComputer< ConstIterator > | Self |
typedef StabbingCircleComputer< ReverseIterator< ConstIterator > > | Reverse |
typedef IteratorCirculatorTraits< ConstIterator >::Value | Pair |
typedef Pair::first_type | Point |
Public Member Functions | |
BOOST_STATIC_ASSERT ((concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value)) | |
BOOST_STATIC_ASSERT ((Point::dimension==2)) | |
StabbingCircleComputer () | |
StabbingCircleComputer (const Self &other) | |
Self & | operator= (const Self &other) |
~StabbingCircleComputer () | |
bool | operator== (const Self &other) const |
bool | operator!= (const Self &other) const |
Self | getSelf () const |
Reverse | getReverse () const |
bool | isValid () const |
ConstIterator | begin () const |
ConstIterator | end () const |
bool | isStraight () const |
StabbingLineComputerPtr | getStabbingLineComputerPtr () const |
Circle | getSeparatingCircle () const |
void | init (const ConstIterator &anIt) |
bool | extendFront () |
bool | isExtendableFront () |
bool | extendBack () |
bool | isExtendableBack () |
void | selfDisplay (std::ostream &out) const |
std::string | className () const |
Private Types | |
typedef CowPtr< StabbingLineComputer< ConstIterator > > | StabbingLineComputerPtr |
typedef CircleFrom3Points< Point > | Circle |
typedef functors::Point2ShapePredicate< Circle, false, true > | PInCirclePred |
typedef functors::Point2ShapePredicate< Circle, true, true > | QInCirclePred |
Private Member Functions | |
template<typename TIterator > | |
bool | isCircularlySeparable (const TIterator &itb, const TIterator &ite, const Point &aPole, Point &Pf, Point &Pl, Point &Qf, Point &Ql) |
Private Attributes | |
ConstIterator | myBegin |
ConstIterator | myEnd |
StabbingLineComputerPtr | mySegPtr |
Circle | myCircle |
bool | myFlagIsInit |
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edges such that there is at least one (Euclidean) circle that separates the centers of the two incident pixels of each grid edge.
The algorithm iteratively calls a routine (isCircularlySeparable) that uses Preimage2D in order to compute the whole set of separating (Euclidean) circles passing through a given point. It returns 'false' if the set is empty and 'true' otherwise.
The algorithm may be divided into two steps:
For a DCA of \( n \) grid edges, a trivial upper bound of this algorithm is \( O(n^2) \) because the linear-time routine may be possibly called \( n \) times. But we observed in practice that the routine is called only a few times and that the algorithm is fast.
This class is a model of the concept CBidirectionalSegmentComputer.
It should be used with the Curve object (defined in StdDefs.h) and its IncidentPointsRange as follows:
TConstIterator | ConstIterator type on STL pairs of 2D points |
Definition at line 112 of file StabbingCircleComputer.h.
|
private |
Definition at line 133 of file StabbingCircleComputer.h.
typedef TConstIterator DGtal::StabbingCircleComputer< TConstIterator >::ConstIterator |
Definition at line 118 of file StabbingCircleComputer.h.
typedef IteratorCirculatorTraits<ConstIterator>::Value DGtal::StabbingCircleComputer< TConstIterator >::Pair |
Definition at line 123 of file StabbingCircleComputer.h.
|
private |
Definition at line 137 of file StabbingCircleComputer.h.
typedef Pair::first_type DGtal::StabbingCircleComputer< TConstIterator >::Point |
Definition at line 126 of file StabbingCircleComputer.h.
|
private |
Definition at line 139 of file StabbingCircleComputer.h.
typedef StabbingCircleComputer<ReverseIterator<ConstIterator> > DGtal::StabbingCircleComputer< TConstIterator >::Reverse |
Definition at line 120 of file StabbingCircleComputer.h.
typedef StabbingCircleComputer<ConstIterator> DGtal::StabbingCircleComputer< TConstIterator >::Self |
Definition at line 119 of file StabbingCircleComputer.h.
|
private |
Definition at line 132 of file StabbingCircleComputer.h.
DGtal::StabbingCircleComputer< TConstIterator >::StabbingCircleComputer | ( | ) |
Constructor.
DGtal::StabbingCircleComputer< TConstIterator >::StabbingCircleComputer | ( | const Self & | other | ) |
Copy constructor.
other | the object to clone. |
DGtal::StabbingCircleComputer< TConstIterator >::~StabbingCircleComputer | ( | ) |
Destructor.
ConstIterator DGtal::StabbingCircleComputer< TConstIterator >::begin | ( | ) | const |
Referenced by testStabbingCircleComputer().
DGtal::StabbingCircleComputer< TConstIterator >::BOOST_STATIC_ASSERT | ( | (concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value) | ) |
DGtal::StabbingCircleComputer< TConstIterator >::BOOST_STATIC_ASSERT | ( | (Point::dimension==2) | ) |
std::string DGtal::StabbingCircleComputer< TConstIterator >::className | ( | ) | const |
ConstIterator DGtal::StabbingCircleComputer< TConstIterator >::end | ( | ) | const |
Referenced by testStabbingCircleComputer().
bool DGtal::StabbingCircleComputer< TConstIterator >::extendBack | ( | ) |
Backward extension of the segment.
NB: linear in the size of the segment is the worst case
Referenced by testStabbingCircleComputer().
bool DGtal::StabbingCircleComputer< TConstIterator >::extendFront | ( | ) |
Forward extension of the segment.
NB: linear in the size of the segment is the worst case
Referenced by testStabbingCircleComputer().
Reverse DGtal::StabbingCircleComputer< TConstIterator >::getReverse | ( | ) | const |
Referenced by testStabbingCircleComputer().
Self DGtal::StabbingCircleComputer< TConstIterator >::getSelf | ( | ) | const |
Circle DGtal::StabbingCircleComputer< TConstIterator >::getSeparatingCircle | ( | ) | const |
StabbingLineComputerPtr DGtal::StabbingCircleComputer< TConstIterator >::getStabbingLineComputerPtr | ( | ) | const |
void DGtal::StabbingCircleComputer< TConstIterator >::init | ( | const ConstIterator & | anIt | ) |
Segment initialization
anIt | any iterator |
Referenced by main(), and testStabbingCircleComputer().
|
private |
Check if the two sets of points can be separated by circles passing through the given point aPole. If yes, return the four points of support of the partial preimage. The pole and either Pf and Ql or Qf and Pl implicitely describe a separating circle.
itb | begin iterator on STL pairs of 2D points. |
ite | end iterator on STL pairs of 2D points. |
aPole | the point the circles pass through. |
Pf | (returned) first inner point of support. |
Pl | (returned) last inner point of support. |
Qf | (returned) first outer point of support. |
Ql | (returned) last outer point of support. |
TIterator | type of iterator (normal or reverse type) |
bool DGtal::StabbingCircleComputer< TConstIterator >::isExtendableBack | ( | ) |
Backward extension test.
NB: linear in the size of the segment is the worst case
bool DGtal::StabbingCircleComputer< TConstIterator >::isExtendableFront | ( | ) |
Forward extension test.
NB: linear in the size of the segment is the worst case
Referenced by testStabbingCircleComputer().
bool DGtal::StabbingCircleComputer< TConstIterator >::isStraight | ( | ) | const |
bool DGtal::StabbingCircleComputer< TConstIterator >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Referenced by testStabbingCircleComputer().
bool DGtal::StabbingCircleComputer< TConstIterator >::operator!= | ( | const Self & | other | ) | const |
Difference operator
other | the object to compare with. |
NB: linear in the size of the segment
Self& DGtal::StabbingCircleComputer< TConstIterator >::operator= | ( | const Self & | other | ) |
Assignment.
other | the object to copy. |
bool DGtal::StabbingCircleComputer< TConstIterator >::operator== | ( | const Self & | other | ) | const |
Equality operator
other | the object to compare with. |
NB: linear in the size of the segment
void DGtal::StabbingCircleComputer< TConstIterator >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
private |
segment begin iterator.
Definition at line 292 of file StabbingCircleComputer.h.
|
private |
Separating circle.
Definition at line 304 of file StabbingCircleComputer.h.
|
private |
segment end iterator.
Definition at line 296 of file StabbingCircleComputer.h.
|
private |
Flag equal to 'true' if mySegPtr has finished its extension 'false' otherwise.
Definition at line 309 of file StabbingCircleComputer.h.
|
private |
Pointer to the geometrical DSS.
Definition at line 300 of file StabbingCircleComputer.h.