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

Active Shape Model. More...

#include <asmmodel.h>

Inheritance diagram for StatModel::ASMModel:
StatModel::ShapeModel

List of all members.

Public Member Functions

 ASMModel ()
 Empty ASM model.
 ASMModel (const string &filename)
 Initialize by a file.
vector< ASMFitResultfitAll (const Mat &img, const vector< cv::Rect > &detectedObjs, int verbose=0)
 Search for objects (e.g. faces) in image, and run ASM on each object.
ASMFitResult fit (const Mat &img, int verbose=0)
 Do ASM fitting on an image patch, return the fitted vector.
void buildModel (const string &shapeDefFile, const string &ptsListFile)
 Build the model.
void saveToFile (const string &filename)
 Save the model into a file.
void loadFromFile (const string &filename)
 Load the model from a file.
void showResult (Mat &img, const vector< ASMFitResult > &res)
 Show the result in the image.

Detailed Description

Active Shape Model.


Constructor & Destructor Documentation

Empty ASM model.

StatModel::ASMModel::ASMModel ( const string &  filename) [inline]

Initialize by a file.


Member Function Documentation

void StatModel::ASMModel::buildModel ( const string &  shapeDefFile,
const string &  ptsListFile 
)

Build the model.

Reimplemented from StatModel::ShapeModel.

ASMFitResult StatModel::ASMModel::fit ( const Mat &  img,
int  verbose = 0 
)

Do ASM fitting on an image patch, return the fitted vector.

I'd recommend use ASMModel::fitAll in most cases.

Parameters:
imgAn image patch (cropped by object detection).
verboseVerbosity level.
Returns:
Result of ASM fitting.
vector< ASMFitResult > StatModel::ASMModel::fitAll ( const Mat &  img,
const vector< cv::Rect > &  detectedObjs,
int  verbose = 0 
)

Search for objects (e.g. faces) in image, and run ASM on each object.

This runs OpenCV object detection and fit ASM model on each detected region.

Parameters:
imgInput image
detectedObjsBounding boxes for all objects. (Usually it can be the result of OpenCV object detection)
verboseVerbosity level.
Returns:
A vector of FitResult's.
void StatModel::ASMModel::loadFromFile ( const string &  filename)

Load the model from a file.

void StatModel::ASMModel::saveToFile ( const string &  filename)

Save the model into a file.

void StatModel::ASMModel::showResult ( Mat &  img,
const vector< ASMFitResult > &  res 
)

Show the result in the image.


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