how to get this video background removal worked?

조회 수: 1 (최근 30일)
matin
matin 2020년 3월 24일
hello everyone,
I cannot get this code working and it gives me black screen as output!
clc
clear
close all
obj = vision.VideoFileReader('1.mov');
frames= 550;
threshold=25;
for f=1:frames
I=step(obj);
%figure(1);imshow(I);title('Input Video Sequence');
if f==1
Background=I;
Fg=abs(I-Background);
else
Fg=abs(I-Background);
end
Fg(Fg>threshold) = 255;
Fg(Fg<=threshold) = 0;
figure(2);imshow(Fg);
drawnow;
pause(0.2)
end

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by