0

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?

enter image description here

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

Mike
  • 11
  • 1
  • 5
  • 1
    Please provide more information and show the code you have already written. – Fabian Damken Jun 11 '16 at 18:51
  • To be honest: The image quality is so bad I would have problems determining if one white dot is just one or multiple points. If a program can count these (like http://stackoverflow.com/a/5304140/2607571) it would not be accurate. – Simon Kirsten Jun 11 '16 at 20:32

0 Answers0