How to use histeq function on color Image?

histogram, image-processing, matlab

Solution

I think the most common solution is to convert the image to an HSV colour space and then apply `histeq` only to the `V` (i.e. value or intensity) channel.

http://en.wikipedia.org/wiki/Histogram_equalization#Histogram_equalization_of_color_images

Problem

I have a color image. I need to apply Histogram equalization in that. If I use it on the following code ``` im = imread('E:\S1\New\Image1.png'); Test = histeq(im); ``` I get the following error ``` Function HISTEQ expected its first input, I, to be two-dimensional. Error in ==> histeq at 71 iptcheckinput(a,{'uint8','uint16','double','int16','single'}, ... ``` How to solve this ?

Original source