summaryrefslogtreecommitdiff
path: root/getVecs.m
blob: 40f08cdbfc2cdd60836f0c8785a26382b9cf17f2 (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
26
function getVecs(dirname)
    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);
        fprintf(fid,'%s ',n);
        fprintf(fid,'%f ',I);
        fprintf(fid,'\n');
    end
    fprintf(fid,'0');
    fclose(fid);
end