Brightness and Contrast Enhancement Method for Color Images via Pairing Adaptive Gamma Correction and Histogram Equalization

—For enhanced adaptability to poor light enhancement whilst achieving high image contrast, a new method for color image correction based on the advantages of non-linear function in grey transformation and histogram equalization techniques is proposed in this work. Firstly, the original red, green and blue (RGB) image is converted into the HSV color space, and the V channel is used for enhancement. An adaptive gamma generator is proposed to adaptively calculate gamma parameters in accordance with dark, medium, or bright image conditions. The computed gamma parameters are used to propose a cumulative distribution function that produces an optimized curve for illumination values. Next, a second modified equalization is performed to evenly correct the offset of the illumination curve values on the basis of the equal probability of the available values only. Finally, the processed V channel replaces the original V channel, and the new HSV model returns to the RGB color space. Experiments show that the proposed method can significantly improve the low contrast and poor illumination of the color image whilst preserving the color and details of the original image. Results from benchmark data sets and measurements indicate that the proposed method outperforms other state-of-the-art methods.


I. INTRODUCTION
These days, digital images are used widely because of the rapid development in capturing machines and computer vision technology. Usually, we deal with low-quality images with low contrast and poor illumination caused by various capturing conditions [1]- [3]. Low-quality visual images pose challenges to human perception, as well as image processing and computer vision applications [2], [4], [5]. Therefore, the quality of images should be improved before they are used to make images highly appropriate to the human visual perception and be analyzed easily by machines and improve computer vision applications [1]- [3], [6], [7].
Although no standards exist for correct levels of illumination and contrast, any images captured in condition lighting that does not correspond to normal levels of light are often poor images [2], [8], [9]. In accordance with reviews in previous studies, low contrast and poor illumination are classic challenges in image processing, computer vision and other applications, such as medical technologies, military applications, satellite imaging, video monitoring, traffic technologies, industrial production and underwater image enhancement [2]- [4], [10], [11].
HE methods remap the histogram of pixel values to corresponding new values to improve the poor contrast of images [2], [3]. They are widely used for their simplicity, swiftness, and effectiveness. However, the output quality varies with the characteristics of the input image, which may cause uneven brightness, lost details and color degradation. GT methods calculate new values of pixels by using linear/nonlinear mathematical functions [2], [17]. They are simple, but they could require manual input parameters. This leads to unsatisfactory results, and some details may be lost in the enhanced images.
Image defogging methods remove atmospheric dispersion, such as fog, from images to restore the contrast [2], [5]. Defogging methods show good performance. Nevertheless, they have complex computation, require prior knowledge of the scene and show the over-enhancement problem. Image fusion methods use multiple images of the same scene under different conditions to extract information for improving the image quality [2], [8]. They are difficult to use in many applications, and the process time is long.
Retinex theory-based methods deal with illumination conditions that vary spatially with color and intensity [2], [18], [19]. Retinex methods are simple and enhance contrast, brightness, and colors. However, they may damage edges and produce over-enhancement and uneven brightness levels. Frequency-domain methods use a Fourier transform of an image to be multiplied by a high-frequency modulation filter and then perform inverse transformation to produce an enhanced image [2], [20], [21]. Such methods can improve image details and noise but require complex calculations and manual input parameters. Recently, machine learning methods have been a trend in image enhancement for their excellent performance [22]- [27]. Nonetheless, they require large data sets for training, benchmark data sets on poor contrast and www.ijacsa.thesai.org illumination are still lacking and the complexity of the models increases the cost in time and hardware required.
Almost all the above-mentioned techniques still have low contrast within weak illumination images, as well as missing detail in enhanced images. The available methods also suffer from various drawbacks. However, GT and HE methods are mostly used for their simplicity and fewer disadvantages.
The objective of this paper is to propose a novel global enhancement method to overcome the disadvantages of previous methods by combining the advantages of HE and GT methodologies in one method. The proposed method is simple and fast, and it offers excellent performance to improve low contrast and poor illumination in color images. It does not cause color distortion and increases information preservation as much as possible compared with existing methods. A set of experiments is conducted using many measurements on several benchmark data set images. The results show that the proposed method significantly improves the contrast and illumination, as well as preserves the colors and details of the benchmark data sets better than existing methods.
The rest of this paper is organized as follows. In Section II, the state of the art is presented. Section III describes the proposed method in detail. Section IV shows the experiments, results and discussion. Section V presents the conclusion.

