So I have the following image:
Using GIMP, I was able to get to here:
- Select all white color (with a touch of fuzz)
- Invert selection
- Cut selection
- Invert all color (goes black)
But now I'm stuck...
I want to use something like
ocrad to extract the numbers.
ocrad goes crazy when I input the black&white image above.
I'd like to see (the grammar is the numbers 1 to 45 inclusive):
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];
It's worth pointing out that the image
is always the same dimensions
is always the same orientation
therefore, I think I can split the image into three rows relatively robustly
(in the above case, I also did an extra step - remove black contiguous regions that have large area. Though I don't know how to do this programatically - I did this by eye in GIMP using the "magic wand" tool).
The above image does OK in
ocrad, but it gets into trouble with the ring surrounding the "44".
I'm trying to avoid pattern matching.
Does anyone have any tips? I'm thinking of doing all this in Python/OpenCV/similar.