a = imread('apple.jpg');b = rgb2gray(a);BW = edge(b,'canny');L = bwlabel(BW);s = regionprops(BW,'centroid');centroids = cat(1, s.Centroid);imshow(BW)hold onplot(centroids(:,1),centroids(:,2), 'b*')hold off
The image is just a red apple with white background.
What I want to do is to segment the apple
I want to connect label region together to form the apple again.
How to do it?
What does the regionprops doing?
Best Answer