Answer the question
In order to leave comments, you need to log in
What to do so that the tesseract can recognize the text?
Hello, after preprocessing the image, I have such an image and I need it to be recognized by pytesseract, how can I do this?
Here is the image:
Here is the code:
src = cv2.imread('dot.png', cv2.IMREAD_COLOR)
#Transform source image to gray if it is not already
if len(src.shape) != 2:
gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)
else:
gray = src
edges = cv2.Canny(gray,50,150)
ret, thresh = cv2.threshold(edges, 127, 255, cv2.THRESH_BINARY)
dilate = cv2.dilate(thresh,kernel,iterations=1)
erode = cv2.erode(dilate,kernel,iterations=1)
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
hierarchy = hierarchy[0]
cv2.imshow('',erode)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question