我编写了使用特征脸进行人脸识别的matlab代码。我得到了归一化图像、平均图像、特征脸,并计算了最小和最大欧氏距离。现在我必须将欧氏距离与阈值进行比较才能识别人脸。每张人脸图像的阈值是如何计算的?下一步是什么?
%show the reconstructed image.
subplot(1,2,2)
imagesc(ReshapedImage); colormap('gray');
title('Reconstructed image','fontsize',18)
InImWeight = [];
for i=1:size(u,2)
t = u(:,i)';
WeightOfInputImage = dot(t,Difference');
InImWeight = [InImWeight; WeightOfInputImage];
end
ll = 1:M;
figure(68)
subplot(1,2,1)
stem(ll,InImWeight)
title('Weight of Input Face','fontsize',14)
% Find Euclidean distance
e=[];
for i=1:size(omega,2)
q = omega(:,i);
DiffWeight = InImWeight-q;
mag = norm(DiffWeight);
e = [e mag];
end
kk = 1:size(e,2);
subplot(1,2,2)
stem(kk,e)
title('Eucledian distance of input image','fontsize',14)
MaximumValue=max(e)
MinimumValue=min(e)
最佳答案
据我所知,人脸识别中的阈值选择没有标准规则。
由于您似乎有一组图像训练,因此您可以尝试根据生物特征性能指标选择阈值,例如错误接受率 (FAR) 和错误匹配率 (FMR)。
您可以尝试通过在一定范围内改变阈值来对训练集中的图像进行分类,并接受 MinimumValue
低于阈值的图像检测。
根据获得的结果,您可以为训练集选择适当的阈值。
关于matlab - 在人脸识别过程中,如何计算matlab训练集中每个图像的特征脸或PCA算法的阈值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22625591/