Problems with adapthisteq and RGB converted to LAB space

2 Ansichten (letzte 30 Tage)
apañero
apañero am 19 Sep. 2011
Hi, I have a problem processing an RGB image with adapthisteq using the LAB colorspace to process luminosity layer of L*a*b* and then converting back to RGB.
I have done it well directly processing R,G,B channels separately or processing intensity component of the converted HSV image but I can´t get it work converting the image to LAB color space. It works with an Indexed image but not with an RGB image. This is the code:
img = imread('Photo.tif');
%# process luminosity layer of L*a*b*, then convert back to RGB
LAB = applycform(img, makecform('srgb2lab'));
L = LAB(:,:,1)/100;
LAB(:,:,1) = adapthisteq(L,'NumTiles',[8 8],'ClipLimit',0.005)*100;
cform2srgb = makecform('lab2srgb');
J = applycform(LAB, cform2srgb);
figure, imshow(img);
figure, imshow(J);
Why is failing within the LAB colorspace? Thanks!

Akzeptierte Antwort

apañero
apañero am 19 Sep. 2011
I think I have found the answer from the manual: "The Image Processing Toolbox software follows the convention that double-precision L*a*b* arrays contain 1976 CIE L*a*b* values. L*a*b* arrays that are uint8 or uint16 follow the convention in the ICC profile specification (ICC.1:2001-4, www.color.org) for representing L*a*b* values as unsigned 8-bit or 16-bit integers".
So If i convert the LAB image in uint format to double format with "lab2double", adapthisteq works well.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by