OpenCV return keypoints coordinates and area from blob detection, Python

后端 未结 2 1822
情歌与酒
情歌与酒 2021-02-19 06:18

I followed a blob detection example (using cv2.SimpleBlobDetector) and successfully detected the blobs in my binary image. But then I don\'t know how to extract the

2条回答
  •  天涯浪人
    2021-02-19 07:09

    If you have a list of keypoints. Then you can print as shown below

    for keyPoint in keyPoints:
        x = keyPoint.pt[0]
        y = keyPoint.pt[1]
        s = keyPoint.size
    

    Edit: Size determines the diameter of the meaningful keypoint neighborhood. You can use that size and roughly calculate the area of the blob.

提交回复
热议问题