python | 이미지 비교
페이지 정보
작성자 굿스웹 작성일19-08-29 16:28 조회896회 댓글0건관련링크
본문
import pyautogui
import schedule
import sched, time
import numpy
import pytesseract
from PIL import Image, ImageEnhance, ImageFilter, ImageGrab
import re
import cv2
import configparser
import os
from PIL import Image
from pytesseract import *
from PIL import Image
from pytesseract import *
def txtsh():
text = 0
image = Image.open('yy5.jpg')
print( pytesseract.image_to_string(image))
def sh(a,b):
backWidth, backHeight = pyautogui.size()
mousePositionX, mousePositionY = pyautogui.position()
imgGrab = ImageGrab.grab(bbox=(float(a - 30), float(b - 20), a + 30, b + 20))
cv_img = cv2.cvtColor(numpy.array(imgGrab), cv2.COLOR_RGB2BGR)
cv2.imshow('image',cv_img)
cv2.imread('--------------.jpg', cv2.IMREAD_COLOR)
imgGrab.save("--------------.jpg")
#cv2 .waitKey(0)
cv2.destroyAllWindows()
exit()
def sleeper():
while True:
try:
five_btn = pyautogui.locateOnScreen('8.png',grayscale=False)
center = pyautogui.center(five_btn)
#print(center.x + 'x' + center.x)
print(center)
#pyautogui .moveTo(center.x,center.y, duration=2, tween=pyautogui.easeInOutQuad )
if five_btn != None:
print('찾았어요')
sh(center.x,center.y)
break
except KeyboardInterrupt:
exit()
except:
print('검색중')
time.sleep(5)
#time .sleep(4.01)
try:
sleeper()
#txtsh ()
except KeyboardInterrupt:
print('\n\nKeyboard exception received. Exiting.')
exit()
#pip #install pillow
pip install pytesseract
pyautogui.PAUSE = 2.5
pyautogui.moveTo(200, 200)
pyautogui.click()
pyautogui.hotkey('ctrl', 's')
print(five_btn)
print(center)
pyautogui.click(center)
backWidth, backHeight = pyautogui.size()
mousePositionX, mousePositionY = pyautogui.position()
python -m pip install opencv_python
pip install tox