how to get this video background removal worked?

1 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by