Closed jacknonebug closed 6 years ago
你还没有导入语言包chi_sim.traineddata,上githug下载一个吧https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
还是不行啊,更改了tesseract的路径,然后报这个错误
采用方式 2 获取截图
Traceback (most recent call last):
File "D:\TopSup\GetQuestionTessAndroid.py", line 20, in
现在可以进行搜索了,但是总搜出来乱七八糟的东西
你改错文件了,找一下tesseract的路径,pytesseract是Python的文件
可以了,但是感觉google的没有百度识别准确
python小白,求指教!
采用方式 2 获取截图 Traceback (most recent call last): File "d:\TopSup\GetQuestionTessAndroid.py", line 20, in
question, choices = ocr.ocr_img(img)
File "d:\TopSup\common\ocr.py", line 76, in ocr_img
question = pytesseract.image_to_string(question_im, lang='chi_sim', config=tessdata_dir_config)
File "D:\Python\lib\site-packages\pytesseract\pytesseract.py", line 122, in image_to_string
config=config)
File "D:\Python\lib\site-packages\pytesseract\pytesseract.py", line 46, in run_tesseract
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
File "D:\Python\lib\subprocess.py", line 709, in init
restore_signals, start_new_session)
File "D:\Python\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。