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 reassignes labels to them in a way that each connected region gets its own label. More...
#include <ltiFastRelabeling.h>
Classes | |
class | parameters |
the parameters for the class fastRelabeling More... | |
Public Member Functions | |
fastRelabeling () | |
fastRelabeling (const parameters &par) | |
fastRelabeling (const fastRelabeling &other) | |
virtual | ~fastRelabeling () |
virtual const char * | getTypeName () const |
bool | apply (channel8 &srcdest) const |
bool | apply (imatrix &srcdest) const |
bool | apply (const channel8 &src, channel8 &dest) const |
bool | apply (const channel8 &src, imatrix &dest) const |
bool | apply (const imatrix &src, imatrix &dest) const |
bool | apply (const channel8 &src, channel8 &dest, ivector &numPixels) const |
bool | apply (const channel8 &src, imatrix &dest, ivector &numPixels) const |
bool | apply (const imatrix &src, imatrix &dest, ivector &numPixels) const |
bool | apply (const channel8 &src, channel8 &dest, ivector &numPixels, std::vector< areaPoints > &objects) const |
bool | apply (const channel8 &src, imatrix &dest, ivector &numPixels, std::vector< areaPoints > &objects) const |
bool | apply (const imatrix &src, imatrix &dest, ivector &numPixels, std::vector< areaPoints > &objects) const |
bool | apply (const channel8 &src, channel8 &partMask, ivector &equivLabels, int &numObjects) const |
bool | apply (const channel8 &src, imatrix &partMask, ivector &equivLabels, int &numObjects) const |
bool | apply (const imatrix &src, imatrix &partMask, ivector &equivLabels, int &numObjects) const |
fastRelabeling & | copy (const fastRelabeling &other) |
fastRelabeling & | operator= (const fastRelabeling &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
bool | sortLabels (const int minSize, ivector &numPixels, ivector &reindex) const |
bool | relabelWithArea (const ivector &equivLabels, const int numObjects, imatrix &dest, ivector &numPixels) const |
bool | relabelWithArea (const vector< ubyte > &equivLabels, const int numObjects, channel8 &dest, ivector &numPixels) const |
This functor takes a mask (labeled or not), where it is assumed that a region must be connected or not and reassignes labels to them in a way that each connected region gets its own label.
Derived classes can compute for each of the found object additional information like geometric features, bounding boxes, weighted probabilities, etc.
lti::fastRelabeling::fastRelabeling | ( | ) |
default constructor
lti::fastRelabeling::fastRelabeling | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::fastRelabeling::fastRelabeling | ( | const fastRelabeling & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::fastRelabeling::~fastRelabeling | ( | ) | [virtual] |
destructor
bool lti::fastRelabeling::apply | ( | const imatrix & | src, | |
imatrix & | partMask, | |||
ivector & | equivLabels, | |||
int & | numObjects | |||
) | const |
This apply method does not complete the relabeling process.
Instead of that it returns an incomplete labeled mask and the label equivalences vector, with which other functors can efficiently compute other information about the found objects.
src | original labeled or unlabeled mask. | |
partMask | partial labeled mask. | |
equivLabels | vector with the equivalence labels | |
numObjects | number of objects found in the src mask. |
The simplest way to get a consistend finished mask (which is directly provided in other apply methods) is to assign to each pixel of partMask the corresponding equivalent label, i.e. for each x and y, partMask.at(y,x) = equivLabels(partMask.at(y,x)).
bool lti::fastRelabeling::apply | ( | const channel8 & | src, | |
imatrix & | partMask, | |||
ivector & | equivLabels, | |||
int & | numObjects | |||
) | const |
This apply method does not complete the relabeling process.
Instead of that it returns an incomplete labeled mask and the label equivalences vector, with which other functors can efficiently compute other information about the found objects.
src | original labeled or unlabeled mask. | |
partMask | partial labeled mask. | |
equivLabels | vector with the equivalence labels | |
numObjects | number of objects found in the src mask. |
The simplest way to get a consistend finished mask (which is directly provided in other apply methods) is to assign to each pixel of partMask the corresponding equivalent label, i.e. for each x and y, partMask.at(y,x) = equivLabels(partMask.at(y,x)).
bool lti::fastRelabeling::apply | ( | const channel8 & | src, | |
channel8 & | partMask, | |||
ivector & | equivLabels, | |||
int & | numObjects | |||
) | const |
This apply method does not complete the relabeling process.
Instead of that it returns an incomplete labeled mask and the label equivalences vector, with which other functors can efficiently compute other information about the found objects.
src | original labeled or unlabeled mask. | |
partMask | partial labeled mask. | |
equivLabels | vector with the equivalence labels | |
numObjects | number of objects found in the src mask. |
The simplest way to get a consistend finished mask (which is directly provided in other apply methods) is to assign to each pixel of partMask the corresponding equivalent label, i.e. for each x and y, partMask.at(y,x) = equivLabels(partMask.at(y,x)).
bool lti::fastRelabeling::apply | ( | const imatrix & | src, | |
imatrix & | dest, | |||
ivector & | numPixels, | |||
std::vector< areaPoints > & | objects | |||
) | const |
operates on a copy of the given parameters.
src | imatrix with the source data. | |
dest | imatrix where the result will be left. | |
numPixels | number of pixel per new object label | |
objects | for each label o, objects[o] contains all points belonging to that object. |
bool lti::fastRelabeling::apply | ( | const channel8 & | src, | |
imatrix & | dest, | |||
ivector & | numPixels, | |||
std::vector< areaPoints > & | objects | |||
) | const |
operates on a copy of the given parameters.
src | channel8 with the source data. | |
dest | channel8 where the result will be left. | |
numPixels | number of pixel per new object label | |
objects | for each label o, objects[o] contains all points belonging to that object. |
bool lti::fastRelabeling::apply | ( | const channel8 & | src, | |
channel8 & | dest, | |||
ivector & | numPixels, | |||
std::vector< areaPoints > & | objects | |||
) | const |
operates on a copy of the given parameters.
src | channel8 with the source data. | |
dest | channel8 where the result will be left. | |
numPixels | number of pixel per new object label | |
objects | for each label o, objects[o] contains all points belonging to that object. |
operates on a copy of the given parameters.
src | imatrix with the source data. | |
dest | imatrix where the result will be left. | |
numPixels | number of pixel per new object label |
operates on a copy of the given parameters.
src | imatrix with the source data. | |
dest | imatrix where the result will be left. |
Reimplemented from lti::modifier.
operates on a copy of the given parameters.
Reimplemented from lti::modifier.
bool lti::fastRelabeling::apply | ( | imatrix & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | imatrix with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
bool lti::fastRelabeling::apply | ( | channel8 & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel8 with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
virtual functor* lti::fastRelabeling::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
Reimplemented in lti::geometricFeaturesFromMask, and lti::multiGeometricFeaturesFromMask.
fastRelabeling& lti::fastRelabeling::copy | ( | const fastRelabeling & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::geometricFeaturesFromMask, and lti::multiGeometricFeaturesFromMask.
const parameters& lti::fastRelabeling::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
Reimplemented in lti::geometricFeaturesFromMask, and lti::multiGeometricFeaturesFromMask.
virtual const char* lti::fastRelabeling::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("fastRelabeling")
Reimplemented from lti::modifier.
Reimplemented in lti::geometricFeaturesFromMask, and lti::multiGeometricFeaturesFromMask.
fastRelabeling& lti::fastRelabeling::operator= | ( | const fastRelabeling & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::geometricFeaturesFromMask, and lti::multiGeometricFeaturesFromMask.
bool lti::fastRelabeling::relabelWithArea | ( | const vector< ubyte > & | equivLabels, | |
const int | numObjects, | |||
channel8 & | dest, | |||
ivector & | numPixels | |||
) | const [protected] |
Just relabel the destination, but compute also the size of each object.
bool lti::fastRelabeling::relabelWithArea | ( | const ivector & | equivLabels, | |
const int | numObjects, | |||
imatrix & | dest, | |||
ivector & | numPixels | |||
) | const [protected] |
Just relabel the destination, but compute also the size of each object.
bool lti::fastRelabeling::sortLabels | ( | const int | minSize, | |
ivector & | numPixels, | |||
ivector & | reindex | |||
) | const [protected] |
Sort labels and eliminate those objects with sizes smaller than the given threshold.