How to make one video out of 3 images?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Teshan Rezel
am 13 Mär. 2022
Kommentiert: Teshan Rezel
am 14 Mär. 2022
Hi folks,
I'm trying to create a single image out of 3 different images, then collate the subsequent images into a video. I'm also trying to write some text onto the middle of the 3 images, that changes with each subsequent frame. I have made the following start but am having limited luck getting it to work!
mainImg = imread([imageMainFolder imageMainFiles(j).name]);
mainImg = mainImg(:,:,1:3);
cropImg = imread([cropsFolder cropFiles(j).name]);
threshImg = im2uint8(imread([threshFolder threshFiles(j).name]));
h = figure;
h(1) = subplot(2, 2, 1);
image(cropImg, "Parent", h(1));
h(2) = subplot(2, 2, 2);
image(threshImg, "Parent", h(2));
h(3) = subplot(2, 2, 3:4);
image(mainImg, "Parent", h(3));
myText = ['Temperature = ' num2str(myTemp(j)) '$^{o}C$'];
RGB = insertText(h, [50 50], myText, 'FontSize',18,'BoxColor', 'black','BoxOpacity',1,'TextColor','white');
image(RGB, 'Parent', axes);
axes.Visible = 'off';
writeVideo(writerObj, RGB);
this is placed inside a loop for j. I close the writerObj when the loop ends.
I'm sure my syntax is wrong so I'd appreciate any advice on how to fix it!
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 13 Mär. 2022
See attached example. See the second half where I create a movie from images in a folder. The first half deals with extracting frames from an existing movie, getting the mean colors, and (optionally) saving the individual frames to disk.
With only 3 images, you'll need to adjust your FrameRate to be something like 1 or 2 seconds.
2 Kommentare
Image Analyst
am 13 Mär. 2022
Attached is another, simpler example where I make a movie from the current figure being displayed.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Preview and Device Configuration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!