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
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.
The pt
property:
keypoints = detector.detect(frame) #list of blobs keypoints
x = keypoints[i].pt[0] #i is the index of the blob you want to get the position
y = keypoints[i].pt[1]
Some documentation