Forums

image subsampling problem???

Started by walala March 22, 2004
Dear all,

I want to ask how to downsample an image and avoid aliasing?

How to make sure that an downsampled image can be reconstructed perfectly?

I guess I am too acquainted with time as my x-axis, now when it comes to 2D
spatial domain, I get perplexed...

Can anybody give me some enlightenment?

Thanks a lot,

-Walala


"walala" <mizhael@yahoo.com> wrote in message
news:c3n4n5$jra$1@mozo.cc.purdue.edu...
> Dear all, > > I want to ask how to downsample an image and avoid aliasing? > > How to make sure that an downsampled image can be reconstructed perfectly?
> > I guess I am too acquainted with time as my x-axis, now when it comes to
2D
> spatial domain, I get perplexed...
In generic terms, the 2D domain is just an extension of the 1D domain you are used to. The same concepts apply for resampling (except they get twice as hard? :-)) So downsampling an image should involve the same process of decimation and filtering as you'd see in 1D processing except everything is in 2D now. You should find necessary details in any basic Image Processing book in your library.
> > Can anybody give me some enlightenment? > > Thanks a lot, > > -Walala > >
"walala" <mizhael@yahoo.com> wrote in message
news:c3n4n5$jra$1@mozo.cc.purdue.edu...
> Dear all, > > I want to ask how to downsample an image and avoid aliasing? > > How to make sure that an downsampled image can be reconstructed perfectly? > > I guess I am too acquainted with time as my x-axis, now when it comes to
2D
> spatial domain, I get perplexed... > > Can anybody give me some enlightenment? >
Walala, Consider this: An image that is sampled. Compute its discrete Fourier Transform (2-D) There will be spatial frequencies that extend away from (zero,zero). Since the sampling theorem applies in 2-D, then if you want to subsample, you are going to have to lowpass filter the image. Consider a filter that looks like a normal lowpass response - but now, just rotate it so the filter looks like a top hat - corresponding to a brick wall filter in one dimention. You have to filter the image frequencies to be not greater than 1/4X where X is the spatial sampling interval. Same as 1/4fs in frequency/time spaces. This means you will be throwing out information - so perfect reconstruction of the original is out of the question. But, you can reasonably reconstruct the *bandlimited version from the subsamples*. Just apply a lowpass filter of appropriate character..... Fred
Fred Marshall wrote:

   ...

> You have to filter the image frequencies to be not greater than 1/4X where X > is the spatial sampling interval. Same as 1/4fs in frequency/time spaces. > This means you will be throwing out information - so perfect reconstruction > of the original is out of the question. But, you can reasonably reconstruct > the *bandlimited version from the subsamples*. > > Just apply a lowpass filter of appropriate character..... > > Fred
Fred, I assume that by 1/4X you mean X/4. Why 4, rather than 2? Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
"Jerry Avins" <jya@ieee.org> wrote in message
news:405f43e6$0$3039$61fed72c@news.rcn.com...
> Fred Marshall wrote: > > ... > > > You have to filter the image frequencies to be not greater than 1/4X
where X
> > is the spatial sampling interval. Same as 1/4fs in frequency/time
spaces.
> > This means you will be throwing out information - so perfect
reconstruction
> > of the original is out of the question. But, you can reasonably
reconstruct
> > the *bandlimited version from the subsamples*. > > > > Just apply a lowpass filter of appropriate character..... > > > > Fred > > Fred, > > I assume that by 1/4X you mean X/4. Why 4, rather than 2? > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095; >
Hi, Fred and Jerry, Thanks a lot for the answers. I wonder the camera, when taking pictures, is doing a subsampling and it did not measure the frequency of the scene, did it? So any picture that is taken by a camera might be aliasing, right? What did people do to solve this problem? Thanks a lot, -Walala
walala wrote:

(snip)

> I wonder the camera, when taking pictures, is doing a
>subsampling and it did not measure the frequency of the > scene, did it? So any picture that is taken
> by a camera might be aliasing, right?
> What did people do to solve this problem? I have wondered about this in the case of scanned TV pictures. It is my understanding that the optical system (or something else) is designed to limit the resolution. Consider a TV picture of a person wearing a striped shirt with very fine stripes. You might get some aliasing, though even more you run into the color subcarrier in analog TV systems, which is even worse. I believe that television personalities learn not to wear such clothes. -- glen
walala wrote:

> I wonder the camera, when taking pictures, is doing a subsampling and it did > not measure the frequency of the scene, did it? So any picture that is taken > by a camera might be aliasing, right? What did people do to solve this > problem?
I guess you mean digital (with CCD or CMOS sensor) cameras. The good ones have optics that act as lowpass filter in order to limit the frequency and avoid aliasing. This means they somehow make the picture a little bit unsharp, maybe a little bit unfocused. The problem can be that the optics need to be retuned each time there is a change in the sensor resolution (also needed for the luminance gain/noise problem). An other option is: don't care... :-) bye, -- Piergiorgio Sartor
glen herrmannsfeldt wrote:

> I have wondered about this in the case of scanned TV > pictures. It is my understanding that the optical > system (or something else) is designed to limit > the resolution.
In theory yes, but...
> Consider a TV picture of a person wearing a striped > shirt with very fine stripes. You might get some > aliasing, though even more you run into the color > subcarrier in analog TV systems, which is even > worse. I believe that television personalities learn > not to wear such clothes.
...in practice there are often aliasing (or crosstalk, or interference) effects. bye, -- Piergiorgio Sartor
>I wonder the camera, when taking pictures, is doing a subsampling and it did >not measure the frequency of the scene, did it? So any picture that is taken >by a camera might be aliasing, right? What did people do to solve this >problem?
CCD sensors do rectangular area sampling, not point sampling. This acts as an averaging low-pass filter. In single CCD color cameras, there's also a mosiac filter in front of the CCD. The small aperature lenses (constituting almost a pinhole camera for some of the smaller consumer digicams) have a circular diffraction pattern which also low pass filters the focal plane image to a degree. And, of course, any JPEG compression can throw away (quantisize) any low-energy high-frequency components. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Ronald H. Nicholson Jr. wrote:

[...]
> the focal plane image to a degree. And, of course, any JPEG compression > can throw away (quantisize) any low-energy high-frequency components.
JPEG compression occurs after sampling, so it does not partecipate to the anti aliasing process. bye, -- Piergiorgio Sartor