latest version v1.9 - last update 10 Apr 2010 |
This functor takes a labeled mask and for each region therein it computes a polygon approximation of its contour. More...
#include <ltiRegionsPolygonizer.h>
Classes | |
class | parameters |
the parameters for the class regionsPolygonizer More... | |
Public Member Functions | |
regionsPolygonizer () | |
regionsPolygonizer (const parameters &par) | |
regionsPolygonizer (const regionsPolygonizer &other) | |
virtual | ~regionsPolygonizer () |
virtual const char * | getTypeName () const |
bool | apply (const matrix< int > &src, const int maxLabel, std::vector< polygonPoints > &polygons) const |
bool | apply (const matrix< int > &src, const int maxLabel, std::vector< polygonPoints > &polygons, std::vector< borderPoints > &borders, matrix< int > &neighbors) const |
regionsPolygonizer & | copy (const regionsPolygonizer &other) |
regionsPolygonizer & | operator= (const regionsPolygonizer &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This functor takes a labeled mask and for each region therein it computes a polygon approximation of its contour.
Additionally, it ensures that those pixels in the contour with at least two neighbors of different classes will be taken as polygon vertices.
lti::regionsPolygonizer::regionsPolygonizer | ( | ) |
default constructor
lti::regionsPolygonizer::regionsPolygonizer | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::regionsPolygonizer::regionsPolygonizer | ( | const regionsPolygonizer & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::regionsPolygonizer::~regionsPolygonizer | ( | ) | [virtual] |
destructor
bool lti::regionsPolygonizer::apply | ( | const matrix< int > & | src, | |
const int | maxLabel, | |||
std::vector< polygonPoints > & | polygons, | |||
std::vector< borderPoints > & | borders, | |||
matrix< int > & | neighbors | |||
) | const |
Computes for each region in src:
The labeled mask given in src must contain only connected regions, identified by an unique integer id, as given by functors like lti::fastRelabeling.
The maximum labeld in src must be given to save some time if possible.
src | input labeled mask | |
maxLabel | maximum label in the input mask, (if you don't know it, give for example src.maximum()) | |
polygons | polygon representation of each region indexed by their id. | |
borders | border points for each region. | |
neighbors | matrix containing for each border pixel the id of a neighbor region and for all other pixels the own region id. |
bool lti::regionsPolygonizer::apply | ( | const matrix< int > & | src, | |
const int | maxLabel, | |||
std::vector< polygonPoints > & | polygons | |||
) | const |
This apply method computes for each region in src a polygon representation of its border.
src | input labeled mask | |
maxLabel | maximum label in the input mask, (if you don't know it, give for example src.maximum()) | |
polygons | polygon representation of each region indexed by their id. |
virtual functor* lti::regionsPolygonizer::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
regionsPolygonizer& lti::regionsPolygonizer::copy | ( | const regionsPolygonizer & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const parameters& lti::regionsPolygonizer::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::regionsPolygonizer::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("regionsPolygonizer")
Reimplemented from lti::functor.
regionsPolygonizer& lti::regionsPolygonizer::operator= | ( | const regionsPolygonizer & | other | ) |