how to use the previous frame of a video in a loop without saving it

2 ビュー (過去 30 日間)
Saba Baloch
Saba Baloch 2020 年 2 月 20 日
コメント済み: Saba Baloch 2020 年 2 月 20 日
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 件のコメント
KSSV
KSSV 2020 年 2 月 20 日
Where you are reading the frame...there you use your calculation....simple.
Saba Baloch
Saba Baloch 2020 年 2 月 20 日
Thanks for your response, but i want to work on the already processed frame, how do i use a frame that has already been processed

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by