K-means Clustering for Image Segmentation to find sum of cluster's pixels
Show older comments
Hello MATLAB community,
I've been using K-mean clustering for image segmentation; this is electron beam data. I've used to code below:
img = data.img(100:500,400:900); % Select the relevant part of the image
[L,Centers] = imsegkmeans(img,8); % Perform image segmentation with 8 centroids
B = labeloverlay(img,L);
imshow(B); % Display it
This code produces the following output:

There are 8 "islands" that represent a quantity that needs to be calculated. What I need to do is to calculated the pixels that account for these "islands". Any suggestions how I may be able to do this?
Accepted Answer
More Answers (0)
Categories
Find more on k-Means and k-Medoids Clustering 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!