II. RELATED WORK
In accordance with literature reviews provided over the years, several methods for improving images' contrast and illumination have been proposed. Previous survey studies, such [2]- [4], [6], [7], [10], [11], [17], [20], [28]- [31], reported that HE and GT are the most involved techniques in proposed contrast and illumination enhancement methods given their simplicity, fast processing time and high performance.
Many GT methods use linear functions to calculate current values of pixels. However, bright regions may become saturated after values are reset, causing lost details in processed images. These methods also require manual intervention and some experience from the user to find optimal enhancement [32]- [35]. To avoid this problem, GT methods then adopt nonlinear functions to perform the enhancement. For instance, authors of [1] proposed an enhancement method for color images of the retina. This method improves the detail by using a bilateral filter. Next, non-linear gamma and logarithmic functions are used to correct the illumination. Finally, the corrected grey values replace the V channel in the HSV color space. This method has achieved great performance, but it shows over-enhancement in some cases. In [8], an enhancement method for low-light images based on a pair of complementary gamma functions through image fusion is introduced. Experiments show that this method can enhance the detail and improve the contrast of low-light images. Nevertheless, it exhibits over-enhancement and loses details in some cases.
In [9], a method based on Retinex theory for improving image illumination is proposed. This method uses a recursive filter to estimate layers and a 2D visual gamma transform function to remap pixels. The results show that this method improves visibility in local areas, but it loses detail in images.
Authors of [13] recommended a non-linear transformation with a bat optimization algorithm. The bat algorithm is employed to solve the problem of manual selection of control parameters. It is used for automated selection of control parameters in nonlinear transformation, but this method presents slow time processing.
In [36], a method to enhance low-light color images based on the fusion strategy is proposed, Gaussian function, and nonlinear function parameters. This method improves brightness and contrast. However, it is slow, so it cannot be used to improve video images. Authors of [37] introduced a method that uses a grey-value histogram to adaptively obtain a nonlinear function to enhance dark regions whilst preventing bright regions. Nonetheless, the performance is strongly limited. Authors of [38] proposed a contrast and brightness enhancement method based on adaptive gamma correction non-linear function to enhance dimmed regions. This method can enhance low-brightness images and is only effective for such images.
Previous GT methods mainly used logarithmic or gamma as transformation functions, and GT was adopted widely as a step in other image enhancement methods, especially in lowlight images. The use of non-linear functions may require complex calculations, in addition to the traditional problems of over-enhancement and unsatisfactory results.
HE is another common technique to improve illumination and contrast and prevent saturation. It has become a popular technique for its high ability to enhance contrast, and several improvements, such as improving the brightness, have been proposed to overcome its limitations. The basic HE was proposed in [39]; this method used a PDF for different CDFs to calculate the new distributions of values. In [40], the output by applying preprocessing steps to the original is improved. However, the method produces unwanted side effects in a wide type of images.
To reduce the side effects of using grey values of the entire image to estimate the optimal enhancement for local different areas in the image, many methods have adopted the local approach, which divides the histogram or image into independent parts to be enhanced individually [41]- [42]. In general, the results of these methods were better than those of the global approach. Nevertheless, these methods are complex and slow, as well as produce noise and over-enhancement challenges.
The mean and variance-based sub-image HE method [43] was proposed to enhance the contrast and preserve the illumination of images. This method exhibits high performance in many types of images. However, it may lose some details from images with a narrow range of grey values. Authors of [42] suggested an HE method for color images. In this method, a clipped histogram based on the HSV color space is separated into two parts by a thresholding method, then the parts are equalized independently. The result of this method has many problems.
Some methods have adopted different techniques instead of the usual equalization to find corresponding new pixel values. Authors of [44] used the min, max, mean and median of a www.ijacsa.thesai.org histogram to clip extreme values. Then, several methods were applied to remap new histograms. Authors of [21] utilized a set of filters and the binary tree structure to remap histogram values. In [45], a region-based thresholding method and the entropy of grey level is adopted to reshape histograms. These methods are complex to apply and depend on the accuracy of the set of involved methods. In addition, results are unsatisfactory in many cases. Previous HE methods could effectively enhance light, improve contrast, and increase the visibility of image details. Nonetheless, HE methods may produce noise, lose information, and destroy color fidelity.
In sum, GT mainly deals with illumination issues but does not improve contrast. It may produce problems on contrast in many cases. Meanwhile, HE methods mainly enhance the contrast between pixel values in images, but they do not improve the illumination perfectly or even produce a potential challenge in low illumination levels.
To utilize both advantages of HE and GT, some proposed algorithms combine HE and GT as steps in one method. For example, authors of [12] proposed a method for improving image contrast, adaptive gamma correction with weighted histogram distribution are used, and then the gamma function in the illumination channel of the HSI color space. This method improves contrast and preserves the color of images. However, noise is created for the outputs. In [46], a method for improving the contrast of images via HE and the gamma function is introduced. This method improves images, but the results are unsatisfactory. In [47], a method to improve dark images is proposed. This method uses both the non-linear gamma function and the local HE method as steps in the algorithm. It enhances dark images; nevertheless, its output is a contrast that depends on the state of the images.
Methods that combine the advantages of both GT and HE technologies should be proposed, especially for large sets of images that suffer from low contrast and poor illumination, such as underwater and medical images. Moreover, the traditional challenges mentioned before must be addressed. Wang et al. [2] claimed that research on image enhancement should focus on the following issues: reduction of processing time and complexity to meet practical application needs and improvement of the effectiveness and adaptive capabilities of proposed methods.

