summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m')
-rwxr-xr-xSD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m56
1 files changed, 0 insertions, 56 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m b/SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m
deleted file mode 100755
index 38d2f7c..0000000
--- a/SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m
+++ /dev/null
@@ -1,56 +0,0 @@
1function vecF=extractFeatures(I, x, y, dataDir)
2
3Igray = I;
4w = (1/16)*[1 4 6 4 1];
5[n temp]=size(x);
6
7%SUB sample rate s=5
8wt = w';
9Iconv=conv2(w, wt, Igray, 'same');
10Iconv=conv2(w, wt, Iconv, 'same');
11Isub=Iconv(1:5:end,1:5:end);
12[nr nc]=size(Isub);
13
14Xsub=min(floor(x/5)+1, nc-4);
15Ysub=min(floor(y/5)+1, nr-4);
16
17if(length(Xsub) < 6 || length(Ysub) < 10)
18 vecF = [Xsub Ysub];
19 return;
20end
21
22newSize = 4;
23[rows, cols] = size(I);
24if(rows > 32 & cols >32)
25 newSize = 64;
26end
27
28for i=1:n
29
30 minValy = 3;
31 minValx = 3;
32 if( Ysub(i) < 4)
33 Ysub(i) = 4;
34 end
35 if( Xsub(i) < 4)
36 Xsub(i) = 4;
37 end
38
39 if( Ysub(i) > size(Isub,1)-4)
40 Ysub(i) = size(Isub,1)-4;
41 end
42 if( Xsub(i) > size(Isub,2)-4)
43 Xsub(i) = size(Isub,2)-4;
44 end
45
46 vecF(i,:)=reshape(Isub(Ysub(i)-minValy:Ysub(i)+4,Xsub(i)-minValx:Xsub(i)+4),1,newSize);
47
48 %normalization
49 vecF(i,:)=vecF(i,:)-mean(vecF(i,:));
50 vecF(i,:)=vecF(i,:)/std(vecF(i,:));
51 %imagesc(reshape(vecF(i,:),8,8)); colormap gray
52 %drawnow
53 %pause
54end
55
56