I have a template image which has features identified and I then have a sample image which I identify feature points and then try to match them against the template image.
load('im1.mat');%This loads I1 and points1
I2 = rgb2gray(imread('/home/colin/downloads/matlabImages/small.jpg'));
points2 = detectHarrisFeatures(I2);
[features2, valid_points2] = extractFeatures(I2, points2);
[features1, valid_points1] = extractFeatures(I1, points1);
indexPairs = matchFeatures(features1, features2);
matched_points1 = valid_points1(indexPairs(:, 1), :);
matched_points2 = valid_points2(indexPairs(:, 2), :);
figure; showMatchedFeatures(I1, I2, matched_points1, matched_points2);
disp(matched_points1);
I am looking to get the number of matched points. When I print matched_points1 I get the following print out:
2x1 cornerPoints array with properties:
Location: [2x2 single]
Metric: [2x1 single]
Count: 2
How can I just get the number from the "Count" value stored in a variable?

 채택된 답변

Amit
Amit 2014년 1월 24일

0 개 추천

count1 = matched_points1.count;

댓글 수: 2

Sam O.
Sam O. 2017년 9월 28일
Hi @amit , tried your code in counting the feature matching but i've got an error saying that " No appropriate method or property, or field 'count' for class cornerPoints. " Also there is no function or variable 'count' . Thank you so mych!
count1 = matched_points1.Count c is capital

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Detect, Extract, and Match Features에 대해 자세히 알아보기

질문:

2014년 1월 24일

댓글:

2018년 1월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by