summaryrefslogtreecommitdiff
path: root/getVecs.m
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-05-12 13:15:55 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-05-12 13:15:55 +0800
commit34de475999a22ac7280411e15339e77a0c8dbc2e (patch)
tree76ecfbe3a8f20d6da8b136dfe78a9e8071075692 /getVecs.m
downloadfeatext-34de475999a22ac7280411e15339e77a0c8dbc2e.tar.gz
featext-34de475999a22ac7280411e15339e77a0c8dbc2e.tar.bz2
featext-34de475999a22ac7280411e15339e77a0c8dbc2e.zip
initial commit
Diffstat (limited to 'getVecs.m')
-rw-r--r--getVecs.m26
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