I need to recognize only one letter
But OCR does not recognize when it's just a letter!
in this case I am trying to recognize the letter H but nothing shows up !! What can I do to make him recognize?
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')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.