人脸识别(二维阵列)置信度公式推导 [英] Face Recognition (2D Array) Confidence Formula Derivation

查看:440
本文介绍了人脸识别(二维阵列)置信度公式推导的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

  1. 为什么将其除以(nTrainFaces * nEigens)?

推荐答案

为什么要除以(nTrainFaces * nEigens)?

好吧,如果您只是想查找仅具有1个且仅受过训练的面部的测试面部特征向量(或值?)"的置信度值,那么您将执行类似的操作

Well, if you're just trying to find the confidence value for the 'test face eigenvectors (or values?)' with just 1 and only trained face, then you'd do something like

confidence = 1.0f - (sqrt( least_squared_distance / no_of_eigens ) / 255.0)

但是,由于要在经过训练的人脸数据库中找到最近的邻居,因此您希望置信度能够反映出,在所有经过训练的人脸中,最近的邻居对训练后的数据库中的其中一张面孔具有较高的置信度值.因此,现在计算的可信度不是针对1个经过训练的面孔,而是针对所有经过训练的面孔,因此

However, since you're finding nearest neighbour within trained face database, you want the confidence to reflect that your nearest neighbour gives a high confidence value for one of the faces in your trained database, amongst all the trained faces. Thus the confidence now is calculated not against 1 trained face, but with all trained faces, thus

confidence = 1.0f - (sqrt( least_squared_distance / no_of_trained_faces * no_of_eigens ) / 255.0)

"leastDistSq = DBL_MAX"是什么DBL_MAX

least_squared_distance = DBL_MAX基本上是说出minimum_squared_distance = 99999999的安全方法,因为取决于平台,硬件或实现,这可能会导致缓冲区溢出.因此,DBL_MAX是代表最大双精度值的标准库.

least_squared_distance = DBL_MAX is basically a safe way from saying least_squared_distance = 99999999, since depending on the platform, hardware, or implementation, that might cause buffer overflow. So DBL_MAX is standard library that represents the largest double value.

这就是找到最小平方距离的方式

And this is how it finds the least squared distance

if(distSq < leastDistSq) {
  leastDistSq = distSq;
  iNearest = iTrain;
}

这篇关于人脸识别(二维阵列)置信度公式推导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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