Luna
Luna

Reputation: 53

is it possible to do a segmentation with k-means clustering in CIELAB color space of a 3d grey scale array in Matlab?

I have a 3d array (grayscale) and I would like to do segmentation. I am using Matlab for this and I found this documentation: https://nl.mathworks.com/help/images/color-based-segmentation-using-k-means-clustering.html

However, this is for a 2D RGB image, so I was wondering if there is a way to do this for a 3D array in grayscale, so clustering based on intensity instead of colors. Thanks in advance.

Upvotes: 0

Views: 216

Answers (1)

Alex Taylor
Alex Taylor

Reputation: 1412

d = load('mri.mat');
D = squeeze(d.D);
numClusters = 3;
out = imsegkmeans3(D,numClusters);
figure
labelvolshow(out)

Upvotes: 1

Related Questions