I write code for recognizing words and letters from images using Tesseract-OCR and OpenCV, but it is only suitable for flat letters and words. The question is how to improve this code so that it can recognize rotated and intersecting characters and words? My code:
import pytesseract
from PIL import Image
import warnings
import cv2
import os
warnings.simplefilter('ignore', Image.DecompressionBombWarning)
image=r"C:\Users\name\Desktop\image.png"
preprocess = "thresh"
c = cv2.imread(image)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
filename = "ImageT.png".format(os.getpid())
cv2.imwrite(filename, gray)
pytesseract.pytesseract.tesseract_cmd=r"C:\Users\name\Desktop\Tesseract-OCR\tesseract.exe"
text=pytesseract.image_to_string(Image.open(filename))
print(text)
and some pictures:
Words
Symbols