Extract hands from a video
Afficher commentaires plus anciens
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
Réponses (0)
Catégories
En savoir plus sur Video Formats and Interfaces dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!