Getting the "Count" value of feature matching
20 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Amit
on 24 Jan 2014
count1 = matched_points1.count;
2 Comments
Sam O.
on 28 Sep 2017
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!
More Answers (0)
See Also
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!