How to match a image with a folder of images using surf descriptor
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to match a input image against a folder of images and display best match from the folder. I had used surf descriptor it works on two images i.e. it extracts the surf features from the images and match the extracted points. How to extract surf features from folder of images, I had tried with this [features(:,i),valid_points(:,i)] = extractFeatures(I1, points1);
but it gives an error "subscripted assignment dimension mismatch"
code is here....
srcFiles = dir('F:\MTECH\MATLAB\Begin\photos\*.jpg'); % the folder in which ur images exists for i = 1 : length(srcFiles) filename = strcat('F:\MTECH\MATLAB\Begin\photos\',srcFiles(i).name); I = rgb2gray(imread(filename)); %figure, imshow(I);
points1 = detectSURFFeatures(I);
% points2 = detectSURFFeatures(I2);
[features1(:,i), valid_points1(:,i)] = extractFeatures(I, points1);
%Match the features. end I2 = rgb2gray(imread('F:\MTECH\MATLAB\Begin\photos\im2.jpg')); points2 = detectSURFFeatures(I2); [features2, valid_points2] = extractFeatures(I2, points2); %Match the features. for i=1:length(srcFiles) indexPairs = matchFeatures(features1, features2);
matched_points1 = valid_points1(indexPairs(:, 1), :);
matched_points2 = valid_points2(indexPairs(:, 2), :);
figure; showMatchedFeatures(I, I2, matched_points1, matched_points2,'montage');
end
댓글 수: 1
Swarooph
2016년 10월 5일
편집: Swarooph
2016년 10월 5일
Could you format your code (tutorial here ) above using the code option? You have commented some lines and have loops. Without the formatting its difficult to understand what's going on. Also paste the full error that you actually see on the MATLAB command window so that we can see which variable is throwing the error and at which line..
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!