人脸识别分类器
Face Recognition Classifier
参考之前的post,用于分类的方法是最近邻欧氏距离。然而,所获得的结果并不准确,因为已知数据集和未知数据集都给出了99%的相似性。即使与Mahalanobis距离也给出了类似的结果。
人脸识别分类还有其他方法吗?你能给我提供一些例子/公式吗?
float d_i = projectedTestFace[i] - projectedTrainFaceMat->data.fl[iTrain*nEigens + i];
distSq += d_i*d_i; // Euclidean distance
imho,如果你得到了糟糕的结果,那就怪你的输入,而不是距离公式
在没有任何进一步预处理(对齐、裁剪、均衡)的情况下,即使像素上的普通L2范数也比本征面给出更好的结果。(这里是可悲的事实)
自2.4.2年起,opencv推出了开箱即用的人脸识别功能。(还具有可选的fisher和lbph功能)
你可能应该使用它,而不是自己滚动(请使用c++api,而不是神秘的c)。
如果你真的想坚持使用本征面,你仍然可以尝试"重建"(从本征向量)图像和测试图像之间的L2距离作为置信度测量,就像这里所做的那样(再次由shervin)
// Compare two images by getting the L2 error (square-root of sum of squared error).
double getSimilarity(const Mat A, const Mat B)
{
if (A.rows > 0 && A.rows == B.rows && A.cols > 0 && A.cols == B.cols) {
// Calculate the L2 relative error between the 2 images.
double errorL2 = norm(A, B, CV_L2);
// Convert to a reasonable scale, since L2 error is summed across all pixels of the image.
double similarity = errorL2 / (double)(A.rows * A.cols);
return similarity;
}
else {
//cout << "WARNING: Images have a different size in 'getSimilarity()'." << endl;
return 100000000.0; // Return a bad value
}
}
我想知道为什么我总是得到100000000的回报。这是否意味着经过预处理和重建的人脸大小不同?这就是它跳过L2距离比较的原因?
以下是我编码的一部分:
Mat j =projectedTestFace[i];
Mat k =projectedTrainFaceMat>data.fl[iTrain*nEigens + i];
similarity=getSimilarity(j,k);
在没有else语句的情况下,我得到了similation=-nan结果,想知道-nan和-inf代表什么。
相关文章:
- 从udp接收帧对于人脸识别来说太慢
- 为我的 c++ 类介绍制作一个三角形分类器.我有几个问题
- 只有级联分类器会发出未定义的引用错误
- 将svm分类器设置为HOG检测器
- 每次b/c程序无法加载级联时,使用harr级联的人脸识别都会失败
- 人脸识别:每个人的所有图像都必须相同吗?
- 在C++中找不到人脸识别器
- 在C /OBJ-C 中运行Tensorflow分类器模型与Python的结果不同
- 贝叶斯和SVM分类器在OpenCV3中的实现
- 如何在opencv3中使用UMat来训练人脸识别
- OpenCV SVM 分类器图像识别
- 人脸识别器OpenCV
- 加载经过训练的人脸识别器模型
- 人脸识别器未在此范围内声明
- 训练人脸识别器需要花费大量时间
- OpenCV , 人脸检测 , 命令理解 : stage_sum += 分类器->alpha[总和 >= t]
- OpenCV性别分类使用级联分类器与面部识别器(fishface)
- 融合多Haar分类器进行人脸检测
- 为LBP人脸识别器格式化图像
- 人脸识别分类器