
k-means clustering in Image Processing
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hafiz Muhammad Tayyab Abbas
el 27 de Jun. de 2021
Comentada: Image Analyst
el 28 de Jun. de 2021
Hi, i'm doing k-mean clustering on an image (fruit tree image) with k=4 clusters. when i display 4 clusters seperately, fruits goes to cluster1, stem goes to cluster 2, leaves goes to clster3 and background goes to cluster4. i'm further interested in fruit clutser only. the probelm is when i change image to another fruit tree image, fruit cluster goes to cluster2 or sometimes to clsuter3 or 4. my wish is to not change the cluster for fruit, means if fruit is in cluster1 it should be in cluster1 in all images of fruit tree. how can i do that? 2ndly if its not possible i want to select that cluster automatically which contains fruit. how can i do that? thanks in advance.



0 comentarios
Respuestas (1)
Image Analyst
el 27 de Jun. de 2021
You're right - the class numbers are random. You can reorder your clusters to the class number you want after you've called kmeans. See attached demo.

In the above demo, the original class numbers are shown on the left. But let's say I wanted them to go in order of distance from the origin. So I relabeled them and got the cluster labels shown on the right.
2 comentarios
Hafiz Muhammad Tayyab Abbas
el 28 de Jun. de 2021
Editada: Hafiz Muhammad Tayyab Abbas
el 28 de Jun. de 2021
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!