a_parida
a_parida

Reputation: 626

Filled Circle drawKeypoints

I am new to opencv and I am doing a blob detection on a image and then draw circles around each blob using the command-

im_with_keypoints = cv2.drawKeypoints(im, keypoints, np.array([]), (0,0,255), cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

I get the output as: Output Image of the blob detection

What I want to know is that how can I get these red circles as filled circles?

Upvotes: 1

Views: 1564

Answers (1)

Tanay
Tanay

Reputation: 661

You have the keypoints and the image so try this code.

def draw_keypoints(img, keypoints, color=(0, 255, 255)):
    for kp in keypoints:
        x, y = kp.pt
        cv2.circle(img, (int(x), int(y)), color=color, radius=10, thickness=-1) # you can change the radius and the thickness

Upvotes: 2

Related Questions