OpenCV功能不再受支持了吗?

时间:2014-04-04 20:56:36

标签: opencv identifier

我正在使用某人使用OpenCV的原始代码(http://www.shervinemami.info/faceRecognition.html)。我遇到了一些OpenCV对象没有找到的标识符,有些没有问题。

例如:

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);

这是因为OpenCV版本不同吗?

构建输出:

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 ==========

1 个答案:

答案 0 :(得分:0)

嗯,shervin很棒,但那个代码有点老了。

opencv api在此期间转移到了c ++,它现在已经开箱即用,并且似乎还有一些特别的' win32特别的'隐藏在该代码中的函数。

也许你可能想看看这里:https://github.com/MasteringOpenCV/code/tree/master/Chapter8_FaceRecognition

稍微清新的版本