Home > Software engineering >  OpenCV FAST Algorithm creating skewed keypoints on only part of an image
OpenCV FAST Algorithm creating skewed keypoints on only part of an image

Time:10-30

I'm trying to use OpenCV's ball.jpg

Output 1 (keypoint.x multiplied by a factor of 1/3, but missing right side)

out.jpg

Output 2 (Coordinates untouched)

out2.jpg

I'm using OpenCV 4.5.4 on MinGW.

CodePudding user response:

Most keypoint detectors use grayscale images as input. If you interpret the memory of a bgr image as grayscale, you will have 3 times the number of pixels. Y axis is still ok if the algorithm uses the width-offset per row, which most algorithms do (because this is useful when subimaging or padding is used).

I don't know whether it is a bug or a feature, that FAST doesn't check for the number of channels snd doesnt throw an exception if the wrong number of channels ist given.

You can convert the image to grayscale by cv::cvtColor with the flag cv:: COLOR_BGR2GRAY

  • Related