# Dual Histogram Equalization Algorithm Based on Adaptive Image Correction
## 1 Introduction  
In the industrial field, machine vision systems applied in practice will inevitably encounter environmental problems (e.g., light, fog, smoke, dust), imaging equipment problems, lighting problems, and other factors that will result in the acquisition of low-quality, low-contrast images, which is not conducive to subsequent image processing, and so image enhancement is necessary. The main methods of image enhancement include histogram equalization, homomorphic filtering [1], Retinex theory-based enhancement algorithm, and deep learning methods. For the image enhancement algorithm of homomorphic filtering, [PERSON] [2] et al. proposed a homomorphic filtering method based on combination and addition in HSV space. However, this work merely improved the underground image data and had certain efficiency flaws. The enhancement method based on Retinex theory has a poor effect on high-brightness images (such as hazy photos), and it produces visible halo phenomena at the intersection of light and dark in the image, which is not conducive to industrial measurement. Deep learning technologies can increase image quality. However, there are still issues with data availability and the generalization of deep learning systems [3]. The histogram equalization method is widely used because it is fast, simple, and effective. Histogram equalization takes the histogram statistics of the pixel values of the input image and then distributes them evenly, which is effective for image enhancement. However, the traditional histogram equalization algorithm [4] can lead to the brightness of the image being offset due to over-stretching, which results in poor enhancement; it canalso lead to a loss of detail information and over-enhancement due to gray-level merging. These image quality problems detract from the success of image processing and hinder the extraction of target information from the image. Therefore, histogram equalization algorithms have been improved through various methods [5; 6; 7; 8]. To solve the problem of mean luminance shift, [PERSON] proposed the bi-histogram equalization (BBHE) algorithm [9], which divides the input image histogram into two sub-histograms based on the mean value of the input image histogram, equalizes them separately, and finally merges them. Later on, many other scholars improved such algorithms, and [PERSON] et al. proposed the dualistic sub-image histogram equalization (DSIHE) algorithm [10], which divides the image into two sub-histograms based on the median of the gray level, instead of the mean, and equalizes them separately. The recursive sub-image histogram equalization (RSIHE) algorithm [11] and the recursive mean-separate histogram equalization (RMSHE) algorithm [12] improve upon BBHE and DSIHE, respectively. [PERSON] et al. [13] proposed a bi-histogram equalization algorithm with a \"minimum\" mean brightness error (i.e., minimum mean brightness error bi-histogram equalization, MMBEBBHE), which determines the unique separation point by testing all intensity values and selecting the minimum difference between the average input brightness and the average output brightness. [PERSON] et al. [14] proposed an infrared image enhancement method combining improved L-C saliency detection and dual-region histogram equalization in order to improve the visual effect of infrared images and highlight the detail information. The foreground and background regions are obtained by adaptive segmentation of the saliency map using the K-means algorithm. Although the K-means algorithm works well when the sample data are dense and the distinction between classes is particularly good, the selection of the K value is difficult to estimate. Blind determination of the K value will lead to inaccurate segmentation results. The principle of all these methods is to calculate a suitable threshold to split the original histogram and then equalize each histogram separately.