% Load images, create movie file a export this as an AVI-file
%
% Tomas Svoboda, svoboda@vision.ee.ethz.ch, 07/2003

clear all;


% wher the images are stored
% im.dir ='/home/svoboda/viroomData/ViRoom/VirtualCamera/Svoboda3Cams/HomographyCalib/cam20/';
im.dir = '/scratch/staehpas/avi/single2/floorpl/4movie/';

im.ext ='pnm';
im.basename = 'sifp*';

% it saves the resulting movie in the current directory
movie.name = 'movie3.avi';
movie.fps  = 5;					% frames per second

% load image names
seq.data = dir([im.dir,im.basename,im.ext]);
seq.size = size(seq.data,1);

% required for indexed images (not full-color ones)
map = colormap(gray(256));

% load images
disp('loading images ...');
for i=1:seq.size,
	im.IM = imread([im.dir,seq.data(i).name]);
	% for j=1:3
	% imnew(:,:,j) = im.IM;
	% end
	seq.F(i) = im2frame(im.IM);
	% seq.F(i) = im2frame(im.IM,map); % for indexed images
end

disp('saving avi-movie ...')
% this is the saving command for the one-directory task
movie2avi(seq.F,movie.name,'FPS',movie.fps)


	




