C++人脸检测/识别实现

发布于 2024-12-07 06:37:47 字数 150 浏览 0 评论 0 原文

我本以为谷歌可以回答这个问题,但我运气不佳。

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

另外,是否存在 Fisherfaces 的开源 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓酥 2024-12-14 06:37:47

这篇文章引起了一些关注,所以我想更新它。在撰写本文时,我已向 OpenCV 贡献了我编写的人脸识别库,其中包括 Eigenfaces、Fisherfaces 和局部二进制模式直方图。因此,OpenCV 2.4.2 现在附带了入门所需的一切,请参阅非常详细的文档:

现在是原始答案。

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

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

main.cpp 向您展示如何使用 Fisherfaces 类 以及如何使用线性判别分析,示例如下:http://www.bytefish.de/wiki/pca_lda_with_gnu_octave。它是一个 CMake 项目,因此编译就像打字一样简单:

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 方式,但我认为发布有点太长了。

请注意两件事。 (1) 我从 CSV 文件中读取图像(就像这个< /a>),您不必关心标签的顺序。 (2)我按列存储特征向量,而OpenCV中的PCA按行存储它们。这样做只是个人喜好问题,但我从未在任何其他解算器中见过这种情况,因此我决定按列存储它们。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文