latest version v1.9 - last update 10 Apr 2010 |
Curvature Scale Space Representation (CSS). More...
#include <ltiCurvatureScaleSpace.h>
Classes | |
class | parameters |
the parameters for the class curvatureScaleSpace More... | |
Public Types | |
enum | eFeatureIndices { MaxY = 0, MaxX, Width, Offset } |
Public Member Functions | |
curvatureScaleSpace () | |
curvatureScaleSpace (const curvatureScaleSpace &other) | |
virtual | ~curvatureScaleSpace () |
virtual const char * | getTypeName () const |
bool | apply (const borderPoints &src, channel8 &dest, float &maxSigma, int &maxRow) const |
bool | apply (const borderPoints &src, channel8 &dest, pointList &rows) const |
bool | apply (const borderPoints &src, channel8 &dest) const |
bool | apply (const borderPoints &src, channel8 &css, dmatrix &vcts) const |
bool | apply (const borderPoints &src, channel8 &css, dmatrix &vcts, pointList &rows) const |
bool | apply (const borderPoints &src, dmatrix &vcts) const |
curvatureScaleSpace & | copy (const curvatureScaleSpace &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
bool | borderToXY (const borderPoints &src, vector< float > &theX, vector< float > &theY) const |
void | calcKernels (const float &sigma, kernel1D< float > &first, kernel1D< float > &second) const |
int | curvature (const float &sigma, const vector< float > &theX, const vector< float > &theY, vector< float > &curv, vector< ubyte > &zeroCross) const |
void | calcKernels (float &sigma, gaussKernel1D< float > &gaussian) const |
int | curvature (const gaussKernel1D< float > &gaussian, vector< float > &theX, vector< float > &theY, vector< float > &curv, vector< ubyte > &zeroCross, const int &lastZC) const |
bool | cssOriginal (const borderPoints &src, channel8 &dest, float &maxSigma, int &maxRow, pointList &rows) const |
bool | cssFast (const borderPoints &src, channel8 &dest, float &maxSigma, int &maxRow, pointList &rows) const |
int | zeroCross (const vector< float > &curv, vector< ubyte > &dest, const ubyte &posNeg, const ubyte &negPos) const |
int | extractBlobs (const channel8 &css, const pointList &rows, matrix< int > &blobs, dmatrix &features) const |
Curvature Scale Space Representation (CSS).
This functor extracts from a boundary (borderPoints) the CSS representation as described in Mokhtarian, F. et. al "Robust and efficient shape indexing through curvature scale space", British Machine Vision Conference, 1996
The apply methods will check if there are enough points in the input parameters to compute the css. If there are not enough points, nothing will be done (see the apply methods for more details).
indices for the columns of the feature-vectors in the matrix
lti::curvatureScaleSpace::curvatureScaleSpace | ( | ) |
default constructor
lti::curvatureScaleSpace::curvatureScaleSpace | ( | const curvatureScaleSpace & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::curvatureScaleSpace::~curvatureScaleSpace | ( | ) | [virtual] |
destructor
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
dmatrix & | vcts | |||
) | const |
operates on the given parameter.
This member computes the CSS-image and the feature vectors. Each row of the matrix will correspond to a feature vector which contains:
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
vcts | feature vectors. Each row corresponds to a CSS "blob" |
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
channel8 & | css, | |||
dmatrix & | vcts, | |||
pointList & | rows | |||
) | const |
operates on the given parameter.
This member computes the CSS-image and the feature vectors. Each row of the matrix will correspond to a feature vector which contains:
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
css | the CSS image will be left here. | |
vcts | the feature vectors packed in a matrix. | |
rows | a list of points p, where p.x contains the number of blobs crossing the row of dest with index p.y. In a "clean" CSS representation the number of blobs has to decrease or be equal with increasing index p.y. If you detect here the opposite effect is because there is too much noise in the high-resolution levels (small variance of Gaussians). |
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
channel8 & | css, | |||
dmatrix & | vcts | |||
) | const |
operates on the given parameter.
This member computes the CSS-image and the feature vectors. Each row of the matrix will correspond to a feature vector which contains:
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
css | the CSS image will be left here. | |
vcts | the feature vectors packed in a matrix. |
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
channel8 & | dest | |||
) | const |
operates on the given parameter.
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
dest | the CSS image will be left here. |
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
channel8 & | dest, | |||
pointList & | rows | |||
) | const |
operates on the given parameter.
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
dest | the CSS image will be left here. | |
rows | a list of points p, where p.x contains the number of blobs crossing the row of dest with index p.y. In a "clean" CSS representation the number of blobs has to decrease or be equal with increasing index p.y. If you detect here the opposite effect is because there is too much noise in the high-resolution levels (small variance of Gaussians). |
bool lti::curvatureScaleSpace::apply | ( | const borderPoints & | src, | |
channel8 & | dest, | |||
float & | maxSigma, | |||
int & | maxRow | |||
) | const |
operates on the given parameter.
src | list of boundary points. If this list has less than 9 points (the smallest "circle" has 8 points), false will be returned with the respective message in the status string | |
dest | the CSS image will be left here. | |
maxSigma | the maximum sigma in the CSS image. | |
maxRow | the row corresponding to the maximum sigma. |
bool lti::curvatureScaleSpace::borderToXY | ( | const borderPoints & | src, | |
vector< float > & | theX, | |||
vector< float > & | theY | |||
) | const [protected] |
extract the x and y components of the borderPoints object and resize (normalize the length) of the vectors if required.
void lti::curvatureScaleSpace::calcKernels | ( | float & | sigma, | |
gaussKernel1D< float > & | gaussian | |||
) | const [protected] |
calculate the gaussian first and second derivative kernels.
The size of the kernel is recomputed considering the parameters object. The sigma term will be updated to the new one.
void lti::curvatureScaleSpace::calcKernels | ( | const float & | sigma, | |
kernel1D< float > & | first, | |||
kernel1D< float > & | second | |||
) | const [protected] |
calculate the gaussian first and second derivative kernels.
The size is calcultated considering the parameters object.
virtual functor* lti::curvatureScaleSpace::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
curvatureScaleSpace& lti::curvatureScaleSpace::copy | ( | const curvatureScaleSpace & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
bool lti::curvatureScaleSpace::cssFast | ( | const borderPoints & | src, | |
channel8 & | dest, | |||
float & | maxSigma, | |||
int & | maxRow, | |||
pointList & | rows | |||
) | const [protected] |
operates on the given parameter.
src | list of boundary points. | |
dest | modified CSS image will be left here. | |
maxSigma | the maximum sigma in the CSS image. | |
maxRow | the row corresponding to the maximum sigma. | |
rows | a list of points, where x contains the number of maxima of the row with the index given in the point's y. |
bool lti::curvatureScaleSpace::cssOriginal | ( | const borderPoints & | src, | |
channel8 & | dest, | |||
float & | maxSigma, | |||
int & | maxRow, | |||
pointList & | rows | |||
) | const [protected] |
operates on the given parameter.
src | list of boundary points. | |
dest | the CSS image will be left here. | |
maxSigma | the maximum sigma in the CSS image. | |
maxRow | the row corresponding to the maximum sigma. | |
rows | a list of points, where x contains the number of maxima of the row with the index given by y. |
int lti::curvatureScaleSpace::curvature | ( | const gaussKernel1D< float > & | gaussian, | |
vector< float > & | theX, | |||
vector< float > & | theY, | |||
vector< float > & | curv, | |||
vector< ubyte > & | zeroCross, | |||
const int & | lastZC | |||
) | const [protected] |
calculate the curvature using the derivatives
int lti::curvatureScaleSpace::curvature | ( | const float & | sigma, | |
const vector< float > & | theX, | |||
const vector< float > & | theY, | |||
vector< float > & | curv, | |||
vector< ubyte > & | zeroCross | |||
) | const [protected] |
calculate the curvature using the derivatives
int lti::curvatureScaleSpace::extractBlobs | ( | const channel8 & | css, | |
const pointList & | rows, | |||
matrix< int > & | blobs, | |||
dmatrix & | features | |||
) | const [protected] |
extract the blobs from the css image (only the first 127 blobs will be extracted)
const parameters& lti::curvatureScaleSpace::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::transform.
virtual const char* lti::curvatureScaleSpace::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("curvatureScaleSpace")
Reimplemented from lti::transform.