showing K means clusters image in colors rather than grey scale
6 次查看(过去 30 天)
显示 更早的评论
Hi
I have clustered my image into 8 different clusters
now I have got to this bit in the example on your web page https://uk.mathworks.com/help/images/examples/color-based-segmentation-using-k-means-clustering.html
pixel_labels = reshape(cluster_idx,nrows,ncols);
imshow(pixel_labels,[]), title('image labeled by cluster index');
but I want to display 8 different colors something like . . .
imshow(pixel_labels,'colormap', hot(8))
then show the colorbar
I know this should be easy but can't figure it out
thanks
Charlie
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!