2012-03-02 54 views
2

我已經使用了vl_ubcmatch函數。我從How to use SIFT algorithm to compute how similiar two images are?獲得了幫助。我使用的步驟是https://stackoverflow.com/users/71131/jacob?推薦的。它們是:如何在Andrea Veldadi的SIFT實現中繪製匹配點?

[fa, da] = vl_sift (I); 
[fb, db] = vl_sift (J); 

[matches, score] = vl_ubcmatch (da, db); 

subplot (1,2,1); 
imshow (uint8(I)); 
hold on; 
plot (fa(1,matches(1,:)), fa(2, matchesf(1,:)), 'b*'); 

subplot (1,2,2); 
imshow (uint8 (J)); 
hold on; 
plot (fb(1, matches(2,:)), fb(2, matches (2,:)), 'r*'); 

這是做什麼的,它顯示兩個圖像旁邊的功能被標記爲藍色在一個和紅色在另一個。但是,我也希望看到通過一行加入的相應功能。

+0

[這裏這答案] [1]應該有你需要的一切代碼。 [1]:http://stackoverflow.com/a/13308950/144201 – Karl 2012-11-10 01:55:16

回答

4

你可以找到的文檔頁面here

figure(2) ; clf ; 
imagesc(cat(2, Ia, Ib)) ; 

xa = fa(1,matches(1,:)) ; 
xb = fb(1,matches(2,:)) + size(Ia,2) ; 
ya = fa(2,matches(1,:)) ; 
yb = fb(2,matches(2,:)) ; 

hold on ; 
h = line([xa ; xb], [ya ; yb]) ; 
set(h,'linewidth', 1, 'color', 'b') ; 

vl_plotframe(fa(:,matches(1,:))) ; 
fb(1,:) = fb(1,:) + size(Ia,2) ; 
vl_plotframe(fb(:,matches(2,:))) ; 
axis image off ;