1 Star 0 Fork 45

ferry / PUBG

forked from LookOutTheBush / PUBG 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Screen.py 613 Bytes
一键复制 编辑 原始数据 按行查看 历史
LookOutTheBush 提交于 2023-04-27 21:37 . aa
import cv2
import numpy
import pyautogui
def adaptive_binarization(img):
#自适应二值化
maxval = 255
blockSize = 3
C = 5
img2 = cv2.adaptiveThreshold(img, maxval, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, blockSize, C)
return img2
# 屏幕截图
def shotCut(x, y, w, h):
im = pyautogui.screenshot(region=[x, y, w, h])
screen = cv2.cvtColor(numpy.asarray(im), cv2.COLOR_BGR2GRAY)
temp = adaptive_binarization(screen)
return temp
def shotCutTest():
img = cv2.imread(r'./resource/shotcut/screen.bmp', 0)
temp = adaptive_binarization(img)
return temp
1
https://gitee.com/kucha_065/PUBG.git
git@gitee.com:kucha_065/PUBG.git
kucha_065
PUBG
PUBG
master

搜索帮助