- kmeans hyperspectral 1.bmp
- kmeans hyperspectral 2.bmp
- kmeans hyperspectral 3.bmp
- kmeans hyperspectral 4.bmp
- kmeans hyperspectral 5.bmp
- kmeans hyperspectral 6.bmp
- kmeans_color_segmentation.m
- kmeans_for_angles.m
- kmeans_grayscale_brain.png
- kmeans_grayscale_segmentation.m
- kmeans_hyperspectral_segmentation.m
- kmeans_relabel_class_numbers.m
For each pixel, how can you calculate the frequency of its assignment to each cluster using v.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Verry new to this, trying to find the frequency and create a scatterplot of the data I have with Kmeans cluster.
This is the code I have so far, any help?
clc
k = input('Enter the Number of Clusters you would like to create: ');
X = imread('face2.jpg');
[height, width, dimensions] = size(J);
points = reshape(im2double(X), height * width, dimensions);
totalnumofexec = 5;
M = zeros(height,width,totalnumofexec);
for i=3:totalnumofexec
locations = randperm(size(points,1),k);
C = points(locations,:);
idx = kmeans(points,k,Start=C);
M(:,:,i) = reshape(idx,height,width);
figure, imagesc(M(:,:,i));
end
figure;
plot(M(:,:,i));
title '2D Graph';3
T = groupcounts(M)
0 commentaires
Réponses (1)
Image Analyst
le 30 Jan 2023
Modifié(e) : Image Analyst
le 30 Jan 2023
You forgot to attach face2.jpg. In the meantime, see my attached kmeans demos.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!