Downsampling a selection of images before converting them to video
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Guglielmo Sonnino Sorisio
el 2 de Mayo de 2022
Respondida: Chandra
el 5 de Mayo de 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 comentarios
Respuesta aceptada
Chandra
el 5 de Mayo de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!