generate movie of a drifting plaid

Elliot Freeman 02/07

Contents

movie parameters

nFrames = 50;
filename = 'plaidMovie';

Gabor parameters

imSize = 100;                           % image size: n X n
lamda = 10;                             % wavelength (number of pixels per cycle)
theta = [ 0 90 ];                             % grating orientation
sigma = 10;                             % gaussian standard deviation in pixels
trim = .005;                           % trim off edges of gaussian with values < trim

% compute phases for each frame in movie
phases = (1:nFrames) / nFrames;

% go through frames
for iFrame = 1: nFrames

   % call gabor function, adding each resulting image to a new layer of 3D matrix
   im1(:,:,iFrame) = gaborFn(imSize, lamda, sigma, theta(1), phases(iFrame), trim);
   im2(:,:,iFrame) = gaborFn(imSize, lamda, sigma, theta(2), phases(iFrame), trim);

   im(:,:,iFrame)  = (im1(:,:,iFrame) + im2(:,:,iFrame)) / 2;

   % display this frame
   imshow(im(:,:,iFrame), [-1 1]);
   mov(iFrame) = getframe(gcf);
   colormap(gray(256));
   drawnow; % forces drawing of figure immediately
end
Error using ==> evalin
Undefined command/function 'gaborFn'.

show movie

movie(mov, 10, 75);

save as .mat file

save(filename)