A utility class to extract the boundaries of a binary image. More...
#include <BoundariesExtractor.hpp>
Public Types | |
typedef std::pair< size_t, size_t > | Coordinates |
The coordinates type of each pixel of the contour. More... | |
typedef std::vector< Coordinates > | Curve |
The type of a contour. More... | |
typedef png::image < png::gray_pixel > | Image |
The type of images to work with. More... | |
Public Member Functions | |
BoundariesExtractor (const Image *image=0) | |
void | setImage (const Image *image) |
std::vector< Curve > | extractBoundaries () |
std::vector< Curve > | extractBoundaries (const Image &image) |
A utility class to extract the boundaries of a binary image.
The BoundariesExtractor class expects a binary image with a black background (i.e. with a pixel value of 0) and a non-black foreground (i.e. pixels value that are different from 0 are considered as foreground). The boundaries of each 4-connected component of the image are extracted and returned as a set of Curve which are an ordered set of coordinates.
typedef std::pair<size_t, size_t> Utils::BoundariesExtractor::Coordinates |
The coordinates type of each pixel of the contour.
typedef std::vector<Coordinates> Utils::BoundariesExtractor::Curve |
The type of a contour.
typedef png::image<png::gray_pixel> Utils::BoundariesExtractor::Image |
The type of images to work with.
|
inline |
Create a new BoundariesExtractor to extract the contour of each 4-connected component of the image.
std::vector< BoundariesExtractor::Curve > Utils::BoundariesExtractor::extractBoundaries | ( | ) |
Extract the boundaries of the image associated to this instance of BoundariesExctractor.
Extract the boundaries of the image.
|
inline |
Associate the image to this BoundariesExtractor instance.