import time import numpy as np from mss import mss import cv2 // 定义窗口位置和大小
bounding_box= {'top': 66, 'left': 0, 'width': 858, 'height': 466} sct = mss()
timer= time.time() while True: start = time.time() sct_img = sct.grab(
bounding_box) cv2.imshow('window', np.array(sct_img)) end = time.time() if time.
time() - timer >= 1: seconds = end - start fps = 1 / seconds timer = time.time()
print(f"time taken: {seconds} seconds (fps: {fps})") if (cv2.waitKey(25) & 0xFF)
== ord('q'): cv2.destroyAllWindows() break

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:766591547
关注微信