- Visual Media Processing Using Matlab Beginner's Guide
- George Siogkas
- 307字
- 2021-08-06 16:37:56
Adaptive histogram equalization using adapthisteq
The advantage of adapthisteq
is that it splits the image into small rectangular areas called tiles, and enhances the contrast of these areas by adjusting their local histograms. This method is also known as contrast limited adaptive histogram equalization (CLAHE) (Zuiderveld, Karel. Contrast Limited Adaptive Histogram Equalization. Graphic Gems IV. San Diego: Academic Press Professional, 474-485, 1994). Like almost every other MATLAB function, adapthisteq
can be used with only one input (the image), with all other parameters set to default values. Such a usage is shown in the following script, in contrast to the histeq
result:
img = imread('my_image.bmp'); img_eq = histeq(img); img_clahe = adapthisteq(img) subplot(2,3,1),imshow(img),title('Original Image''); subplot(2,3,2),imshow(img_eq),title('Equalized Image'); subplot(2,3,3),imshow(img_clahe),title('CLAHE Image'); subplot(2,3,4),imhist(img,64),title('Original Image Histogram'); subplot(2,3,5),imhist(img_eq,64),title('Equalized Image Histogram'); subplot(2,3,6),imhist(img_clahe,64),title('CLAHE Image Histogram');
Saving this script as HisteqVsClahe.m
and running it, leads to the following result:

As we can see, the CLAHE method leads to a less spread result, which has an apparent positive effect especially on very bright or very dark areas. An even lesser spread histogram result can be acquired if we do not use the default, uniform, or distribution setting. Let's see what the other choices (rayleigh
and exponential
) look like, by running the following script (ClaheDistributions.m
):
img = imread('my_image.bmp'); img_u = adapthisteq(img); img_r = adapthisteq(img,'Distribution','rayleigh'); img_e = adapthisteq(img,'Distribution','exponential'); subplot(2,3,1),imshow(img_u),title('Uniform distribution'); subplot(2,3,2),imshow(img_r),title('Rayleigh distribution'); subplot(2,3,3),imshow(img_e),title('Exponential distribution'); subplot(2,3,4),imhist(img_u,64),title('Uniform Histogram'); subplot(2,3,5),imhist(img_r,64),title('Rayleigh Histogram'); subplot(2,3,6),imhist(img_e,64),title('ExponentialHistogram');
The resulting images show that the Uniform and Exponential histograms are similar, while the Rayleigh distribution leads to a less spread result:

Until now, we have used functions included in MATLAB toolboxes in conjunction with basic programming techniques in order to accomplish image enhancement. Our work was facilitated by the usage of scripts; however these tools are not fully practical for more demanding tasks. Our life will become a lot easier if we begin to master the art of making custom-made functions.
- 筆記本電腦使用、維護與故障排除實戰
- 用“芯”探核:龍芯派開發實戰
- Cortex-M3 + μC/OS-II嵌入式系統開發入門與應用
- Augmented Reality with Kinect
- 施耐德SoMachine控制器應用及編程指南
- 平衡掌控者:游戲數值經濟設計
- 分布式微服務架構:原理與實戰
- 電腦橫機使用與維修
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- Blender for Video Production Quick Start Guide
- 基于S5PV210處理器的嵌入式開發完全攻略
- MicroPython Cookbook
- 微服務架構實戰:基于Spring Boot、Spring Cloud、Docker
- PIC系列單片機的流碼編程
- USB 3.0編程寶典