From 34de475999a22ac7280411e15339e77a0c8dbc2e Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Tue, 12 May 2015 13:15:55 +0800 Subject: initial commit --- getVecs.m | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 getVecs.m (limited to 'getVecs.m') 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 -- cgit v1.2.3-70-g09d2