From: kiki on
Hi all,

I read into the "imresize" Matlab function and want to understand how does
these types of image transformation work...

Here is the code segment in "imresize"; it uses the "maketform" function.

I also studied that "maketform" and attached the example as follows:

Can anybody tell me what does "maketform('affine',[.5 0 0; .5 2 0; 0 0 1]);"
mean?

Especially what does [.5 0 0; .5 2 0; 0 0 1] mean?

Second question: my understanding of "imresize" is rate conversion. Suppose
I want to upsample to a ratio of 7/5...

In DSP principle I should first upsample by 7(fill in zeros every other 6
pixels, and expand the size of image to x7) and then downsample by 5, with
low pass filters in between(cutoff frequency pi/7).

However I did not see these operations in "imresize", it uses a "tformarray"
to scale the size of the image directly to 7/5... and then use the
"bilinear" and/or "bicubic" interpolants to connect the sample points to
make them smoother...

I don't quite understand this procedure... why doesn't it follow the
standard DSP rate conversion procedure?

Thanks a lot!

----------------------------------------------------
sc = (so-1)./(sn-1);% scaling for tformarray
boxA = maketform('box',so,[0 0],so-1);
boxB = maketform('box',sn,[0 0],sn-1);
scale = maketform('affine',diag(1./[sc 1]));

T = maketform('composite',[fliptform(boxB),scale,boxA]);

--------------------------------------------------------------------
T = maketform('affine',[.5 0 0; .5 2 0; 0 0 1]);
tformfwd([10 20],T)
I = imread('cameraman.tif');
I2 = imtransform(I,T);
imshow(I2)