【暂存】MSR-Action3D分组gist特征

Glist=[];%特征列表
Tlist=[];%标签列表
maindir = 'MSR-Action3D\';
% AS1=['a02', 'a03', 'a05', 'a06', 'a10', 'a13', 'a18', 'a20'];
% T1=[02,03,05,06,10,13,18,20];
% AS1=['a01', 'a04', 'a07', 'a08', 'a09', 'a11', 'a14', 'a12'];
% T1=[01,04,07,08,09,11,14,12];
AS1=[ 'a06', 'a14', 'a15', 'a16', 'a17', 'a18', 'a19', 'a20'];
T1=[06,14,15,16,17,18,19,20];
NumAct = 8;          % number of actions in each subset
for i=1:NumAct
    action=AS1((i-1)*3+1:i*3);
    subdir=strcat(maindir,action,'\');
    subdirpath = fullfile(subdir, '*.jpg');
    list = dir(subdirpath);
    G=[];
    T=[];
    n=0;
    for k=1:3:length(list)
        % Load image
        img1=imread(fullfile(subdir,list(k).name));
        img2=imread(fullfile(subdir,list(k+1).name));
        img3=imread(fullfile(subdir,list(k+2).name));
        n=n+1;
        % Parameters:
        clear param
        param.imageSize = [256 256]; % it works also with non-square images
        param.orientationsPerScale = [8 8 8 8];
        param.numberBlocks = 4;
        param.fc_prefilt = 4;
        % Computing gist requires 1) prefilter image, 2) filter image and collect
        % output energies
        [gist1, param] = LMgist(img1, '', param);
        [gist2, param] = LMgist(img2, '', param);
        [gist3, param] = LMgist(img3, '', param);
        gist=[gist1 gist2 gist3];
        G(n,:)=gist;
        T(n,:)=T1(i);
    end
      Glist=[Glist;G];
      Tlist=[Tlist;T];   
end



你可能感兴趣的:(毕业设计)