How to plot the centroids of kmeans in an image?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a binary images (black and white) to cluster using
[idx, C] = kmeans(img, 3)
and now i want to plot the centroid in this image ,may i ask how to draw the centroids of kmeans?
should i expand the image into a column?
0 comentarios
Respuestas (1)
Yogesh Khurana
el 29 de Jul. de 2019
kmeans returns a numeric matrix containing Centroid location. Once you have locations you can plot these locations using plot function. I am assuming you want to plot these centroids on the same image as background. For that you can use MATLAB’s uistack function that reorders visual stacking of UI components. You can refer to following function’s documentations for more information:
Hope this helps!
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!