MATLAB Answers


how to replace the pixel value of image with the cluster center value in the K-means clustering

Asked by lina
on 23 Nov 2012

Hi all,

I want to do image segmentation by replacing the pixel value of original image with the value of cluster center in the K-means clustering.

I use the the kmean.m from the below link:

function [mu,mask]=kmeans(ima,k)

All of I want is applying the 'mu' value in to 'mask'.



0 Answers

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!