python text recognition

42

import cv2 
import pytesseract

img = cv2.imread('image.jpg')

# Adding custom options
custom_config = r'--oem 3 --psm 6'
pytesseract.image_to_string(img, config=custom_config)
import pytesseract
import cv2

img = cv2.imread('test.jpg')
img = cv2.resize(img, (720, 480))

cv2.imshow('Result', img)
cv2.waitKey(0)

Comments

Submit
0 Comments