Thread Subject: colormap

Subject: colormap

From: Mathew Thomas

Date: 15 Oct, 2009 17:22:04

Message: 1 of 4

Hello,

Does anyone know how can I get colormap index value for a particular set of coordinates from an image...I can see these values using colormapeditor, but is there any command such that I can get it into the matlab output as a value.

Do let me know...

Thanks,

Matt

Subject: colormap

From: Carlos Adrian Vargas Aguilera

Date: 15 Oct, 2009 17:52:19

Message: 2 of 4

Get the color limits with

CAXIS

and then use INTERP1 to get the values.

Carlos

Subject: colormap

From: Mathew Thomas

Date: 15 Oct, 2009 19:43:06

Message: 3 of 4

Thanks Carlos....trying it right now...

Matt

Subject: colormap

From: ImageAnalyst

Date: 15 Oct, 2009 23:01:51

Message: 4 of 4

Matt:
Try this:
(You may have to fix line breaks introduced by the newsreader if there
are any errors.)

monochromeImage = imread('cameraman.tif');
imshow(monochromeImage);
% Apply a colormap
colormap('jet');
% Let's get the intensity at position (50,100);
grayLevel = monochromeImage(50,100)
% Retrieve the color map that is being used for the image.
cm = colormap
% Get the color corresponding to that gray level.
theColor = cm(grayLevel, :)
message = sprintf('The color for gray level %d is [%.2f, %.2f, %.
2f]', ...
grayLevel, theColor(1), theColor(2), theColor(3));
msgbox(message);

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
caxis Carlos Adrian Vargas Aguilera 15 Oct, 2009 13:54:07
index Mathew Thomas 15 Oct, 2009 13:24:27
colormap Mathew Thomas 15 Oct, 2009 13:24:27
images Mathew Thomas 15 Oct, 2009 13:24:27
rssFeed for this Thread

Contact us at files@mathworks.com