Question

I am using someone's raw code (http://www.shervinemami.info/faceRecognition.html) that uses OpenCV . I am encountering so not found identifiers for some OpenCV objects and some do not have the problem.

For example:

CvRect ROI = cvRect(x, y, w, h);
cvSetImageROI(bigImg, ROI);
cvCopyImage(byteImg, bigImg);   //For example here only this function is making problems
cvResetImageROI(bigImg);
cvReleaseImage(&byteImg);

Is this because of different OpenCV versions?

The build output:

1>------ Build started: Project: OnlineFaceRec, Configuration: Debug Win32 ------
1>Build started 04.04.2014 21:47:28.
1>InitializeBuildStatus:
1>  Creating "Debug\OnlineFaceRec.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  OnlineFaceRec.cpp
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(220): error C3861: 'cvCopyImage': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(255): error C3861: 'cvEigenDecomposite': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(308): error C2065: 'fileStorafge' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(402): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(440): error C2065: 'CV_EIGOBJ_NO_CALLBACK' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(436): error C3861: 'cvCalcEigenObjects': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(554): error C3861: 'cvEigenDecomposite': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(605): error C3861: 'Sleep': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(631): error C3861: 'cvCvtColor': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(660): error C3861: 'cvResize': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(665): error C3861: 'cvResize': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(763): error C3861: 'cvCvtColor': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(843): error C2065: 'FALSE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(849): error C2065: 'FALSE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(909): error C2065: 'VK_ESCAPE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(936): error C2065: 'TRUE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(943): error C2065: 'FALSE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(962): error C2065: 'FALSE' : undeclared identifier
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(996): error C3861: 'cvEqualizeHist': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(1006): error C3861: 'cvEigenDecomposite': identifier not found
1>c:\users\faraz\desktop\onlinefacerec\onlinefacerec.cpp(1062): error C2065: 'VK_ESCAPE' : undeclared identifier
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:02.52
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Was it helpful?

Solution

hmm, shervin is great, but that code is a bit old.

the opencv api moved to c++ in the meantime, it has a proper facerecognition out of the box now, and also there seem to be some 'win32 special' functions hidden in that code.

maybe you might want to take a look here: https://github.com/MasteringOpenCV/code/tree/master/Chapter8_FaceRecognition

for a slightly fresher version

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top