Re: Downsample and then reconstruct an image.



"VijaKhara" <VijaKhara@xxxxxxxxx> writes:

I have a 2048x2048 image and what I want is to reduce its size to
1024x1024 (downsampling factor is
2). Actually, I don't care about whether or not the sampled image looks
like the orgininal image. What I care is how from the downsampled
image to reconstruct the orginal image.

But only approximately, since you've thrown away up to 3/4 of the
information that was present in the original (you have 1 million pixels
now instead of 4 million).

Theoretically in 1 D, I should low pass filter the image firstly to
avoid aliasing, and then pickup just every middle points Y(n)=X(2*n).
But I also learn that there are many filters for this task,

Yes, because there are many ways to trade off high-frequency
attenuation, low-frequency preservation, sharpness of the filter, and
computational cost. The simplest (and worst) method is to just select
every second data point with no filtering at all. Averaging pairs of
pixels together (box filter) is somewhat better. Bicubic and higher
polynomials are better yet, as are apprioximations to a sinc function.

I the case of 2D (an image), do you think what filter will work the
best. Also what interpolation function should I use to interpolate to
get the orginal image. In my case, can I get the exactly the original
image?

There is no "best" downsampling filter - it depends on the tradeoffs
between the factors above. There's no "best" upsampling filter either.

But with most normal images, you cannot reconstruct the original image
because you have discarded 3/4 of the data. If you properly low-pass
filter as part of the downsampling process, you have saved the lower
half of the horizontal and vertical frequencies while discarding the
upper half of each. The upsampling process will (more or less
accurately, depending on algorithm) correctly resample these lower
frequencies to the larger image size. But the small details,
representing high spatial frequencies in the original, are lost during
downsampling and cannot magically reappear during upsampling.

The *only* time the process of downsampling and upsampling by 2X will
get you the original image back is when the original image didn't have
any high frequency detail to begin with - for example, when the camera
lens was quite out of focus.

Dave

.



Relevant Pages

  • Re: Oversampling using Cheby2 IIR FIlter.
    ... The same distortions that produce frequencies above 24.255kHz. ... If you should filter before downsampling, ...
    (comp.dsp)
  • Re: Optimal downsampling
    ... input image: http://www.general-cathexis.com/images/lena.tif ... a linear operation cannot depend on the input. ... is not a FIR filter. ... I gave you the optimum linear downsampling operation. ...
    (sci.image.processing)
  • Re: Interpolation
    ... lowpass responses narrower than the Nyquist band. ... Downsampling with anti-alias filtering is the only case I've ... for any lowpass anti-aliasing filter designed for sample rate ...
    (comp.dsp)
  • Re: Interchanging of filtering and decimation operations
    ... It is known that downsampling introduces aliasing if the signal to be ... pass filter before it is downsampled. ... or is it always necessary to filter the signal first and then ... When cleverly done filtering and decimation can be combined into one operation. ...
    (comp.dsp)
  • Re: Interchanging of filtering and decimation operations
    ... It is known that downsampling introduces aliasing if the signal to be ... a low pass filter before it is downsampled. ... the signal first and then downsample it. ... If your signal has frequency components above the Nyquist for the ...
    (comp.dsp)