Open source computer vision - c++

I am working on face recognition project and i am using opencv2.4.8. i am planning to implement face recognition using eigenface algorithm.
The thing is how to know the list of algorithm for face recognition that is present in opencv 2.4.8.

You can find this information in documentation

There is simple LBP based face recognition in OpenCV contrib. It should be better than PCA (eigenfaces) in terms of sensitivity to lighting conditions. I would recommend to start from this.

Have a look at OpenCV 3.0. The change list includes face recognition functionality - http://docs.opencv.org/3.0.0/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#details
Also might be worth a look at another face recognition tool, openBR - http://openbiometrics.org/. You can control the keypoint detection stage too to avoid using algorithm which breach license issues.

Related

dlib vs opencv which one to use when

I am currently learning OpenCV API with Python and its all good. I am making decent progress. Part of it comes from Python syntax's simplicity as against using it with C++ which I haven't attempted yet. I have come to realize that I have to get dirty with C++ bindings for OpenCV at some point if I intend to do anything production quality.
Just recently I came across dlib which also claims to do all the things OpenCV does and more. Its written in C++ and offers Python API too (surprise). Can anybody vouch for dlib based on their own implementation experience?
I have used both OpenCV and dlib extensively for face detection and face recognition and dlib is much accurate as compared to OpenCV Haar based face detector. ( Note that OpenCV now has a DNN module where we get Deep Learning based Face Detector and Face Recognizer models. )
I'm in the middle of comparing the OpenCV-DNN vs Dlib for face detection / recognition. Will post the results once I'm done with it.
There are many useful functions available in dlib, but I prefer OpenCV for any other CV tasks.
EDIT : As promised, I have made a detailed comparison of OpenCV vs Dlib Face Detection methods.
Here is my conclusion :
General Case
In most applications, we won’t know the size of the face in the image before-hand. Thus, it is better to use OpenCV – DNN method as it is pretty fast and very accurate, even for small sized faces. It also detects faces at various angles. We recommend to use OpenCV-DNN in most
For medium to large image sizes
Dlib HoG is the fastest method on CPU. But it does not detect small sized faces ( < 70x70 ). So, if you know that your application will not be dealing with very small sized faces ( for example a selfie app ), then HoG based Face detector is a better option. Also, If you can use a GPU, then MMOD face detector is the best option as it is very fast on GPU and also provides detection at various angles.
For more details, you can have a look at this blog

How to extract LBP features from a hand contour using opencv c++

I am currently working on a hand recognition system. I have been able to detect the hand and draw a contour for it. Now, I have to extract features from the hand region. What is the best feature extraction method that i can use?
I was thinking to use Local Binary Pattern, but since i am new to computer vision i don't know how to use it.
Perhaps you must look at histogram of gradients (HOG), which can be considered as a more general version of LBP. You can have multiple images of hands; by extracting HOG features from each image and using an SVM or neural network classifier, you can learn a statistical model of hand poses. This will help in recognizing an unseen hand. Look also at the current literature on deep learning.
A C++ implementation of HOG is available from vlfeat library [1], which can be called from OpenCV. HOG can be computer from OpenCV also [2].
[1] http://www.vlfeat.org/overview/hog.html
[2] http://goo.gl/8jTetR

Feature detection in profile face images

I am using opencv 2.4.2 and c++. I am trying to detect the eyes,nose and mouth of a profile face using haarcascade xml files.The eyes are most of the time detected correctly using haarcascade_mcs_righteye and haarcascade_mcs_lefteye. However,the nose and mouth xml are mostly failures with profile faces[as shown below]. I understand that those were made for frontal face,but is there any other "not-so-complicated" open source method which I can use to detect the tip of the nose and corner of mouth in profile images?Basically,I will need their coordinates,but first I will need to detect them. Anybody please?
Recently, Zhu and Ramanan CVPR 2012 had intoduced Face detection, pose estimation and landmark localization, this is by far the best I've seen, OpenCV Is Great By All means, but it's not state of the art for all applications out there nowadays.
I hope this helps

Detect and extract face from an image

I have been trying to do the following -
When a user uploads an Image in my web app, I'd like to detect his/her face in it and extract face (from forehead to chin and cheek to cheek) from it.
I tried OpenCV/C++ face detection using Haar Cascade but problem with it is that it gives a probability of where the face would be because of which either background of image comes inside the ROI or even the complete face doesn't come in the ROI.
I also want to detect eye inside the face and while using the above technique, the eye detection isn't that accurate.
I've read up on a new technique called Active Appearance Model (AAM). The blogs where I read up about this show that this is exactly what I want but I am lost on how to implement this.
My queries are -
Is using AAM a good idea for face detection and face feature detection.
Are there any other techniques for doing the same.
Any help on any of these is much appreciated.
Thanks !
As you noticed OpenCV's implementation of face detection is not state-of-the-art. It is a very good and robust implementation but you can do better.
Recently, Zhu and Ramanan (CVPR 2012) had intoduced Face detection, pose estimation and landmark localization in the wild which is considered to be one of the leading algorithms for face detection in recent years.
Their algorithm is capable of detecting faces both frontal and profile views AND identifying keypoints on the detected face such as eyes nose and mouth.
The authors were kind enough to publish their code along with learned models, it is a Matlab implementation but the main computations are done in C++, so it should not be too difficult to make a standalone C++ implementation of thier method.

Facial Feature Points Detection using OpenCV

I want to detect the points on a face as shown in the picture
I am using OpenCV CascadeClassifier::detectMultiScale.
I am using the haarcascade_frontalface_alt, haarcascade_eye, haarcascade_mcs_mouth xml files.
I am satisfied with the face detection but not with the facial feature points detection.
I want the feature points detection to work for the images upto a distance of 8 feet.
I am looking for more accuracy and robustness wrt pose(15 degrees) and opening of mouth, without compromising speed.
I am looking for speed of 25fps on an i5 processor.
Can anyone suggest/refer me any libraries/open source codes for my problem.
C++ platform.
Try Flandmarks http://cmp.felk.cvut.cz/~uricamic/flandmark/
It extracts 7 feature points but you will not be able to get the feature points for upperlip and the lower lip.
You can try using an ASM mesh to fit the face. There are several implementations that use ASM/AAM.
https://code.google.com/p/asmlib-opencv/ is an open source library which has built in dataset for face images. Do look into it.
Cheers