"convert" command help - image to b&w text
Posted: 2012-05-07T01:33:04-07:00
Hello,
I want to use the "convert" command to produce clear black & white images which I can then use to train OCR software.
The images contain numbers in the format NN.NN (i.e. 12.19 or 1.4 or 2.39 or 78.5), and they are taken from a robotic camera. I am looking for black & white output which shows the digits clearly. Here's a sample:
I tried to C&P some code I found for captchas:
And after some fiddling, I get this:
Notice that the digit 9 is now missing a chunk up top. I'd appreciate any help as I'm almost completely oblivious to image filters and their settings!
I want to use the "convert" command to produce clear black & white images which I can then use to train OCR software.
The images contain numbers in the format NN.NN (i.e. 12.19 or 1.4 or 2.39 or 78.5), and they are taken from a robotic camera. I am looking for black & white output which shows the digits clearly. Here's a sample:
I tried to C&P some code I found for captchas:
Code: Select all
convert test.png -colorspace Gray -gaussian-blur 9.0 -level 0,30%,0,1 -paint 1 -depth 1 -quality 100 -shave 40x20 test+_c.png
Notice that the digit 9 is now missing a chunk up top. I'd appreciate any help as I'm almost completely oblivious to image filters and their settings!