how to enhance a color image ?

7 views (last 30 days)
Sivakumaran Chandrasekaran
Edited: DGM on 2 Jul 2023
For gray image, we use the commands like adapthisteq, imadjust... How to increase the intensity for the color image.

Answers (1)

Image Analyst
Image Analyst on 22 Aug 2012
Convert to hsv color space with rgb2hsv(). Then do those same things on the v channel, then transform back to rgb color space with hsv2rgb().
  6 Comments
Sivakumaran Chandrasekaran
Thanks Image Analyst.. Now, I got your point..
DGM
DGM on 2 Jul 2023
Edited: DGM on 2 Jul 2023
FWIW, the synopsis for adapthisteq() has had an example of doing this in LAB. That said, it's written around very old conventions, so it can be simplified in contemporary versions. For comparison:
inpict = imread('peppers.png');
cl = 0.005;
% adjust V in HSV
hsvpict = rgb2hsv(inpict);
hsvpict(:,:,3) = adapthisteq(hsvpict(:,:,3),'cliplimit',cl); % adjust
op1 = im2uint8(hsv2rgb(hsvpict));
% adjust L in LAB
labpict = rgb2lab(inpict);
labpict(:,:,1) = adapthisteq(labpict(:,:,1)/100,'cliplimit',cl)*100; % adjust
op2 = im2uint8(lab2rgb(labpict));
outpict = [inpict; op1; op2];
imshow(outpict,'border','tight')
... either way, it might not look so great.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!