a class for calculating the contour of a segmented region
More...
#include <FeatureDetector/ContourDetectorSimple.hh>
|
bool | CreateContourBase_ (BIAS::BIASContour &contour, BIAS::Image< StorageType > &img) |
| creates the contour of the first blob found in the image; a pixel is assumed as foreground pixel, if the pixel value is != 0; this function works even if the blob is located at the image frame More...
|
|
bool | FindFirst_ (int &pos_x, int &pos_y) |
| Finds first foreground pixel. More...
|
|
void | Init_ (BIAS::Image< StorageType > &img) |
|
void | InitDistanceImage_ (BIAS::Image< StorageType > &img, const BIASContour &contour) |
| Initializes the distance image. More...
|
|
bool | IsFg_ (int x, int y) |
| determines of a pixel is foreground or not More...
|
|
bool | IsFg_ (int x, int y, int direction) |
| returns IsFg_ of the next pixel in the direction of param direction More...
|
|
void | MakeDistanceImage_ (BIAS::Image< StorageType > &img) |
| converts the given image to an distance transformed image (the Borgefor distance is used, that means one step in diagonal direction has a distance of 4 other steps have distances of 3); the underlying pixel set has to be marked as zero valued pixels – all other pixels have to be set to a high value (MAX_USHORT) More...
|
|
template<class StorageType>
class BIAS::ContourDetectorSimple< StorageType >
a class for calculating the contour of a segmented region
- Author
- Dennis Herzog, Jan. 2005 ischiller 08/08
- Examples:
- ExampleContourDetectorSimple.cpp, and ExampleRefineContour.cpp.
Definition at line 45 of file ContourDetectorSimple.hh.
template<class StorageType >
ContourDetectorSimple::ContourDetectorSimple |
( |
| ) |
|
template<class StorageType >
ContourDetectorSimple::~ContourDetectorSimple |
( |
| ) |
|
template<class StorageType >
template<class StorageType >
void ContourDetectorSimple::CreateDistanceImage |
( |
BIAS::Image< StorageType > & |
dist_img, |
|
|
const BIASContour & |
contour |
|
) |
| |
returns a Borgefor distance transformed image (returned in 'dist_img') of the pixel set given by the contour pixels in 'contour'
- Author
- herzog
- Parameters
-
dist_im | (output) the Borgefor distance image |
contour | (input) the already detected contour by a call to Detect(...) |
Definition at line 176 of file ContourDetectorSimple.cpp.
template<class StorageType >
int ContourDetectorSimple::CreateDistanceImageByContour |
( |
BIAS::Image< StorageType > & |
dist_img, |
|
|
BIAS::Image< StorageType > & |
img |
|
) |
| |
returns a Borgefor distance transformed image of the contour pixel set of the first blob found in the image 'img'.
- Author
- herzog
- Parameters
-
img | (input) source image, from which the contour comes |
dist_img | (output) returns the distance transformed image of the contour |
- Returns
- <0=error, > 0 length of contour in pixel
Definition at line 185 of file ContourDetectorSimple.cpp.
References BIAS::BIASContour::length.
template<class StorageType >
int ContourDetectorSimple::Detect |
( |
Image< StorageType > & |
image, |
|
|
std::vector< BIAS::BIASContour > & |
contour |
|
) |
| |
|
virtual |
template<class StorageType >
bool ContourDetectorSimple::FindFirst_ |
( |
int & |
pos_x, |
|
|
int & |
pos_y |
|
) |
| |
|
protected |
Finds first foreground pixel.
- Parameters
-
pos_x | (output) x position of pixel |
pos_y | (output) y position of pixel |
- Returns
- true=found, false=not found
Definition at line 118 of file ContourDetectorSimple.cpp.
template<class StorageType >
bool ContourDetectorSimple::GetContourImage |
( |
BIAS::Image< unsigned char > & |
image, |
|
|
const std::vector< BIASContour > & |
contour |
|
) |
| |
template<class StorageType>
instead of contour pixels a start point and a list of difference vector (created during surrounding the blob clock wise) is given
- Author
- herzog
- Returns
- directionList difference vectors coded in FreeManCode (that means: ( 0 = step right – 1 = step right & step down – 2 = step down – 3 = step left & step down – 4 = step left – 5 = step left & up 6 = step up – 7 = step right & step up))
Definition at line 107 of file ContourDetectorSimple.hh.
template<class StorageType >
void ContourDetectorSimple::Init_ |
( |
BIAS::Image< StorageType > & |
img | ) |
|
|
protected |
template<class StorageType >
void ContourDetectorSimple::InitDistanceImage_ |
( |
BIAS::Image< StorageType > & |
img, |
|
|
const BIASContour & |
contour |
|
) |
| |
|
protected |
template<class StorageType>
determines of a pixel is foreground or not
- Parameters
-
x | (input) x position of pixel |
y | (input) y position of pixel |
- Returns
- true=is foreground, false=not foreground
Definition at line 156 of file ContourDetectorSimple.hh.
template<class StorageType>
returns IsFg_ of the next pixel in the direction of param direction
- Parameters
-
x | (input) x position of pixel |
y | (input) y position of pixel |
direction | (input) direction of next pixel (freeman code) |
- Returns
- true=is foreground, false=not foreground
Definition at line 168 of file ContourDetectorSimple.hh.
template<class StorageType >
void ContourDetectorSimple::MakeDistanceImage_ |
( |
BIAS::Image< StorageType > & |
img | ) |
|
|
protected |
template<class StorageType>
Set the background color if it is different from 0.
- Parameters
-
backgroundColor | (input) the new background color |
Definition at line 113 of file ContourDetectorSimple.hh.
template<class StorageType>
Set the maximum gap which is bridged in search for contour.
- Parameters
-
gap | (input) the new max gap (default 5) |
Definition at line 120 of file ContourDetectorSimple.hh.
template<class StorageType>
template<class StorageType>
template<class StorageType>
template<class StorageType>
template<class StorageType>
template<class StorageType>
The documentation for this class was generated from the following files: