Enhancement of Digital Stereo Vision Images based on Histogram and Gamma Correction Strategy

Image contrast enhancement methods have been a topic of interest in digital image processing for various applications like satellite imaging, recognition, medical imaging, and stereo vision. This paper studies the technique for image enhancement utilizing Adaptive Histogram Equalization and Weighted Gamma Correction to cater radiometric condition and illumination variations of stereo image pairs. In the proposed method, the stereo pair images are segmented together with weighted distribution into sub-histograms supported with Histogram Equalization (HE) mapping or gamma correction and guided filtering. The experimental result shows the experimented techniques outperform compare with the original image in evaluation parameters of visual quality and image enhancement parameters via Entropy, MSE, and PSNR, etc. taken for performance analysis and validation.


Introduction
Digital image contrast enhancement has been a topic of interest in image processing. It is widely used in numerous applications such as pattern recognition, medical image processing, biometric recognition, and video processing [1]. This is a general area of importance and research interest; such applications expect adequate contrast, which produces an object distinguishable between other objects and image backgrounds. Image contrast enhancement aims to construct a better and improved visual appearance of the image and image quality from the original image so that the image can be interpreted by changing the original characteristics. Thus, it will provide enhanced transformed appearance for prospect processing such as segmentation, detection, analysis, and recognition. In application, especially for stereo images, image perception is similar to human visual perception where it is used in computational stereo vision to recover depth of 2D image for various applications such as the 3D reconstruction of satellite images in the remote sensing field. Naturally, visual perception for humans is established based on object brightness and color with other objects within the same perspective. The perception also differentiates involving the lighter to the darker pixel of an image and the image's quality or video due to inadequate contrast. These are contributed from the bad quality of the imaging sensor or device, lack of expertise from the operator, and the ISSN: 0067-2904 external adversarial conditions. The stereo image pairs consist of different radiometric conditions and illumination variations to each other [2]. Image contrast enhancement techniques can be generally categorized based on their function, spatial-domain, and frequency-domain or transform-based methods [3]. Spatial-domain techniques introduced on the intensity of image pixel, whereas transform-based techniques employ image coefficients formulated using transforms function such as Discrete Cosine Transform (DCT), Fourier Transform (FT), Curvelet Transform (CT), Wavelet Transform (WT), etc. for enhancement of images. Histogram Equalization (HE) is the most popular and broadly used in image contrast enhancement technique because of its favorable results in straightforward implementation and good accuracy. This technique introduces an impressive technology using flattens shape probability distribution and extending the gray levels dynamic range to improves the contrast of an input image; though, the method does not operate to increase the improvement of local contrast of an image because it only utilizes global information. Another technique that quite frequently is the Adaptive Gamma Correction that used for color enhancement. This example makes extensive use of gamma correction approach that sub-topics under general histogram modification techniques family by only using a modifying adaptive parameter γ. The formulated equation of the transform-based gamma correction is derived by [4]: where I max is the maximum intensity of the input image, the intensity I of each pixel in the input image is transformed as T c (I) after completing Eq. (1). Many contrast enhancement methods are available, but not much work has been done to enhance stereo image pairs to solve the problem of radiometric condition and illumination variations. Another issue is that while enhancement process is in progress, it comes with a risk of image brightness deteriorating quite enormously. Consequently, there was a necessity for some image enhancement technique that operated need to be refined when enhancement was completed; thus, the brightness of the images does not reduce significantly. Therefore, the limitations in recent techniques as all above mentioned provide the possibility for further exploration and inspire us to develop a new design or algorithm to improve the quality of image contrast enhancement. This paper proposes to study the algorithm that integrating the Contrast Limited Adaptive Histogram Equalization (CLAHE), including Adaptive Gamma Correction Weight Distribution (AGCWD) with Guided Filter (GF) for contrast enhancement for stereo pair images. These methods are expected to preserve the maximum entropy together with the over enhancement control, and quantitative analysis will be performed on the enhancement performance. The rest of this paper's organization is as follows: -Section 2 describes related works of contrast enhancement, while Section 3 describes the proposed methodologies in detail. Section 4 describes experimental results achieved using developed techniques and performance analysis, followed by a conclusion in Section 5.

Related Works
There exists pervasive literature on the topic of image enhancement level implementation. An approach proposed by [5] was employed in this work, which uses a histogram splitting technique called a bi-histogram that focuses on edge-based image contrast. This technique may likely produce poor bi-histogram separation results due to various modality image histograms. The method can be rendered more efficient by using the method of an adaptive edge-based contrast enhancement. The capability to improve the abilities in preserving information entropy and mean brightness is one of the significant advantages of this method. This work is based on the work of [6] and uses Bi-histogram Equalization utilizing Modified Histogram Bins (BHEMHB) as the underlying technique where it slices the input histogram according to the median brightness and modifies the bins of histogram before HE is employed. The work [7] proposes a theoretical algorithm using particle swarm optimization-based for local entropy and weighted histogram equalization. The aim is to attempt to resolve the theoretical and technical problems associated with both fore-and background and local details contrast enhancement. A calculation based on hyperbolic tangent function modification illustrates the distribution of detail local entropy and weighted histogram information before allotted into two elements of inter-class variance to increase the contrasts quality of foreground and background. To further protect the detailed information formulated of a particle swarm optimization-based approach is applied. Then, a constrained sub-local entropy and weighted histogram each sub-image is equalized accordingly. This idea of implementing Automatic Contrast-Limited Adaptive Histogram Equalization (CLAHE) was studied by [8] for image contrast enhancement. The researcher introduced dual gamma correction with clip point in the CLAHE to attain image enhancement while preserving naturalness. This method used each dynamic block range to redistribute the histogram and implement dual gamma correction in dark regions to reduce over enhancement artefacts while enhancing luminance. This technique is vastly efficient in improving darker and brighter images with strong dark shadows. Another method for addressing this issue is described in [4] exercising gamma correction and the probability distribution of luminance pixels to improve the brightness of dimmed images and videos. The researcher proposed a theoretical algorithm to reduce computational complexity based on temporal information regarding each frame's differences. [9] discusses the possible strategies for solving this issue, including the weighted probability distribution of luminance pixels and gamma correction as contrast and brightness enhancement. The later work of [10] addressed these problems by using improved adaptive gamma correction that implemented the gamma parameter using CDF curves with a reasonable thresholding limit. These have demonstrated better performance and contrast of input dimmed images improvement without missing details in bright regions. An improvement over this method was developed recently by [11] using both histogram equalization and gamma correction in extensively adaptive swarm intelligence for dark image optimization enhancement techniques. This technique is used for satellite images of remote sensors. This method was explored for dark satellite images enhancement executed without missing original image attributes. The gamma correction is as well used in a piecewise manner, autonomously for light as well as dark pixel values, protecting from over-saturation, and additional linked unnatural artefacts can be prevented. Particle swarm optimization in 3D space provides contrast-based cost function and entropy maximization. More recent work in this area [12] extends the methods by using a combination of HE, gamma correction, and homomorphic filter in medical imaging. The algorithm adopted histogram segmentation based on its valley curve locations. Subsequently, the weighted distribution is employed to all segmented sub-histograms to satisfy the constraint of over enhancement with maximum entropy support. An efficient image enhancement technique called an Adaptive Gamma Correction with Weighted Histogram Distribution (AGCWHD) method is introduced by [13] to contrast improvement while preserving richer details and natural colour in images. The technique used in the proposed system is a recent development new adaptive gamma correction that used natural colour and detail preservation with weighted histogram distribution. Despite the HE algorithm's success in certain aspects, it still suffers from unequally enhanced local contrast of an image. Different alternatives aimed at improving this technique are available such as an effective local histogram equalization algorithm. Despite the success of this work [14] in certain aspects, it still suffers from over enhancement of noise and artefacts.
Thus, the researcher proposed improved local histogram equalization to overcome over enhancement. The most recent method is proposed by [15] on the colour image enhancement technique based on Retime. The method implements the weighted guided image filter instead of the Gaussian filter as a surround function to improve poor visibility or colour images under non-uniform illumination circumstances. The weighted guided image filter acts as background illumination estimation and significantly enhanced in local blur and halo artefact that commonly occurred in the Gaussian filter. To overcome the colour distortion, the guided filter is transformed to the HSI colour model, and only the intensity channel is enhanced.

