Monday, February 23, 2009

Convert images sequence from one format to another

for i = 1:942

filename_in = sprintf('/home/gaipaul/Desktop/data/logitech/%08d.jpg',i);
I = imread(filename_in);
Ig = rgb2gray(I);
Ig = imresize(Ig,0.3);
filename_out = ['/home/gaipaul/Desktop/data/logitech/gray/' int2str(i) '.pgm'];
imwrite(Ig,filename_out);

end

No comments: