C++ 人脸检测/识别实现 [英] C++ face detection/recognition implementations

查看:22
本文介绍了C++ 人脸检测/识别实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'd have thought that google could answer this question, but I've not had much luck.

Does anyone know of any open source C++ implementations of any face detection algorithms other than the Viola-Jones (boosted cascades of Haar-like features) method?

Also, does there exist an open source C++ implementation of Fisherfaces anywhere?

Thanks.

解决方案

This post gets some attention, so I'd like to update it. I've contributed the face recognition library I wrote to OpenCV, which includes Eigenfaces, Fisherfaces and Local Binary Patterns Histograms at time of writing this. So OpenCV 2.4.2 now comes with everything to get started, see the very detailed documentation:

Now the original answer.

I am the author of the article linked in Kevin's post. Please note that you need to find the eigenvalues of the non-symmetric matrix S_{W}^{-1} S_{B} for the Fisherfaces, I didn't explicitly mention it in my blog. OpenCV only has a solver for symmetric matrices in its current version; since eigenvalues and singular values aren't equivalent for non-symmetric matrices you can't use a SVD either. For my project I have adapted the JAMA solver to C++ for solving the eigenvalue problem for non-symmetric matrices, so there's no need to use an external library for it. The CMakeLists.txt is configured, so Eigen can be used as well, so you have the choice.

Now I've finally found some minutes to implement the Fisherfaces method with the OpenCV2 C++ API and pushed the code into my github account at:

The main.cpp shows you how to use the Fisherfaces class and how to use the Linear Discriminant Analysis with the same example as on: http://www.bytefish.de/wiki/pca_lda_with_gnu_octave. It comes as a CMake project, so compiling is as easy as typing:

philipp@mango:~/some/dir$ mkdir build; cd build
philipp@mango:~/some/dir/build$ cmake ..
philipp@mango:~/some/dir/build$ make
philipp@mango:~/some/dir/build$ ./lda

I don't know if it's the preferred Stackoverflow way to post code in the answer, but I think it's a bit too long to post.

Please note two things. (1) I read the images from a CSV file (just like this one), you don't have to care about the order of the labels. (2) I store the eigenvectors by column, while the PCA in OpenCV stores them by row. It's just a matter of personal taste to do so, but I've never seen that for any other solver and so I decided to store them by column.

这篇关于C++ 人脸检测/识别实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