how do i only use the green cluster on this 3 clustering?
3 views (last 30 days)
Image Analyst on 22 May 2022
If you're using kmeans() I don't think you can specify any rule in advance for what cluster has what data. You'd have to do that afterwards to renumber the clusters if you need to or want to.
Attached is a demo that does kmeans clustering to reassign the random numbering of the clusters according to two rules. First I numbered them according to the distance of the cluster centroid from the origin. In the second case I renumbered them according to the number of points in each cluster, from 1 being the smallest to 4 being the largest number of points.
Image Analyst on 23 May 2022
I'm not sure you're doing clustering. You may be using the Color Thresholder app on the Apps tab of the tool ribbon to do color segmentation to get masks for certain color ranges. Then you're doing "connected components labeling" which labels blobs from top down, then left to right. Attached is an explanatory demo for how labeling assigns its numbers.