@@ -103,12 +103,11 @@ class FacemarkAAMImpl : public FacemarkAAM {
103
103
104
104
bool getData (void * items) CV_OVERRIDE;
105
105
106
- bool fitConfig ( InputArray image, InputArray roi, OutputArrayOfArrays _landmarks, const std::vector<Config> &runtime_params ) CV_OVERRIDE;
106
+ bool fitConfig ( InputArray image, const std::vector<Rect>& roi, std::vector<std::vector<Point2f> >& _landmarks, const std::vector<Config> &runtime_params ) CV_OVERRIDE;
107
107
108
108
protected:
109
109
110
- bool fit ( InputArray image, InputArray faces, OutputArrayOfArrays landmarks ) CV_OVERRIDE;
111
- // bool fit( InputArray image, InputArray faces, InputOutputArray landmarks, void * runtime_params);//!< from many ROIs
110
+ bool fit ( InputArray image, const std::vector<Rect>& faces, CV_OUT std::vector<std::vector<Point2f> >& landmarks ) CV_OVERRIDE;
112
111
bool fitImpl ( const Mat image, std::vector<Point2f>& landmarks,const Mat R,const Point2f T,const float scale, const int sclIdx=0 );
113
112
114
113
bool addTrainingSample (InputArray image, InputArray landmarks) CV_OVERRIDE;
@@ -323,19 +322,18 @@ void FacemarkAAMImpl::training(void* parameters){
323
322
if (params.verbose ) printf (" Training is completed\n " );
324
323
}
325
324
326
- bool FacemarkAAMImpl::fit ( InputArray image, InputArray roi, OutputArrayOfArrays _landmarks )
325
+ bool FacemarkAAMImpl::fit ( InputArray image, const std::vector<Rect>& roi, CV_OUT std::vector<std::vector<Point2f> >& _landmarks )
327
326
{
328
327
std::vector<Config> config; // empty
329
328
return fitConfig (image, roi, _landmarks, config);
330
329
}
331
330
332
- bool FacemarkAAMImpl::fitConfig ( InputArray image, InputArray roi, OutputArrayOfArrays _landmarks, const std::vector<Config> &configs )
331
+ bool FacemarkAAMImpl::fitConfig ( InputArray image, const std::vector<Rect>& roi, std::vector<std::vector<Point2f> >& _landmarks, const std::vector<Config> &configs )
333
332
{
334
- std::vector<Rect> & faces = *(std::vector<Rect> *) roi. getObj () ;
333
+ const std::vector<Rect> & faces = roi;
335
334
if (faces.size ()<1 ) return false ;
336
335
337
- std::vector<std::vector<Point2f> > & landmarks =
338
- *(std::vector<std::vector<Point2f> >*) _landmarks.getObj ();
336
+ std::vector<std::vector<Point2f> > & landmarks = _landmarks;
339
337
landmarks.resize (faces.size ());
340
338
341
339
Mat img = image.getMat ();
0 commit comments