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

lti::geometricFeaturesFromMask Class Reference

This functor takes a mask (labeled or not), where it is assumed that a region must be connected or not and reassigned labels to them in a way that each connected region gets its own label. More...

#include <ltiGeometricFeaturesFromMask.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class geometricFeaturesFromMask More...

Public Member Functions

 geometricFeaturesFromMask ()
 geometricFeaturesFromMask (const parameters &par)
 geometricFeaturesFromMask (const geometricFeaturesFromMask &other)
virtual ~geometricFeaturesFromMask ()
virtual const char * getTypeName () const
geometricFeaturesFromMaskcopy (const geometricFeaturesFromMask &other)
geometricFeaturesFromMaskoperator= (const geometricFeaturesFromMask &other)
virtual functorclone () const
const parametersgetParameters () const
bool apply (const channel8 &src, std::vector< rectangle > &objects) const
bool apply (const channel8 &src, imatrix &dest, std::vector< rectangle > &objects) const
bool apply (const channel8 &src, std::vector< geometricFeatureGroup0 > &objects) const
bool apply (const channel8 &src, imatrix &dest, std::vector< geometricFeatureGroup0 > &objects) const

Protected Member Functions

bool computeEquivLabels (const channel8 &src, imatrix &dest, ivector &objSize, ivector &equivLabels, int &numObjects) const
virtual bool initRectangleVector (const int numLab, const point &size, std::vector< rectangle > &objects) const
virtual bool initGeomFeature0Vector (const int numLab, const point &size, std::vector< geometricFeatureGroup0 > &objects) const
bool merge (std::vector< rectangle > &src) const
bool merge (std::vector< geometricFeatureGroup0 > &src) const
bool sortMerged (std::vector< geometricFeatureGroup0 > &objects) const

Detailed Description

This functor takes a mask (labeled or not), where it is assumed that a region must be connected or not and reassigned labels to them in a way that each connected region gets its own label.

Additionally the minimum bounding rectangle or geometric features of the labeled objects are computed. Close objects are merged if requested. To ensure fast merging two objects are close if their surrounding rectangles are close. CAVEAT: 1) Sorting of the merged objects by their size does not work if the circumscribing rectangles are returned only.


Constructor & Destructor Documentation

lti::geometricFeaturesFromMask::geometricFeaturesFromMask (  ) 

default constructor

lti::geometricFeaturesFromMask::geometricFeaturesFromMask ( const parameters par  ) 

Construct a functor using the given parameters.

lti::geometricFeaturesFromMask::geometricFeaturesFromMask ( const geometricFeaturesFromMask other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::geometricFeaturesFromMask::apply ( const channel8 src,
imatrix dest,
std::vector< geometricFeatureGroup0 > &  objects 
) const

apply-method to get simple geometric features (bounding box, area, center of gravity) of the objects inside the image.

Additionally to the bounding boxes a matrix with all the labels is returned, where the label subtracted by one corresponds to the index of vector with the geometric features.

Parameters:
src channel8 with the source data.
dest imatrix with the labeled objects.
objects a vector with the geometric features of each labeled object
Returns:
true if apply successful or false otherwise.
bool lti::geometricFeaturesFromMask::apply ( const channel8 src,
std::vector< geometricFeatureGroup0 > &  objects 
) const

apply-method to get simple geometric features (bounding box, area, center of gravity) of the objects inside the image.

operates on the given parameter.

Parameters:
src channel8 with the source data.
objects a vector with the geometric features of each labeled object
Returns:
true if apply successful or false otherwise.
bool lti::geometricFeaturesFromMask::apply ( const channel8 src,
imatrix dest,
std::vector< rectangle > &  objects 
) const

apply-method to get the bounding boxes of the objects inside the image.

Additionally to the bounding boxes a matrix with all the labels is returned, where the label subtracted by one corresponds to the index into the vector with the bounding boxes.

operates on the given parameter.

Parameters:
src channel8 with the source data.
dest imatrix with the labeled objects.
objects a vector with the smallest rectangles containing each labeled object
Returns:
true if apply successful or false otherwise.
bool lti::geometricFeaturesFromMask::apply ( const channel8 src,
std::vector< rectangle > &  objects 
) const

apply-method to get the bounding boxes of the objects inside the image.

operates on the given parameter.

Parameters:
src channel8 with the source data.
objects a vector with the smallest rectangles containing each labeled object
Returns:
true if apply successful or false otherwise.
virtual functor* lti::geometricFeaturesFromMask::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::fastRelabeling.

Reimplemented in lti::multiGeometricFeaturesFromMask.

bool lti::geometricFeaturesFromMask::computeEquivLabels ( const channel8 src,
imatrix dest,
ivector objSize,
ivector equivLabels,
int &  numObjects 
) const [protected]

computes the vector of equivalent labels, i.e.

suppresses objects smaller than the minimum size and those which are not among the n-best. Furthermore this suppression is more efficient than using the parent class' methods because the labeled mask is not updated yet.

Parameters:
src channel8 with the source data
dest matrix with the labels
objSize vector with the object sizes
equivLabels vector with equivalent labels
numObjects contains the number of detected objects
Returns:
true on success or false otherwise.
geometricFeaturesFromMask& lti::geometricFeaturesFromMask::copy ( const geometricFeaturesFromMask other  ) 

copy data of "other" functor.

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

Reimplemented from lti::fastRelabeling.

Reimplemented in lti::multiGeometricFeaturesFromMask.

const parameters& lti::geometricFeaturesFromMask::getParameters (  )  const

returns used parameters

Reimplemented from lti::fastRelabeling.

Reimplemented in lti::multiGeometricFeaturesFromMask.

virtual const char* lti::geometricFeaturesFromMask::getTypeName (  )  const [virtual]

returns the name of this type ("geometricFeaturesFromMask")

Reimplemented from lti::fastRelabeling.

Reimplemented in lti::multiGeometricFeaturesFromMask.

virtual bool lti::geometricFeaturesFromMask::initGeomFeature0Vector ( const int  numLab,
const point size,
std::vector< geometricFeatureGroup0 > &  objects 
) const [protected, virtual]

initializes the vector of geometric features from group 0

Parameters:
numLab the number of labels
size the size of the input channel
objects the vector to be initializes
Returns:
true on success or false otherwise.
virtual bool lti::geometricFeaturesFromMask::initRectangleVector ( const int  numLab,
const point size,
std::vector< rectangle > &  objects 
) const [protected, virtual]

initializes the vector of bounding rectangles with the rectangle containing the entire image.

Parameters:
numLab the number of labels
size the size of the input channel
objects the vector to be initializes
Returns:
true on success or false otherwise.
bool lti::geometricFeaturesFromMask::merge ( std::vector< geometricFeatureGroup0 > &  src  )  const [protected]

merge neighboring objects

Parameters:
src the vector with the geometric features to be merged
Returns:
true on success or false otherwise.
bool lti::geometricFeaturesFromMask::merge ( std::vector< rectangle > &  src  )  const [protected]

merge neighboring objects

Parameters:
src the vector with the rectangles to be merged
Returns:
true on success or false otherwise.
geometricFeaturesFromMask& lti::geometricFeaturesFromMask::operator= ( const geometricFeaturesFromMask other  ) 

alias for copy member

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

Reimplemented from lti::fastRelabeling.

Reimplemented in lti::multiGeometricFeaturesFromMask.

bool lti::geometricFeaturesFromMask::sortMerged ( std::vector< geometricFeatureGroup0 > &  objects  )  const [protected]

sort the merged objects

Parameters:
objects the vector with the geometric features to be sorted
Returns:
true on success or false otherwise.

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

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