0

I have image like this from my windstation

enter image description here enter image description here

I have tried get thoose lines recognized, but lost becuase all filters not recognize lines. Any ideas what i have use to get it black&white with at least some needed lines?

Typical detection result is something like this: enter image description here

I need detect edges of digit, which seams not recognized with almost any settings.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • Please post an image marked up showing what you are hoping to find exactly? Is it the ellipse? The 14? The vertical line inside the ellipse? – Mark Setchell Aug 24 '15 at 11:40
  • this one is wind station. need get digits(wind speed, 1.4 in this example) and direction(angle of line in center of image, on this image show north). – arheops Aug 24 '15 at 16:41
  • The camera is fixed? Can we assume that the position of the 1.4 and the center of the wind direction are always there? – Miki Aug 25 '15 at 19:48
  • No, you can't. It can changes sometimes. If it fixed i can do it without opencv at all. – arheops Aug 26 '15 at 07:22

1 Answers1

0

This doesn't provide you with a complete guide as to how to solve your image processing question with opencv but it contains some hints and observations that may help you get there. My weapon of choice is ImageMagick, which is installed on most Linux distros and is available for OS X and Windows.

Firstly, I note you have date and time across the top and you haven't cropped correctly at the lower right hand side - these extraneous pixels will affect contrast stretches, so I crop them off.

Secondly, I separate your image in 3 channels - R, G and B and look at them all. The R and B channels are very noisy, so I would probably go with the Green channel. Alternatively, the Lightness channel is pretty reasonable if you go to HSL mode and discard the Hue and Saturation.

convert display.jpg -separate channel.jpg

Red

enter image description here

Green

enter image description here

Blue

enter image description here

Now make a histogram to look at the tonal distribution:

convert display.jpg -crop 500x300+0+80 -colorspace hsl -separate -delete 0,1 -format %c histogram:png:ahistogram.png

enter image description here

Now I can see all your data are down the dark, left-hand end of the histogram, so I do a contrast stretch and a median filter to remove the noise

convert display.jpg -crop 500x300+0+80 -colorspace hsl -separate -delete 0,1 -median 9x9 -normalize -level 0%,40% z.jpg

enter image description here

And a final threshold to get black and white...

convert display.jpg -crop 500x300+0+80 -colorspace hsl -separate -delete 0,1 -median 9x9 -normalize -level 0%,40% -threshold 60% z.jpg

enter image description here

Of course, you can diddle around with the numbers and levels, but there may be a couple of ideas in there that you can develop... in OpenCV or ImageMagick.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432