how to generate customize color
2 ビュー (過去 30 日間)
古いコメントを表示
hi,
I have a matrix m as follows:
1 1 1 1 3 3 3 4 4 4
1 1 1 1 3 3 3 4 4 4
1 1 1 1 3 3 3 4 4 4
1 1 1 1 3 3 3 4 4 4
2 2 2 2 2 4 4 4 4 4
2 2 2 2 2 4 4 4 4 4
2 2 2 2 2 4 4 4 4 4
3 3 3 3 3 3 3 4 4 4
3 3 3 3 3 3 3 4 4 4
3 3 3 3 3 3 3 4 4 4
here different values show different region. I want to have different color for each region. How can I do that? Its a example. In practice, the matrix has many regions. how can i have different color for a image matrix of dimension 3. For example
segPart1=zeros(10,10,'uint8');
segPart2=zeros(10,10,'uint8');
segPart3=zeros(10,10,'uint8');
for i=1:4
d=find(m==i);
segPart1(d)=85;
segPart2(d)=145;
segPart3(d)=85;
C = cat(3, segPart1, segPart2, segPart3);
end
this will make a color little bit blue all the four region. But I need to have a technique how could I make each region fill with different colors. Is there any one to help?
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Modify Image Colors についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!