Answer the question
In order to leave comments, you need to log in
Recognizing digital digits in tesseract?
I need to recognize this picture
. To do this, I need to process it.
Here is the tesseract processing and recognition code. (sorry for stupid comments, I wrote them quickly specifically for the question)
import pytesseract as tess
tess.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
import cv2
import matplotlib.pyplot as plt
import numpy as np
image = cv2.imread('image/1.2.jpeg')
foto = cv2.GaussianBlur(image,(11,11), 0) # размытие
kernel = np.ones((1,1), np.uint8) #делает объекты на фото тоньше
foto = cv2.dilate(foto,kernel,iterations = 9)
foto = cv2.cvtColor(foto, cv2.COLOR_BGR2GRAY) #изменение цвета
(thresh, foto) = cv2.threshold(foto,95,155,cv2.THRESH_BINARY) # простой порог
foto = cv2.cvtColor(foto, cv2.COLOR_BGR2RGB) # изменение в серый цвет
result = tess.image_to_string(foto) #результат tess
cv2.imwrite('image/3.4.jpeg',foto)
plt.imshow(foto)
plt.show()
print (result)
cv2.threshold(foto,95,155,cv2.THRESH_BINARY)
Answer the question
In order to leave comments, you need to log in
Let's not make a bike. The task is old.
https://github.com/topics/number-recognition
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question