Page 1 of 1

thermostat picture make black and white

Posted: 2015-05-07T14:19:50-07:00
by jokken
hi, in the end I hope to be able to OCR the text out of this picture or an edited version of this picture.
the top left 73 is the most important the other 73 and the time 9:56 are nice to haves..

Image

I assume I first want to make this picture totally either black or white (no grayscale). White background (no green) with the black text (or greenish black text).
and then make the greenish black part of the text real black
and then make the text have some real hard defined borders

I've been playing with convert.exe and
threshold
black-threshold
white-threshold

and I am totally getting the opposite result as I expect. Also I am a bit confused at the huge number of option availables. im in over my head. I am a novice admittedly.

any help would be appreciated. these are some really cool tools...

thanks!

Re: thermostat picture make black and white

Posted: 2015-05-07T14:44:22-07:00
by fmw42
try using -lat WxH+Offset as follows. adjust the arguments as desired.

Code: Select all

convert try.jpg -channel g -separate +channel -auto-level -negate -lat 25x25+5% result.gif 

Re: thermostat picture make black and white

Posted: 2015-05-07T15:01:15-07:00
by jokken
wow nice that works well thanks!
it gets me way further then i hoped. now for a OCR tool that can pull that text out. the one Ive been trying Tesseract-OCR does not seem to get anything (ever)

Re: thermostat picture make black and white

Posted: 2015-05-08T14:44:19-07:00
by jokken
i used -negate again and got it white with black text.


is there a way I can make the numbers edges more defined (smoother white/black borders) and get rid of the black speckles all around?

Image

i know im asking alot

thanks!

Re: thermostat picture make black and white

Posted: 2015-05-08T15:06:23-07:00
by fmw42
First thing is pay with the -lat size and offset percent. Get it as good as you can. Then you can try using -morphology smooth Octagon:X where X is an integer that controls the size of the spots to remove. But it will likely affect your numbers and letters. See http://www.imagemagick.org/Usage/morphology/#smooth

Note you may get different results if your letters are white on black vs letters black on white. So try both ways.

Re: thermostat picture make black and white

Posted: 2015-05-19T13:48:29-07:00
by jokken
thanks fwm42 im getting a good deal better images with your suggestions. thanks