Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Here is my code: cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED); cv::Mat srcImage = cv::Mat::zeros(srcImage_3channels.rows, srcImage_3channels.cols, CV_16UC1);

    UINT16* src_3 = (UINT16*)srcImage_3channels.data;
    UINT16* src = (UINT16*)srcImage.data;

    int B = 0;

    for (int j = 0; j < srcImage_3channels.rows; j++)
    {
        for (int i = 0; i < srcImage_3channels.cols; i ++)
        {

            B = src_3[i*3 + j*srcImage_3channels.cols * 3];

            src[(i)+j*srcImage.cols] = (UINT16)B;//getting single channel from 3 channel image
        }

    }

    test::cvClahe(srcImage, srcImage, clipLimit);



    cv::imwrite(OutputPath, srcImage);

Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Here is my code: code:

cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED);
     cv::Mat srcImage = cv::Mat::zeros(srcImage_3channels.rows, srcImage_3channels.cols, CV_16UC1);

CV_16UC1);

    UINT16* src_3 = (UINT16*)srcImage_3channels.data;
    UINT16* src = (UINT16*)srcImage.data;

    int B = 0;

    for (int j = 0; j < srcImage_3channels.rows; j++)
    {
        for (int i = 0; i < srcImage_3channels.cols; i ++)
        {

            B = src_3[i*3 + j*srcImage_3channels.cols * 3];

            src[(i)+j*srcImage.cols] = (UINT16)B;//getting single channel from 3 channel image
        }

    }

    test::cvClahe(srcImage, srcImage, clipLimit);



    cv::imwrite(OutputPath, srcImage);

Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Here is my code:

cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED);
    cv::Mat srcImage = cv::Mat::zeros(srcImage_3channels.rows, srcImage_3channels.cols, CV_16UC1);

    UINT16* src_3 = (UINT16*)srcImage_3channels.data;
    UINT16* src = (UINT16*)srcImage.data;

    int B = 0;

    for (int j = 0; j < srcImage_3channels.rows; j++)
    {
        for (int i = 0; i < srcImage_3channels.cols; i ++)
        {

            B = src_3[i*3 + j*srcImage_3channels.cols * 3];

            src[(i)+j*srcImage.cols] = (UINT16)B;//getting single channel from 3 channel image
        }

    }

    test::cvClahe(srcImage, srcImage, clipLimit);
      cv::imwrite(OutputPath, srcImage);

Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Here is my code:

cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED);
    cv::Mat srcImage = cv::Mat::zeros(srcImage_3channels.rows, srcImage_3channels.cols, CV_16UC1);

    UINT16* src_3 = (UINT16*)srcImage_3channels.data;
    UINT16* src = (UINT16*)srcImage.data;

    int B = 0;

    for (int j = 0; j < srcImage_3channels.rows; j++)
    {
        for (int i = 0; i < srcImage_3channels.cols; i ++)
        {

            B = src_3[i*3 + j*srcImage_3channels.cols * 3];

            src[(i)+j*srcImage.cols] = (UINT16)B;//getting single channel from 3 channel image
        }

    }

    test::cvClahe(srcImage, srcImage, clipLimit);
            cv::imwrite(OutputPath, srcImage);