• 大小: 14.12MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-10
  • 语言: 其他
  • 标签: SRC  

资源简介

适合做人脸识别的朋友,其中有特征提取,创建字典,分类识别,是完整的一套SRC算法,和SRC那篇论文相匹配。

资源截图

代码片段和文件信息

% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TS_Vector = dir(‘C:\Documents and Settings\Administrator\桌面\SRC\train‘);
No_Folders_In_Training_Set_Folder=length(TS_Vector);
Class_Count = 1;
Dic_Count=1;
for k = 3:No_Folders_In_Training_Set_Folder
    Class_Folder = [‘C:\Documents and Settings\Administrator\桌面\SRC\train\‘ TS_Vector(k).name‘\‘];
    CF_Tensor = dir(Class_Folder);
    flag=0;
   for p = 3:length(CF_Tensor)
       Tmp_Image_Path = Class_Folder; 
       Tmp_Image_Name = CF_Tensor(p).name;
       if strcmp(Tmp_Image_Name‘Thumbs.db‘)
             flag=1;
             continue;
         end
       Tmp_Image_Path_Name = [Tmp_Image_PathTmp_Image_Name];
       img=imread(Tmp_Image_Path_Name);
%        imshow(img);
%        pause(0.2);
       [rowline]=size(img);
       img_new=img(1:10:row1:10:line:);
       [row2line2]=size(img_new);
       Dic(:Dic_Count)=img_new(:);
       Dic_Count=Dic_Count+1;
   end  
   if flag==0
       No_Files_In_Class_Folder(Class_Count)=length(CF_Tensor)-2
   else
       No_Files_In_Class_Folder(Class_Count)=length(CF_Tensor)-3
   end
    Class_Count=Class_Count+1;
end
  Class_Count=Class_Count-1; 
  Dic_Count= Dic_Count-1;  
  Dic=double(Dic);
  Dic=Dic/(diag(sqrt(diag(Dic‘*Dic)))); %字典
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%稀疏编码


 
correct_num=0;wrong_num=0;
  e=0.05;
  TS_Vector2 = dir(‘C:\Documents and Settings\Administrator\桌面\SRC\test‘);
  No_Folders_In_Test_Set_Folder = length(TS_Vector2);
for k = 1: No_Folders_In_Test_Set_Folder-2  
    class=k;
    Class_Folder = [‘C:\Documents and Settings\Administrator\桌面\SRC\test\‘ TS_Vector2(k+2).name‘\‘];
    CF_Tensor= dir(Class_Folder);
    num=0;
   for p = 3:length(CF_Tensor)
       Tmp_Image_Path = Class_Folder; 
       Tmp_Image_Name = CF_Tensor(p).name;
        if strcmp(Tmp_Image_Name‘Thumbs.db‘)
            continue
         end
       Tmp_Image_Path_Name = [Tmp_Image_PathTmp_Image_Name];
       num=num+1;
       img=imread(Tmp_Image_Path_Name);
%        imshow(img);
%        pause(0.2);
%        [rowline]=size(img);
       img_new=img(1:10:row1:10:line:);
       img_new=double(img_new(:));
        r=img_new;        %残差
%         D=[];             %空字典
%         coeff=[];          %去0系数
%         pos_arr=[];         %位置
%         coeff2=zeros(Dic_Count1);%完整系数
%         Dic2=Dic;
%         disp([‘正在测试第‘num2str(k)‘类的第‘num2str(num)‘个样本!‘]);
%         while sqrt(sum(r.^2))>0.005  
%            for col=1:Dic_Count
%                product(col)=abs(Dic2(:col)‘*r);
%            end 
%                [val pos]=max(product);
%                D=[DDic2(:pos)];
%                Dic2(:pos)=zeros(length(img_new)1); 
%                coeff=(D‘*D)^(-1)*D‘*img_new;
%                r=img_new-D*coeff;
%                pos_arr=[pos_arr;pos];              
%        end
%             coeff2(pos_arr)=coeff;
            reconst=zeros

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10318  2008-09-25 09:34  SRC\03.pgm

     文件       5239  2012-09-29 09:56  SRC\experi.asv

     文件       5211  2012-09-29 15:53  SRC\experi.m

     文件       4155  2012-09-27 15:40  SRC\face.asv

     文件       4130  2012-09-27 15:58  SRC\face.m

     文件       4663  2012-09-27 15:27  SRC\face2.asv

     文件       4658  2012-09-27 15:55  SRC\face2.m

     文件    3227703  2011-09-01 14:02  SRC\FDDL\AR_EigenFace.mat

     文件       1620  2012-09-20 09:55  SRC\FDDL\demo.asv

     文件       1632  2012-09-20 10:36  SRC\FDDL\demo.m

     文件       2048  2011-09-02 09:54  SRC\FDDL\Readme.txt

     文件       1521  2006-12-19 06:13  SRC\FDDL\utilies\Eigenface_f.m

     文件       6636  2011-09-01 14:54  SRC\FDDL\utilies\FDDL.m

     文件       2427  2011-08-31 23:48  SRC\FDDL\utilies\FDDL_Class_Energy.m

     文件       2100  2011-09-01 15:03  SRC\FDDL\utilies\FDDL_FDL_Energy.m

     文件       2975  2011-08-31 23:57  SRC\FDDL\utilies\FDDL_Gradient_Comp.m

     文件       7852  2011-09-01 15:05  SRC\FDDL\utilies\FDDL_INIC.m

     文件       1126  2011-08-31 22:25  SRC\FDDL\utilies\FDDL_INID.m

     文件       9189  2011-09-01 15:05  SRC\FDDL\utilies\FDDL_SpaCoef.m

     文件       3470  2011-09-01 00:13  SRC\FDDL\utilies\FDDL_UpdateDi.m

     文件       6226  2011-09-01 21:32  SRC\FDDL\utilies\IPM_SC.m

     文件        119  2009-09-24 21:20  SRC\FDDL\utilies\soft.m

     文件    3245884  2012-08-19 10:11  SRC\FDDL.zip

     文件      10318  2008-09-25 09:34  SRC\save test\s01\01.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s01\02.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s01\03.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s01\04.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s01\05.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s02\01.pgm

     文件      10318  2008-09-25 09:34  SRC\save test\s02\02.pgm

............此处省略1193个文件信息

评论

共有 条评论