我试着用Python的OpenCV实时(视频)显示我的屏幕。你知道吗
当我运行代码时,它会打开很多窗口,而不是只替换一个窗口上的框架。你知道吗
请帮忙:)
代码如下:
import numpy as np
import cv2
from mss import mss
sct = mss()
monitor = {'top': 0, 'left': 0, 'width': 1920, 'height': 1080}
while True:
img = sct.grab(monitor)
cv2.imshow("Netstream", np.array(img))
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
我不能管理图书馆,但可以试试。只是一些假设而已。你知道吗
img=sct.抓斗(监视器)在while循环之前写入
使用img代替np.数组(img)
使用cv2.destroyWindow(“Netstream”)before break语句
相关问题 更多 >
编程相关推荐