% EE437 Intro to Image Processing, S97
% Geometric image manipulation (2nd time)
% updated for ver 5.3 (S00)

% Load the image
f=imread('camera.png');
f=double(f);

% Show the image
figure
imshow(uint8(f)),truesize
drawnow

% Image dimensions
fnumrow=size(f,1);
fnumpix=size(f,2);



% Image coordinates for output image
[xnew ynew]=meshgrid(-1:2/fnumpix:1-1/fnumpix,...
   -1:2/fnumrow:1-1/fnumrow);

% Compute the coordinates for the input image
xold=xnew./(1-abs(ynew)+abs(ynew)/10);
yold=ynew;

% Display the new image
g=interp2(xnew,ynew,f,xold,yold,'*linear');
figure
imshow(uint8(g)),truesize

