No member named 'getMat' in 'cv :: face :: FaceRecognizer'

@interface FJFaceRecognizer () { Ptr<FaceRecognizer> _faceClassifier; } @property (nonatomic, strong) NSMutableDictionary *labelsDictionary; @end @implementation FJFaceRecognizer - (NSArray *)labels { 

The following line displays the error message No member named 'getMat' in 'cv::face::FaceRecognizer' when using OpenCV 3.0:

  cv::Mat labels = _faceClassifier->getMat("labels"); if (labels.total() == 0) { return @[]; } else { NSMutableArray *mutableArray = [NSMutableArray array]; for (MatConstIterator_<int> itr = labels.begin<int>(); itr != labels.end<int>(); ++itr ) { int lbl = *itr; [mutableArray addObject:@(lbl)]; } return [NSArray arrayWithArray:mutableArray]; } } } 

What should be used instead of getMat in OpenCV 3.0?

+3
source share
1 answer

If you want std::vector<int> shortcuts, you should use getLabelsByString

http://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html

Maybe you should take a look at the transition guide from 2 to 3

http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html

+1
source

Source: https://habr.com/ru/post/985712/


All Articles