summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/stitch/src/matlab/main.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src/matlab/main.m')
-rwxr-xr-xSD-VBS/benchmarks/stitch/src/matlab/main.m47
1 files changed, 0 insertions, 47 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/matlab/main.m b/SD-VBS/benchmarks/stitch/src/matlab/main.m
deleted file mode 100755
index 9be8504..0000000
--- a/SD-VBS/benchmarks/stitch/src/matlab/main.m
+++ /dev/null
@@ -1,47 +0,0 @@
1Icur_list=readData('capitol');
2Icur=Icur_list{1};
3%Icur=Icur(1:150,:,:);
4[x y v]=harris(Icur);
5interestPntsCur=getANMS(x, y, v, 24);
6Fcur=extractFeatures(Icur, interestPntsCur(:,1), interestPntsCur(:,2));
7
8for id=2:length(Icur_list)
9 Iprev=Icur;
10 Fprev=Fcur;
11 interestPntsPrev=interestPntsCur;
12 Icur=Icur_list{id};
13 %Icur=Icur(1:150,:,:);
14 [x y v]=harris(Icur);
15 %showInterestPoints(I, x, y)
16 interestPntsCur=getANMS(x, y, v, 16);
17 %showInterestPoints(I, interestPnts(:,1), interestPnts(:,2))
18 Fcur=extractFeatures(Icur, interestPntsCur(:,1), interestPntsCur(:,2));
19 matchedPntsIdx=matchFeatures(Fprev, Fcur);
20 matchedPntsPrev=interestPntsPrev(matchedPntsIdx(:,1),:);
21 matchedPntsCur=interestPntsCur(matchedPntsIdx(:,2),:);
22
23 %subplot(1,2,1);showInterestPoints(Iprev, matchedPntsPrev(:,1), matchedPntsPrev(:,2));axis image
24 %subplot(1,2,2);showInterestPoints(Icur, matchedPntsCur(:,1), matchedPntsCur(:,2));axis image
25 %drawnow
26 %pause;
27 %printImage(['featureMatching' int2str(id-1) '_' int2str(id)]);
28 [retH retPntsIdx]=ransac(matchedPntsPrev, matchedPntsCur, 10000, 100);
29 subplot(2,2,1);showInterestPoints(Iprev, matchedPntsPrev(retPntsIdx,1), matchedPntsPrev(retPntsIdx,2));axis image
30 subplot(2,2,2);showInterestPoints(Icur, matchedPntsCur(retPntsIdx,1), matchedPntsCur(retPntsIdx,2));axis image
31 T=maketform('projective', retH');
32 Tfn_Mat=T;
33 [nr nc nd]=size(Iprev);
34 Itrans=imtransform(Iprev,T,'XData', [1 nc], 'YData', [1 nr],'FillValues',[0;0;0]);
35 subplot(2,2,3);imshow(Itrans)
36 subplot(2,2,4);imagesc(rgb2gray(abs(Icur-Itrans)))
37 drawnow
38 pause;
39 printImage(['ransac' int2str(id-1) '_' int2str(id)]);
40end
41
42 %[Itrans2 XData YData]=imtransform(Iprev,T,'FillValues',[0;0;0]);
43 %for the fast iteration
44 %[Itrans2 XData2 YData2]=imtransform(Iprev,T,'XData', [-2*nc 2*nc], 'YData', [-2*nr 2*nr],'FillValues',[0;0;0]);
45
46 %h=imshow(Itrans);
47