-2
如何捕獲使用python我想這個代碼在屏幕的中心,但它給了我錯誤,每當我彌補了以上參數200圖像捕獲屏幕的中心使用python
import numpy as np
from PIL import ImageGrab
import cv2
while(True):
printscreen_pil = ImageGrab.grab(bbox=(0,200,500,200))
printscreen_numpy = np.array(printscreen_pil.getdata(),dtype='uint8')\
.reshape((printscreen_pil.size[1],printscreen_pil.size[0],3))
cv2.imshow('window',printscreen_numpy)
if cv2.waitKey(25) & 0xFF == ord('q'):
cv2.destroyAllWindows()
break
將示例圖像添加到捕獲的問題和輸出中,以顯示屏幕圖像的中心。 OP應該明確地描述問題以避免任何猜測。 – thewaywewere