diff options
Diffstat (limited to 'getVecs.m')
-rw-r--r-- | getVecs.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/getVecs.m b/getVecs.m new file mode 100644 index 0000000..40f08cd --- /dev/null +++ b/getVecs.m @@ -0,0 +1,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
\ No newline at end of file |