Could anyone tell me how can I check if a face was detected in an image?

3 ビュー (過去 30 日間)
geo i
geo i 2016 年 3 月 12 日
コメント済み: ABDELKARIM MELIKI 2019 年 4 月 18 日
faceDetector = vision.CascadeObjectDetector();
videoFileReader = vision.VideoFileReader('visionface.avi');
videoFrame = step(videoFileReader);
bbox = step(faceDetector, videoFrame);
videoOut = insertObjectAnnotation(videoFrame,'rectangle',bbox,'Face');
figure, imshow(videoOut), title('Detected face');
  3 件のコメント
geo i
geo i 2016 年 3 月 16 日
Thank you very much. I resolved the problem.
ABDELKARIM MELIKI
ABDELKARIM MELIKI 2019 年 4 月 18 日
would you please tell me how did you resolved the problem ?
my code is like this:
  • first i did the same steps as you did above.
  • i added, when i place a bbox around the face i save it into a directory in my laptop (cuz I need it later) with :
FacCrop=imcrop(videoFrame,bbox);
imwrite(FacCrop, fpath); %fpath is already specified
  • , but since there's some frames where the face can't be detected, that means no face has been detected, and no bbox, so it returns an error in the imcrop function and won't finnish the rest of the video !
So what i want, is first to verify if the face has been detected or not in bbox, to call the crop function, else, skipp the crop step.
I hope you get my problem, and I hope I find a solution from you guys.
Thanks in advance.

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

回答 (1 件)

Explorer
Explorer 2016 年 3 月 15 日
編集済み: Explorer 2016 年 3 月 15 日
1. Capture your image using webcam
2. Detect skin and convert it into binary image
3. Detected larger blob i.e Face (Smaller one is hand and I detected hand for my project)
4. Process it.
  1 件のコメント
geo i
geo i 2016 年 3 月 16 日
Thank you very much. It's very helpful for me.

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

カテゴリ

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