Reputation: 1201
i am using ubuntu 12.04, and i have installed opencv 2.4 (actually, i installed ROS, opencv gets installed with it) i am trying to run this demo and i am getting this error:
usama@ubuntu:~/Desktop/opencv/Advanced/Face Recognition$ g++ `pkg-config opencv --cflags` face_recog.cpp -o face_recog `pkg-config opencv --libs`
face_recog.cpp: In function ‘int main(int, const char**)’:
face_recog.cpp:119:30: error: ‘class cv::FaceRecognizer’ has no member named ‘getMat’
face_recog.cpp:121:20: error: ‘class cv::FaceRecognizer’ has no member named ‘getMat’
facerecog.cpp:123:23: error: ‘class cv::FaceRecognizer’ has no member named ‘getMat’
Any idea, how can i get rid of this error ? should i upgrade opencv to a new version ?
Upvotes: 1
Views: 1817
Reputation: 3797
Only since OpenCV 2.4.2 you can use the cv::Algorithm functions like getMat(...)
for the cv::FaceRecognizer. The cv::FaceRecognizer in (the official) OpenCV 2.4.0 and OpenCV 2.4.1 wasn't based on cv::Algorithm, so the examples from the OpenCV 2.4.2 documentation won't work with the OpenCV 2.4.0/2.4.1 release.
So yes, I would suggest updating to OpenCV 2.4.2. It's been officially released some days ago, see the new user page at http://www.opencv.org.
If you can't update OpenCV, then you could either try a OpenCV 2.4.0/2.4.1 compatible demo:
Or you give libfacerec a try, which has the same interface as the OpenCV 2.4.2 implementation:
It really depends on your OpenCV Version. If you are using OpenCV 2.3, then try the version 0.04 of libfacerec. However, if you are using OpenCV 2.4.2 already and you have problems, then please issue a bug on the official OpenCV bugtracker:
In case you didn't notice. You can also ask OpenCV related questions on:
Where a lot of OpenCV experts are.
Upvotes: 3