6

How can I use the tesseract to extract the mathematical equation?

While reading the image given below:

enter image description here

after using:

img = cv2.imread(IN_PATH+'sample1.png')

pytesseract.image_to_string(img)

I get the result as:

'The value of 7/8144 is\n- (a) 20.2 (b) 20.16\n(c) 20.12 (d) 20.4'

With the older versions, I could have used

config='-l eng + equ'
pytesseract.image_to_string(img,config=config)

but the equ is no longer supported in the tesseract 4.0+. I have the equ.traineddata file too but I do not know how that'll work and when I tried to paste it inside the /usr/share/tesseract-ocr/4.00/tessdata/ it threw an error that it can not be copied.

Please help how can I extract some text with simple mathematics symbols in it.

Deshwal
  • 3,436
  • 4
  • 35
  • 94

0 Answers0