Reputation: 213
I've encountered with new terms while writing code for CBIR, in my reference algorithm it is given that some varaible say
z(i) is the set of euclidian distance between centroid and all N boundary pixels of digitized shape.
There is a function to find out centroid
I = imread('coins.png');
bw = im2bw(I, graythresh(getimage));
bw2 = imfill(bw,'holes');
s = regionprops(bw2, 'centroid');
centroids = cat(1, s.Centroid);
imtool(I)
plot(imgca,centroids(:,1), centroids(:,2), 'r*')
what is N boundary pixels of digitized shapes and How to find it? any appropriate answers are appreciable.
Upvotes: 0
Views: 635
Reputation: 929
You can use bwboundaries
to find the boundary point coordinates of connected components. If you fill holes as in the sample code, then you should get a cell array of boundary point coordinates that corresponds in order to the centroids you have computed. If any of your components have holes, then it will return additional boundary segments corresponding to those.
Upvotes: 1