Matlab 2012a で次のコマンドを実行すると
centroids=kmeans(imread('image.jpg'),4);
次のエラーが表示されます。
Error using +
Integers can only be combined with integers of the same class, or scalar doubles.
Error in kmeans>distfun (line 659)
D(:,i) = D(:,i) + (X(:,j) - C(i,j)).^2;
Error in kmeans (line 273)
D = distfun(X, C, distance, 0, rep, reps);
画像を 4 つのクラスターに分割する必要があります。この画像は、形式の CT 脳腫瘍画像JPEG
です。この画像のサイズは です233x216
。
この画像ファイルをクラスター化する解決策を教えてください。