Ask Your Question
0

extractor.compute clears keypoints

asked 2015-06-24 10:44:25 -0600

stillNovice gravatar image

updated 2015-06-24 10:44:55 -0600

If I run any one of the descriptor extractors, it clears the keypoints and returns no descriptors.

Even this simple test case:

            cv::Mat descriptorsTest;
            std:vector<cv::KeyPoint> tester;
            cv::KeyPoint test;
            test.pt.x = 232;
            test.pt.y = 132;
            tester.push_back(test);

            OrbDescriptorExtractor extractor;                               //tester.size = 1;
            extractor.compute(img1, tester, descriptorsTest);       //tester.size = 0;

As I step through, tester fills up so that its size is 1. As soon as the extractor.compute runs, the size goes to 0.

Why is this happening?

edit retag flag offensive close merge delete

Comments

Ah i see. What i am trying to do is detect keypoints, TRACK those keypoints using optical flow, then calculate descriptors of the new, tracked positions of the points. Is this possible?

stillNovice gravatar imagestillNovice ( 2015-06-24 10:57:34 -0600 )edit

or, would the descriptors be the same, no matter the position of the point?

stillNovice gravatar imagestillNovice ( 2015-06-24 10:59:24 -0600 )edit

For example if you have corners in your image you are not fixed position. You have to detect it. In your second image you have to look for corners and try to match with corners detected in previous image. Of course you can detect many feature like orb kaze akaze .. All mean that around keypoint pixels properties are particular and sometimes invariant by rotation translation ...

LBerger gravatar imageLBerger ( 2015-06-24 11:24:00 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-24 10:50:59 -0600

LBerger gravatar image

updated 2015-06-24 12:19:44 -0600

You must detect first

Ptr<Feature2D> b;
vector<KeyPoint> keyImg1;       /*<! keypoint  for img1 */
Mat descImg1;         /*<! Descriptor for img1 */
b = ORB::create();
b->detect(img1, keyImg1, Mat());
b->compute(img1, keyImg1, descImg1);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-06-24 10:44:25 -0600

Seen: 172 times

Last updated: Jun 24 '15