フィルターのクリア

Multicolor representation

2 ビュー (過去 30 日間)
DAD
DAD 2011 年 11 月 20 日
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 件のコメント
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 日
Does the command ind2rgb help?
  1 件のコメント
DAD
DAD 2011 年 11 月 20 日
Nice answer

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2011 年 11 月 20 日
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')
  1 件のコメント
DAD
DAD 2012 年 1 月 21 日
Good

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by