Filter löschen
Filter löschen

how to construct a video from frames

1 Ansicht (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 21 Nov. 2012
am constructing video from frames... now i delete a frame... but then also i need to construct video from remaining frames... it can be the first frame i'm deleting or last frame or any other frame... still it must construct video with the remaining frames...
please help me with what modification i need to do here.... please reply...
here's the code i used to construct video when all frames are there..
for frame = 1 : numberOfFrames
outputBaseFileName = sprintf('%d.jpg', frame);
outputFullFileName = fullfile('frame', outputBaseFileName);
% Read the image in from disk.
thisFrame = imread(outputFullFileName);
% Convert the image into a "movie frame" structure.
recalledMovie(frame) = im2frame(thisFrame);
end
% Create new axes for movie.
fontSize=14;
figure;
set(gcf, 'Position',get(0,'Screensize')); % Maximize figure.
axis off;
title('Movie recalled from disk', 'FontSize', fontSize);
% Play the movie in the axes.
movie(recalledMovie);

Akzeptierte Antwort

Image Analyst
Image Analyst am 21 Nov. 2012
Just change your for loop to start with the frame you want to begin with:
for frame = beginningFrameNumber : numberOfFrames
  7 Kommentare
Walter Roberson
Walter Roberson am 22 Nov. 2012
outframe = 0;
for frame = 1 : numberOfFrames
outputBaseFileName = sprintf('%d.jpg', frame);
outputFullFileName = fullfile('frame', outputBaseFileName);
% Skip this file if it does not exist.
if ~exist(outputFullFileName, 'file')
continue;
end
% Read the image in from disk.
thisFrame = imread(outputFullFileName);
% Convert the image into a "movie frame" structure.
outframe = outframe + 1;
recalledMovie(outframe) = im2frame(thisFrame);
end
Elysi Cochin
Elysi Cochin am 22 Nov. 2012
thank u so much... its working... thanks a lot...

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by