Getting error while compiling sampleDetectLandmarks.cpp [closed]
I was trying to compiling sampleDetectLandmarks.cpp but I'm getting this error please help me resolving this error
sampleDetectLandmarks.cpp: In function ‘int main(int, char**)’:
sampleDetectLandmarks.cpp:69:5: error: ‘FacemarkKazemi’ has not been declared
FacemarkKazemi::Params params;
^~~~~~~~~~~~~~
sampleDetectLandmarks.cpp:70:9: error: ‘FacemarkKazemi’ was not declared in this scope
Ptr<FacemarkKazemi> facemark = FacemarkKazemi::create(params);
^~~~~~~~~~~~~~
sampleDetectLandmarks.cpp:70:23: error: template argument 1 is invalid
Ptr<FacemarkKazemi> facemark = FacemarkKazemi::create(params);
^
sampleDetectLandmarks.cpp:70:36: error: ‘FacemarkKazemi’ is not a class, namespace, or enumeration
Ptr<FacemarkKazemi> facemark = FacemarkKazemi::create(params);
^~~~~~~~~~~~~~
sampleDetectLandmarks.cpp:70:59: error: ‘params’ was not declared in this scope
Ptr<FacemarkKazemi> facemark = FacemarkKazemi::create(params);
^~~~~~
sampleDetectLandmarks.cpp:70:59: note: suggested alternative: ‘parser’
Ptr<FacemarkKazemi> facemark = FacemarkKazemi::create(params);
^~~~~~
parser
sampleDetectLandmarks.cpp:71:13: error: base operand of ‘->’ is not a pointer
facemark->setFaceDetector((FN_FaceDetector)myDetector, &face_cascade);
^~
sampleDetectLandmarks.cpp:71:32: error: ‘FN_FaceDetector’ was not declared in this scope
facemark->setFaceDetector((FN_FaceDetector)myDetector, &face_cascade);
^~~~~~~~~~~~~~~
sampleDetectLandmarks.cpp:71:32: note: suggested alternative: ‘myDetector’
facemark->setFaceDetector((FN_FaceDetector)myDetector, &face_cascade);
^~~~~~~~~~~~~~~
myDetector
sampleDetectLandmarks.cpp:72:13: error: base operand of ‘->’ is not a pointer
facemark->loadModel(filename);
^~
sampleDetectLandmarks.cpp:75:41: error: ‘INTER_LINEAR_EXACT’ was not declared in this scope
resize(img,img,Size(460,460), 0, 0, INTER_LINEAR_EXACT);
^~~~~~~~~~~~~~~~~~
sampleDetectLandmarks.cpp:75:41: note: suggested alternative: ‘CV_INTER_LINEAR’
resize(img,img,Size(460,460), 0, 0, INTER_LINEAR_EXACT);
^~~~~~~~~~~~~~~~~~
CV_INTER_LINEAR
sampleDetectLandmarks.cpp:76:13: error: base operand of ‘->’ is not a pointer
facemark->getFaces(img,faces);
^~
sampleDetectLandmarks.cpp:82:20: error: base operand of ‘->’ is not a pointer
if(facemark->fit(img,faces,shapes))
Have you compiled opencv_contrib using cmake?
yes, this is the cmake i have done.
There is no problem with this sample (in windows or raspberry). Can you explain how do you get those error messages? Are you sure that you haven't got an old version of opencv?
You can check this with cout<<getbuildinformation()<<endl;< p="">
my current OpenCV version is 3.2.0, while compiling the sample face landmarks as mentioned in this link I got that error message.
You cannot use this sample with opencv3.2 :
contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenCV
1 update (git ull) opencv repo
2 update (git ull) opencv_contrib repo
3 rebuild everything using camke