First time here? Check out the FAQ!

Ask Your Question
0

FeatureDetector factory doesn't work

asked Feb 21 '13

I've been trying out the abstract class FeatureDetector, which has a factory method to create several child detectors. Unfortunately, this factory doesn't allow passing any parameters to the constructor, which I suspect many of the detectors need (some of the children have a member called Params). The following code caused an exception:

cv::FeatureDetector * the_detector;

the_detector= FeatureDetector::create("FAST");
vector<KeyPoint> keypoints;

the_detector->detect(img, keypoints);

However, identical handling of an automatic variable constructed with the default constructor worked just fine:

cv::FeatureDetector * the_detector;

cv::FastFeatureDetector FFD;
    // the_detector= FeatureDetector::create("FAST");
the_detector = &FFD;
vector<KeyPoint> keypoints;

the_detector->detect(img, keypoints);

I don't know what the create() method is doing, but it doesn't seem to be much good.

Preview: (hide)

Comments

can't reproduce your error on 2.4.2/win

berak gravatar imageberak (Feb 21 '13)edit

1 answer

Sort by » oldest newest most voted
0

answered Feb 21 '13

It looks like a bug. The best solution is to create ticket on OpenCV issue tracker. Also you can contribute issue solution via pull request on Github.

Preview: (hide)

Question Tools

Stats

Asked: Feb 21 '13

Seen: 197 times

Last updated: Feb 21 '13