[comp.graphics] Image processing question

nick@marvax.berkeley.edu (nicholas socci) (10/18/88)

I have simple (I hope) image processing problem.  I am given an image
with say 32x32 pixels (8 bits) and want to magnify the image to say
512x512. (Actually i need to go from MxN --> M1xN1).

I would like to know if there are any good algorithms out there to do
this. NOTE linear interpolation is not good enough. It was suggested to
me that I fourier transform the image and then use the transform to
interpolate. 

I would be interested in learning any other methods, or efficient ways
of using the fourier transform method.

Please reply via e-mail to nick@marvax.berkeley.edu

Thanks in advance.

turk@mit-amt (Matthew Turk) (10/18/88)

In article <26451@ucbvax.BERKELEY.EDU>, nick@marvax.berkeley.edu (nicholas socci) writes:
> I have simple (I hope) image processing problem.  I am given an image
> with say 32x32 pixels (8 bits) and want to magnify the image to say
> 512x512. (Actually i need to go from MxN --> M1xN1).
> 
> I would like to know if there are any good algorithms out there to do
> this. NOTE linear interpolation is not good enough. It was suggested to
> me that I fourier transform the image and then use the transform to
> interpolate. 

This simplest way I know of doing this is described by Burt and Adelson
in April 1983 IEEE Trans. on Communications (p.534).  They give a
simple algorithm for expanding a pyramid level, which basically
preserves the band-limited spatial frequency characteristics of the
image.  In a nutshell, here it is:

	I'old - (M+1)by(N+1)
	I'new - (2M+1)by(2N+1)

                        2    2
	I'new(i,j) = 4 Sum  Sum  w(m,n) I'old( (i-m)/2, (j-n)/2 )
                       m=-2 n=-2

	where w(m,n) is the 5x5 array whose 1D separable component
	  is (0.05 0.25 0.4 0.25 0.05)
	and only terms for which (i-m)/2 and (j-n)/2 are integers
	  are included in the sum.

You could use a larger filter, but this 5x5 one is pretty good and 
rather quick.

	Matthew Turk

kworrell@urbsdc.Urbana.Gould.COM (10/19/88)

A standard way of doing this type of transformation is to take each pixel in the
output image, do the inverse scaling transform (to determine where on the original
image we should be looking to find relevant data) and do some kind of weighting
function of neighboring pixels to get a value.  There are several standard functions
(Nearest neighbor, bilinear, cubic ...) which trade image quality for speed.

Note that this doesn't just work for scaling.  Basically any xform will work.

Take a look at Rosenfeld & Kak or Ballard & Brown (or any other reasonable IP book)
for weights and algorithms.

------------------------------------------------------------------------
Kurt J. Worrell	                 USEnet1:    uunet!uiucuxc!urbsdc!kworrell
Motorola Inc                     ARPAnet:    kworrell@xenurus.Gould.Com
**** Standard Disclaimer ***     BELLnet:    (217) 384-8500, x740

aramini@apollo.COM (Michael Aramini) (10/27/88)

    Take a look at Rosenfeld & Kak or Ballard & Brown (or any other reasonable IP book)
    for weights and algorithms.

Another good IP book for this is:

    Pratt, W. K., _Digital Image Processing_, John Wiley & Sons (1978), sect.
      4.3.2: "Interpolation Functions", pp. 113-116.

In addition, the following paper is a good comparision of the results of several
interpolation weigting functions.  In addition it gives a cubic spline
interpolation weighting function not usually discussed in textbooks (i.e. it is
*not* the traditional cubic B-spline) which gives good results with medicalCT
and MRI images:

    Parker, J. A., R. V. Kenyon, and Troxel, D. E., "Comparison of Interpolating
      Methods for Image Resampling", _IEEE Transations on Medical Systems_, Vol.
      MI-2, No. 1, March, 1983, pp. 31-39.


-Michael Aramini    aramini@apollo.com      (508) 256-6600, ext. 5821

aramini@apollo.COM (Michael Aramini) (10/27/88)

                                       In addition it gives a cubic spline
    interpolation weighting function not usually discussed in textbooks (i.e. it is
    *not* the traditional cubic B-spline) which gives good results with medicalCT
    and MRI images:

        Parker, J. A., R. V. Kenyon, and Troxel, D. E., "Comparison of Interpolating
          Methods for Image Resampling", _IEEE Transations on Medical Systems_, Vol.
          MI-2, No. 1, March, 1983, pp. 31-39.

At the risk of being reduntant, let me elaborate on this.  The traditional cubic
B-spline interpolation function smoothes the data, i.e. if you used it to
resample the image for the same data points as the input, you would get a blurred
version of the orginal image.  This blurring can be useful if the input image
is noisy.  However, for many applications it smoothes the data too much.

The so called high resolution cubic spline interpolation function described in the
paper does not smooth the data nearly as much. In fact if you used it to
resample the image for the same data points as the input, you would get the
original image back.  In general, it results in clearer interpolated images,
and tends to enhance contrast.  However, one thing to be aware of is that
the output image may have pixel values outside the range of the input pixel
values, which can cause underflows and overflows, so you have check for such
conditions and set the output pixel value to the bottom or top of the allowed
range of pixel values when appropriate.

-Michael

eugene@eos.UUCP (Eugene Miya) (01/04/89)

Okay to discussion image processing type questions (analysis
as opposed to synthesis): here is a good posting.  The fellow has
asked me to post for him because his news software has problems
Please make to him directly, not me.

--eugene
============================ =========================

From: Richard Outerbridge <RAMO%AC.DAL.CA@CORNELLC.ccs.cornell.edu>

Hi, I'm a grad student in Oceanography at Dalhouise in Canada. 
> Editing of a personal message at this point asking reposting

thanks in advance,

Richard

the following bit is what i tried to send out.
----------------------------------------------------

I have two planar fields from which I intend to construct two false colour
images. In doing this in the past I have noticed that the two images are
similar. I would like to have some method of quantifying this similarity,
perhaps even a method for determining how one image (or original field) derives
from the other (i.e. by what combination of rotation, transposition, re-scaling,
etc. one can best approximate the transformation).

Any help you can provide would be greatly appreciated.

P.S. Please reply be e-mail directly to me if possible. Our connection to
     the NEWS net is experimental and subject to the whims of the folks in
     leisure suits.

From: Richard Outerbridge <RAMO%AC.DAL.CA@CORNELLC.ccs.cornell.edu>

andreww@dgp.toronto.edu (Andrew Chung How Woo) (04/03/91)

I am looking for ideas, algorithms, or references on the following problem:

INPUT: 	(1) raster background (24-bit per pixel)
	(2) 3d geometry
	(3) one-bit raster boundary defining a region of the raster
	    background representing a forground object (we want this object
	    to appear in front of the rendered geometry in the final image)

GOAL: Composited, anti-aliased image in which the part of the raster
	background defined by the one-bit raster boundary appears to be
	in front of the rendered geometry.

THE PROBLEM: I know how to generate the one-bit forground raster region,
	and know how to do anti-aliased compositing given 8-bit mattes
	approximating coverage information for the rendered geometry and the
	forground raster object.  BUT how can I generate or approximate
	8-bit coverage information for the forground raster object given only
	the background and 1-bit boundary information?

It seems that some active edge detection is required here, but such detection
tends to be expensive and is bound to fail when shadows are involved.  Any
suggestions or thoughts, please e-mail me at andreww@dgp.toronto.edu.  

Thank you very much for your time.

Andrew Woo