Ask Your Question

pvt.peter's profile - activity

2019-03-25 05:31:32 -0500 received badge  Popular Question (source)
2017-04-03 11:57:31 -0500 commented answer Result of CLAHE is different on 8 and 16 bit

Hi Everybody,

Could someone tell me what causes the "living/moving" grids on the next 16 bit image?

http://i.imgur.com/SlCZAcb.gif (~17MB)

Source *.png

I use the next parametrization:

ClipLimit is fix: 400.0

TileGridSize is various: (1,1) -> (2,2) -> (3,3) -> ... -> (56,56) -> (57,57)

BR,

Peter

2017-03-22 03:18:48 -0500 commented answer Result of CLAHE is different on 8 and 16 bit

Hi @Tetragramm, I have just updated the links of images only.

2017-03-21 04:21:10 -0500 received badge  Editor (source)
2016-10-24 05:39:41 -0500 answered a question CLAHE on 16bit images?
2016-10-24 05:39:12 -0500 answered a question OpenCV 3.0 CLAHE with 16bit images
2016-10-24 05:35:54 -0500 answered a question 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
2016-10-24 04:06:55 -0500 received badge  Student (source)
2016-10-24 03:01:09 -0500 commented answer Result of CLAHE is different on 8 and 16 bit

Thanks for your reply and help. :) And yes, i think too that CLAHE via OpenCL requires some modification.

2016-10-24 02:22:46 -0500 received badge  Scholar (source)
2016-10-23 09:58:49 -0500 received badge  Supporter (source)
2016-10-23 09:57:47 -0500 answered a question Result of CLAHE is different on 8 and 16 bit

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?

2016-10-23 07:45:16 -0500 received badge  Enthusiast
2016-10-21 09:14:15 -0500 asked a question Result of CLAHE is different on 8 and 16 bit

Hi,

I have got a remark, problem with CLAHE algorithm on applying 8 bit and 16 bit grayscale image. I use opencv-master build. So if i applying CLAHE algorithm on 8 bit grayscale image (CV_8UC1), the result was very good.

But unfortunately i have to work with 16 bit grayscale images (CV_16UC1).


If i normalized and converted the source 16 bit grayscale image to 8 bit and after that executed CLAHE, the result was beautiful, you can see it in this picture: 2.

If i executed CLAHE on the source 16 bit grayscale image, and after it normalized and converted to 8 bit, the result was very weird. Little grids appeared on the image and it was very unnatural, you can see it in this picture: 3.

I tried to different parametrization on CLAHE, but the point was the same.

I attached different pictures of my problem:

  1. Original 16 bit image normalize to 8 bit [0, 255] and convert to 8 bit (CV_8UC1).
  2. Applying CLAHE algorithm with default parameters (ClipLimit(40.0) and TilesGridSize(Size(8, 8))) on the previous (1.) image.
  3. Applying CLAHE algorithm with default parameters on the original 16 bit image. After executing, normalize CLAHE result to 8 bit [0, 255] and convert to 8 bit (CV_8UC1).

I have got some questions too:

  • Why is limited the histogram bin size to 4096 when a 16 bit image has got (1<<16) == 65536 kinds shade?
  • What do the grids mean on image 3? How can i eliminate them?