Ask Your Question

I want to run surf example in toturial

asked 2012-11-13 08:13:34 -0500

sara gravatar image

updated 2012-11-20 09:24:34 -0500

SR gravatar image

Hi all ,

I am reading toturial (from the opencv site) and I want to run surf example . but it doesn't know the features2d.hpp and .h file . It ends up with 14 error .

edit retag flag offensive close merge delete


@sara Can you post your error here ? so we can better know them and answer you

FLY gravatar imageFLY ( 2013-08-23 05:27:33 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2012-11-13 08:42:12 -0500

SR gravatar image

updated 2012-11-13 12:21:54 -0500

See for an example.

If you use SURF or SIFT you must include the headers for the "nonfree" module (since OpenCV 2.4):

#include <cxcore.h>
#include <cv.h>
    #include <opencv2/features2d/features2d.hpp>
    #include <opencv2/nonfree/nonfree.hpp>

Depending on how you use these features, etc. you may need to call cv::initModule_features2d(), cv::initModule_nonfree() before first use.

edit flag offensive delete link more


Hi thanks a lot for answering but I am using opencv 2.2 . what should I do now ? I have not nonfree folder att all.

sara gravatar imagesara ( 2012-11-18 14:09:22 -0500 )edit

IIRC it is sufficient to include "cxcore.h", "cv.h" in OpenCV 2.2. "cv.h" itself then includes "features2d.hpp". Omit the nonfree module.

SR gravatar imageSR ( 2012-11-19 01:44:42 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2012-11-13 08:13:34 -0500

Seen: 1,066 times

Last updated: Nov 13 '12