화면에서 일부 숫자를 감지하기 위해 현재 화면의 일부를 캡처하려고했지만 코드 실행시이 오류가 발생했습니다.
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/bot/detect_num.py", line 12, in <module>
print(pytesseract.image_to_string(Image.open('test.jpg')))
File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string
config=config)
File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract
stderr=subprocess.PIPE)
File "C:\Python35\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\Python35\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
소스 코드:
import pyscreenshot as ImageGrab
from PIL import Image
import subprocess
from pytesseract import *
if __name__=="__main__":
im = ImageGrab.grab(bbox=(1349, 34, 1357, 45))
im = im.convert('1')
im.save('test.jpg', 'JPEG')
im.show()
print(pytesseract.image_to_string(Image.open('test.jpg')))
누군가가 이유와 해결 방법을 알려주십시오.
여기서 문제는 필요한 종속성을 설치하지 않았다는 것입니다. pyteseeract
의 문서 를 읽을 때 다음 텍스트가 표시됩니다.
아직 해당 단계를 수행하지 않은 것 같으므로 tesseract
실제로 필요한 OCR 작업을 수행하는 명령이 없습니다 .
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다