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

7 visualizaciones (últimos 30 días)
Anirudh
Anirudh el 11 de Jun. de 2014
Respondida: Dima Lisin el 15 de Jul. de 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.

Respuestas (1)

Dima Lisin
Dima Lisin el 15 de Jul. de 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 .

Categorías

Más información sobre Computer Vision Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by