|
asmlib-opencv
an ASM(Active Shape Model) implementation by C++ & OpenCV
|
Active Shape Model. More...
#include <asmmodel.h>
Public Member Functions | |
| ASMModel () | |
| Empty ASM model. | |
| ASMModel (const string &filename) | |
| Initialize by a file. | |
| vector< ASMFitResult > | 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. | |
| 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. | |
Active Shape Model.
| StatModel::ASMModel::ASMModel | ( | ) | [inline] |
Empty ASM model.
| StatModel::ASMModel::ASMModel | ( | const string & | filename | ) | [inline] |
Initialize by a file.
| 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.
| img | An image patch (cropped by object detection). |
| verbose | Verbosity level. |
| 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.
| img | Input image |
| detectedObjs | Bounding boxes for all objects. (Usually it can be the result of OpenCV object detection) |
| verbose | Verbosity level. |
| 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.