Downsampling a selection of images before converting them to video
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Guglielmo Sonnino Sorisio
le 2 Mai 2022
Réponse apportée : Chandra
le 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 commentaires
Réponse acceptée
Chandra
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!