Search code examples
opencvfeature-detectionkeypoint

How can I get Orientation Scale Position information of keypoints in OPENCV implementation?


I only can get image features form MAT file, but I also want some other information such as positions, orientation and scale. How can I get these information, could anyone offer its code? Thank you in advance.


Solution

  • The output of feature detection is a std::vector<cv::KeyPoint>, where every keypoint contain:

    • Point2f pt: coordinates of the keypoint
    • float size: diameter of the meaningful keypoint neighborhood
    • float angle: computed orientation of the keypoint (-1 if not applicable). Its possible values are in a range [0,360) degrees. It is measured relative to image coordinate system (y-axis is directed downward), ie in clockwise.
    • float response: the response by which the most strong keypoints have been selected. Can be used for further sorting or subsampling
    • int octave: octave (pyramid layer) from which the keypoint has been extracted
    • int class_id: object id that can be used to clustered keypoints by an object they belong to