latest version v1.9 - last update 10 Apr 2010 |
This is the base class for active shape models (ASM). More...
#include <ltiActiveShapeModel.h>
Classes | |
class | parameters |
the parameters for the class activeShapeModel More... | |
Public Member Functions | |
activeShapeModel () | |
activeShapeModel (const activeShapeModel &other) | |
virtual | ~activeShapeModel () |
virtual const char * | getTypeName () const |
activeShapeModel & | copy (const activeShapeModel &other) |
activeShapeModel & | operator= (const activeShapeModel &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Transformation | |
void | convertShapeToWeightsVector (const pointDistributionModel::shape &src, vector< double > &dest) const |
void | convertShapeToWeightsVector (const pointDistributionModel::shape &src, vector< double > &dest, const fvector &pointReliability) const |
void | convertWeightsVectorToShape (const vector< double > &src, pointDistributionModel::shape &dest) const |
Comparison | |
geometricTransform::parameters | alignShape (pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape) const |
geometricTransform::parameters | alignShape (pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability) const |
float | calculateShapeDifference (const pointDistributionModel::shape &firstShape, const pointDistributionModel::shape &secondShape) const |
float | calculateShapeDifference (const pointDistributionModel::shape &firstShape, const pointDistributionModel::shape &secondShape, const fvector &pointReliability) const |
Properties | |
tpoint< float > | calculateShapeCenter (const pointDistributionModel::shape &shape) const |
tpoint< float > | calculateShapeCenter (const pointDistributionModel::shape &shape, const fvector &pointReliability) const |
float | calculateShapeDistance (const pointDistributionModel::shape &shape, const tpoint< float > &thePoint=tpoint< float >(0.0f, 0.0f)) const |
float | calculateShapeDistance (const pointDistributionModel::shape &shape, const fvector &pointReliability, const tpoint< float > &thePoint=tpoint< float >(0.0f, 0.0f)) const |
double | calculateShapeOrientation (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const tpoint< float > &theCenter=tpoint< float >(0.0f, 0.0f)) const |
double | calculateShapeOrientation (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability, const tpoint< float > &theCenter=tpoint< float >(0.0, 0.0)) const |
Protected Member Functions | |
float | calculateRelativeShapeScale (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability, const tpoint< float > &shapeCenter=tpoint< float >(0.0, 0.0), const tpoint< float > &referenceShapeCenter=tpoint< float >(0.0, 0.0)) const |
void | trimShape (pointDistributionModel::shape &srcdest) const |
void | trimShape (pointDistributionModel::shape &srcdest, const fvector &pointReliability) const |
void | trimWeightsVector (vector< double > &srcdest) const |
double | calculateAngle (const tpoint< float > &thePoint) const |
vector< double > | buildVector (const pointDistributionModel::shape &src) const |
pointDistributionModel::shape | buildShape (const vector< double > &src) const |
void | createListOfNormals (const pointDistributionModel::shape &theShape, tpointList< float > &listOfNormals) const |
This is the base class for active shape models (ASM).
ASMs are deformable 2D-templates, that can align themselves to image features according to defined search strategies (see derived classes). The deformation is regularized (i.e. constrained) by an underlying PDM (pointDistributionModel).
This class provides the methods for aligning PDM shapes (pointDistributionModel::shape) and to correct invalid shapes to satisfy the restrictions of a given PDM. Furthermore, methods to obtain information about the position of a shape are provided. Shapes with weighted points (point reliabilities) are also supported.
lti::activeShapeModel::activeShapeModel | ( | ) |
default constructor
lti::activeShapeModel::activeShapeModel | ( | const activeShapeModel & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::activeShapeModel::~activeShapeModel | ( | ) | [virtual] |
destructor
geometricTransform::parameters lti::activeShapeModel::alignShape | ( | pointDistributionModel::shape & | shape, | |
const pointDistributionModel::shape & | referenceShape, | |||
const fvector & | pointReliability | |||
) | const |
align a given weighted shape to another.
shape | shape to be aligned. the transformed shape will also be saved here. | |
referenceShape | fixed shape to be aligned to | |
pointReliability | vector containing reliability values between 0 (unreliable) and 1 (reliable) for all points |
geometricTransform::parameters lti::activeShapeModel::alignShape | ( | pointDistributionModel::shape & | shape, | |
const pointDistributionModel::shape & | referenceShape | |||
) | const |
align a given shape to another.
note that the return geometricTransform::parameters describe the transformation from the referenceShape to the unaligned shape! this is done to align a given shape to a normalized shape and be able to easily project this normalized shape (e.g. meanShape) on the original shape.
shape | shape to be aligned. the transformed shape will also be saved here. | |
referenceShape | fixed shape to be aligned to |
pointDistributionModel::shape lti::activeShapeModel::buildShape | ( | const vector< double > & | src | ) | const [protected] |
convert a vector [x1, y1, x2, y2, .
..] into a shape [(x1,y1),...]
vector<double> lti::activeShapeModel::buildVector | ( | const pointDistributionModel::shape & | src | ) | const [protected] |
convert the shape [(x1,y1),.
..] to a vector [x1, y1, x2, y2, ...]
double lti::activeShapeModel::calculateAngle | ( | const tpoint< float > & | thePoint | ) | const [protected] |
calculate angle between a point and the x-axis
float lti::activeShapeModel::calculateRelativeShapeScale | ( | const pointDistributionModel::shape & | shape, | |
const pointDistributionModel::shape & | referenceShape, | |||
const fvector & | pointReliability, | |||
const tpoint< float > & | shapeCenter = tpoint< float >(0.0, 0.0) , |
|||
const tpoint< float > & | referenceShapeCenter = tpoint< float >(0.0, 0.0) | |||
) | const [protected] |
calculate reliability-weighted scaling factor
tpoint<float> lti::activeShapeModel::calculateShapeCenter | ( | const pointDistributionModel::shape & | shape, | |
const fvector & | pointReliability | |||
) | const |
calculate the center of a given shape.
all points of the shape are multiplied with their reliability factor, then summed, and the results divided by the sum of reliabilities.
tpoint<float> lti::activeShapeModel::calculateShapeCenter | ( | const pointDistributionModel::shape & | shape | ) | const |
calculate the center of a given shape.
all points of the shape are summed and the results divided by the number of points.
float lti::activeShapeModel::calculateShapeDifference | ( | const pointDistributionModel::shape & | firstShape, | |
const pointDistributionModel::shape & | secondShape, | |||
const fvector & | pointReliability | |||
) | const |
calculate difference of two weighted shapes
float lti::activeShapeModel::calculateShapeDifference | ( | const pointDistributionModel::shape & | firstShape, | |
const pointDistributionModel::shape & | secondShape | |||
) | const |
calculate mean difference of two shapes, i.e.
the sum of squared distances of all corresponding points divided by the number of points
float lti::activeShapeModel::calculateShapeDistance | ( | const pointDistributionModel::shape & | shape, | |
const fvector & | pointReliability, | |||
const tpoint< float > & | thePoint = tpoint< float >(0.0f, 0.0f) | |||
) | const |
calculate the mean distance of a given point to the reliability-weighted points of a shape
float lti::activeShapeModel::calculateShapeDistance | ( | const pointDistributionModel::shape & | shape, | |
const tpoint< float > & | thePoint = tpoint< float >(0.0f, 0.0f) | |||
) | const |
calculate the mean distance of a given point to the points of a shape
double lti::activeShapeModel::calculateShapeOrientation | ( | const pointDistributionModel::shape & | shape, | |
const pointDistributionModel::shape & | referenceShape, | |||
const fvector & | pointReliability, | |||
const tpoint< float > & | theCenter = tpoint< float >(0.0, 0.0) | |||
) | const |
calculate the relative orientation difference of two shapes with regard to a given rotation center and given point reliabilities
double lti::activeShapeModel::calculateShapeOrientation | ( | const pointDistributionModel::shape & | shape, | |
const pointDistributionModel::shape & | referenceShape, | |||
const tpoint< float > & | theCenter = tpoint< float >(0.0f, 0.0f) | |||
) | const |
calculate the relative orientation difference of two shapes, with regard to a given rotation center
virtual functor* lti::activeShapeModel::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
Reimplemented in lti::gradientASM, and lti::skinASM.
void lti::activeShapeModel::convertShapeToWeightsVector | ( | const pointDistributionModel::shape & | src, | |
vector< double > & | dest, | |||
const fvector & | pointReliability | |||
) | const |
void lti::activeShapeModel::convertShapeToWeightsVector | ( | const pointDistributionModel::shape & | src, | |
vector< double > & | dest | |||
) | const |
convert a shape to a weights vector, i.e.
project a shape into the pdm eigenspace
Formula: w = (eigenVectorMatrix)^T * (shape - meanShape)
Note: the shape is assumed to be aligned to position, size and rotation of meanShape!
src | shape with the source data. | |
dest | vector where the result will be left. |
void lti::activeShapeModel::convertWeightsVectorToShape | ( | const vector< double > & | src, | |
pointDistributionModel::shape & | dest | |||
) | const |
activeShapeModel& lti::activeShapeModel::copy | ( | const activeShapeModel & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::gradientASM, and lti::skinASM.
void lti::activeShapeModel::createListOfNormals | ( | const pointDistributionModel::shape & | theShape, | |
tpointList< float > & | listOfNormals | |||
) | const [protected] |
create normals for each point
const parameters& lti::activeShapeModel::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
Reimplemented in lti::gradientASM, and lti::skinASM.
virtual const char* lti::activeShapeModel::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("activeShapeModel")
Reimplemented from lti::functor.
Reimplemented in lti::gradientASM, and lti::skinASM.
activeShapeModel& lti::activeShapeModel::operator= | ( | const activeShapeModel & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::gradientASM, and lti::skinASM.
void lti::activeShapeModel::trimShape | ( | pointDistributionModel::shape & | srcdest, | |
const fvector & | pointReliability | |||
) | const [protected] |
convert reliability-weighted shape to weights vector, correct if invalid and convert back to shape space.
srcdest | shape with the source data. The result will be left here too. | |
pointReliability | the reliabilities of each point of the shape as value between 0.0 and 1.0 |
void lti::activeShapeModel::trimShape | ( | pointDistributionModel::shape & | srcdest | ) | const [protected] |
convert shape to weights vector, correct if invalid and convert back to shape space.
srcdest | shape with the source data. The result will be left here too. |
void lti::activeShapeModel::trimWeightsVector | ( | vector< double > & | srcdest | ) | const [protected] |
Correct weights vector according to varianceCoefficient.
all vector entries that are not in between -c*v and c*v, where c is the given varianceCoefficient and v is the variance of the corresponding dimension (eigenvector), are set to 0.0
srcdest | vector<double> with the source data. The result will be left here too. |