Multicolor representation

I had a image with values full of 1 ,2, 3 and 4 ...........I want to represent the value 1 pixels as red color and value 2 pixels as blue color ........Like this i want to differentiate the remaining.............What can i do?,.................Please help me as soon as possible

댓글 수: 4

Jan
Jan 2011년 11월 20일
@DAD: Some suggestions to improve your question:
1. Using a heap of dots decreases the readability.
2. "image with values full of 1,2,3 and 4" is not a unique description of the input data. If you post the Matlab source to create a small example, the readers would exactly know, what you are talking about. Especially the type and dimensions of the inputs are important.
3. "as soon as possible"?! It is sunday and it is my spare time.
DAD
DAD 2012년 5월 27일
I have an image with four different colors as Black,Blue, Green and yellow.
How can I represent these colors as 1, 2, 3 and 4 respectively. Please help me earlier.. Urgent
Walter Roberson
Walter Roberson 2012년 5월 27일
http://www.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency
Walter Roberson
Walter Roberson 2012년 5월 27일
Have you considered rgb2ind() ?

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2011년 11월 20일

1 개 추천

Does the command ind2rgb help?

추가 답변 (1개)

Image Analyst
Image Analyst 2011년 11월 20일

0 개 추천

You mean like this:
% Generate some sample data in the range 1-4.
m = randi(4, [50 50]);
% Display the image.
imshow(m, []);
% Set up a colormap.
cmap = [1 0 0; ... % 1 = Red
0 0 1; ... % 2 = Blue
0 1 0; ... % 3 = Green
1 1 0]; % 4 = Yellow.
% Apply the colormap.
colormap(cmap);
colorbar();
% Enlarge figure to full screen.
set(gca, 'units','normalized','outerposition',[0 0 .9 .9]);
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')

카테고리

질문:

DAD
2011년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by