diff options
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m')
| -rwxr-xr-x | SD-VBS/benchmarks/stitch/src/matlab/extractFeatures.m | 56 |
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 @@ | |||
| 1 | function vecF=extractFeatures(I, x, y, dataDir) | ||
| 2 | |||
| 3 | Igray = I; | ||
| 4 | w = (1/16)*[1 4 6 4 1]; | ||
| 5 | [n temp]=size(x); | ||
| 6 | |||
| 7 | %SUB sample rate s=5 | ||
| 8 | wt = w'; | ||
| 9 | Iconv=conv2(w, wt, Igray, 'same'); | ||
| 10 | Iconv=conv2(w, wt, Iconv, 'same'); | ||
| 11 | Isub=Iconv(1:5:end,1:5:end); | ||
| 12 | [nr nc]=size(Isub); | ||
| 13 | |||
| 14 | Xsub=min(floor(x/5)+1, nc-4); | ||
| 15 | Ysub=min(floor(y/5)+1, nr-4); | ||
| 16 | |||
| 17 | if(length(Xsub) < 6 || length(Ysub) < 10) | ||
| 18 | vecF = [Xsub Ysub]; | ||
| 19 | return; | ||
| 20 | end | ||
| 21 | |||
| 22 | newSize = 4; | ||
| 23 | [rows, cols] = size(I); | ||
| 24 | if(rows > 32 & cols >32) | ||
| 25 | newSize = 64; | ||
| 26 | end | ||
| 27 | |||
| 28 | for 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 | ||
| 54 | end | ||
| 55 | |||
| 56 | |||