III. PROPOSED METHOD
The objective of this work is to propose a method for improving poor illumination and low contrast, as well as preserving the natural color and details of original color images. The flow chart of the proposed method is shown in Fig. 1, whilst each step is described in detail below.

A. Color Space Conversion
In human eyes, cones consist of three different photopigments that enable color perception under normal lighting conditions. When light levels drop to darkness, the human eye becomes highly sensitive to light and loses the ability to distinguish color. Therefore, illumination correction is of critical importance for enhancing images obtained under inaccurate lighting conditions. In general, RGB is not the most intuitive color model for humans; it is tied on screen hardware to display colors. By contrast, humans usually introduce illumination and color as two different related things. Several color space systems present color and illumination similar to the human visual system. HSV is one of the easy-to-use systems to identify colors and illumination and closest to how humans perceive and compare colors.
The hue (H), saturation (S) and brightness (V) in the HSV color space are independent of one another. Hue (H) is the rainbow side of color, showing where a particular color is in the visible light spectrum. Saturation (S) describes how pure a color is. Value (V) is the brightness; it is the amount of light that comes from the color. The H and S channels are both related to color. Any modification will distort the color, such that both are ignored. Enhancement of the value of brightness (V) does not affect the color information of images. The channel (V) that presents the obtained brightness matrix of an image ( Fig. 2 (d)) is separated from the two channels, hue (H) and saturation (S), to be used in the proposed method individually.
The expression for converting RGB space to HSV space is as follows: (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 14, No. 3, 2023 127 | P a g e www.ijacsa.thesai.org

B. Adaptive Gamma
To effectively enhance the illumination of images, the range of low-level values should be increased significantly, the moderate-level values should be increased slightly, and the high-level values should be maintained. To achieve that, a nonlinear function is adopted in this work to transform the brightness level values. The gamma function is a common nonlinear transformation for illumination level curve and is expressed as: (4) where N refers to the normalized pixel illumination values in the range [0,1]; G(x, y) denotes the new illumination values of x, y pixels; and is a constant of the gamma correction parameter.
Different transformation curves can be obtained by changing the constant parameter . When > 1, the transformation will stretch to low illumination values, making images look darker. Conversely, when γ < 1, the transformation will extend to high illumination values to make images look brighter. Meanwhile, when y = 1, no transformation occurs. Despite the advantages of gamma transformation, it does not consider the global grey distribution of images, and its adaptability is poor.
To overcome these disadvantages, an adaptive gamma generator, in which the gamma parameter is acquired adaptively in accordance with the global illumination condition of an image (dark, medium or bright image), is proposed. Firstly, the mean of values in the brightness matrix (V) is calculated (Eq. (5)) to compute the brightness level of the image. Larger values indicate brighter images, whereas smaller values indicate darker images.
where X and Y refer to the size of the brightness matrix (V), and V(x, y) is the value at x, y points. Then, the adaptive gamma parameter (γ') value is calculated using the following proposed equation: (6) where L is the maximum grey level of the images; here, L = 255, and it is multiplied by 0.33 to adapt value to one of the three global states, which are dark, medium or bright, for the images. C is a bias constant to overcome the problem of ; here, C = 0.1. The extracted gamma parameters produce a high transformation to brightness, which is required to unify the characteristics of different images, regardless of their original state (dark, medium, or bright), and the subsequent steps in this work.

C. Histogram Computation and Clipping
A histogram is a cumulative representation of the distribution of brightness values and displays the frequency of each value in V. Some values have higher frequency than others (Fig. 3 (c)), which produces the over-enhancement problem after HE process. To prevent over-enhancement, the histogram is clipped to reduce the high enhancement rate of higher-frequency values by using an adaptive threshold value based on the mean of histogram values. Any value that exceeds the threshold will regard the threshold as a new value, as shown in Fig. 3 (d). The calculation is performed using the following equations: where is the threshold value, is the clipped histogram, and is a point in the histogram from 0 to 255.

D. Equalization Process
In this stage, HE with a proposed significant modification is performed to improve image contrast and prepare the illumination for subsequent stages. A proposed CDF function is also used to greatly improve the illumination. Firstly, the PDF of the clipped histogram is computed as follows: The computed PDF is used to calculate the CDF by using the following equation: However, the CDF displays a curve wherein its values are within [0, 1], as shown in Fig. 3 (e); they can be assumed as normalized pixel values. This condition can be exploited to turn the CDF curve into an illuminated curve of the images. The CDF curve can be further transformed to clarify the details and improve the illumination of the images. To do this, a proposed CDF is used to produce a new curve (Fig. 3  (f)) by using the proposed adaptive gamma parameter of Eq. (11) via the following equation: This proposed CDF function aims to improve the illumination and contrast adaptively to unify the visual properties of any image, ranging from considerably light to dark. The subsequent steps affected by any type of illumination problem are then unified. Next, the HE processes is performed. New values of brightness matrix are calculated using the following transformation function: (12) where is the new brightness matrix that will be used in the last enhancement stage.
has an improved contrast but has extreme high displacement towards high-brightness values, as shown in Fig. 3 (g), and new histograms, as shown Fig. 3 (h). The histogram values shift to high-brightness regions for all image types compared with the original histograms shown in Fig. 3 (c). Therefore, the next step is required to solve this displacement.

E. Probability of Value Availability
After matrix is calculated, a second equalization process, which aims to modify the displacement of values equally, is applied. Here, an equal probability of density is applied instead of a normal pdf. The equal probability is calculated based on the available values only by using the following equation: where is a list of size (L=255). Each cell has 1 if the index value is available in , as shown in Figure 4 (a).
is the equal probability of each available value in matrix.

F. Value Equalization
Subsequently, the distribution of displaced values of matrix is corrected by rearranging equally to correct the illumination levels and the contrast of the processed images. Therefore, the cdf of is calculated using Eq. (15), as shown in Fig. 4 (b), and equalized using the transformation function of Eq. (16).
From Fig. 4 (c), the result is a processed brightness matrix ( ) that presents improved contrast and illumination properties of the original V channel (Fig. 3 (b)). Their new histograms in Fig. 4 (e) show balanced and arranged distribution of values that are better than the original histograms (Fig. 3 (c)).

G. HSV Modification and Conversion into RGB
After the contrast and illumination of V' matrix have been improved in the previous stages, it is used to produce brilliant color images. matrix is the processed V channel, which will replace the original V channel and be recombined with the H and S channels of the original image. The new HSV' model is then returned to the RGB color space. The conversion from HSV to RGB is shown using the following formats.

 
where denotes the equivalent red, green and blue channels of for each pixel in the modified image. The values of S and V' illumination-corrected channels range within (0 to 1), whilst 0º ≤ H < 360º. The results present a fine colorful image with improved illumination and contrast properties.

IV. EXPERIMENTS AND RESULTS
In this section, two types of experiments are performed to evaluate the proposed method: visual and statistical experiments. A comparative analysis is also conducted with a set of well-known recent methods. In accordance with the state of the art, the bio-inspired multi-exposure (BIME) method [48], multi-scale Retinex with color restoration (MSRCR) [49], naturalness preserved enhancement (NPE) algorithm [50], simultaneous reflection and illumination estimation (SRIE) [51], multi-deviation fusion (MF) method [52], low-light image enhancement (LIME) [52] and a fusion-based enhancement method for weakly illuminated images (Dong) [53] are chosen to evaluate the performance of the proposed method.
To obtain significant results showing valid performance of each of the contributing methods, approximately 180 color images from many benchmark data sets for poor illumination and contrast challenges are used for the experiments. Specifically, the DICM data set contains 69 color indoor and outdoor images in varying degrees of dark to high-brightness lighting conditions captured from commercial digital cameras [54]. The LIME-data data set contains 10 indoor and outdoor low-light color images [55]. The MEF data set contains 17 high-quality dark indoor and outdoor color images, including natural scene [56]. The NPE [50] data set contains 85 low-light outdoor images collected from the Internet [50]. They present outdoor natural scenes, including cloudy, daytime, daybreak, nightfall, and night-time scenes.

A. Visual Experiments
Visual experiments measure image quality based on the subjective perception of human vision. These experiments can only qualitatively assess image quality, which provide a clear idea of the image quality for humans. They are conducted on selected images from the above data sets. The most interesting cases are selected and presented in Fig. 5 to 9. The results show that all selected images are visually enhanced differently depending on the method used. In general, all images become better than original images, which is expected because the involved methods are some of the most interesting in accordance with the state of the art. Dong, (f) BIME, (g) SRIE and (h) Proposed methods.   In detail, the MSRCR [49], LIME [52] and Dong [53] methods produce images with high brightness levels. The MSRCR [49], Dong [53] and NPE [50] methods show excessive levels of enhancement, and edges appear aggressive. MSRCR [49] and LIME [52] present color fading and uneven brightness levels in some cases. The Dong [53] method produces low contrast levels caused by the effect of oil paintings on images. The BIME [48] method exhibits low brightness and contrast levels. It is the worst method in case of brightness. The SRIE [51], MF [52] and proposed methods preserve the colors of original images, but MF [52] shows faded colors in some cases. The SRIE [51] and proposed methods produce constant brightness levels with all cases of images. They preserve color effects for all involved images. In conclusion, the LIME [52] method achieves higher brightness with accepted preservation for color and details, but SIRI and the proposed method achieve higher performance in the perception of human vision.

B. Statistical Experiments
The visual experiment methodology is simple and evaluates the visual quality of images in an understandable way for humans. However, this type of assessment lacks stability and observed properties of image structures and details. In addition, visual experiments are influenced by the background, visual capability, and visual properties of images; experimental conditions; and the emotional state and motivation of observers.
To overcome the disadvantages of visual experiments, analytical statistical evaluation methods, which use objective criteria that rely on benchmark measures, are adopted. The measurement methods used in this work are mean value (MV), the standard deviation (STD) for contrast, entropy, peak signalto-noise ratio (PSNR), structural similarity index metric (SSIM), absolute mean brightness error (AMBE) and contrastto-noise ratio (CNR).
 AMBE is a common method for detecting brightness change. It evaluates the similarity between the brightness of original and processed images. It presents the absolute delta between the MVs of original and processed images. Smaller values indicate that the brightness of the processed image is closer to that of the original image.
 SSIM is popular for assessing image quality because it simulates human visual perception about the structure of images. SSIM analyses the correlations between www.ijacsa.thesai.org pixels by comparing luminance, contrast and structure between original and processed images. A value closer to 1 indicates more similarity between the two images. (25) where L is the dynamic range of the pixel values; and are the means of x and y, respectively. are the variances of x and y, respectively; and is the covariance of x and y.
 CNR simulates human perception to evaluate contrast resolution in images. It shows a visual quantitative evaluation of the detectability of defects. Smaller values are better.
| | (26) where and are the signal intensities (MVs) of A and B regions of interest, respectively; and is the STD of the background image noise.
 PSNR is a common method to measure the effect of denoising on an image. Larger values show a smaller difference between the original and processed images.
 Entropy is used in evaluating image quality by measuring the amount of information in images. A larger value shows more details in an image.
where is the probability of the grey value in the image.
Here, the result of each measurement method could not be meaningful individually. For example, high mean and AMBE show high levels of brightness. Nonetheless, they may lead to missing information in the processed image if the accompanying STD, SSIM or PSNR values are small. Considerable difference between original and processed images and entropy indicates great effect, but they are not good with high CNR. With much side effects, excessive noise and unwanted details are produced in processed images. Therefore, all previous measurements should not be used individually to estimate the quality of output images. The relationships and interactions between all measurement values must be analyzed to evaluate performance. Tables I to IV show the evaluation results of the involved methods. The analytical observation indicates that the SRIE [51] and proposed methods are more stable than the other methods, regardless of the type of data sets. The other methods show a large variation in their performance in accordance with the data set used. The SRIE [51] and proposed methods are the most adaptive methods for different types of images. However, the proposed method produces enhanced images that have higher brightness levels, better contrast and better preservation for color and details than the SRIE [51] method .   TABLE I.  RESULTS OF SRIE, NPE, MSRCR, MF, LIME, DONG, BIME,  AND PROPOSED METHODS ON DICM DATASET BY MEAN, STD, AMBE,  SSIM, CNR, PSNR, AND ENTROPY MEASUREMENTS   TABLE II

C. Analysis and Discussion
The objective of the conducted experiments is to evaluate the performance of the respective methods in accordance with their ability to enhance image quality by improving contrast and brightness, as well as preserving the details and color of processed images similar to the original ones. From the literature review, SRIE [51], NPE [50], MSCRR, MF [52], LIME [52], Dong [53] and BIME [48] are popular methods that deal with many challenges of low contrast and brightness. Therefore, high performance is expected using these methods to compare with the proposed method. On the basis of the results, the following conclusions are drawn:  The MSRCR [49] method shows the highest levels of brightness by recording the highest mean and AMBE values. However, it destroys the contrast in many cases, which is evident because its STD values are lower than those of the original images in the DICM and NPE data sets (Tables I to IV). In addition, it shows worse SSIM and CNR results than the other methods. It also presents worse MVs of PSNR (specifically, it is the worst in the DICM data set) and the farthest entropy value of the original images. The results of SSIM, CNR, PSNR and entropy show that this method is the worst for preserving the color and natural details of processed images.
 The LIME [52] method has the second-highest mean and AMBE values after the MSRCR method. It increases brightness more than the methods mentioned. This correlates with the highest STD values compared with the other methods. It is one of the best methods to improve the contrast of enhanced images. Nevertheless, its SSIM, CNR and entropy are the worst after the MSRCR method, in addition to the varying PSNR values in accordance with the applied data set. This method is unstable based on the applied images, and it is one of the worst methods used to preserve the details of the processed images.
 The Dong [53] [51] method exhibits the best SSIM and CNR results in all data sets, as well as better-thanaverage PSNR and entropy. Therefore, it is one of the best methods to preserve colors and details of processed images.
 The proposed method shows average brightness levels by scoring average values in mean and AMBE. The STD shows that it is the best method to improve the contrast of outputs. The proposed method scores higher STD in two data sets and presents the best performance amongst the involved methods overall. Moreover, the proposed method shows the second-best SSIM and CNR results in all data sets, next to the SRIE [51] method. It scores the best or better-than-average PSNR values in all data sets. Therefore, it is one of the best methods to preserve colors and details of processed images. In case of entropy, it achieves the closest values to the original images, which means its results are the closest to the original images. www.ijacsa.thesai.org Based on the above observations, the performance of the methods varies between the brightness levels and the accuracy of preserving the properties of the resulting images. The LIME [52] and MSRCR [49] methods achieve higher brightness levels amongst the respective methods but fail to preserve the color and information of the original images. Whilst MSRCR performs the worst, the LIME [52] method can be accepted for human vision applications. However, it loses considerable information, which makes it inefficient for computer vision applications.
On the contrary, the performance of the remaining methods, such as SRIE [51], NPE [50], MF [52], LIME [52], Dong [53], BIME [48] and the proposed method, varies in brightness from average to better than average. Nonetheless, many of these methods reduce the contrast and fail to preserve the color and detail of the images, such as the NPE [50], MF [52], LIME [53], Dong [53] and BIME [48] methods. They show variance and over-enhancement performance for many image situations. Therefore, they can be useful in specific cases of images. However, in general, they cannot adapt to all situations of human vision and computer vision applications.
In cases of preserving image properties, such as color, contrast and detail, only the SRIE [51] and proposed methods achieve the best performance. In addition to stable performance in enhancing brightness levels, they improve contrast, produce fewer side effects and show better color and detail preservation similar to original images. SRIE [51] and the proposed method are the most suitable in computer vision applications. Nevertheless, comparison of the two methods shows that the proposed method is better at improving contrast and keeping details closer to the original images. In conclusion, the proposed method is the most adaptive and stable regardless of the type of image applied. In future work, we aim to conserve details in images with extremely varied levels to highlight all the details in the image and prevent any loss of information.

V. CONCLUSION
In this work, a new method for color image brightness and contrast correction based on the advantages of non-linear function in gray transformation and histogram equalization techniques is proposed. The proposed method consists of set stages: the original red, green and blue (RGB) image is converted into the HSV color space, and the V channel is used for enhancement. Next, an adaptive gamma generator is proposed to calculate gamma parameters in accordance to dark, medium, or bright image conditions. This parameter is used to propose a cumulative distribution function that produces an optimized curve for illumination values. Then, a second modified equalization is performed to evenly correct the offset of the illumination curve values based on the equal probability of the available values only. Finally, the processed V channel replaces the original V channel, and the new HSV model returns to the RGB color space. The experiments show that the proposed method significantly improves the low contrast and poor illumination of the color image while preserving the color and details of the original image. It is the most adaptive and stable method, regardless of the type of image applied, compared to other state-of-the-art methods.