LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::regionsPolygonizer Class Reference

This functor takes a labeled mask and for each region therein it computes a polygon approximation of its contour. More...

#include <ltiRegionsPolygonizer.h>

Inheritance diagram for lti::regionsPolygonizer:
Inheritance graph
[legend]
Collaboration diagram for lti::regionsPolygonizer:
Collaboration graph
[legend]

List of all members.

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
regionsPolygonizercopy (const regionsPolygonizer &other)
regionsPolygonizeroperator= (const regionsPolygonizer &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

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.


Constructor & Destructor Documentation

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

Parameters:
other the object to be copied
virtual lti::regionsPolygonizer::~regionsPolygonizer (  )  [virtual]

destructor


Member Function Documentation

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:

  • approximating polygon
  • border
  • at the border points the label of the neighbor region.

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.

Parameters:
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.
Returns:
true if apply successful or false otherwise.
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.

Parameters:
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.
Returns:
true if apply successful or false otherwise.
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.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

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  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:47 2010 for LTI-Lib by Doxygen 1.6.1