# Re: Remove speckles in bilevel (bw) image

*From*: "Jens Dierks" <me@xxxxxxxxxxx>*Date*: Wed, 17 Jun 2009 17:52:20 +0200

Laurent S. wrote:

Thanks for the 'heads-up'. Turkel offers a wealth of

material in .../notes/...

Yes, thanks for the hint.

....

I do not understand exactly what Turkel is proposing here. Is the group 'a' the pixels in the 'X shaped' subarea

aa aa

aa aa

aa

aa aa

aa aa

And is group 'b' similarly the '+ shaped' subarea?

Thats what i think.

If so, we

presumably are required to take the median value of group 'a'

and also that of of group 'b'. But then what's to do?

And then the median from this two values plus the center value

becomes the new value, but i am also not really shure.

This way, the result for bw_04 would be:

http://freenet-homepage.de/JDierks/tmp/bw_04_medhybrid.png

Because it erases very much, here is a version with a center weight

of 3 for Group A and B:

http://freenet-homepage.de/JDierks/tmp/bw_04_medhybrid3Center.png

....

Sounds like the features we want.

Maybe i misinterprated the paper, because it is somewhat unclear,

but i made also a very easy function, that looks in the 8 directions

from the center pixel and counts how many pixels have the same

value as the center and if so, one more pixel in this direction is taken

into account.

If the amount is at least 3, including the center pixel, the value stays,

otherwise it changes (so this function makes only sense for 2 level

images):

http://freenet-homepage.de/JDierks/tmp/bw_04_least3.png And 2 iterations of it:

http://freenet-homepage.de/JDierks/tmp/bw_04_least3_2it.png

For comparison here are the results for a 3x3 Median with a center

weight of 5, that should come close to the gaussian07 weighted

median(?):

http://freenet-homepage.de/JDierks/tmp/bw_04_med9Cen5.png

And 2 iterations:

http://freenet-homepage.de/JDierks/tmp/bw_04_med9Cen5_2it.png

It erases more values from the tips of the letters.

Is this (once understood) trivial to program within MATLAB? As ImageAnalyst's recipe is!

Cant tell you really, because i dont use matlab. But it should be

not very complicated.

Jens

.

**References**:**Re: Remove speckles in bilevel (bw) image***From:*Jens Dierks

**Re: Remove speckles in bilevel (bw) image***From:*Laurent S.

- Prev by Date:
**Re: Remove speckles in bilevel (bw) image** - Next by Date:
**Re: Remove speckles in bilevel (bw) image** - Previous by thread:
**Re: Remove speckles in bilevel (bw) image** - Next by thread:
**Re: Remove speckles in bilevel (bw) image** - Index(es):