From: Vassilis Papavassiliou on
Hi,
(new in this forum).

I would like to ask about the imresize function.

It uses an antiliasing filter for interpolation/decimation, but
how is this filter selected?
suppose i want to turn gray-scale images of different heights (eg. 45 or 23 pixels) to the corresponding ones with 30 pixles height.
probably, the filter is changing. Therefore, the spectral information of the each new image is not the same of the original one (probably some high frequencies), but it depends on the filter.
Does anybody have an idea?

Vassilis
From: Steve Eddins on
Vassilis Papavassiliou wrote:
> Hi,
> (new in this forum).
>
> I would like to ask about the imresize function.
>
> It uses an antiliasing filter for interpolation/decimation, but
> how is this filter selected?
> suppose i want to turn gray-scale images of different heights (eg. 45 or 23 pixels) to the corresponding ones with 30 pixles height.
> probably, the filter is changing. Therefore, the spectral information of the each new image is not the same of the original one (probably some high frequencies), but it depends on the filter.
> Does anybody have an idea?
>
> Vassilis

If the scale factor is less than 1, then the interpolation kernel is
stretched by the corresponding amount. For example, if the scale factor
is 0.5, then the interpolation kernel is stretched by a factor of 2.0.

If the scale factor is greater than 1, then there is no aliasing and so
no antialiasing is applied.

---
Steve Eddins
http://blogs.mathworks.com/steve/
From: Vassilis Papavassiliou on
Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hflncf$mio$1(a)fred.mathworks.com>...
> Vassilis Papavassiliou wrote:
> > Hi,
> > (new in this forum).
> >
> > I would like to ask about the imresize function.
> >
> > It uses an antiliasing filter for interpolation/decimation, but
> > how is this filter selected?
> > suppose i want to turn gray-scale images of different heights (eg. 45 or 23 pixels) to the corresponding ones with 30 pixles height.
> > probably, the filter is changing. Therefore, the spectral information of the each new image is not the same of the original one (probably some high frequencies), but it depends on the filter.
> > Does anybody have an idea?
> >
> > Vassilis
>
> If the scale factor is less than 1, then the interpolation kernel is
> stretched by the corresponding amount. For example, if the scale factor
> is 0.5, then the interpolation kernel is stretched by a factor of 2.0.
>
> If the scale factor is greater than 1, then there is no aliasing and so
> no antialiasing is applied.
>
> ---
> Steve Eddins
> http://blogs.mathworks.com/steve/

probably im confused. is the kernel just an extra low pass filter (e.g. average), or you mean just the new grid. To be more clear by an example.
Suppose i want to resize a gray-scale of height 67 pixels to 30. the factor is 30/67. so an new grid of 30x(new_width) "sits" on the original image and the values are estimated according the selected method (e.g. bilinear). Is an extra filter applied?
From: Steve Eddins on
Vassilis Papavassiliou wrote:
> Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hflncf$mio$1(a)fred.mathworks.com>...
>> Vassilis Papavassiliou wrote:
>>> Hi,
>>> (new in this forum).
>>>
>>> I would like to ask about the imresize function.
>>>
>>> It uses an antiliasing filter for interpolation/decimation, but
>>> how is this filter selected?
>>> suppose i want to turn gray-scale images of different heights (eg. 45 or 23 pixels) to the corresponding ones with 30 pixles height.
>>> probably, the filter is changing. Therefore, the spectral information of the each new image is not the same of the original one (probably some high frequencies), but it depends on the filter.
>>> Does anybody have an idea?
>>>
>>> Vassilis
>> If the scale factor is less than 1, then the interpolation kernel is
>> stretched by the corresponding amount. For example, if the scale factor
>> is 0.5, then the interpolation kernel is stretched by a factor of 2.0.
>>
>> If the scale factor is greater than 1, then there is no aliasing and so
>> no antialiasing is applied.
>>
>> ---
>> Steve Eddins
>> http://blogs.mathworks.com/steve/
>
> probably im confused. is the kernel just an extra low pass filter (e.g. average), or you mean just the new grid. To be more clear by an example.
> Suppose i want to resize a gray-scale of height 67 pixels to 30. the factor is 30/67. so an new grid of 30x(new_width) "sits" on the original image and the values are estimated according the selected method (e.g. bilinear). Is an extra filter applied?

