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 reassigns labels to them in a way that each connected region gets its own label. More...
#include <ltiMultiGeometricFeaturesFromMask.h>
Classes | |
class | parameters |
the parameters for the class multiGeometricFeaturesFromMask More... | |
Public Member Functions | |
multiGeometricFeaturesFromMask () | |
multiGeometricFeaturesFromMask (const parameters &par) | |
multiGeometricFeaturesFromMask (const multiGeometricFeaturesFromMask &other) | |
virtual | ~multiGeometricFeaturesFromMask () |
virtual const char * | getTypeName () const |
bool | updateParameters () |
bool | apply (const channel8 &src, std::vector< std::vector< rectangle > > &objects) const |
bool | apply (const channel8 &src, imatrix &dest, std::vector< std::vector< rectangle > > &objects) const |
bool | apply (const channel8 &src, std::vector< std::vector< geometricFeatureGroup0 > > &objects) const |
bool | apply (const channel8 &src, imatrix &dest, std::vector< std::vector< geometricFeatureGroup0 > > &objects) const |
bool | postProcess (std::vector< std::vector< geometricFeatureGroup0 > > &objects) const |
bool | postProcess (std::vector< std::vector< rectangle > > &objects) const |
multiGeometricFeaturesFromMask & | copy (const multiGeometricFeaturesFromMask &other) |
multiGeometricFeaturesFromMask & | operator= (const multiGeometricFeaturesFromMask &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This functor takes a mask (labeled or not), where it is assumed that a region must be connected or not and reassigns 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 and stored in the vector corresponding to the object's kind. Thereby it is assumed that each object kind is assigned the same grey value in the input channel. All objects of the same kind are stored in a single vector. These vectors again are returned in a vector and ordered in the same way as in the parameter mask Values, which specifies the grey values for which the geometric features are computed. Any other grey values are still labeled as described in fastRelabeling, but excluded from the further processing performed by this class.
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::multiGeometricFeaturesFromMask::multiGeometricFeaturesFromMask | ( | ) |
default constructor
lti::multiGeometricFeaturesFromMask::multiGeometricFeaturesFromMask | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::multiGeometricFeaturesFromMask::multiGeometricFeaturesFromMask | ( | const multiGeometricFeaturesFromMask & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::multiGeometricFeaturesFromMask::~multiGeometricFeaturesFromMask | ( | ) | [virtual] |
destructor
bool lti::multiGeometricFeaturesFromMask::apply | ( | const channel8 & | src, | |
imatrix & | dest, | |||
std::vector< 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 into the vector with the geometric features. operates on the given parameter.
src | channel8 with the source data | |
dest | matrix with the labeled data | |
objects | a vector with the geometric features of each labeled object |
bool lti::multiGeometricFeaturesFromMask::apply | ( | const channel8 & | src, | |
std::vector< 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::multiGeometricFeaturesFromMask::apply | ( | const channel8 & | src, | |
imatrix & | dest, | |||
std::vector< std::vector< rectangle > > & | 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 into the vector with the geometric features. operates on the given parameter.
src | channel8 with the source data | |
dest | a matrix with the labeled data | |
objects | a vector with the geometric features of each labeled object |
virtual functor* lti::multiGeometricFeaturesFromMask::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::geometricFeaturesFromMask.
multiGeometricFeaturesFromMask& lti::multiGeometricFeaturesFromMask::copy | ( | const multiGeometricFeaturesFromMask & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::geometricFeaturesFromMask.
const parameters& lti::multiGeometricFeaturesFromMask::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::geometricFeaturesFromMask.
virtual const char* lti::multiGeometricFeaturesFromMask::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("multiGeometricFeaturesFromMask")
Reimplemented from lti::geometricFeaturesFromMask.
multiGeometricFeaturesFromMask& lti::multiGeometricFeaturesFromMask::operator= | ( | const multiGeometricFeaturesFromMask & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::geometricFeaturesFromMask.
bool lti::multiGeometricFeaturesFromMask::postProcess | ( | std::vector< std::vector< rectangle > > & | objects | ) | const |
Merge if requested.
This method need only be called in the manual post processing mode.
objects | the rectangles to be processed |
bool lti::multiGeometricFeaturesFromMask::postProcess | ( | std::vector< std::vector< geometricFeatureGroup0 > > & | objects | ) | const |
Merge if requested and compute the center of gravity.
This method need only be called in the manual post processing mode.
objects | the geometric features to be processed |
bool lti::multiGeometricFeaturesFromMask::updateParameters | ( | ) | [virtual] |
Update the parameters content.
return true on success and false otherwise
Reimplemented from lti::functor.