how to generate customize color

2 ビュー (過去 30 日間)
Mohammad Golam Kibria
Mohammad Golam Kibria 2012 年 10 月 14 日
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 件)

カテゴリ

Help Center および File ExchangeModify Image Colors についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by