1
votes

I cannot figure out how keypoints in the output of the ORB algorithm are ranked in OpenCV.

What I know by testing it on some samples is that it’s not by position on the frame, and I think it’s not as well by the score the algorithm assigned to each keypoint.

My aim would be to rank the keypoints by their score. Best features to worst features. Am I missing something or is it unfeasible without changing the code source of the ORB algorithm?

1

1 Answers

0
votes

In the OpenCV source, there's a comment and code that indicates that keypoints are clustered by image pyramid level. See: OpenCV Orb code on github. Within each image pyramid level, keypoints are selected using OpenCV's FastFeatureDetector, which scans by rows then columns, computing corner scores. So the result would be that the output keypoints would be sorted neither by image location nor by keypoint score, as you noted, if you use an image pyramid. It seems like maybe the Python lib doesn't allow you to set the number of image pyramid levels? But the C++ API does (see: http://docs.opencv.org/trunk/db/d95/classcv_1_1ORB.html).

In any case, you should be able to set the number of keypoints retained by using an input argument in Python, so you might not care about ranking them. From what I can tell, you might only want to rank the keypoints by score in order to discard low scoring points, which can be done with the API already. See: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_orb/py_orb.html#orb-in-opencv