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
Related
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 have been given an image with rgb channels. I only want to see the persons face. How would I do that? Are neural nets used for this? If so, are there existing data files from neural nets that have already done the processing?
Since your questions is tagged with OpenCV, I will assume that you are looking for a solution within this library.
The first step is to find the faces. For this, use one of the cascade object detectors that are available: either the Viola-Jones one or the LBP one.
OpenCV comes with cascades trained for face detection for each of these detectors.
Then, it depends if getting a bounding box is enough or not.
If you need something more accurate, then you can:
[coarse face] use a skin color detector inside the face bounding box to get a finer face estimate, binarize the image and finally close the face shape using morphological filtering;
[fine face contour] use something like a grabcut procedure to get a pixel-accurate contour. You can initialize the grabcut with borders of the bounding box as background and center part of the bounding box as foreground.
Not really sure what you want to do, but you can use Haar Classifier for face detection.
From then on, it should be easy to only display the face. While there are available classifiers online, you can try training your own classifier should you have the time. I have done classifiers on hand, face, eyes before and it have an impressive result.
Should you need more help on training classifier, etc, just comment here, I will try my best to assist you.
Face detection functionality is also available in the Computer Vision System Toolbox for MATLAB in the form of the vision.CascadeObjectDetector object.
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.
Is there anyway to detect a car (object) after a sobel detction in opencv?
This is my current's work as shown as the image below:
Advanced thanks for any guidelines or solutions!
Object detection task need quite a bit of effort.
First, extract relevant features from object you want to detect: histogram of oriented gradient should be fine for car detection. So, you need to get database of car images. Second, you need to learn models using machine learning algorithm. Boosting or support vector machine should do the work. You will find the implementation in opencv.
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.