[comp.graphics] smoothing a binary image file?

leeda@cpsin3.cps.msu.edu (Dae Hee Lee) (11/06/90)

I am interesting in smoothing a binary image file with characters.
I have used a local averaging scheme:
if
v[i][j]+v[i][j-1]+v[i][j+1]+v[i-1][j]+v[i-1][j-1]+v[i-1][j+1]+v[i+1][j]+
v[i+1][j-1]+v[i+1][j+1] > 4
then v[i][j] = 1
else v[i][j] = 0.

But it did not work well.
Could you let me know other smoothing schemes?

Thank you verymuch.
Daehee

callisto@blake.u.washington.edu (Finn) (11/07/90)

In article <1990Nov6.140616.12286@msuinfo.cl.msu.edu> leeda@cpsin3.cps.msu.edu (Dae Hee Lee) writes:
>I am interesting in smoothing a binary image file with characters.
>I have used a local averaging scheme:
>if
>v[i][j]+v[i][j-1]+v[i][j+1]+v[i-1][j]+v[i-1][j-1]+v[i-1][j+1]+v[i+1][j]+
>v[i+1][j-1]+v[i+1][j+1] > 4
>then v[i][j] = 1
>else v[i][j] = 0.
>
>But it did not work well.
>Could you let me know other smoothing schemes?

I can't see the image you used or know what you wanted, but I suspect
"didn't work very well" might mean too much smoothing.

You might try weighting the target pixel more.  A good starting point 
might be :

	1 2 1
	2 4 2
	1 2 1

take the sum and output 1 if > 8.  You might also play with using the
sum as a brightness number (0 to 16), using traditional image processing
techniques, then dither back to binary.  Again, depending on the nature
of your image, and the results you are after, it may or may not work.