OK, here's what's going on from a theoretical point of view.

1. Reconstruct a continuous signal from the original discrete signal.
This reconstruction is performed using an interpolation kernel.
Reconstruction (interpolation) can be viewed as filtering an impulse
train with the interpolation kernel. For linear interpolation, the
shape of the interpolation kernel is a triangle that is nonzero between
-1.0 and 1.0.

2. Apply a lowpass antialiasing filter to the reconstructed continuous
signal. The bandwidth of the lowpass filter is chosen according to the
scale factor. That is, if you're shrinking more, you have to smooth
more with the antialiasing filter.

3. Resample the reconstructed, antialiased continuous signal at the
desired new sampling rate to get the output.

Linear system theory says you can combine the reconstruction filter in
step 1 with the antialiasing filter in step 2.

So what imresize is doing is using a stretched interpolation kernel in
order to do interpolation and antialiasing simultaneously. There is no
separate filtering step.

---
Steve Eddins
http://blogs.mathworks.com/steve/
From: Vassilis Papavassiliou on
Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hflqtl$le2$1(a)fred.mathworks.com>...
> Vassilis Papavassiliou wrote:
> > Steve Eddins <Steve.Eddins(a)mathworks.com> wrote in message <hflncf$mio$1(a)fred.mathworks.com>...
> >> Vassilis Papavassiliou wrote:
> >>> Hi,
> >>> (new in this forum).
> >>>
> >>> I would like to ask about the imresize function.
> >>>
> >>> It uses an antiliasing filter for interpolation/decimation, but
> >>> how is this filter selected?
> >>> suppose i want to turn gray-scale images of different heights (eg. 45 or 23 pixels) to the corresponding ones with 30 pixles height.
> >>> probably, the filter is changing. Therefore, the spectral information of the each new image is not the same of the original one (probably some high frequencies), but it depends on the filter.
> >>> Does anybody have an idea?
> >>>
> >>> Vassilis
> >> If the scale factor is less than 1, then the interpolation kernel is
> >> stretched by the corresponding amount. For example, if the scale factor
> >> is 0.5, then the interpolation kernel is stretched by a factor of 2.0.
> >>
> >> If the scale factor is greater than 1, then there is no aliasing and so
> >> no antialiasing is applied.
> >>
> >> ---
> >> Steve Eddins
> >> http://blogs.mathworks.com/steve/
> >
> > probably im confused. is the kernel just an extra low pass filter (e.g. average), or you mean just the new grid. To be more clear by an example.
> > Suppose i want to resize a gray-scale of height 67 pixels to 30. the factor is 30/67. so an new grid of 30x(new_width) "sits" on the original image and the values are estimated according the selected method (e.g. bilinear). Is an extra filter applied?
>
> OK, here's what's going on from a theoretical point of view.
>
> 1. Reconstruct a continuous signal from the original discrete signal.
> This reconstruction is performed using an interpolation kernel.
> Reconstruction (interpolation) can be viewed as filtering an impulse
> train with the interpolation kernel. For linear interpolation, the
> shape of the interpolation kernel is a triangle that is nonzero between
> -1.0 and 1.0.
>
> 2. Apply a lowpass antialiasing filter to the reconstructed continuous
> signal. The bandwidth of the lowpass filter is chosen according to the
> scale factor. That is, if you're shrinking more, you have to smooth
> more with the antialiasing filter.
>
> 3. Resample the reconstructed, antialiased continuous signal at the
> desired new sampling rate to get the output.
>
> Linear system theory says you can combine the reconstruction filter in
> step 1 with the antialiasing filter in step 2.
>
> So what imresize is doing is using a stretched interpolation kernel in
> order to do interpolation and antialiasing simultaneously. There is no
> separate filtering step.
>
> ---
> Steve Eddins
> http://blogs.mathworks.com/steve/

What can i say. I hope "thanks a lot" is enough.