-1

我是 OpenCV 的初学者。我已经成功检测到人脸,现在我要做的是匹配来自两个不同图像的人脸并返回真值或假值。我怎样才能在openCV中使用c++做到这一点请帮忙

4

1 回答 1

2

人脸识别是一种先进的方法。

有一个专门用于此的网站:http: //www.face-rec.org/

它包含许多研究论文、算法等来进行人脸识别。您可以通过谷歌搜索找到类似的网站。

用于此目的的两种流行方法是:

1. 特征面:

要理解这一点,下面的维基百科段落很好:

A set of eigenfaces can be generated by performing a mathematical process called principal component analysis (PCA) on a large set of images depicting different human faces. Informally, eigenfaces can be considered a set of "standardized face ingredients", derived from statistical analysis of many pictures of faces. Any human face can be considered to be a combination of these standard faces. For example, one's face might be composed of the average face plus 10% from eigenface 1, 55% from eigenface 2, and even -3% from eigenface 3. Remarkably, it does not take many eigenfaces combined together to achieve a fair approximation of most faces. Also, because a person's face is not recorded by a digital photograph, but instead as just a list of values (one value for each eigenface in the database used), much less space is taken for each person's face.

人脸的前 32 个特征面(从http://www.shervinemami.info/faceRecognition.html获得)

在此处输入图像描述

此方法的 C++ 实现可以在http://www.shervinemami.info/faceRecognition.html找到。

2. 费雪脸:

这使用了另一种称为线性判别分析的方法。欲了解更多详情,请访问:http ://www.scholarpedia.org/article/Fisherfaces

例如:图像的前 4 个 Fisher 脸

在此处输入图像描述

最后,您可以从此 pdf 中找到有关它们的所有详细信息代码。你可以在这个 github repo中找到它的 C++ 实现。

供您参考,上述实现已从 2.4-beta 版开始添加到 OpenCV 主流(在此处查看更改日志)。甚至这些代码也包含在OpenCV 2.4-beta附带的cpp 示例中。

于 2012-04-26T04:50:49.370 回答