how to split image and fill different color
问题 As this picture, how to use matlab code to split it into different parts, and then fill color in it? In addition, how to set gradient color in the second code ??? Here is the picture segmentation code: clc rgb=imread('sample1.bmp'); bw=im2bw(rgb2gray(rgb),.8); bw=medfilt2(bw); planes=bwareaopen(bw,800); D=mat2gray(bwdist(imcomplement(planes))); stats=regionprops(D>.8,'Centroid'); planes_centroid=cat(1,stats.Centroid); planes_mask=false(size(bw)); planes_mask(sub2ind(size(bw),round(planes