matlab中人脸识别效果不好

matlab中人脸识别效果不好,第1张

在使用matlab进行人脸识别时,可能存在多方面的原因导致效果不好。首先,人脸识别需要大量的数据集进行训练,如果使用的数据集不够大或者不够质量好,那么识别效果会大打折扣。其次,算法的选择也是一个关键因素,如果选择的算法不适合当前的场景,则效果也可能不理想。此外,对于不同的人脸特征,可能需要不同的算法进行处理,如果使用同一种算法对所有人脸进行处理,则效果也可能不够好。因此,在使用matlab进行人脸识别时,需要综合考虑以上因素,对系统进行优化和调整,以获得更好的识别效果。

sh167779@163.com

程序

程序执行过程为:

程序运行后首先提示将TestDatabase,TrainDatabase两个文件夹添加到路径中

然后提示从TestDatabase中随便选择一张图片,程序会从TrainDatabase中选出与刚才所选相同的图片

效果如下

手选图片

程序挑出来的图片

主程序代码如下:

clear all

clc

close all

% You can customize and fix initial directory paths

TrainDatabasePath = uigetdir(strcat(matlabroot,'\work'), 'Select training database path' )

TestDatabasePath = uigetdir(strcat(matlabroot,'\work'), 'Select test database path')

prompt = {'Enter test image name (a number between 1 to 10):'}

dlg_title = 'Input of FLD-Based Face Recognition System'

num_lines= 1

def = {'1'}

TestImage  = inputdlg(prompt,dlg_title,num_lines,def)

TestImage = strcat(TestDatabasePath,'\',char(TestImage),'.jpg')

im = imread(TestImage)

T = CreateDatabase(TrainDatabasePath)

[m V_PCA V_Fisher ProjectedImages_Fisher] = FisherfaceCore(T)

OutputName = Recognition(TestImage, m, V_PCA, V_Fisher, ProjectedImages_Fisher)

SelectedImage = strcat(TrainDatabasePath,'\',OutputName)

SelectedImage = imread(SelectedImage)

imshow(im)

title('Test Image')

figure,imshow(SelectedImage)

title('Equivalent Image')

str = strcat('Matched image is :  ',OutputName)

disp(str)


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11857479.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-19
下一篇2023-05-19

发表评论

登录后才能评论

评论列表(0条)

    保存