37#ifndef VIGRA_CONTOURCIRCULATOR_HXX
38#define VIGRA_CONTOURCIRCULATOR_HXX
40#include "pixelneighborhood.hxx"
92template <
class IMAGEITERATOR>
93class CrackContourCirculator
96 NEIGHBORHOODCIRCULATOR;
97 typedef typename IMAGEITERATOR::value_type label_type;
100 NEIGHBORHOODCIRCULATOR neighborCirc_;
104 CrackContourCirculator(NEIGHBORHOODCIRCULATOR
const & circ)
105 : neighborCirc_(circ),
141 label_(*in_the_region),
144 neighborCirc_.turnLeft();
151 pos_ += neighborCirc_.
diff();
155 if(*neighborCirc_ == label_)
157 neighborCirc_.moveCenterToNeighbor();
162 neighborCirc_.moveCenterToNeighbor();
164 if(*neighborCirc_ == label_)
166 neighborCirc_.moveCenterToNeighbor();
167 neighborCirc_.turnRight();
171 neighborCirc_.moveCenterToNeighbor();
172 neighborCirc_.turnLeft();
173 neighborCirc_.moveCenterToNeighbor();
174 neighborCirc_.turnRight();
185 CrackContourCirculator ret(*
this);
194 return neighborCirc_ == o.neighborCirc_;
201 return neighborCirc_ != o.neighborCirc_;
226 {
return NEIGHBORHOODCIRCULATOR(neighborCirc_).turnRight().base(); }
232 {
return neighborCirc_.diff(); }
IMAGEITERATOR outerPixel() const
Definition contourcirculator.hxx:225
bool operator==(CrackContourCirculator const &o) const
Definition contourcirculator.hxx:192
Point2D const * pointer
Definition contourcirculator.hxx:121
bool operator!=(CrackContourCirculator const &o) const
Definition contourcirculator.hxx:199
CrackContourCirculator & operator++()
Definition contourcirculator.hxx:149
Point2D const & reference
Definition contourcirculator.hxx:117
Diff2D const & diff() const
Definition contourcirculator.hxx:231
reference operator*() const
Definition contourcirculator.hxx:212
forward_circulator_tag iterator_category
Definition contourcirculator.hxx:125
CrackContourCirculator(IMAGEITERATOR const &in_the_region, vigra::FourNeighborCode::Direction dir=vigra::FourNeighborCode::West)
Definition contourcirculator.hxx:138
reference pos() const
Definition contourcirculator.hxx:207
CrackContourCirculator operator++(int)
Definition contourcirculator.hxx:183
pointer operator->() const
Definition contourcirculator.hxx:217
Point2D value_type
Definition contourcirculator.hxx:113
Two dimensional difference vector.
Definition diff2d.hxx:186
Direction
Definition pixelneighborhood.hxx:179
@ West
 
Definition pixelneighborhood.hxx:183
Circulator that walks around a given location in a given image.
Definition pixelneighborhood.hxx:1038
base_type center() const
Definition pixelneighborhood.hxx:1263
Two dimensional point or position.
Definition diff2d.hxx:586
EightNeighborhood::NeighborCode EightNeighborCode
Definition pixelneighborhood.hxx:687