On the Interpretation of Clip Limit in Contrast-Limited Adaptive Histogram Equalization
摘要
Contrast - Limited Adaptive Histogram Equalization (CLAHE) is widely used to enhance local contrast in digital images, particularly in domains such as medical imaging, remote sensing, and low-light photography. Despite its broad adoption, the internal handling of key parameters in software libraries like OpenCV remains insufficiently documented. This work identifies that OpenCV internally rescales the user-defined contrast limit based on tile size, introducing a scaling effect not explicitly detailed in public documentation. As a result, the effective contrast-limiting behavior may diverge from both user expectations and the method’s theoretical formulation. To address this, a mathematically consistent mapping is derived that ensures the contrast limit corresponds to the number of pixels per histogram bin before clipping. A wrapper function is proposed to implement this mapping, enabling predictable and reproducible behavior across different tile configurations. The analysis contributes to both the theoretical understanding and practical application of CLAHE in image processing pipelines.