I.
3. Methodology This section provides methodologies that implement the contrast enhancement algorithm based on CLAHE and AGCWD with guided filtering. The dataset stereo pair images are from the Middlebury Stereo Vision Page that provides 15 stereo pair images in training sets with different resolutions, disparity level, height, width, image size, and camera calibration parameters [16]. A comprehensive explanation of each stage for the developed techniques is given in the following sub-sections. The Block diagram of the developed methods is shown in Figure 1. Experiments have been conducted to be comparable for the visual quality with quantitative analysis within five categories; 1. Original image, 2. CLAHE, 3. AGCWD, 4. CLAHE + GF, and 5. AGCWD + GF. Obtained results have been compared based on four quality parameters, namely histogram distribution, entropy, peak signal to noise ratio (PSNR), and mean square error (MSE) [17].A. Contrast Limited Adaptive Histogram Equalization There are four main steps in the framework of the CLAHE algorithm, as shown in Figure 1. The framework for enhancement applied is a straightforward, starting with image decomposition into rectangular blocks to redistribute the lightness values of the image. Second step is adjusting to each histogram block, including creating, clipping, and distributing the histogram to limits the histogram amplification thus limits the slope of the cumulative distribution function (CDF) and transformation function. Third step is to obtain the CDF and the probability density function (PDF) of the clipped histogram to perform the HE on the image and scale. Finally, the equalization mapping done to the pixels in the bulk by the bilinear interpolation amongst the blocks to eliminate potential block artefacts and avoid visibility of region boundaries. The bins are established at 180 after a series of segmentation and specified the histogram shape distribution to a bell-shaped histogram as the basis for creating the contrast transform function of the imagery to look more natural. This technique improves conventional HE by controlling the contrast utilizing a clip point to chop off the histogram peak value in each block. Therefore, the clip point is an essential factor in terms of the contrast factor that avoids the image's oversaturation precisely inhomogeneous areas. The clipped pixels are redistributed to each gray level. The clip point is calculated as follows [8]: where M represents each block number of pixels while N represents the dynamic block range. α is the clip factor, and S is the maximum slope. The critical factor is the clip point in the contrast enhancement adjustment. Clip limit for this approach is normalized from 0 to 1 limits contrast enhancement based on Eq. (2). Higher numbers get the result in more contrast. This experiment's clip limit is adjusted to a value of 0.009, which is the contrast limit for localized changes. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The equation of mapping function used to remap the image blocks gray levels is based on the CDF and PDF provided from the clipped histogram as in Eq.
where T map (I) is the remapping function while I is the gray level pixel, and I max is the block maximum pixel value. In general, this is attractive because it is very fast to compute for different mapping functions based on the CDF of histogram redistribution for each block. Therefore, it is critical to consider the blocking artefacts by the interpolated value of each pixel from the adjacent blocks' mapping function. The remapped of pixel p using the bilinear interpolation in the equalization mapping step as follows: The p is the arbitrary pixel surrounding the four blocks while points a, b, c, and d are the four blocks' center pixels. T (·) denotes the remapping function, whereas p(i) is the value of an arbitrary pixel i with coordinate (x, y). This interpolation step is essential for making the method feasible for a low computational cost for image enhancement, and the stage also removes blocking artefacts.

B. Adaptive Gamma Correction Weighted Distribution
The AGCWD technique has been used extensively to solve the problem of manually gamma value adjustment for image enhancement. The weighted distribution function in AGCWD will improve the algorithm to obtain the values automatically. The straightforward formula of the transform-based of gamma correction is derived by Eq. (1). The proposed AGCWD algorithm is expressed as follows [8]: and the parameter for weighted distribution as follows: where PDF max and PDF min are the maximum and minimum PDF of the statistical histogram from histogram analysis, whereas α is the weighted adjusted parameter. In this experiment, the α is manual adjusted to 0.5. This approach requires that an optimal solution be reached using the Recursively Separated and Weighted Histogram Equalization (RSWHE) method. The next step is to calculate the approximation CDF as follows: ( ) ∑ ( ) ∑ (9) and the sum of the PDF w can be calculated according as follows: ∑ ∑ ( ) (10) Finally, to increase the generality of the results, the gamma parameter based on CDF is modified according to Eq. (7) as follows: ( ) (11) This is a functionality that is vital to the HE to map output gray level from the input gray level, which is the level transformation function based on the CDF.

C. Guided Image Filtering
In this experiment, a guided filter setup was implemented to aid in developing and testing these techniques to smooth the image enhancement. As well as being simple, the method is practical and thus is suitable for better preserves the sharpness of image edges [18]. The guided image filtering is applied to each channel independently of the color images. The guided image filter local linear model of the multichannel as follows [15]: (12) where I i and a k are 3 x 1 color and coefficient vector while q i and b k are the scalars. Thus, the guided image filtering for the color image as follows: is the 3 x 3 matrix identity and ∑ k is the 3 x 3 matrix covariance. It appears that this filter generally produces better results to preserve edges that are not apparent on grayscale. Thus, the experiment value of the degree of smoothing on the filter is 650.25, which indicates a soft threshold on variance for the given neighbourhood.

