2026年遍历并显示图库文件夹中的人脸图像.zip【Matlab智能算法】

遍历并显示图库文件夹中的人脸图像.zip【Matlab智能算法】用 subplot imshow imread 遍历并显示图库文件夹中的人脸图像 用循环 运行后图像要显示成矩阵模式的 还得产生统一矩阵和均值矩阵 大侠们帮帮小妹吧 自己编的最好 如果从网上扒的最好能有简单的注解 clc clear all close all clear memory nump 40 no of classes nots 5 no of training set

大家好,我是讯享网,很高兴认识大家。这里提供最前沿的Ai技术和互联网信息。

用subplot,imshow,imread,遍历并显示图库文件夹中的人脸图像(用循环)。运行后图像要显示成矩阵模式的,还得产生统一矩阵和均值矩阵。 大侠们帮帮小妹吧,自己编的最好,如果从网上扒的最好能有简单的注解!

clc clear all close all clear memory nump=40; %no_of_classes nots=5; %no_of_training_set D=pwd; cd([D, ‘ORLDatabase’]); [face,MAP]=imread(‘face1.bmp’); [a,b]=size(face); counter=0; for i=1:nump

for j=1:nots file=['face' int2str((i-1)*10+j) '.bmp']; [face,MAP]=imread(file); grayface=ind2gray(face,MAP); counter=counter+1; X(counter,:)=double(reshape(grayface,a*b,1)); end 

end counter=0; for i=1:nump

for j=nots+1:10 file=['face' int2str((i-1)*10+j) '.bmp']; [face,MAP]=imread(file); grayface=ind2gray(face,MAP); counter=counter+1; Y(counter,:)=double(reshape(grayface,a*b,1)); end 

end cd(D) clear memory clc AVERAGE=mean(x’)‘; Average_Matrix=(ones(noc*nots,1)*AVERAGE’)‘; clear memory Difference=double(x)-double(Average_Matrix); [V,L]=eig(Difference’*Difference); clear memory [rr,cc]=size(L); maxL=min(min(L)); for i=1:rr

for j=1:cc if L(i,j)>maxL maxL=L(i,j); ii=i; jj=j; end end 
for j=1:nots new_X(counter,:)=v(i,:)'*(x(:,counter))'; counter=counter+1; end 

end clear memory counter=1; for i=1:nump

for j=1:3-nots new_Y(counter,:)=v(i,:)'*(y(:,counter))'; counter=counter+1; end 

end clear memory

counter=0;holder=0; for i=1:nump*(3-nots)

error=[]; for j=1:nump*nots temp=(new_X(j,:)-new_Y(i,:)); distance=sqrt(temp*temp'); error=[error distance]; end clear memory Minimum_Error=max(error); for k=1:nump*nots if error(k) 
  
    
    

end clear memory clear new_Y new_X v x y error Minimum_Error LDA_Performance=(counter/(noc*(3-nots)))*100 clear counter

小讯
上一篇 2026-04-14 08:42
下一篇 2026-04-14 08:40

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/261553.html