Guest User

Untitled

a guest
Jan 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. I = imread('IMG_4.jpg');
  2. J = imread('IMG_5.jpg');
  3.  
  4. I = single(rgb2gray(I)); % Conversion to single is recommended
  5. J = single(rgb2gray(J)); % in the documentation
  6.  
  7. [F1 ,D1] = vl_sift(I);
  8. [F2 ,D2] = vl_sift(J);
  9.  
  10. % Where 1.5 = ratio between euclidean distance of NN2/NN1
  11. [matches, score] = vl_ubcmatch(D1,D2,1.5);
  12.  
  13. subplot(1,2,1);
  14. imshow(uint8(I));
  15. hold on;
  16. plot(F1(1,matches(1,:)),F1(2,matches(1,:)),'b*');
  17.  
  18. subplot(1,2,2);
  19. imshow(uint8(J));
  20. hold on;
  21. plot(F2(1,matches(2,:)),F2(2,matches(2,:)),'r*');
Add Comment
Please, Sign In to add comment