[comp.graphics] Integer Deconvolutions

kla@physc1.byu.edu (04/10/90)

Integer Convolutions can be done relatively fast in software even though
hardware implementations are common and can be relatively cheap.
The basic idea is to take a 2-d filter (say 3 by 3) and pass it over
each pixel of the image multiplying corresponding pixels of the kernel
with those of the image and summing. For example:

   Kernel                   Image                    Result

  -1 -1 -1               1 1 0 1 2
  -1  9 -1               1 1 0 2 2                   0 -8 7
  -1 -1 -1               2 1 2 2 2

  Ex: 7 = 9*2 - 1*1 - 1*2 - 1*2 - 1*2 - 1*2 - 1*2 - 1*0 - 1*0

Notice that there are some ugly boundary conditions at the edge
of the image. These can be handled by wrap around or ignored
(Thus making the resultant image x-2 * y-2 pixels)

A kernel of all one's can be used to do quick anti aliasing by doing an
average of the neighboring pixels. (do each color separately for a 24
bit image) The above filter does sharpening as does the following:

  0 -1  0
 -1  5 -1
  0 -1  0

But with a slightly different type of result. Try both and see which you
like best. Good Luck. If further questions of this nature arise you might
try comp.ai.vision for quicker response.

thompson@adobe.com (Ross Thompson) (04/12/90)

I am doing something similar, but I am not using a gray scale image.  I'm
trying to clean up a 1 bit per pixel image.  Does this same technique of
running a filter such as the one below over the image help with that?  What
filter should I use if the image I am cleaning up is a line drawing with lots
of lines 1 pixel wide?

 0 -1  0
-1  5 -1
 0 -1  0

Thanks for any help.