asmlib-opencv
an ASM(Active Shape Model) implementation by C++ & OpenCV
|
Shape vector, presented as a 1-D OpenCV matrix. More...
#include <shapevec.h>
Inherits Mat_< double >.
Public Member Functions | |
ShapeVec (const Mat_< double > &a) | |
Construct by a matrix. | |
ShapeVec & | operator= (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. |
Shape vector, presented as a 1-D OpenCV matrix.
StatModel::ShapeVec::ShapeVec | ( | const Mat_< double > & | a | ) | [inline] |
Construct by a matrix.
StatModel::ShapeVec::ShapeVec | ( | ) | [inline] |
Default constructor does nothing.
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.
void StatModel::ShapeVec::scaleToOne | ( | ) |
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] |
void StatModel::ShapeVec::zeroGravity | ( | ) |
Move the center of gravity to origin. X and Y are moved seperately.