How do i separate a video into frames without displaying all the frames in different figures?

2 vues (au cours des 30 derniers jours)
I have a code that takes a video and separate it into frames.I would like to NOT keep all the frames, instead i want each frame to be displayed in the previous figure. The code looks like these:
filename = uigetfile; %get the file name
obj = VideoReader(filename);
nFrames=obj.NumberOfFrames;
for k = 1 : nFrames
this_frame = read(obj, k);
thisfig = figure();
thisax = axes('Parent', thisfig);
image(this_frame, 'Parent', thisax);
title(thisax, sprintf('Frame #%d', k));
Another thing that's important is that i calculate intensities from each figure as it comes but i don't need to save the figure after i save the data. Can anyone help me and tell me what i should change in my code? Thanks!

Réponse acceptée

Walter Roberson
Walter Roberson le 11 Sep 2013
Change
thisfig = figure();
to
thisfig = gcf;

Plus de réponses (0)

Catégories

En savoir plus sur Particle & Nuclear Physics 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!

Translated by