Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double_file_names = load('data/fileName.txt');
- [size_imgs, trash] = size(double_file_names);
- str_file_names = num2str(double_file_names,'%.3f');
- str_folder_color = 'data/color/';
- for i = 1:1%size_imgs-1
- file_p = strcat(str_file_names(i,1:6), '.png');
- file_p = strcat(str_folder_color, file_p)
- file_q = strcat(str_file_names(i+1,1:6), '.png');
- file_q = strcat(str_folder_color, file_q)
- feature_ding(file_p, file_q)
- end
- function feature_ding(img_1, img_2)
- I1 = rgb2gray(imread(img_1));
- I2 = rgb2gray(imread(img_2));
- points1 = detectKAZEFeatures(I1,'Threshold', 0.0003,'NumOctaves' , 5,'NumScaleLevels',3);
- points2 = detectKAZEFeatures(I2,'Threshold', 0.0003,'NumOctaves' , 5,'NumScaleLevels',3);
- [f1, vpts1] = extractFeatures(I1, points1);
- [f2, vpts2] = extractFeatures(I2, points2);
- indexPairs = matchFeatures(f1, f2) ;
- [m, n] = size(indexPairs);
- matchedPoints1 = vpts1(indexPairs(1:m, 1));
- matchedPoints2 = vpts2(indexPairs(1:m, 2));
- figure; ax = axes;
- showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,'montage','Parent',ax);
- title(ax, 'Candidate point matches');
- legend(ax, 'Matched points 1','Matched points 2');
- end
- function fprintf_ding()
- end
Add Comment
Please, Sign In to add comment