Using the feature points object in matlab(no feature matching)

1 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2021-6-18
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 个评论
Thai Duong Nguyen
Thai Duong Nguyen 2021-6-18
what is then the best practice to iterate through the Object featurePoints? It has an location array as properties which gives us the coordinate to the detected corners and we can use them as the centers of our windows. But I want to avoid a for loop there. Is there anyway to do it?
Thanks a lot in advance!
Image Analyst
Image Analyst 2021-6-18
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().

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Feature Detection and Extraction 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by