필터 지우기
필터 지우기

Extract hands from a video

조회 수: 3 (최근 30일)
Marco
Marco 2014년 1월 24일
Hello,
I have a video in which hands perform some gesture and are not always in motion; I have to extract them. Because the first frames are the background I tried with:
readerObj = VideoReader('VideoWithHands.mp4');
nFrames = readerObj.NumberOfFrames;
fr = get(readerObj, 'FrameRate');
writerObj = VideoWriter('Hands.mp4', 'MPEG-4');
set(writerObj, 'FrameRate', fr);
open(writerObj);
bg = read(readerObj, 1); %background
for k = 1 : nFrames
frame = read(readerObj, k);
hands = imabsdiff(frame,bg);
writeVideo(writerObj,hands);
end
close(writerObj);
but in this way, colors are not "real" and opacity level is low (you can see something through the hands). I wonder whether it would be possible to extract the hands keeping real colors and opacity exploiting the background. Thanks

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by