Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

how do i rectify the error that i have got while performing the kmeans clustering

1 view (last 30 days)
color based segmentation using kmeans clustering how do i use 'start' key word in kmeans..i have tried a code but it gives an error it must have k rows how to solve it the code i tried is here
[cluster_idx, cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ...
'Replicates', 4, 'start',seeds);
rng(123); %// Set seed for reproducibility
numReplicates = 4;
ind = randperm(size(ab,1),numReplicates*nColors);
% ind=ind(1:numReplicates*nColors);
seeds = permute(reshape(ab(ind,:).', [2 nColors numReplicates]), [2 1 3]);
%// Now call kmeans
[cluster_idx, cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ...
'Replicates', numReplicates, 'start', seeds);

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!