Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi Tetragramm,

Thanks for your reply. I did your suggestions, code modifications, and it seems to work.

I uploaded the results too, the scenario is already the same: applying CLAHE algorithm on the original 16 bit image. After executing, normalize CLAHE's result to 8 bit [0, 255] and convert to 8 bit (CV_8UC1):

  1. opencv-master CLAHE (with default parameters)
  2. modified CLAHE via your suggestions (ClipLimit(500.0) and TilesGridSize(Size(8, 8)) parameters)
  3. modified CLAHE via your suggestions (ClipLimit(500.0) and TilesGridSize(Size(3, 3)) parameters)

The modified CLAHE's result is more better and smoother, especially if parameter of clip limit and grid size are set "right".

Parameterization is a good question because of comparison of image 2. and 3. If i decrease the parameter of tiles grid size, no grids appeared on result image but the center of image (part of lung) is less contrasty.

I think it is a good change, fix about CLAHE executing on 16 bit grayscale images (CV_16UC1). Will you commit this modification to clahe.cpp?

If you would like, i can send sample *.raw 16 bit images with little framework which handle this format for you to further experiment. What do you think? If OK, please give me an e-mail address to contact with you.


And now i have a question about this modification of clahe.cpp, according you:

if (residual != 0)
{
    int residualStep = MAX(histSize / residual, 1);
    for (int i = 0; i < histSize; i += residualStep)
        tileHist[i]++;
}

Why this modification is needed?

Are you sure these are all the needed modifications?

Hi Tetragramm,

Thanks for your reply. I did your suggestions, code modifications, and it seems to work.

I uploaded the results too, the scenario is already the same: applying CLAHE algorithm on the original 16 bit image. After executing, normalize CLAHE's result to 8 bit [0, 255] and convert to 8 bit (CV_8UC1):

  1. opencv-master CLAHE (with default parameters)
  2. modified CLAHE via your suggestions (ClipLimit(500.0) and TilesGridSize(Size(8, 8)) parameters)
  3. modified CLAHE via your suggestions (ClipLimit(500.0) and TilesGridSize(Size(3, 3)) parameters)

The modified CLAHE's result is more better and smoother, especially if parameter of clip limit and grid size are set "right".

Parameterization is a good question because of comparison of image 2. and 3. If i decrease the parameter of tiles grid size, no grids appeared on result image but the center of image (part of lung) is less contrasty.

I think it is a good change, fix about CLAHE executing on 16 bit grayscale images (CV_16UC1). Will you commit this modification to clahe.cpp?

If you would like, i can send sample *.raw 16 bit images with little framework which handle this format for you to further experiment. What do you think? If OK, please give me an e-mail address to contact with you.


And now i have a question about this modification of clahe.cpp, according you:

if (residual != 0)
{
    int residualStep = MAX(histSize / residual, 1);
    for (int i = 0; i < histSize; i += residualStep)
        tileHist[i]++;
}

Why this modification is needed?

Are you sure these are all the needed modifications?