标签:false mit screen opencv from bug image array int
import time
from PIL import ImageGrab
import numpy as np
import cv2
beg = time.time()
debug = False
# img = ImageGrab.grab(bbox=(250, 161, 1141, 610))
img = ImageGrab.grab()
end = time.time()
print(‘time:‘,end - beg)
img.show()
img.save("screen.jpg")
# PIL image to OpenCV image
im = np.array(img)
cv2.imshow(‘cv image‘, im)
cv2.waitKey(http://www.my516.com/heimitao/)
# OpenCV image to PIL image
im_pil = PIL.Image.fromarray(im)
im_pil.show()
标签:false mit screen opencv from bug image array int
原文地址:https://www.cnblogs.com/liyanyan665/p/11278097.html