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

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

问题描述

我本以为google可以回答这个问题,但是我倒霉。

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

除了Viola-Jones(类似Haar的功能的增强级联)方法之外,有人知道任何人脸检测算法的开源C ++实现吗?

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?

此外,在任何地方都存在Fisherfaces的开源C ++实现吗?

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

谢谢。

推荐答案

此帖子引起了一些注意,因此我想对其进行更新。我已经将我编写的面部识别库贡献给OpenCV,在编写本文时,它包括了特征脸,Fisherfaces和局部二进制模式直方图。因此,OpenCV 2.4.2现在附带了所有入门指南,请参见非常详细的文档:

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:

  • http://docs.opencv.org/trunk/modules/contrib/doc/facerec/

现在是原始答案。

我是Kevin's中链接的文章的作者发布。请注意,您需要找到Fisherfaces的非对称矩阵S_ {W} ^ {-1} S_ {B}的特征值,但我在博客中并未明确提及。在当前版本中,OpenCV仅具有对称矩阵的求解器;由于非对称矩阵的特征值和奇异值不相同,因此您也不能使用SVD。在我的项目中,我已将JAMA求解器改编为C ++以解决非对称矩阵的特征值问题,因此无需使用外部库。 CMakeLists.txt已配置,因此也可以使用 Eigen ,因此您可以选择。

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.

现在我终于找到了一些时间来实现 Fisherfaces方法使用OpenCV2 C ++ API,并将代码推送到我的github帐户中:

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:

  • https://github.com/bytefish/opencv/blob/master/lda

main.cpp 向您展示如何使用 Fisherfaces类和如何使用线性判别分析,其示例与以下示例相同: http://www.bytefish.de/wiki / pca_lda_with_gnu_octave 。它来自CMake项目,因此编译就像键入一样简单:

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

我不知道这是否是首选的Stackoverflow发布代码的方式在答案中,但我认为发布时间太长了。

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.

请注意两点。 (1)我从CSV文件(与此类似的文件中读取图像),则不必关心标签的顺序。 (2)我按列存储特征向量,而OpenCV中的PCA按行存储它们。这样做只是个人喜好,但我从未见过其他求解器能够做到这一点,因此我决定按列存储它们。

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天全站免登陆