diff options
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src')
16 files changed, 0 insertions, 325 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/calculateH.m b/SD-VBS/benchmarks/stitch/src/matlab/calculateH.m deleted file mode 100755 index caefd74..0000000 --- a/SD-VBS/benchmarks/stitch/src/matlab/calculateH.m +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | function retH=calculateH(pnt1, pnt2) | ||
| 2 | |||
| 3 | [n temp]=size(pnt1); | ||
| 4 | |||
| 5 | X=zeros(0,8); | ||
| 6 | b=zeros(0,1); | ||
| 7 | |||
| 8 | for i=1:n | ||
| 9 | X=[X; pnt1(i,1) pnt1(i,2) 1 0 0 0 -pnt2(i,1)*pnt1(i,1) -pnt2(i,1)*pnt1(i,2);0, 0, 0, pnt1(i,1), pnt1(i,2), 1, -pnt2(i,2)*pnt1(i,1), -pnt2(i,2)*pnt1(i,2)]; | ||
| 10 | b=[b; pnt2(i,1); pnt2(i,2)]; | ||
| 11 | end | ||
| 12 | |||
| 13 | if n==4 | ||
| 14 | %if abs(det(X)~=0 | ||
| 15 | H=X^(-1)*b; | ||
| 16 | %else | ||
| 17 | % H=[0 0 0; 0 0 0; 0 0 1]; | ||
| 18 | %end | ||
| 19 | else | ||
| 20 | Xt = X'; | ||
| 21 | H=(Xt*X)^(-1)*Xt*b; | ||
| 22 | end | ||
| 23 | |||
| 24 | retH=[H(1) H(2) H(3);H(4) H(5) H(6);H(7) H(8) 1]; | ||
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/dist2.m b/SD-VBS/benchmarks/stitch/src/matlab/dist2.m deleted file mode 100755 index 89116ac..0000000 --- a/SD-VBS/benchmarks/stitch/src/matlab/dist2.m +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | function n2 = dist2(x, c) | ||
| 2 | %DIST2 Calculates squared distance between two sets of points. | ||
| 3 | % | ||
| 4 | % Description | ||
| 5 | % D = DIST2(X, C) takes two matrices of vectors and calculates the | ||
| 6 | % squared Euclidean distance between them. Both matrices must be of | ||
| 7 | % the same column dimension. If X has M rows and N columns, and C has | ||
| 8 | % L rows and N columns, then the result has M rows and L columns. The | ||
| 9 | % I, Jth entry is the squared distance from the Ith row of X to the | ||
| 10 | % Jth row of C. | ||
| 11 | % | ||
| 12 | % See also | ||
| 13 | % GMMACTIV, KMEANS, RBFFWD | ||
| 14 | % | ||
| 15 | |||
| 16 | % Copyright (c) Christopher M Bishop, Ian T Nabney (1996, 1997) | ||
| 17 | |||
| 18 | [ndata, dimx] = size(x); | ||
| 19 | [ncentres, dimc] = size(c); | ||
| 20 | if dimx ~= dimc | ||
| 21 | error('Data dimension does not match dimension of centres') | ||
| 22 | end | ||
| 23 | |||
| 24 | ct = c'; | ||
| 25 | opt = (x.^2)'; | ||
| 26 | op2t = (x.^2)'; | ||
| 27 | tempT = (ones(ncentres, 1) * sum(opt, 1))'; | ||
| 28 | n2 = tempT + ones(ndata, 1) * sum(op2t,1) - 2.*(x*ct); | ||
| 29 | |||
| 30 | |||
| 31 | |||
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 | |||
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/getANMS.m b/SD-VBS/benchmarks/stitch/src/matlab/getANMS.m deleted file mode 100755 index caece31..0000000 --- a/SD-VBS/benchmarks/stitch/src/matlab/getANMS.m +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | function [interestPnts]=getANMS(x, y, v, r, dataDir) | ||
| 2 | %interestPnts=[x y v] | ||
| 3 | MAX_LIMIT=100000000; | ||
| 4 | C_ROBUST=0.9; | ||
| 5 | r_sq=r^2; | ||
| 6 | points=[x y v]; | ||
| 7 | [n temp]=size(v); | ||
| 8 | [srtdV srtdVIdx]=sort(v,'descend'); | ||
| 9 | srtdPnts=points(srtdVIdx,:); | ||
| 10 | |||
| 11 | interestPnts=zeros(0,3); | ||
| 12 | |||
| 13 | suppressR=ones(n,1)*MAX_LIMIT; | ||
| 14 | supId=find(suppressR>r_sq); | ||
| 15 | |||
| 16 | iter = 0; | ||
| 17 | while length(supId)>0 | ||
| 18 | interestPnts=[interestPnts; srtdPnts(supId(1),:)]; | ||
| 19 | srtdPnts=srtdPnts(supId(2:end),:); | ||
| 20 | suppressR=suppressR(supId(2:end),:); | ||
| 21 | |||
| 22 | suppressR=min(suppressR,(C_ROBUST*interestPnts(end,3)>srtdPnts(:,3)).*((srtdPnts(:,1)-interestPnts(end,1)).^2 + (srtdPnts(:,2)-interestPnts(end,2)).^2)+(C_ROBUST*interestPnts(end,3)<=srtdPnts(:,3))*MAX_LIMIT); | ||
| 23 | supId=find(suppressR>r_sq); | ||
| 24 | iter = iter + 1; | ||
| 25 | end | ||
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/getDirParamLocal.m b/SD-VBS/benchmarks/stitch/src/matlab/getDirParamLocal.m deleted file mode 100755 index 7b36886..0000000 --- a/SD-VBS/benchmarks/stitch/src/matlab/getDirParamLocal.m +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | function DIR_PARAM=getDirParam | ||
| 2 | DIR_PARAM.main_dir=pwd; | ||
| 3 | DIR_PARAM.data_dir=fullfile(DIR_PARAM.main_dir,'data'); | ||
| 4 | DIR_PARAM.report_dir=fullfile(DIR_PARAM.main_dir,'report'); | ||
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/harris.m b/SD-VBS/benchmarks/stitch/src/matlab/harris.m deleted file mode 100755 index 423330e..0000000 --- a/SD-VBS/benchmarks/stitch/src/matlab/harris.m +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | |||
| 2 | % Sample code for detecting Harris corners, following | ||
| 3 | % Brown et al, CVPR 2005 | ||
| 4 | % by Alyosha Efros, so probably buggy... | ||
| 5 | |||
| 6 | function [x,y,v] = harris(im, dataDir); | ||
| 7 | |||
| 8 | g1 = [1,4,6,4,1; 4,16,24,16,4;6,24,36,24,6;4,16,24,16,4;1,4,6,4,1]/256; | ||
| 9 | g2 = [1,2,1;2,4,2;1,2,1]/16; | ||
| 10 | |||
| 11 | img1 = conv2(im,g1,'same'); % blur image with sigma_d | ||
| 12 | |||
| 13 | Ix = conv2(img1,[-0.5 0 0.5],'same'); % take x derivative | ||
| 14 | Iy = conv2(img1,[-0.5;0;0.5],'same'); % take y derivative | ||
| 15 | |||
| 16 | % Compute elements of the Harris matrix H | ||
| 17 | %%% we can use blur instead of the summing window | ||
| 18 | Ix2 = conv2(Ix.*Ix,g2,'same'); | ||
| 19 | Iy2 = conv2(Iy.*Iy,g2,'same'); | ||
| 20 | IxIy = conv2(Ix.*Iy,g2,'same'); | ||
| 21 | |||
| 22 | R = (Ix2.*Iy2 - IxIy.*IxIy) ... % det(H) | ||
| 23 | ./ (Ix2 + Iy2 + eps); % trace(H) + epsilon | ||
| 24 | |||
