Example of interpolating images using a 1st order Taylor polynomial
Using the images in images
and functions
% Center image
I0 = ppmunpack(readppm('bus/bus-0000000118.pgm'))'/255;
imshow(I0);
% Numerically compute central difference approximation based on I(t-1)
% and I(t+1)
I1 = ppmunpack(readppm('bus/bus-0000000117.pgm'))'/255;
I2 = ppmunpack(readppm('bus/bus-0000000119.pgm'))'/255;
dI = I2-I1;
% Render 11 images around I(t) using Taylor approximation
for t = -1:.2:1
Ic = I0 + t*dI;
imshow(Ic)
drawnow;
end
To think about: How do you form a B-matrix from the above of
the form used in the rest of the lab?
You can also try your sinus wave interpolation from Exc 1 to
make the bus go back and forth with smooth physically plausible
accelerations.