For my new iPhone app I like to use OpenCV for detecting face elements with the purpose of morphing faces. Does anybody know what elements need to be detected for this, and if it's even possible with OpenCV? Are there perhaps better alternatives?
You could use dlib for detecting facial landmarks, there is 68 points:
Here is very useful project: https://github.com/zweigraf/face-landmarking-ios
Opencv has eye, ear,mouth, nose, eye pair detector cascades.
Related
Using dlib, is it possible to detect eye landmarks without face detection? If yes, how? and if no, any suggestion or advice? Thank you!
Sample
Q: Is it possible to detect eye landmarks without face detection?
A: No, because the dlib facial landmark requires faces as inputs.
Q: and if no, any suggestion or advice?
A: The simplest way for face detection in your case is to use face detection from dlib dlib.get_frontal_face_detector(). However, you can use any face detection as long as you can find the bounding box to detect landmarks.
It's possible by training your own object detector using dlib. Simple HOG detector can do that. Steps are:
Prepare train data
Draw bounding boxes on training data set
Train it and save as model
Load model to use.
You can go from simple object detector using HOG in dlib, or higher level using deep learning dlib MMOD.
Here is the link to MMOD (deep learning based, higher accuracy): http://dlib.net/dnn_mmod_train_find_cars_ex.cpp.html
I am trying to extract mouth(lips) from images. What I did is this. I first extract faces from images and tried to detect mouth using haarcascade_mcs_mouth.xml. However, It keeps detecting other parts instead detecting mouth from the face. Is there any other way to detect mouth from face images?
You can use some facial landmark detector such as Flandmark detector:
http://cmp.felk.cvut.cz/~uricamic/flandmark/
Or STASM:
http://www.milbo.users.sonic.net/stasm/
To correctly detect mouth regions, you can try more advanced methods like the following one:
X. Zhu, D. Ramanan. Face Detection, Pose Estimation and Landmark Localization in the Wild Computer Vision and Pattern Recognition (CVPR) Providence, Rhode Island, June 2012. (Project page), (PDF Online available), (Source code)
Several real examples can be seen from here.
I'm making system for emotion detection on Android mobile phone. I'm using OpenCV's Cascades (LBP's or Haars) to find face, eyes, mouth areas etc. What I have observed till now that accuracy isn't stable. There are situations where I can't find eye or I have "additional faces" in the background due to very slight change of light. What I wanted to ask is:
1) Is Haar Cascade more Accurate than LBP?
2) Is there any good method for increasing accuracy of detection? Like find face/eyes etc on binarized image, or use some edge detection filter, saturation, anything else?
you can try Microsoft API for face emotion detection ..i am trying in my project so..result is best..try this link
https://www.microsoft.com/cognitive-services/en-us/emotion-api
sometimes HAAR or LBP will not get a good enough result for a face detection system. if you want to get more good acc. i think you can try to using STASM
it base on opencv and using Haar to detect face and landmark. something others you can also try YOLO Face detection
if you want to build your own face detection system just base on Haar or LBP and make them get a good result, maybe you will need to using the LBP to find out the face faster and train a CNN model to get the last good result, it can make your system to detect faces in realtime. as i know, the SEETAFACE is using this way to make a realtime faces detection.
I am very new to opencv and able to install it so far. I want to compare a face with other different faces available in library and to find out the closest match. I have tried different features but couldn't find the closer answer.
Any suggestion to choose a detector.
dimensions of input image and images in library are same.
thanks in advance
i think, you want face recognition (who is it?), not detection (is it a face?).
look here for what opencv has to offer there
How can I detect irises in a face with opencv?
Have a look at this forum thread. There's some source code there to get you started, but be careful about using it directly -- the original author seemed to have problems compiling it.
Start with detecting circles - see cvHoughCircles - hint, eyes have a series of concentric circles.
OpenCV has Face Detection module which uses Haar Cascade. You can use the same method to detect Iris. You collect some iris images and make it as positive set and non iris images as negative set. The use the Haar Training module to train it.
Quick and dirty would be making an eye detection first with Haar filter, there are good model xml files shipped with opencv 2.4.2. Then you do some skin detection (in the HSV space rather than the rgb space) to identify the area of the eye in the middle, or circle search.
Also, projections, histogram-based decisions can be used once the eye area is cropped.