I need to detect lights in this image and to count number of them but simple minThreshold
and maxThreshold
in Open CV don't work. How can I detect this?
This code I try to use
import cv2
import numpy as np;
im = cv2.imread("test.png", cv2.IMREAD_GRAYSCALE)
params = cv2.SimpleBlobDetector_Params()
params.minThreshold = 0
params.maxThreshold = 255
params.filterByArea = True
params.minArea = 1
params.maxArea = 50
params.filterByCircularity = False
params.filterByConvexity = False
params.filterByInertia = False
detector = cv2.SimpleBlobDetector(params)
keypoints = detector.detect(im)
im_with_keypoints = cv2.drawKeypoints(im,keypoints, np.array([]), (0,0,255), cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
cv2.imshow("Keypoints", im_with_keypoints)
cv2.waitKey(0)
But it works very strange enter image description here