summaryrefslogtreecommitdiff
path: root/getVecs.m
blob: b71f6edb75c476af33c513a0a330ac3a35de6e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function getVecs(dirname,minc,maxc)
    indir = strcat(strcat('~/VIPeR/',dirname),'/');
    idlist=dir(indir);

    ofile = strcat(dirname,'.txt');
    fid = fopen(ofile,'wt');

    for i=1:length(idlist)
        n = idlist(i).name;
        switch n
            case '.'
                continue;
            case '..'
                continue;
            otherwise
                n=n(1:strfind(n,'_')-1)
        end
        img=im2double(imread(strcat(indir,idlist(i).name)));
        I=genFeatureVec(img,minc,maxc);
        fprintf(fid,'%s ',n);
        fprintf(fid,'%g ',I);
        fprintf(fid,'\n');
    end
    fclose(fid);
end