Ask Your Question
0

Feature Detection Interface vs Specific Classes

asked 2013-06-28 11:03:31 -0600

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-06-28 11:31:07 -0600

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.

edit flag offensive delete link more

Comments

Thank you! Calling initModule_nonfree() worked!

arablau gravatar imagearablau ( 2013-06-28 15:45:16 -0600 )edit

Question Tools

Stats

Asked: 2013-06-28 11:03:31 -0600

Seen: 336 times

Last updated: Jun 28 '13