[英]Pytesseract does not recognize when it's just a letter
我只需要識別一個字母
但是當它只是一個字母時 OCR 無法識別!
在這種情況下,我試圖識別字母 H 但什么也沒顯示!! 我該怎么做才能讓他認出來?
from PIL import Image
from pytesseract import *
import cv2
img = cv2.imread('H.png',0)
edges = cv2.Canny(img,100,200)
img_new = Image.fromarray(edges)
text = pytesseract.image_to_string(img_new, lang='eng')
print (text)
請嘗試以下操作:
text = pytesseract.image_to_string(img_new, lang='eng', config='--psm 10')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.