for i=1:row
for j=1:col
Num=Label_num(i,j);
if(Num==0)
Image(i,j,1)=255;
Image(i,j,2)=255;
Image(i,j,3)=255;
else
if(Color_array(Num,1)==1000)
Color_array(Num,1)=Image(i,j,1);
Color_array(Num,2)=Image(i,j,2);
Color_array(Num,3)=Image(i,j,3);
else
Image(i,j,1)=Color_array(Num,1);
Image(i,j,2)=Color_array(Num,2);
Image(i,j,3)=Color_array(Num,3);
end
end
end
end