Skip to content

Commit 7e9c532

Browse files
committed
whitespace
1 parent e85a802 commit 7e9c532

File tree

9 files changed

+3222
-3309
lines changed

9 files changed

+3222
-3309
lines changed

modules/face/include/opencv2/face/facemark.hpp

Lines changed: 320 additions & 320 deletions
Large diffs are not rendered by default.

modules/face/include/opencv2/face/facemarkAAM.hpp

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -44,114 +44,114 @@ namespace face {
4444
//! @addtogroup face
4545
//! @{
4646

47-
class CV_EXPORTS_W FacemarkAAM : public Facemark
47+
class CV_EXPORTS_W FacemarkAAM : public Facemark
48+
{
49+
public:
50+
struct CV_EXPORTS Params
4851
{
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-
7752
/**
78-
* \brief Optional parameter for fitting process.
53+
* \brief Constructor
7954
*/
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();
9456

9557
/**
96-
* \brief Data container for the facemark::getData function
58+
* \brief Read parameters from file, currently unused
9759
*/
98-
struct CV_EXPORTS Data
99-
{
100-
std::vector<Point2f> s0;
101-
};
60+
void read(const FileNode& /*fn*/);
10261

10362
/**
104-
* \brief The model of AAM Algorithm
63+
* \brief Read parameters from file, currently unused
10564
*/
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+
};
147102

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
148138
};
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+
};
149149

150-
//!< initializer
151-
static Ptr<FacemarkAAM> create(const FacemarkAAM::Params &parameters = FacemarkAAM::Params() );
152-
virtual ~FacemarkAAM() {}
150+
//!< initializer
151+
static Ptr<FacemarkAAM> create(const FacemarkAAM::Params &parameters = FacemarkAAM::Params() );
152+
virtual ~FacemarkAAM() {}
153153

154-
}; /* AAM */
154+
}; /* AAM */
155155

156156
//! @}
157157

modules/face/include/opencv2/face/facemarkLBF.hpp

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -45,72 +45,72 @@ namespace face {
4545
//! @addtogroup face
4646
//! @{
4747

48-
class CV_EXPORTS_W FacemarkLBF : public Facemark
48+
class CV_EXPORTS_W FacemarkLBF : public Facemark
49+
{
50+
public:
51+
struct CV_EXPORTS Params
4952
{
53+
/**
54+
* \brief Constructor
55+
*/
56+
Params();
57+
58+
double shape_offset;
59+
//!< offset for the loaded face landmark points
60+
String cascade_face;
61+
//!< filename of the face detector model
62+
bool verbose;
63+
//!< show the training print-out
64+
65+
int n_landmarks;
66+
//!< number of landmark points
67+
int initShape_n;
68+
//!< multiplier for augment the training data
69+
70+
int stages_n;
71+
//!< number of refinement stages
72+
int tree_n;
73+
//!< number of tree in the model for each landmark point refinement
74+
int tree_depth;
75+
//!< the depth of decision tree, defines the size of feature
76+
double bagging_overlap;
77+
//!< overlap ratio for training the LBF feature
78+
79+
std::string model_filename;
80+
//!< filename where the trained model will be saved
81+
bool save_model; //!< flag to save the trained model or not
82+
unsigned int seed; //!< seed for shuffling the training data
83+
84+
std::vector<int> feats_m;
85+
std::vector<double> radius_m;
86+
std::vector<int> pupils[2];
87+
//!< index of facemark points on pupils of left and right eye
88+
89+
Rect detectROI;
90+
91+
void read(const FileNode& /*fn*/);
92+
void write(FileStorage& /*fs*/) const;
93+
94+
};
95+
96+
class BBox {
5097
public:
51-
struct CV_EXPORTS Params
52-
{
53-
/**
54-
* \brief Constructor
55-
*/
56-
Params();
57-
58-
double shape_offset;
59-
//!< offset for the loaded face landmark points
60-
String cascade_face;
61-
//!< filename of the face detector model
62-
bool verbose;
63-
//!< show the training print-out
64-
65-
int n_landmarks;
66-
//!< number of landmark points
67-
int initShape_n;
68-
//!< multiplier for augment the training data
69-
70-
int stages_n;
71-
//!< number of refinement stages
72-
int tree_n;
73-
//!< number of tree in the model for each landmark point refinement
74-
int tree_depth;
75-
//!< the depth of decision tree, defines the size of feature
76-
double bagging_overlap;
77-
//!< overlap ratio for training the LBF feature
78-
79-
std::string model_filename;
80-
//!< filename where the trained model will be saved
81-
bool save_model; //!< flag to save the trained model or not
82-
unsigned int seed; //!< seed for shuffling the training data
83-
84-
std::vector<int> feats_m;
85-
std::vector<double> radius_m;
86-
std::vector<int> pupils[2];
87-
//!< index of facemark points on pupils of left and right eye
88-
89-
Rect detectROI;
90-
91-
void read(const FileNode& /*fn*/);
92-
void write(FileStorage& /*fs*/) const;
93-
94-
};
95-
96-
class BBox {
97-
public:
98-
BBox();
99-
~BBox();
100-
BBox(double x, double y, double w, double h);
101-
102-
cv::Mat project(const cv::Mat &shape) const;
103-
cv::Mat reproject(const cv::Mat &shape) const;
104-
105-
double x, y;
106-
double x_center, y_center;
107-
double x_scale, y_scale;
108-
double width, height;
109-
};
110-
111-
static Ptr<FacemarkLBF> create(const FacemarkLBF::Params &parameters = FacemarkLBF::Params() );
112-
virtual ~FacemarkLBF(){};
113-
}; /* LBF */
98+
BBox();
99+
~BBox();
100+
BBox(double x, double y, double w, double h);
101+
102+
cv::Mat project(const cv::Mat &shape) const;
103+
cv::Mat reproject(const cv::Mat &shape) const;
104+
105+
double x, y;
106+
double x_center, y_center;
107+
double x_scale, y_scale;
108+
double width, height;
109+
};
110+
111+
static Ptr<FacemarkLBF> create(const FacemarkLBF::Params &parameters = FacemarkLBF::Params() );
112+
virtual ~FacemarkLBF(){};
113+
}; /* LBF */
114114

115115
//! @}
116116

0 commit comments

Comments
 (0)