0

How to improve accuracy of character recognition. bellow is the image and the code.

Input image

Image after thresholding

code:


rcz = cv2.resize(img, dsize, fx=1, fy=1, interpolation=cv2.INTER_AREA)

gray = cv2.cvtColor(rcz, cv2.COLOR_BGR2GRAY)

bl = cv2.bilateralFilter(gray,9,5,5)

th = cv2.threshold(bl, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]

text = pytesseract.image_to_string(th)

output :

5 8EM TDC ECO M*

2018

( November )

ECONOMICS ( Major ) Course : 504 ( Monetary Theory and Financial Market } Full Marks : 80 Pass Marks : 32/24 Time : 3 hours”

The figures in the margin indicate full marks for the questions

  1. Choose the correct option/Answer the following : 1*8=8 fa) As per RBI, M2 is composed of

(j M, + all post office deposits

(ii) M,+ time deposits of commercial banks 5

Ppo/ase (Tusn Ower}

Kuro
  • 13
  • 5
  • if you have some standards for your sample input images such as background, no handwritten, no lines, in specific rotations etc., there can be applied some preprocesses. Otherwise there can not be said that there are some preprocess steps for every sample. Also sometimes preprocessing can be a problem for tesseract as seen in [this example](https://stackoverflow.com/questions/62022808/tesseract-always-missing-a-line-in-picture/62099892#62099892) – Yunus Temurlenk Aug 06 '20 at 18:01
  • It is very hard to says which processing best for improving OCR accuracy. It is depend on the quality and condition of the image. You can try play few option etc erosion, median, tresholding, denoising .. to see which one best fit you. You can try ROI your image to reduce the scope of detection, it helps improve the accuracy by removing unwanted border. – WenJuan Aug 07 '20 at 01:24

0 Answers0