【问题标题】:Get X and Y coordinates of white dot in a black screen python [closed]在黑屏python中获取白点的X和Y坐标[关闭]
【发布时间】:2023-04-06 05:19:01
【问题描述】:

是否有python库可以检测黑色背景png图像中白点的像素坐标并返回其坐标的NumPy数组

即。

【问题讨论】:

标签: python opencv


【解决方案1】:

您可以通过numpy.where 找到白点。你可以这样试试:

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)

【讨论】:

  • 你好有没有办法让中心像素比一大堆像素
猜你喜欢
  • 2022-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-17
  • 1970-01-01
  • 2014-12-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多