Indexed Images for Cielab Color Space

5 views (last 30 days)
Hi!
How can I build a function indexed image for other color spaces such as CIELAB? any help..?

Accepted Answer

Image Analyst
Image Analyst on 16 Oct 2014
I'm not sure what that means. You can convert a color RGB image into hsv with rgb2hsv()
hsvImage = rgb2hsv(rgbImage);
and into lab with makecform():
cform = makecform('srgb2lab');
labImage = applycform(rgbImage,cform);
Creating an indexed image doesn't make any sense. You'd have to create a grayscale image and then use the proper colormap, but why? Like my demo shows, you can create RGB images that are better.
See my attached demo.
  2 Comments
l.l.
l.l. on 16 Oct 2014
Edited: l.l. on 16 Oct 2014
I want to get for my image in LAB space an indexed image: A data matrix, X, and a colormap matrix, map. map is an m-by-3 array of class double containing floating-point values in the range [0, 1]. Each row of map specifies the L, *a, and *b components of a single color. So the color of each image pixel is determined by using the corresponding value of X as an index into map.
Image Analyst
Image Analyst on 16 Oct 2014
What you're saying doesn't make sense. What you're describing - an integer image with a m-by-3 colormap array is simply a normal indexed image, in essence an integer image and a pseudocolor look up table to turn the gray scale image into a color image. The colormap is a gray-to-color lookup table. It makes no sense to have a gray-to-LAB lookup table. First of all, if it's starting as gray, there is no a and b values, by definition, and the L would just go from 0 to 100. If you want LAB you're going to have to start with an RGB image, not an integer (indexed) image. There is no colormap to give you what you want.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!