Detecting frames for which a face appears in a video...

6 vues (au cours des 30 derniers jours)
Anirudh
Anirudh le 11 Juin 2014
I need to detect the number of frames for which a face is appearing in a video. I looked into the sample code using CAMShift algorithm (<http://www.mathworks.in/help/vision/examples/face-detection-and-tracking-using-camshift.html)>. Is there a way to get true and false values from the step function (bbox = step(faceDetector, videoFrame);) in order to know if a face appears in a particular frame? I'm new to MatLab. I'm assuming inbuilt functions (the step function seems pretty confusing) return some default value in case a condition fails. Is there a possible solution?
I am not concerned about the computational burden - although a faster approach for the same would be appreciated.

Réponses (1)

Dima Lisin
Dima Lisin le 15 Juil 2014
If a face is not detected in a frame, bbox will be empty. So you can simply check
if isempty(bbox) ...
to handle the case when a face is not detected.
Generally, you probably want to track the face, because vision.CascadeObject detector is not likely to detect a face, which is tilted or turned. Please see this example of tracking a face using the KLT algorithm, and this example of tracking multiple faces .

Catégories

En savoir plus sur Computer Vision Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by