[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
CrackContourCirculator< IMAGEITERATOR > Class Template Reference |
Circulator that walks around a given region. More...
#include <vigra/contourcirculator.hxx>
Public Types | |
typedef forward_circulator_tag | iterator_category |
typedef Point2D const * | pointer |
typedef Point2D const & | reference |
typedef Point2D | value_type |
Public Member Functions | |
CrackContourCirculator (IMAGEITERATOR const &in_the_region, vigra::FourNeighborCode::Direction dir=vigra::FourNeighborCode::West) | |
Diff2D const & | diff () const |
bool | operator!= (CrackContourCirculator const &o) const |
reference | operator* () const |
CrackContourCirculator & | operator++ () |
CrackContourCirculator | operator++ (int) |
pointer | operator-> () const |
bool | operator== (CrackContourCirculator const &o) const |
IMAGEITERATOR | outerPixel () const |
reference | pos () const |
Circulator that walks around a given region.
The circulator follows the crack contour of a given region. Here, a region is an 8-connected component of pixels with the same value, such as the regions in a label image. The crack contour is located between the inside and outside pixels, that is "on the crack" between the region and the background. Thus, the circulator moves from pixel corner to pixel corner. By definition, the first corner (where the circulator was initialized) gets the coordinate (0,0), and calls to *circulator
return the distance of the current corner to the initial one.
The circulator can be used to calculate the area of a region (in pixels):
#include <vigra/contourcirculator.hxx>
Namespace: vigra
typedef Point2D value_type |
the circulator's value type
typedef forward_circulator_tag iterator_category |
the circulator tag
CrackContourCirculator | ( | IMAGEITERATOR const & | in_the_region, |
vigra::FourNeighborCode::Direction | dir = vigra::FourNeighborCode::West |
||
) |
Initialize the circulator for a given region.
The image iterator in_the_region
must refer to a boundary pixel of the region to be analysed. The direction code dir
must point to a pixel outside the region (the default assumes that the pixel left of the given region pixel belongs to the background). The first corner of the crack contour is the corner to the right of this direction (i.e. the north west corner of the region pixel, if the direction was West).
CrackContourCirculator& operator++ | ( | ) |
Move to the next crack corner of the contour (pre-increment).
CrackContourCirculator operator++ | ( | int | ) |
Move to the next crack corner of the contour (post-increment).
bool operator== | ( | CrackContourCirculator< IMAGEITERATOR > const & | o | ) | const |
equality
bool operator!= | ( | CrackContourCirculator< IMAGEITERATOR > const & | o | ) | const |
inequality
reference pos | ( | ) | const |
Get the coordinate of the current corner (relative to the first corner).
pointer operator-> | ( | ) | const |
Access member of the current coordinate.
IMAGEITERATOR outerPixel | ( | ) | const |
Access pixel to the right of the crack edge (outside of the region bounded by the crack contour we walk on). Note that after operator++, the iterator can still point to the same pixel (looking from another direction now).
Diff2D const& diff | ( | ) | const |
Get the offset from the current corner of the contour to the next one.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|