Once you've identified the shapes, which we've talked about in your other question, you can use a for loop to reassign your labeled region to the desired number, like 1 for squares = blue, 2 for circles = red, and so on. Then just create the colormap and pass that plus the labeled image in to ind2rgb() to get an RGB image with shapes having the desired color.
1 Comment
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/162433-how-do-i-assign-a-color-to-the-same-type-of-shape#comment_376712
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/162433-how-do-i-assign-a-color-to-the-same-type-of-shape#comment_376712
Sign in to comment.