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

lti::fastRelabeling Class Reference

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>

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

List of all members.

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
fastRelabelingcopy (const fastRelabeling &other)
fastRelabelingoperator= (const fastRelabeling &other)
virtual functorclone () const
const parametersgetParameters () 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

Detailed Description

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.


Constructor & Destructor Documentation

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

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

destructor


Member Function Documentation

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.

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

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.

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

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.

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

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.

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.
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const channel8 src,
imatrix dest,
ivector numPixels,
std::vector< areaPoints > &  objects 
) const

operates on a copy of the given parameters.

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.
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const channel8 src,
channel8 dest,
ivector numPixels,
std::vector< areaPoints > &  objects 
) const

operates on a copy of the given parameters.

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.
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const imatrix src,
imatrix dest,
ivector numPixels 
) const

operates on a copy of the given parameters.

Parameters:
src imatrix with the source data.
dest imatrix where the result will be left.
numPixels number of pixel per new object label
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const channel8 src,
imatrix dest,
ivector numPixels 
) const

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
numPixels number of pixel per new object label
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const channel8 src,
channel8 dest,
ivector numPixels 
) const

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
numPixels number of pixel per new object label
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const imatrix src,
imatrix dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src imatrix with the source data.
dest imatrix where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::fastRelabeling::apply ( const channel8 src,
imatrix dest 
) const

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
Returns:
true if apply successful or false otherwise.
bool lti::fastRelabeling::apply ( const channel8 src,
channel8 dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::fastRelabeling::apply ( imatrix srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest imatrix with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::modifier.

bool lti::fastRelabeling::apply ( channel8 srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest channel8 with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

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.

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

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

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

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.

Parameters:
minSize minimum number of pixels an object must have.
numPixels number of pixels per object. The index of the vector corresponds to the label in the given mask. After calling this vector is also sorted.
reindex new indices

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

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