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

lti::regionShapeFeatures Class Reference

This functor computes descriptors for shapes, decomposing a binary mask as a sum of some basis functions. More...

#include <ltiRegionShapeFeatures.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class regionShapeFeatures More...

Public Member Functions

 regionShapeFeatures ()
 regionShapeFeatures (const parameters &par)
 regionShapeFeatures (const regionShapeFeatures &other)
virtual ~regionShapeFeatures ()
virtual const char * getTypeName () const
bool apply (const channel8 &src, channel &dest) const
bool apply (const channel8 &src, dvector &dest) const
bool apply (const channel8 &src, channel &dest1, channel &dest2) const
bool apply (const channel8 &src, dvector &dest1, dvector &dest2) const
bool reconstruct (const channel &coef1, const channel &coef2, channel &shape1, channel &shape2) const
bool getBasisFunction (const int n, const int m, channel &real, channel &imag) const
regionShapeFeaturescopy (const regionShapeFeatures &other)
regionShapeFeaturesoperator= (const regionShapeFeatures &other)
virtual functorclone () const
virtual bool updateParameters ()
const parametersgetParameters () const

Protected Member Functions

void dot (const channel &reA, const channel &imA, const channel &reB, const channel &imB, float &real, float &imag) const
bool calcLUT ()
bool testOrthogonality (channel &ortho) const
void resizeMask (const channel8 &src, channel &ssrc) const
double fac (int arg)

Static Protected Member Functions

static float binarize (const float &x)

Protected Attributes

std::vector< std::vector
< channel > > 
lutR
std::vector< std::vector
< channel > > 
lutI
channel radLut
parameters::basisFunctionsType lastBasisFunctionSet
std::vector< std::vector< bool > > vecNM

Detailed Description

This functor computes descriptors for shapes, decomposing a binary mask as a sum of some basis functions.

Several basis function sets have been implemented:

Tschebichef Moments need still to be implemented.


Constructor & Destructor Documentation

lti::regionShapeFeatures::regionShapeFeatures (  ) 

default constructor

lti::regionShapeFeatures::regionShapeFeatures ( const parameters par  ) 

default constructor with parameters

lti::regionShapeFeatures::regionShapeFeatures ( const regionShapeFeatures other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::regionShapeFeatures::apply ( const channel8 src,
dvector dest1,
dvector dest2 
) const

operates on the given parameter.

Parameters:
src channel8 with the input binary mask. All not-object pixels must be zero. The object pixels must have a value 255.
dest1 feature vector with real part or magnitude of the coefficients, depending on the value of parameters::polar.
dest2 feature vector with imaginary part or phase of the coefficients, depending on the value of parameters::polar.
Returns:
true if apply successful or false otherwise.
bool lti::regionShapeFeatures::apply ( const channel8 src,
channel dest1,
channel dest2 
) const

operates on the given parameter.

Parameters:
src channel8 with the input binary mask. All not-object pixels must be zero. The object pixels must have a value 255.
dest1 channel with real part or magnitude of the coefficients, depending on the value of parameters::polar.
dest2 channel with imaginary part or phase of the coefficients, depending on the value of parameters::polar.
Returns:
true if apply successful or false otherwise.
bool lti::regionShapeFeatures::apply ( const channel8 src,
dvector dest 
) const [virtual]

operates on the given parameter.

Parameters:
src channel8 with the input binary mask. All not-object pixels must be zero. The object pixels must have a value 255.
dest feature vector with coefficients for the base functions. (real part or magnitude, depending on parameters::polar value)
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::globalFeatureExtractor.

bool lti::regionShapeFeatures::apply ( const channel8 src,
channel dest 
) const

operates on the given parameter.

Parameters:
src channel8 with the input binary mask. All not-object pixels must be zero. The object pixels must have a value 255.
dest channel with coefficients for the base functions. (real part or magnitude, depending on parameters::polar value)
Returns:
true if apply successful or false otherwise.
static float lti::regionShapeFeatures::binarize ( const float &  x  )  [static, protected]

static function used to binarize a channel.

All values under 0.5 will be set to 0 and all values above 0.5 will be set to 1.0

bool lti::regionShapeFeatures::calcLUT (  )  [protected]

calculates the look up tables (LUT) for the transformation (suitable to the given parameters::maskSize)

Returns:
true if successful
virtual functor* lti::regionShapeFeatures::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::globalFeatureExtractor.

regionShapeFeatures& lti::regionShapeFeatures::copy ( const regionShapeFeatures other  ) 

copy data of "other" functor.

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

Reimplemented from lti::globalFeatureExtractor.

void lti::regionShapeFeatures::dot ( const channel reA,
const channel imA,
const channel reB,
const channel imB,
float &  real,
float &  imag 
) const [protected]

dot product between two matrices of the same size

double lti::regionShapeFeatures::fac ( int  arg  )  [protected]

compute factorial of arg

bool lti::regionShapeFeatures::getBasisFunction ( const int  n,
const int  m,
channel real,
channel imag 
) const

get one of the basis functions currently being used.

The indices must be in the valid range (specified in the parameters), otherwise the function will return false.

Parameters:
n radial component (row)
m angular component (column)
real real part of the basis function
imag imaginary part of the basis function
Returns:
true if successful, false otherwise
const parameters& lti::regionShapeFeatures::getParameters (  )  const

returns used parameters

Reimplemented from lti::globalFeatureExtractor.

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

returns the name of this type ("regionShapeFeatures")

Reimplemented from lti::globalFeatureExtractor.

regionShapeFeatures& lti::regionShapeFeatures::operator= ( const regionShapeFeatures other  ) 

alias for copy member

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

Reimplemented from lti::functor.

bool lti::regionShapeFeatures::reconstruct ( const channel coef1,
const channel coef2,
channel shape1,
channel shape2 
) const

This method is for debugging purposes only.

It provides a tentative reconstruction algorithm for the original shape using the given coefficients. Depending on the parameters::polar the output will be in cartesic or in polar form.

Parameters:
coef1 real part (or magnitude) of the coefficients.
coef2 imaginary part (or phase) of the coefficients.
shape1 reconstructed real part (or magnitude)
shape2 reconstructed imaginary part (or phase)
Returns:
true if successful, false otherwise.
void lti::regionShapeFeatures::resizeMask ( const channel8 src,
channel ssrc 
) const [protected]

crop the object in the mask and resizes it to the parameters::maskSize (here: the center of mass of the object is in the center of the new image)

bool lti::regionShapeFeatures::testOrthogonality ( channel ortho  )  const [protected]

Test the orthogonality of the base functions The comparition matrix will be a square matrix with the size.x*sizey elements at one size.

virtual bool lti::regionShapeFeatures::updateParameters (  )  [virtual]

set functor's parameters.

This member makes a copy of theParam: the functor will keep its own copy of the parameters!

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.


Member Data Documentation

flag to remember the last basis function set

std::vector< std::vector<channel> > lti::regionShapeFeatures::lutI [protected]

imaginary part of the basis functions (LUT)

std::vector< std::vector<channel> > lti::regionShapeFeatures::lutR [protected]

real part of the basis functions (LUT)

radius matrix.

It will contain the distance of a pixel to the center of the image: f(x,y) = radius ; radius = ((x-xcenter)^2+(y-ycenter)^2)^0.5

std::vector<std::vector<bool> > lti::regionShapeFeatures::vecNM [protected]

used to decide whether zernike moment (n,m) exists


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

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