[python] OCR pytesseract影像辨識數字
發表於 : 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
範例
教學
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()