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

Image and image related operations. More...

#include <modelimage.h>

List of all members.

Public Member Functions

bool loadTrainImage ()
 Load training image from saved host image.
bool loadTrainImage (const Mat &img)
 Load training image.
void setShapeInfo (ShapeInfo *si)
bool releaseTrainImage ()
 Release Training Image.
Mat_< double > getLocalStruct (int pId, int k, int level, double step)
 Get local structure.
void getPointsOnNorm (int pId, int k, int level, vector< Point_< int > > &V, double step, int pOffset=0)
 Get the coordinates of points at normal direction of a landmark point.
Mat & getTrainImage (int level=0, bool gray=false)
 Get the image saved at specified level.
Mat & getDerivImage (int level)
 Return the derivative image at specified level;.
const string & HostImage () const
 Host image (if any).
void buildFromShapeVec (SimilarityTrans &trans)
void setHostImage (const char *hostImageFilename)
 Set the host image.
int NPoints () const
 The number of shape points.
bool readPTS (const char *filename)
 Read mark points information from a PTS file.
void initPointsByVector (const vector< cv::Point2i > &V)
 Set mark points information from a vector of points.
Mat show (int level=0, int pId=-1, bool showInWin=true, int highLight=0)
 Show the image interactively.
 ModelImage ()

Public Attributes

vector< Point_< int > > points
 Landmark points.
ShapeVec shapeVec
 Shape vectors.

Protected Attributes

int nMarkPoints
 The number of landmark points.
string hostImageName
 Optional 'host image' filename including full path.
Mat imgdata
 the training image
vector< Mat > imgPyramid
 Image pyramid.
vector< Mat_< double > > imgPyrGrayDeriv
vector< Mat_< uchar > > imgPyrGray
bool imgLoaded
 Is the image loaded?
ShapeInfoshapeInfo
 Information about shapes and paths.

Detailed Description

Image and image related operations.


Constructor & Destructor Documentation


Member Function Documentation

Mat& StatModel::ModelImage::getDerivImage ( int  level) [inline]

Return the derivative image at specified level;.

Mat_< double > StatModel::ModelImage::getLocalStruct ( int  pId,
int  k,
int  level,
double  step 
)

Get local structure.

Parameters:
pIdid of the point
khow many points to get on either direction
levelposition in the pyramid level
stepVERY IMPORTANT, for a image with area of 10000, 1.0 may be a good choice
void StatModel::ModelImage::getPointsOnNorm ( int  pId,
int  k,
int  level,
vector< Point_< int > > &  V,
double  step,
int  pOffset = 0 
)

Get the coordinates of points at normal direction of a landmark point.

Parameters:
pIdid of the point
khow many points to get on either direction
levelposition in the pyramid level
Vthe vector that save results.
stepVERY IMPORTANT, for a image with area of 10000, 1.0 may be a good choice
pOffsetwhen searching for best points, use the p'th point along the profile as the center
Mat & StatModel::ModelImage::getTrainImage ( int  level = 0,
bool  gray = false 
)

Get the image saved at specified level.

const string& StatModel::ModelImage::HostImage ( ) const [inline]

Host image (if any).

void StatModel::ModelImage::initPointsByVector ( const vector< cv::Point2i > &  V)

Set mark points information from a vector of points.

Load training image from saved host image.

bool StatModel::ModelImage::loadTrainImage ( const Mat &  img)

Load training image.

int StatModel::ModelImage::NPoints ( ) const [inline]

The number of shape points.

bool StatModel::ModelImage::readPTS ( const char *  filename)

Read mark points information from a PTS file.

Release Training Image.

void StatModel::ModelImage::setHostImage ( const char *  hostImageFilename) [inline]

Set the host image.

Mat StatModel::ModelImage::show ( int  level = 0,
int  pId = -1,
bool  showInWin = true,
int  highLight = 0 
)

Show the image interactively.


Member Data Documentation

Optional 'host image' filename including full path.

the training image

Is the image loaded?

vector< Mat > StatModel::ModelImage::imgPyramid [protected]

Image pyramid.

vector< Mat_<uchar> > StatModel::ModelImage::imgPyrGray [protected]
vector< Mat_<double> > StatModel::ModelImage::imgPyrGrayDeriv [protected]

The number of landmark points.

vector< Point_< int > > StatModel::ModelImage::points

Landmark points.

Information about shapes and paths.


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