Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am running a loop which generate an image fg_modify inside loop. i.e. the image is generated inside loop everytime with same name and get over-written in next run. I want to make a video using all these images. Please help me.

2 ビュー (過去 30 日間)
Anurag
Anurag 2016 年 9 月 23 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
for i=1:numframes %blah blah %blah blah
figure; imshow(fg_modify,[]) end
I want to make a video using all images(fg_modify) which is generated in the for loop.

回答 (1 件)

Amgad Salama
Amgad Salama 2016 年 10 月 9 日
Hi,
You can try this. I'm using it to generate a GIF from multiple images
figure(1)
filename = 'OUTPUT_FILE_NAME.gif' ;
for n = 1 : N %%%total number of your images
imshow(FILENAME)
drawnow
frame = getframe(1) ;
im = frame2im(frame) ;
[imind,cm] = rgb2ind(im,128) ;
if n == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf) ;
else
imwrite(imind,cm,filename,'gif','WriteMode','append') ;
end
end
Hope that will help you or at least indicate the idea.
Best, Amgad

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by