Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

RGB to Lab conversion and median filtering function

Hi .

I trying to do the following tasks using function below :

  1. after the RGB input image is converted to an Lab* image, an

  2. extract L ( illuminative component ) and apply a 31×31 median filter to the L image,

  3. obtain the inverted illuminative image (L) .

  4. adding the inverted image to the original L image.

I need your review of the function is it ok ?

and how the addition of inverted image and L component can be obtained (void add() or addWeighted() )

or is there another way to do it ?

    void split_lab(Mat planes)
    {

    Mat lab,dst,inv;
    cvtColor(planes, lab, CV_BGR2Lab);

    vector <Mat> splits;
    split(lab, splits);


    Mat Y = splits[0];

    medianBlur(Y, dst, 31);             // is that how 31*31 median blur is obtained ?


    bitwise_not(dst, inv);             // is this the right way to obtain invert ?

      }

RGB to Lab conversion and median filtering function

Hi .

I trying to do the following tasks using function below :

  1. after the RGB input image is converted to an Lab* image, an

  2. extract L ( illuminative component ) and apply a 31×31 median filter to the L image,

  3. obtain the inverted illuminative image (L) .

  4. adding the inverted image to the original L image.

I need your review of the function is it ok ?

and how the addition of inverted image and L component can be obtained (void add() or addWeighted() )

or is there another way to do it ?

    void split_lab(Mat planes)
    {

    Mat lab,dst,inv;
    cvtColor(planes, lab, CV_BGR2Lab);

    vector <Mat> splits;
    split(lab, splits);


    Mat Y L = splits[0];

    medianBlur(Y, medianBlur(L, dst, 31);             // is that how 31*31 median blur is obtained ?


    bitwise_not(dst, inv);             // is this the right way to obtain invert ?

      }