Cuando intento ejecutar la muestra find_obj.cpp
o cualquier programa OpenCV SURF, aparece el siguiente error en el símbolo del sistema al ejecutar el código. El proyecto se construye sin errores y advertencias. Estoy usando VS2011 beta, OpenCV 2.4 y Windows7.La función OpenCV SURF no está implementada
mensaje de error:
OpenCV Error: The function/feature is not implemented < OpenCV was built without SURF support> in unknown function,file ..\..\..\src\opencv\modules\legacy\src\features2d.cpp, line 77
me trató de construir el OpenCV 2.4 utilizando de nuevo Cmake y luego VS2011 en modo de depuración y luego agregó los caminos lib en el IDE, pero todavía no hay resultado.
¿Cómo puedo solucionar eso?
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/legacy/legacy.hpp>
#include <opencv2/legacy/compat.hpp>
#include <opencv2/flann/flann.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/nonfree/nonfree.hpp>
using namespace std;
using namespace cv;
int main()
{
cv::initModule_nonfree();//THIS LINE IS IMPORTANT
IplImage *image1 = cvLoadImage("C:\\SURF\\1.jpg");
IplImage *image2 = cvLoadImage("C:\\SURF\\2.jpg");
CvMemStorage* memoryBlock = cvCreateMemStorage();
CvSeq* image1KeyPoints;
CvSeq* image1Descriptors;
CvSeq* image2KeyPoints;
CvSeq* image2Descriptors;
// Only values with a hessian greater than 500 are considered for keypoints
CvSURFParams params = cvSURFParams(500, 1);
cvExtractSURF(image1, 0, &image1KeyPoints, &image1Descriptors, memoryBlock, params);
cvExtractSURF(image2, 0, &image2KeyPoints, &image2Descriptors, memoryBlock, params);
return 0;
}
ya i googled los foros OpenCV e incluí la opencv_nonfree240.lib ..y las cabeceras son 1 ...... opencv2/objdetect/objdetect.hpp ....... 2 ..... .opencv2/features2d/features2d.hpp ..... 3 ......opencv2/highgui/highgui.hpp ...... 4 ...... opencv2/calib3d/calib3d.hpp ..... 5 ...... opencv2/nonfree/nonfree.hpp .. .... 6 ...... opencv2/imgproc/imgproc_c.h ....... 7 ...... opencv2/legacy/legacy.hpp ...... 8. ..... opencv2/legacy/compat.hpp ...... –
@Astor .... en el IDE ... configuré el camino a C: \ OpenCV2.4 \ opencv \ build \ x86 \ vc10 \ lib ... he guardado el archivo opencv2.4 en la unidad c ... la carpeta bin contiene todos los dll en los que he comprobado que contiene el archivo opencv_nonfree240.dll ... y en las dependencias adicionales que he proporcionado a opencv_nonfree240. lib –
library directories = C: \ OpenCV2.4 \ opencv \ build \ x86 \ vc10 \ lib dependencias adicionales = opencv_nonfree240.lib esta es mi configuración en VS2011 –