asmlib-opencv
an ASM(Active Shape Model) implementation by C++ & OpenCV
StatModel::ShapeVec Class Reference

Shape vector, presented as a 1-D OpenCV matrix. More...

#include <shapevec.h>

Inherits Mat_< double >.

List of all members.

Public Member Functions

 ShapeVec (const Mat_< double > &a)
 Construct by a matrix.
ShapeVecoperator= (const Mat_< double > &a)
 Assign shape vector by a Mat.
 ShapeVec ()
 Default constructor does nothing.
void alignTo (const ShapeVec &ref)
 Align to another shape vector.
void zeroGravity ()
 Move the center of gravity to origin. X and Y are moved seperately.
void scaleToOne ()
 Scale the vector's norm to 1.
void doTranslate (double vX, double vY)
void doScale (double r)
double getXMean () const
double getYMean () const
double X (int i) const
double & X (int i)
double Y (int i) const
double & Y (int i)
cv::Rect_< double > getBoundRect ()
void restoreToPointList (vector< Point_< int > > &v, const SimilarityTrans &st)
 Do a similarity transform and restore it into a list of points.
void fromPointList (const vector< cv::Point2i > &v)
 Flatten a list of points to the current shape vector.
int nPoints () const
 Number of points for this Shape.
SimilarityTrans getShapeTransformFitingSize (const cv::Size &rect, double scaleRatio=0.9, double xOffset=0, double yOffset=0)
 Given a target size, find a proper transformation to rescale the shape.

Detailed Description

Shape vector, presented as a 1-D OpenCV matrix.


Constructor & Destructor Documentation

StatModel::ShapeVec::ShapeVec ( const Mat_< double > &  a) [inline]

Construct by a matrix.

Default constructor does nothing.


Member Function Documentation

void StatModel::ShapeVec::alignTo ( const ShapeVec ref)

Align to another shape vector.

void StatModel::ShapeVec::doScale ( double  r)
void StatModel::ShapeVec::doTranslate ( double  vX,
double  vY 
)
void StatModel::ShapeVec::fromPointList ( const vector< cv::Point2i > &  v)

Flatten a list of points to the current shape vector.

cv::Rect_< double > StatModel::ShapeVec::getBoundRect ( )
SimilarityTrans StatModel::ShapeVec::getShapeTransformFitingSize ( const cv::Size &  rect,
double  scaleRatio = 0.9,
double  xOffset = 0,
double  yOffset = 0 
)

Given a target size, find a proper transformation to rescale the shape.

double StatModel::ShapeVec::getXMean ( ) const [inline]
double StatModel::ShapeVec::getYMean ( ) const [inline]
int StatModel::ShapeVec::nPoints ( ) const [inline]

Number of points for this Shape.

ShapeVec& StatModel::ShapeVec::operator= ( const Mat_< double > &  a) [inline]

Assign shape vector by a Mat.

void StatModel::ShapeVec::restoreToPointList ( vector< Point_< int > > &  v,
const SimilarityTrans st 
)

Do a similarity transform and restore it into a list of points.

Scale the vector's norm to 1.

double StatModel::ShapeVec::X ( int  i) const [inline]
double& StatModel::ShapeVec::X ( int  i) [inline]
double StatModel::ShapeVec::Y ( int  i) const [inline]
double& StatModel::ShapeVec::Y ( int  i) [inline]

Move the center of gravity to origin. X and Y are moved seperately.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Defines