Make a video from images in while loop

32 ビュー (過去 30 日間)
Eliska Paulikova
Eliska Paulikova 2022 年 10 月 29 日
コメント済み: KALYAN ACHARJYA 2022 年 10 月 30 日
Hello I had a video that I separated to "n" frames, I apply a segmentation on them and now I would like to make the video again from that frames. But I do not want to save it in file. Only make a variable in matlab.
How can I do that.
Thank you so much.
EP

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 10 月 29 日
#Ensure that all images having same size & format
images_data=dir('*.jpg') ;
writerObj=VideoWriter('Video_test.avi'); % Change the video file name
%Change the frame rate as per requirements
writerObj.FrameRate = 5;
open(writerObj); % Open Video writer
% write the frames to the video
for i=1:length(images_data)
image_data=images_data(i).name ;
im=imread(image_data);
imshow(im)
vid_file= getframe(gcf); % Get the displayed image/figure
writeVideo(writerObj,vid_file); % write video
end
#Check the video file at Current Working Diretory (File Name: Video_test)
  2 件のコメント
Eliska Paulikova
Eliska Paulikova 2022 年 10 月 30 日
Thank you so much, I appreciate it
KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 10 月 30 日
Welcome, glad to know that. @Eliska Paulikova

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by