-5

Is there a python library to detect the pixel's coordinate of white dots in a black background png image and return a NumPy array of its coordinates

ie.

black screen white dot

Hussien Mostafa
  • 159
  • 2
  • 18
  • OpenCV can solve this – Maximilian Freitag Jan 31 '22 at 09:06
  • please review [ask]. question was tagged OpenCV by author, so the author knows about OpenCV. this question simply lacks research effort (searching for answers). perhaps this? https://stackoverflow.com/questions/8076889/how-to-use-opencv-simpleblobdetector or browse the tutorials on https://docs.opencv.org – Christoph Rackwitz Jan 31 '22 at 11:44

1 Answers1

2

You can find white dot by numpy.where. You can try this way:

import numpy as np 
import cv2 

img = cv2.imread('XXWck.png')

x, y, z = np.where(img==(255,255,255))
points = zip(x,y)
print(points)
bao.le
  • 146
  • 1
  • 4