@@ -44,114 +44,114 @@ namespace face {
44
44
// ! @addtogroup face
45
45
// ! @{
46
46
47
- class CV_EXPORTS_W FacemarkAAM : public Facemark
47
+ class CV_EXPORTS_W FacemarkAAM : public Facemark
48
+ {
49
+ public:
50
+ struct CV_EXPORTS Params
48
51
{
49
- public:
50
- struct CV_EXPORTS Params
51
- {
52
- /* *
53
- * \brief Constructor
54
- */
55
- Params ();
56
-
57
- /* *
58
- * \brief Read parameters from file, currently unused
59
- */
60
- void read (const FileNode& /* fn*/ );
61
-
62
- /* *
63
- * \brief Read parameters from file, currently unused
64
- */
65
- void write (FileStorage& /* fs*/ ) const ;
66
-
67
- std::string model_filename;
68
- int m;
69
- int n;
70
- int n_iter;
71
- bool verbose;
72
- bool save_model;
73
- int max_m, max_n, texture_max_m;
74
- std::vector<float >scales;
75
- };
76
-
77
52
/* *
78
- * \brief Optional parameter for fitting process.
53
+ * \brief Constructor
79
54
*/
80
- struct CV_EXPORTS Config
81
- {
82
- Config ( Mat rot = Mat::eye(2 ,2 ,CV_32F),
83
- Point2f trans = Point2f(0.0 ,0.0 ),
84
- float scaling = 1.0 ,
85
- int scale_id=0
86
- );
87
-
88
- Mat R;
89
- Point2f t;
90
- float scale;
91
- int model_scale_idx;
92
-
93
- };
55
+ Params ();
94
56
95
57
/* *
96
- * \brief Data container for the facemark::getData function
58
+ * \brief Read parameters from file, currently unused
97
59
*/
98
- struct CV_EXPORTS Data
99
- {
100
- std::vector<Point2f> s0;
101
- };
60
+ void read (const FileNode& /* fn*/ );
102
61
103
62
/* *
104
- * \brief The model of AAM Algorithm
63
+ * \brief Read parameters from file, currently unused
105
64
*/
106
- struct CV_EXPORTS Model
107
- {
108
- int npts; // !< unused delete
109
- int max_n; // !< unused delete
110
- std::vector<float >scales;
111
- // !< defines the scales considered to build the model
112
-
113
- /* warping*/
114
- std::vector<Vec3i> triangles;
115
- // !< each element contains 3 values, represent index of facemarks that construct one triangle (obtained using delaunay triangulation)
116
-
117
- struct Texture {
118
- int max_m; // !< unused delete
119
- Rect resolution;
120
- // !< resolution of the current scale
121
- Mat A;
122
- // !< gray values from all face region in the dataset, projected in PCA space
123
- Mat A0;
124
- // !< average of gray values from all face region in the dataset
125
- Mat AA;
126
- // !< gray values from all erorded face region in the dataset, projected in PCA space
127
- Mat AA0;
128
- // !< average of gray values from all erorded face region in the dataset
129
-
130
- std::vector<std::vector<Point> > textureIdx;
131
- // !< index for warping of each delaunay triangle region constructed by 3 facemarks
132
- std::vector<Point2f> base_shape;
133
- // !< basic shape, normalized to be fit in an image with current detection resolution
134
- std::vector<int > ind1;
135
- // !< index of pixels for mapping process to obtains the grays values of face region
136
- std::vector<int > ind2;
137
- // !< index of pixels for mapping process to obtains the grays values of eroded face region
138
- };
139
- std::vector<Texture> textures;
140
- // !< a container to holds the texture data for each scale of fitting
141
-
142
- /* shape*/
143
- std::vector<Point2f> s0;
144
- // !< the basic shape obtained from training dataset
145
- Mat S,Q;
146
- // !< the encoded shapes from training data
65
+ void write (FileStorage& /* fs*/ ) const ;
66
+
67
+ std::string model_filename;
68
+ int m;
69
+ int n;
70
+ int n_iter;
71
+ bool verbose;
72
+ bool save_model;
73
+ int max_m, max_n, texture_max_m;
74
+ std::vector<float >scales;
75
+ };
76
+
77
+ /* *
78
+ * \brief Optional parameter for fitting process.
79
+ */
80
+ struct CV_EXPORTS Config
81
+ {
82
+ Config ( Mat rot = Mat::eye(2 ,2 ,CV_32F),
83
+ Point2f trans = Point2f(0.0 ,0.0 ),
84
+ float scaling = 1.0 ,
85
+ int scale_id=0
86
+ );
87
+
88
+ Mat R;
89
+ Point2f t;
90
+ float scale;
91
+ int model_scale_idx;
92
+
93
+ };
94
+
95
+ /* *
96
+ * \brief Data container for the facemark::getData function
97
+ */
98
+ struct CV_EXPORTS Data
99
+ {
100
+ std::vector<Point2f> s0;
101
+ };
147
102
103
+ /* *
104
+ * \brief The model of AAM Algorithm
105
+ */
106
+ struct CV_EXPORTS Model
107
+ {
108
+ int npts; // !< unused delete
109
+ int max_n; // !< unused delete
110
+ std::vector<float >scales;
111
+ // !< defines the scales considered to build the model
112
+
113
+ /* warping*/
114
+ std::vector<Vec3i> triangles;
115
+ // !< each element contains 3 values, represent index of facemarks that construct one triangle (obtained using delaunay triangulation)
116
+
117
+ struct Texture {
118
+ int max_m; // !< unused delete
119
+ Rect resolution;
120
+ // !< resolution of the current scale
121
+ Mat A;
122
+ // !< gray values from all face region in the dataset, projected in PCA space
123
+ Mat A0;
124
+ // !< average of gray values from all face region in the dataset
125
+ Mat AA;
126
+ // !< gray values from all erorded face region in the dataset, projected in PCA space
127
+ Mat AA0;
128
+ // !< average of gray values from all erorded face region in the dataset
129
+
130
+ std::vector<std::vector<Point> > textureIdx;
131
+ // !< index for warping of each delaunay triangle region constructed by 3 facemarks
132
+ std::vector<Point2f> base_shape;
133
+ // !< basic shape, normalized to be fit in an image with current detection resolution
134
+ std::vector<int > ind1;
135
+ // !< index of pixels for mapping process to obtains the grays values of face region
136
+ std::vector<int > ind2;
137
+ // !< index of pixels for mapping process to obtains the grays values of eroded face region
148
138
};
139
+ std::vector<Texture> textures;
140
+ // !< a container to holds the texture data for each scale of fitting
141
+
142
+ /* shape*/
143
+ std::vector<Point2f> s0;
144
+ // !< the basic shape obtained from training dataset
145
+ Mat S,Q;
146
+ // !< the encoded shapes from training data
147
+
148
+ };
149
149
150
- // !< initializer
151
- static Ptr<FacemarkAAM> create (const FacemarkAAM::Params ¶meters = FacemarkAAM::Params() );
152
- virtual ~FacemarkAAM () {}
150
+ // !< initializer
151
+ static Ptr<FacemarkAAM> create (const FacemarkAAM::Params ¶meters = FacemarkAAM::Params() );
152
+ virtual ~FacemarkAAM () {}
153
153
154
- }; /* AAM */
154
+ }; /* AAM */
155
155
156
156
// ! @}
157
157
0 commit comments