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!
Best Answer