Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?

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?