Guest User

Untitled

a guest
Jun 25th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. double_file_names = load('data/fileName.txt');
  2.  
  3. [size_imgs, trash] = size(double_file_names);
  4. str_file_names = num2str(double_file_names,'%.3f');
  5.  
  6. str_folder_color = 'data/color/';
  7.  
  8. for i = 1:1%size_imgs-1
  9.  
  10. file_p = strcat(str_file_names(i,1:6), '.png');
  11. file_p = strcat(str_folder_color, file_p)
  12.  
  13. file_q = strcat(str_file_names(i+1,1:6), '.png');
  14. file_q = strcat(str_folder_color, file_q)
  15.  
  16. feature_ding(file_p, file_q)
  17. end
  18.  
  19.  
  20. function feature_ding(img_1, img_2)
  21.  
  22. I1 = rgb2gray(imread(img_1));
  23. I2 = rgb2gray(imread(img_2));
  24.  
  25. points1 = detectKAZEFeatures(I1,'Threshold', 0.0003,'NumOctaves' , 5,'NumScaleLevels',3);
  26. points2 = detectKAZEFeatures(I2,'Threshold', 0.0003,'NumOctaves' , 5,'NumScaleLevels',3);
  27.  
  28. [f1, vpts1] = extractFeatures(I1, points1);
  29. [f2, vpts2] = extractFeatures(I2, points2);
  30.  
  31. indexPairs = matchFeatures(f1, f2) ;
  32. [m, n] = size(indexPairs);
  33. matchedPoints1 = vpts1(indexPairs(1:m, 1));
  34. matchedPoints2 = vpts2(indexPairs(1:m, 2));
  35.  
  36. figure; ax = axes;
  37. showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,'montage','Parent',ax);
  38. title(ax, 'Candidate point matches');
  39. legend(ax, 'Matched points 1','Matched points 2');
  40. end
  41.  
  42. function fprintf_ding()
  43.  
  44. end
Add Comment
Please, Sign In to add comment