Ask Your Question
0

FeatureDetector factory doesn't work

asked 2013-02-20 19:59:14 -0600

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.

edit retag flag offensive close merge delete

Comments

can't reproduce your error on 2.4.2/win

berak gravatar imageberak ( 2013-02-21 04:05:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-02-21 00:24:35 -0600

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-20 19:59:14 -0600

Seen: 193 times

Last updated: Feb 21 '13