D. Performance Parameters and Evaluation
Each technique's performance is compared to qualitatively and quantitatively through image quality parameters of Entropy, MSE, PSNR and histogram calculation, and visual inspection evaluation. Entropy is also referred to as the overall amount of information details in the image and expressed in bits, and describes the amount of uncertainty gray levels measurement in the input image. The formulated of the Entropy based on Shannon is given below [19]: where P(k) is the probability of gray levels with intensity l and L is the total number of gray levels present in the image. Additional, two typically employed measurements are PSNR and MSE. The MSE between the two images as follows [20]: while PSNR that avoids dependent on image intensity scaling as follows: (18) where S is the maximum value of pixel. The higher the PSNR, the better the quality of the image contrast enhancement. Both of these parameters are used to compare image enhancement quality. It is vital to measure the performance's variability apart from that qualitative evaluation to review developed image enhancement performance. The visual quality evaluation technique has been included.  As shown in Figure 2 for each image for the Entropy, MSE, and PSNR, the standard deviation result shows that the data between left and right images are nearly related to only small variance except for the three images Motorcycle and Vintage. This finding is expected since these images consist of numerous noise and illumination variations as shown in Figure 2(c). The standard deviation result for Vintage under AGCWD + GF produces an abnormal tremendously high value of variance between the left and right images in the Entropy. The difference implementation of this algorithm is the guided filter application, which indicates the AGCWD performs well in contrast improvement but still fails in the preservation of Entropy between the left and right images. Figure 3 also shows that the result indicates that the CLAHE technique contributes to a lower standard deviation value of almost 50% compare with AGCWD.
The initial histogram quantitative analysis shows that original images produce specific histogram distribution for each image, as shown in Figure 3(a). The implementation of CLAHE and AGCWD techniques contributes to slightly plateau distribution action to the original image histogram distribution. The guided filter applied in the experiment contributes to much more uniform histogram distribution, and change to the intensities means that better contrast is generated. The produced histogram distribution for CLAHE shows that the Noise Illumination intensity is lesser than the original histogram distribution due to the HE equalizes the input image histogram resulted in a loss of some intensities; however, in AGCWD, the technique preserves the intensities. Each individual image for example in Figure 3(a) the Teddy image shows the AGCWD histogram distribution skewed to the side due to the weight distribution function. Greater is the histogram stretch greater is the contrast of the image.

. Visual Quality Evaluation and Analysis
In the qualitative evaluation of this work, visual quality and appearance are essential parameters that can be investigated over enhancement, noise, and artefacts or unnatural enhancement. Several different types of stereo pair images have been considered for testing the work's versatility and robustness. Figure 3(b) and 3(c) shows the visual comparison of image contrast enhancement based on the Teddy image. CLAHE improves both contrasts of images and pixel values but produces halo artifacts. Halo artifacts are from over-stretching of the histogram, which is very apparent along the firm edges. Additionally, tone distortion is not tolerable in image enhancement. AGCWD produces quite good performance results, which is resilient because of weighting distribution usage on the gamma correction. This technique preserves the image brightness closely to the original image compare with the CLAHE. Image acquired from implementing a guided filter has been smoothed at the entire appearance along the surface regions while preserving the edges. Experiments show that the guided filter is effective and efficient in detail enhancement that will eliminate or reduce the noise's effect without blurring the stereo pair images' boundaries.

Conclusion
This paper presents the several techniques used for image contrast enhancement of stereo vision images. The proposed CLAHE and AGCWD techniques are implemented with the combination of a guided filter for image smoothing. The CLAHE technique consisted of assigning the frequency and probability function, calculation of PDF and CDF, and equalization mapping. In contrast, the AGCWD consists of histogram analysis, weight distribution, and gamma correction. These techniques have demonstrated a marked improvement in stereo vision images' quality efficiently compared with the original images. Based on the Entropy, MSE, PSNR, and histogram evaluation, better results and better visual enhancement of the images were applied to the stereo matching algorithm. Future Halo Halo Halo developments are intended to improve this algorithm even more with the idea of a hybrid technique between image contrast enhancement techniques.

Acknowledgement
This work supported by the Ministry of Higher Education (MOHE), Malaysia, and Universiti Teknikal Malaysia Melaka (UTeM).