Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tips on performing OCR - not getting desired results

Tags:

python

opencv

ocr

So I have the following image:

enter image description here

I'm trying to extract three arrays:

var a = [30,31,32,35,37,40,44];
var b = [6,7,11,15,18,21,22];
var c = [5,11,15,18,23,37,28];

I tried feeding this image into tesseract ~/Desktop/test.png out to no avail:

9 % ooenesew @
5 ‘ 904399

And here is the result from ocrad ~/Desktop/test.ppm:

o
?
28

Can any OCR experts suggest what I might try next? I'm comfortable using Python/OpenCV, but will try anything.

like image 499
Eamorr Avatar asked Feb 03 '26 20:02

Eamorr


1 Answers

If your images always look like in the example, you might have to do some tidy up to remove anything that is not a number (all the black background and the circle). Then the method described in the accepted answer on the linked question might be sufficient for your needs, since it looks like you are not dealing with different fonts and sizes: Simple Digit Recognition OCR in OpenCV-Python

like image 95
ikkjo Avatar answered Feb 06 '26 08:02

ikkjo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!