对OpenCV的FaceRecognizer有信心吗? [英] What is confidence in OpenCV's FaceRecognizer?

查看:56
本文介绍了对OpenCV的FaceRecognizer有信心吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用OpenCV的FaceRecognizer进行人脸识别项目,进行性别区分.该算法效果很好,但是我想在程序中实现一些额外的功能,例如预测的可信度.

I've been working on a face recognition project using OpenCV's FaceRecognizer, doing gender differentiation. The algorithm works pretty well, but I wanted to implement some extra features into my program like the confidence of the prediction.

预测函数可以输出置信度,但是我不确定它的含义.这种信心实际上可以衡量什么,我可以将其转换为百分比吗?

The predict function can output a confidence level, but I'm not sure what it means. What does this confidence actually measure, and can I convert it into a percentage?

int predictedLabel = -1;
double confidence = 0.0;
model->predict(face_resized, predictedLabel, confidence);
string result_message = format("Predicted class = %d / Confidence = %d.", predictedLabel, confidence);
cout << result_message << endl;

这是输出的样子. https://www.dropbox.com/s/65h1n5180ulz3hl/facerecConfidence%20.jpg

推荐答案

在OpenCV-用户列表此处.

There's a brief discussion on what this distance actually is on the OpenCV-users list here.

总结一下,他们使用的功能是:

To summarise, the function they use is:

distance = 1.0f - sqrt( distSq / (float)(nTrainFaces * nEigens) ) / 255.0f 

但是,该函数的作者说这是一个非常粗糙的指南,而不是一个完整的证明指南.请参阅用户列表讨论的链接,以获取对本文的参考以及对​​替代指标的建议.

However, the author of the function says that it is a very rough guide and not a full proof guide. See the link to the users list discussion for a reference to the paper and a suggestion for an alternative metric.

这篇关于对OpenCV的FaceRecognizer有信心吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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