[python] OCR pytesseract影像辨識數字

回覆文章
Lexaul
文章: 231
註冊時間: 2019-10-18, 14:28

[python] OCR pytesseract影像辨識數字

文章 Lexaul » 2022-01-24, 13:17

參考資料:
教學
https://ithelp.ithome.com.tw/articles/10227263
https://medium.com/codingbar/%E4%B8%8D% ... 1be7f9efef
Tesseract官網
https://github.com/UB-Mannheim/tesseract/wiki

範例

代碼: 選擇全部

import pytesseract
from PIL import Image

def main():
    pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
    img = Image.open(r"temp.JPG")
    #img.show()
    print(pytesseract.image_to_string(img))


if __name__ == "__main__":
    main()
[email protected]
github.com/Lexaul

回覆文章