how to use the previous frame of a video in a loop without saving it
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hello,
I am trying to compute the silhoutte motion image from a silhouette of video, i want to perform all the steps in a sequence with saving the silhouette and then working on it. as my application is real-time
i used this code to extract the silhouette
v = VideoReader('2.mp4');
nFrames = v.NumberOfFrames;
for f=1:nFrames
I=read(v,f);
if f==1
Background=I;
Fg=abs(I-Background);
else
Fg=abs(I-Background);
end
grayImage = rgb2gray(abs(im2double(Fg))); % Convert to gray level
thresholdLevel = graythresh(grayImage);
binaryImage = im2bw(grayImage,thresholdLevel);
% now for the silhouette motion image i have to compute
for n=1:f
if f==1
smi1=binaryImage;
else
smi1=abs(binaryImage+binaryImage(previous frame i.e (f-1));
end
end
smii=abs(smi1-bi);
my question is how do i access the previous frame within the loop, without saving it
2 Commenti
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!