Using the feature points object in matlab(no feature matching)
4 views (last 30 days)
Show older comments
Thai Duong Nguyen
on 17 Jun 2021
Commented: Image Analyst
on 18 Jun 2021
Hi,
with detectSURFFeatures or any other feature detection function of matlab we can get a featurePoints object, which is perfectly designed to be passed on to extractFeature and matchFeature function.
Except unfortunately that's not really what I want to do with the features. Rather than matching features with a specific reference image, i would like to look at the neighborhood of the pixel and using some specific features to filter out the one that is interesting.
As an example, I want to look at a very small window around every points and see the color(for rgb)/power(for black and white) distribution of the pixels the window. How can I best do this? The more I read into binary features of matlab, the less it appears to me that I can use them for it.
Many thanks in advance
0 Comments
Accepted Answer
Image Analyst
on 18 Jun 2021
Just use indexing to get the small sub-image you're interested in and then use histogram
subImage = bigImage(row1:row2, column1:column2, :);
[r, g, b] = imsplit(subImage); % For RGB image
histObjectR = histogram(r);
histObjectG = histogram(g);
histObjectB = histogram(b);
For grayscale
subImage = bigImage(row1:row2, column1:column2);
histObject = histogram(subImage);
% or
[counts, grayLevels] = imhist(subImage);
2 Comments
Image Analyst
on 18 Jun 2021
Depends on what you want to do. Nothing wrong with a for loop for a few dozens of locations. It's not the for loop itself that's slow. A for loop will be fast. You can do a for loop with tens of millions of iterations in less than a second if there's nothing computationally intensive inside. You might be able to concatenate all the bounding boxes into a single double array with vertcat().
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!