2017-05-20 119 views
-3

我想閱讀下面的圖片:不明白的結果我有pytesseract

so here is my python script :

try: 
    import Image 
except ImportError: 
    from PIL import Image 
import pytesseract as tes 

results = tes.image_to_string(Image.open('./test.png'),boxes=True) 
print(results) 

這裏是結果,我有:

_ 239 780 263 787 0 
. 239 758 263 767 0 
L 235 737 263 761 0 
1 220 763 229 783 0 
1 220 741 229 761 0 
‘ 129 763 137 784 0 
1 129 741 136 761 0 
1 220 650 229 670 0 
‘ 220 628 229 648 0 
F 235 537 263 561 0 
. 239 531 263 540 0 
A 239 511 268 534 0 
_ 199 554 223 561 0 
I 260 401 268 421 0 
r 235 424 263 448 0 
. 239 418 263 427 0 
_ 239 398 263 404 0 
{ 220 424 229 444 0 
I 220 401 229 421 0 
「 220 288 229 331 0 

這是什麼意思 ?我如何解釋這個結果?

非常感謝!

回答

1

當您在tes.image_to_string()中設置boxes=True時,輸出爲箱形文件格式,該行中的第一個字母是識別的字符,然後是圖像中該字符出現的邊界框座標。如果boxes=False,tesseract只會輸出識別的字符。

您嘗試使用OCR的圖像是7段數字,您可能需要爲7段數字提供經過培訓的(語言)數據才能獲得良好效果。