asmlib-opencv
an ASM(Active Shape Model) implementation by C++ & OpenCV
|
00001 #ifndef SHAPEINFO_H 00002 #define SHAPEINFO_H 00003 00004 #include "afreader.h" 00005 #include "modelfile.h" 00006 00007 using cv::Mat; 00008 using cv::Point; 00009 using std::vector; 00010 00011 namespace StatModel { 00013 00019 class ShapeInfo 00020 { 00021 private: 00023 vector< int > contourStartInd; 00024 00030 vector< int > contourIsClosed; 00031 00033 int nContours; 00034 00035 public: 00037 struct PointInfo 00038 { 00039 int type; 00040 int pathId; 00041 int connectFrom; 00042 int connectTo; 00043 }; 00044 00046 vector< PointInfo > pointInfo; 00047 00049 void writeToFile(ModelFile &f) const; 00050 00052 void readFromFile(ModelFile &f); 00053 00055 int loadFromShapeDescFile(AFReader &shapeDefFile); 00056 00058 Mat drawMarkPointsOnImg( 00059 Mat &img, const vector< Point > &vP, bool drawInPlace = false) const; 00060 }; 00061 } // Namespace 00062 #endif