Mohammad Moghimi
Mohammad Moghimi

Reputation: 4696

DescrpitorExtractor::create("SIFT") returns 0?

The following piece of code outputs 0.

Ptr<DescriptorExtractor> descriptor = DescriptorExtractor::create("SIFT");
cout << descriptor << endl;

whilethis piece of code outputs a non-zero pointer.

Ptr<DescriptorExtractor> descriptor = DescriptorExtractor::create("ORB");
cout << descriptor << endl;

What should I do to fix the create sift function? I have tested it with opencv 2.4.7 and 2.4.6.1.

Upvotes: 0

Views: 59

Answers (1)

berak
berak

Reputation: 39816

SIFT and SURF are patented, nonfree.

so, to use those, you have to

  • include the "opencv2/nonfree/nonfree.hpp" header,
  • link to the opencv_nonfree.lib and
  • call cv::initModule_nonfree();
    in main() before doing anything else.

Upvotes: 2

Related Questions