Reputation: 326
I'm working on an image classification task, and I am using Tesseract OCR for digit classification.
My main problem is receiving really poor results from the OCR for single digits.
After reading a lot online about improving Tesseract's performance, I am pre-processing the image with OpenCV using the following general scheme:
I am getting something I'm fairly pleased with, for example:
I am calling Tesseract in the following way, emphasizing that I am expecting a single digit:
tesseract input.jpg output.txt - psm 10 digits
I thought Tesseract would surely identify it correctly, but it returns ".".
Does anyone have ideas for further improvements? I'm guessing I could train Tesseract for this specific font, but since I would be dealing with different fonts I'm hoping for a better approach.
Upvotes: 2
Views: 1359
Reputation: 326
What I ended up doing, in light of what @micka commented, was to assemble all the single characters back into one image and then send that image to the OCR. For some reason which is still unclear to me, it really improves the results.
Upvotes: 0
Reputation: 10540
What version of Tesseract? It works for me (note: there should not be a space between '-' and 'psm').
$ tesseract ~/Downloads/6digit.jpg stdout -psm 10 digits
6
$ tesseract -v
tesseract 3.05.00dev
leptonica-1.71
libgif 4.2.3 : libjpeg 9a : libpng 1.6.21 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.5.0 : libopenjp2 2.1.0
Upvotes: 1