フィルターのクリア

How to remove shadow from frames extracted with foreground detector?

2 ビュー (過去 30 日間)
Avinash S
Avinash S 2016 年 2 月 5 日
コメント済み: Avinash S 2016 年 2 月 7 日
Im working on tracking the human silhouette with input from webcam. I have used vision.foregroundDetector to get the foreground masks. But they detect the shadows too. How to eliminate them? Code:
foregroundDetector = vision.ForegroundDetector('NumGaussians',3,'NumTrainingFrames',10,
'LearningRate',0.000001);
vid = videoinput('winvideo', 1); %select input device
i=1;
while(1)
%frame = step(vid); % read the next video frame
frame = getsnapshot(vid);
foreground = step(foregroundDetector, frame);
se = strel('square', 3);
filteredForeground = imopen(foreground, se);
fname = sprintf('frames/frame%d.jpg',i);
imwrite(filteredForeground,fname,'jpg');
i = i+1;
end
Output Frame:

採用された回答

Dima Lisin
Dima Lisin 2016 年 2 月 6 日
One thing to try is to convert the video frame to a color space like HSV or YCbCr, and then only feed the chroma channels into the foreground detector. This is going to eliminate most shadows. However, it may also eliminate legitimate objects which do not have a lot of saturated colors.
  1 件のコメント
Avinash S
Avinash S 2016 年 2 月 7 日
Thanks for the idea Dima Lisin. I will try it

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by