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):

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:

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):

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: