Prev: Wave Equation
Next: Identifying workspaces
From: Zulkifli on 8 Feb 2010 22:50 Hi all, I've written some code where the idea is to store the images in sequence. there is a video for 2secs. video fps is 15. and for 2 secs video, it should provide 30 frame of images. anyway, i written the code as below; fin = 'C:\Users\atsb\Documents\MATLAB\output.avi'; %directory of the video fileinfo = aviinfo(fin); nframes = fileinfo.NumFrames; for i = 1:nframes %Read frames from input video mov_in = aviread(fin,i); im_in = frame2im(mov_in); image(im_in); imwrite(im_in,'test.tiff','WriteMode','append'); %write frame as image test1.tiff, test2.tiff and so on... end; when i run it, it only store 1 image only. seems like it didn't write another 29 frames into images. where did i do wrong. thanks
From: ImageAnalyst on 8 Feb 2010 23:06 I don't see how you're changing the filename like you claim in your comment - it's always the same "test'tiff" Use sprintf() and fullfile() to build up your filenames if you want separate files. Or, are you trying to build up a multi-page tiff file? With multiple images in one tiff file? Have you tried the new tiff class in the most recent version?
|
Pages: 1 Prev: Wave Equation Next: Identifying workspaces |