Downsampling a selection of images before converting them to video
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Guglielmo Sonnino Sorisio
am 2 Mai 2022
Beantwortet: Chandra
am 5 Mai 2022
I'm trying to create an .avi file from several .tif images, due to the very large number of images and the high frame rate I need to only use every other frame so that instead of 80 fps I get 40 fps. for example if there are images named 1, 2, 3, 4, 5, 6 etc, I only need images 1, 3, 5 in the video. This is the code I'm using so far:
function tif2avi
clc; close all;
[imagelist,p]=uigetfile('*.tif','MultiSelect','on',...
'Select LIST to plot'); pause(0.5); cd(p);
if ~iscell(imagelist); disp('imagelist not cell'); return; end;
outputVideo = VideoWriter('0424_rat01.avi');
outputVideo.FrameRate = 80;
outputVideo.Quality = 50;
open(outputVideo);
for i=1:numel(imagelist)
img=imread(imagelist{i});
writeVideo(outputVideo,img);
end
0 Kommentare
Akzeptierte Antwort
Chandra
am 5 Mai 2022
Hi,
for i=1:numel(imagelist)
img=imread(imagelist{i});
img = imresize(img,[1920 911]); % change the values accordingly, find the size in outputVideo using workspace or command window
writeVideo(outputVideo,img);
end
close(outputVideo);
try to explore outputVideo from workspace and change the required values accordingly.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing 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!