Ask Your Question
0

Feature Detection Interface vs Specific Classes

asked Jun 28 '13

arablau gravatar image

Hi everyone,

I was wondering what the difference is between cv::FeatureDetector and specific classes like cv::SIFT.

If I create an instance of cv::SIFT as follows, my code works:

cv::SIFT sift;

// Detect key points and extract descriptors
std::cout << "Detecting key points" << std::endl;
sift(front, cv::Mat(), frontKeyPoints, frontDescriptors);

but if I try to use the cv::FeatureDetector::create my program crashes!

// Create SIFT feature detector    
siftDetector = cv::FeatureDetector::create("SIFT");

// Detect key points
std::cout << "Detecting key points" << std::endl;
siftDetector->detect(front, frontKeyPoints);

Why does the FeatureDetector crash? Is one better to use than the other?

Thanks

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Jun 28 '13

BeS gravatar image

Can you write initModule_nonfree () before calling siftDetector = cv :: FeatureDetector :: create ("SIFT")? Probably cv :: FeatureDetector :: create ("SIFT") returns you to the null pointer. This occurs because the algorithm SIFT and SURF are outside module features2d.

Preview: (hide)

Comments

Thank you! Calling initModule_nonfree() worked!

arablau gravatar imagearablau (Jun 28 '13)edit

Question Tools

Stats

Asked: Jun 28 '13

Seen: 445 times

Last updated: Jun 28 '13