I want to isolate the 'wavy line' feature of the attached image.
I thought the approach should be to somehow blur or average the pixel colors first; then apply a threshold operation of some sort. I'd ideally like a black & white image when done.
The problem seems to be that the background (for both light and dark regions) is quite noisy, which, seems to interfere.. or maybe it's something else. I haven't even got close.
Can someone take a stab at it or at least suggest an approach?
http://keveney.com/forum-sample.png
Edge feature detection on 'noisy', low-contrast images
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Edge feature detection on 'noisy', low-contrast images
I'm not sure what result you want. Can you sketch the required result, eg with Gimp?
If this is a photo, the lighting is uneven. The first step might be to correct that.
There is almost no variation in hue or saturation, so I suppose you could grayscale the image. There is overlap in lightness between the "light" stripes and the "dark" stripes.
There is a reasonable contrast at the left edges of the light strips, but poorer contrast at the right edges.
"-statistic median" might be useful.
If this is a photo, the lighting is uneven. The first step might be to correct that.
There is almost no variation in hue or saturation, so I suppose you could grayscale the image. There is overlap in lightness between the "light" stripes and the "dark" stripes.
There is a reasonable contrast at the left edges of the light strips, but poorer contrast at the right edges.
"-statistic median" might be useful.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Edge feature detection on 'noisy', low-contrast images
Try something like this. Adjust or increase the arguments as desired.
See viewtopic.php?f=4&t=25405
It is not great, but best I can think of at the moment.
Code: Select all
convert forum-sample.png -colorspace gray -despeckle -despeckle -despeckle -despeckle -despeckle -despeckle -despeckle -despeckle -despeckle -statistic median 15x15 -sharpen 0x15 -canny 0x1+5%+20% result.png
It is not great, but best I can think of at the moment.
Re: Edge feature detection on 'noisy', low-contrast images
snibgo:
> Can you sketch the required result, eg with Gimp?
Here's what I had in mind, though I could do with simple outlines, as produced by fmw42's attempt.
> If this is a photo, the lighting is uneven. The first step might be to correct that.
The ideal process would tolerate this unevenness, though I can more carefully control the photography if necessary.
fmw42: thanks for your example. I'll experiment with it too. Gratified to see that it's not something easy I was missing, anyway.
> Can you sketch the required result, eg with Gimp?
Here's what I had in mind, though I could do with simple outlines, as produced by fmw42's attempt.
> If this is a photo, the lighting is uneven. The first step might be to correct that.
The ideal process would tolerate this unevenness, though I can more carefully control the photography if necessary.
fmw42: thanks for your example. I'll experiment with it too. Gratified to see that it's not something easy I was missing, anyway.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Edge feature detection on 'noisy', low-contrast images
Try
Code: Select all
convert forum-sample.png -colorspace gray -statistic median 51x51 -brightness-contrast 0x50 -sharpen 0x51 result.png