Skip to content

Commit f00b9c8

Browse files
committed
face: attempt opencv#1 (kazemi)
1 parent 53986aa commit f00b9c8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

modules/face/include/opencv2/face/face_alignment.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ namespace face{
1111
class CV_EXPORTS_W FacemarkKazemi : public Algorithm
1212
{
1313
public:
14-
struct CV_EXPORTS Params
14+
struct CV_EXPORTS_W_SIMPLE Params
1515
{
1616
/**
1717
* \brief Constructor
1818
*/
19-
Params();
19+
CV_PROP Params();
2020
/// cascade_depth This stores the deapth of cascade used for training.
21-
unsigned long cascade_depth;
21+
CV_PROP_RW unsigned long cascade_depth;
2222
/// tree_depth This stores the max height of the regression tree built.
23-
unsigned long tree_depth;
23+
CV_PROP_RW unsigned long tree_depth;
2424
/// num_trees_per_cascade_level This stores number of trees fit per cascade level.
25-
unsigned long num_trees_per_cascade_level;
25+
CV_PROP_RW unsigned long num_trees_per_cascade_level;
2626
/// learning_rate stores the learning rate in gradient boosting, also reffered as shrinkage.
27-
float learning_rate;
27+
CV_PROP_RW float learning_rate;
2828
/// oversampling_amount stores number of initialisations used to create training samples.
29-
unsigned long oversampling_amount;
29+
CV_PROP_RW unsigned long oversampling_amount;
3030
/// num_test_coordinates stores number of test coordinates.
31-
unsigned long num_test_coordinates;
31+
CV_PROP_RW unsigned long num_test_coordinates;
3232
/// lambda stores a value to calculate probability of closeness of two coordinates.
33-
float lambda;
33+
CV_PROP_RW float lambda;
3434
/// num_test_splits stores number of random test splits generated.
35-
unsigned long num_test_splits;
35+
CV_PROP_RW unsigned long num_test_splits;
3636
/// configfile stores the name of the file containing the values of training parameters
37-
String configfile;
37+
CV_PROP_RW String configfile;
3838
};
39-
static Ptr<FacemarkKazemi> create(const FacemarkKazemi::Params &parameters = FacemarkKazemi::Params());
39+
CV_WRAP static Ptr<FacemarkKazemi> create(const FacemarkKazemi::Params &parameters = FacemarkKazemi::Params());
4040
virtual ~FacemarkKazemi();
4141

4242
/// @brief training the facemark model, input are the file names of image list and landmark annotation
@@ -54,13 +54,13 @@ class CV_EXPORTS_W FacemarkKazemi : public Algorithm
5454
/** @brief This function is used to load the trained model..
5555
*@param filename A variable of type cv::String which stores the name of the file in which trained model is stored.
5656
*/
57-
virtual void loadModel(String filename)=0;
57+
CV_WRAP virtual void loadModel(String filename)=0;
5858
/** @brief This functions retrieves a centered and scaled face shape, according to the bounding rectangle.
5959
*@param image A variable of type cv::InputArray which stores the image whose landmarks have to be found
6060
*@param faces A variable of type cv::InputArray which stores the bounding boxes of faces found in a given image.
6161
*@param landmarks A variable of type cv::InputOutputArray which stores the landmarks of all the faces found in the image
6262
*/
63-
virtual bool fit( InputArray image, InputArray faces, InputOutputArray landmarks )=0;//!< from many ROIs
63+
CV_WRAP virtual bool fit( InputArray image, InputArray faces, OutputArray landmarks )=0;//!< from many ROIs
6464
/// set the custom face detector
6565
virtual bool setFaceDetector(bool(*f)(InputArray , OutputArray, void*), void* userData)=0;
6666
/// get faces using the custom detector

modules/face/src/getlandmarks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void FacemarkKazemiImpl :: loadModel(String filename){
163163
f.close();
164164
isModelLoaded = true;
165165
}
166-
bool FacemarkKazemiImpl::fit(InputArray img, InputArray roi, InputOutputArray landmarks){
166+
bool FacemarkKazemiImpl::fit(InputArray img, InputArray roi, OutputArray landmarks){
167167
if(!isModelLoaded){
168168
String error_message = "No model loaded. Aborting....";
169169
CV_Error(Error::StsBadArg, error_message);
@@ -241,4 +241,4 @@ bool FacemarkKazemiImpl::fit(InputArray img, InputArray roi, InputOutputArray la
241241
return true;
242242
}
243243
}//cv
244-
}//face
244+
}//face

0 commit comments

Comments
 (0)