image_output_1.png
import cv2 as cv

import matplotlib.pyplot as plt

import numpy as np

blob = plt.imread('../input/opencv-samples-images/blobs.jpg')
blob_gray = cv.cvtColor(blob, cv.COLOR_RGB2GRAY)

detector = cv.SimpleBlobDetector_create()

keypoints = detector.detect(blob_gray)
keypoints

im_with_keypoints = cv.drawKeypoints(
    blob_gray,
    keypoints,
    np.array([]),
    (255,0,), 
    cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS
)

coun = plt.imread('../input/opencv-samples-images/data/blox.jpg')
_, coun_thresh = cv.threshold(cv.cvtColor(coun, cv.COLOR_RGB2GRAY), 180, 255, cv.THRESH_BINARY)
plt.imshow(coun_thresh)
plt.show()