Ask Your Question

extractor.compute clears keypoints

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

stillNovice gravatar image

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

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;
   = 232;
   = 132;

            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


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 -0500 )edit

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

stillNovice gravatar imagestillNovice ( 2015-06-24 10:59:24 -0500 )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 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

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

LBerger gravatar image

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

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


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

Seen: 140 times

Last updated: Jun 24 '15