latest version v1.9 - last update 10 Apr 2010 |
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>
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 |
geometricFeaturesFromMask & | copy (const geometricFeaturesFromMask &other) |
geometricFeaturesFromMask & | operator= (const geometricFeaturesFromMask &other) |
virtual functor * | clone () const |
const parameters & | getParameters () 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 |
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.
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
other | the object to be copied |
virtual lti::geometricFeaturesFromMask::~geometricFeaturesFromMask | ( | ) | [virtual] |
destructor
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.
src | channel8 with the source data. | |
dest | imatrix with the labeled objects. | |
objects | a vector with the geometric features of each labeled object |
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.
src | channel8 with the source data. | |
objects | a vector with the geometric features of each labeled object |
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.
src | channel8 with the source data. | |
dest | imatrix with the labeled objects. | |
objects | a vector with the smallest rectangles containing each labeled object |
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.
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 |
geometricFeaturesFromMask& lti::geometricFeaturesFromMask::copy | ( | const geometricFeaturesFromMask & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
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] |
bool lti::geometricFeaturesFromMask::merge | ( | std::vector< geometricFeatureGroup0 > & | src | ) | const [protected] |
merge neighboring objects
src | the vector with the geometric features to be merged |
bool lti::geometricFeaturesFromMask::merge | ( | std::vector< rectangle > & | src | ) | const [protected] |
merge neighboring objects
src | the vector with the rectangles to be merged |
geometricFeaturesFromMask& lti::geometricFeaturesFromMask::operator= | ( | const geometricFeaturesFromMask & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::fastRelabeling.
Reimplemented in lti::multiGeometricFeaturesFromMask.
bool lti::geometricFeaturesFromMask::sortMerged | ( | std::vector< geometricFeatureGroup0 > & | objects | ) | const [protected] |