簡體   English   中英

pytesseract的不同輸出

[英]Different output with pytesseract

為什么我使用tesseractpytesseract獲得不同的輸出?
在tesseract中:

tesseract t10.tiff output -1 eng

在python中

ocr_text = pytesseract.image_to_string(image, lang='eng', config='-psm 3').

如果仔細查看pytesseract.run_tesseract(),您會看到pytesseract運行一個子進程,該子進程創建另一個.PNG文件,然后在該圖像上運行tesseract子進程。 我在創建文件后立即放置了python調試器,並嘗試將文件復制到磁盤上以進行檢查。 原來,文件顏色配置文件與原始圖像不同。 此外,新圖像具有3個顏色通道,而原始圖像具有alpha通道。 嘗試在此新映像上從命令行運行tesseract,您將獲得與在原始映像上運行pytesseract相同的結果。 生成的PNG與原始png

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM