首页 > 其他 > 详细

使用PIL的ImageGrab模块 opcv PIL

时间:2020-02-26 01:24:40      阅读:112      评论:0      收藏:0      [点我收藏+]

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()

使用PIL的ImageGrab模块 opcv PIL

原文:https://www.cnblogs.com/enumx/p/12364886.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!