Page 1 of 1

Edge feature detection on 'noisy', low-contrast images

Posted: 2019-04-22T18:05:54-07:00
by mkeveney
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

Re: Edge feature detection on 'noisy', low-contrast images

Posted: 2019-04-22T19:18:04-07:00
by snibgo
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.

Re: Edge feature detection on 'noisy', low-contrast images

Posted: 2019-04-22T23:52:03-07:00
by fmw42
Try something like this. Adjust or increase the arguments as desired.

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
See viewtopic.php?f=4&t=25405

It is not great, but best I can think of at the moment.

Re: Edge feature detection on 'noisy', low-contrast images

Posted: 2019-04-23T12:04:26-07:00
by mkeveney
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.

Image

> 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.

Re: Edge feature detection on 'noisy', low-contrast images

Posted: 2019-04-23T13:05:50-07:00
by fmw42
Try

Code: Select all

convert forum-sample.png -colorspace gray -statistic median 51x51 -brightness-contrast 0x50 -sharpen 0x51 result.png