Ask Your Question
0

Impossible to create SIFT detector and extractor

asked 2013-11-18 08:29:47 -0600

arthur.sw gravatar image

I'm trying to detect SIFT keypoints, using this code:

#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/nonfree/features2d.hpp"

[...]

Ptr<FeatureDetector> detector = FeatureDetector::create( "SIFT" );
vector<KeyPoint> keyPoints;
detector->detect( image, keyPoints );

The problem is that my detector pointer points to nowhere after that last line, and no error is shown in the console.

I'm using QtCreator and my .pro file contains:

LIBS += -lopencv_nonfree
CONFIG += link_pkgconfig
PKGCONFIG += opencv

so my makefile contains:

LIBS          = $(SUBLIBS) -lopencv_nonfree [...]  /usr/local/lib/libopencv_nonfree.so [...]

There is no error when loading the libraries.

I've installed opencv using those instructions.

edit retag flag offensive close merge delete

Comments

I forgot to call cv::initModule_nonfree(); before doing anything else.

arthur.sw gravatar imagearthur.sw ( 2013-11-18 08:46:58 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-01-13 04:05:40 -0600

arthur.sw gravatar image

I forgot to call cv::initModule_nonfree(); before doing anything else.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-11-18 08:29:47 -0600

Seen: 351 times

Last updated: Jan 13 '14