Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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);

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by