# Optimization of Plane Image Color Enhancement Processing Based on Computer Vision Virtual Reality

Authors: Renzheng Xue; Ming Liu; Zuozheng Lian
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

In order to solve the problems of low brightness contrast of a color image, hiding a large amount of detail information, and deviation of color information in the process of image acquisition, an optimization method of plane image color enhancement processing based on computer vision virtual reality is proposed. In this method, the input RGB image is converted into the image represented by the HSI color model, and its adaptive brightness is adjusted to improve the overall brightness of the image. For the local detail enhancement of the color image, the three-dimensional Gaussian model perceived by retinal neurons is introduced into the illuminance image estimation of the MSR algorithm to enhance the image color. The results are as follows: from the perspective of objective parameter evaluation, the mean, standard deviation, information entropy, and average gradient of example images 1 and 2 are improved by about 70%; this algorithm not only enhances the brightness and contrast of the image but also maintains the detailed edge information of the image and the color characteristics of the object itself. The average enhancement rate is the highest among various algorithms, up to 95%. The algorithm proposed in this paper maintains the edge detail information of the image, optimizes the defects of the combination of traditional bilateral filtering and Retinex algorithm, and the color is also well restored, which makes the monitoring image easier to identify, more conducive to criminal investigation and solving cases, and lays a foundation for subsequent image processing.


---

## Body

## 1. Introduction

Human beings obtain external information mainly through vision and hearing, and scientific research shows that the proportion of information obtained through vision is higher than 75%. As one of the main sources of visual information, image is a vital information transmission medium [1]. In recent years, with the increasing popularity of portable digital cameras, people have more opportunities to obtain images in the open air. However, in the process of image acquisition, due to the influence of many factors such as hardware equipment configuration, lighting conditions, weather conditions, objective environment, and so on, there may be a series of problems in the actually obtained image. In particular, the brightness and contrast of the color image acquired at night will be significantly low, and the color information and local detail information are easy to be hidden, which makes the computer vision system unable to conduct more in-depth research on the acquired night color image. There are many application fields of computer vision technology, such as visual tracking, intelligent vehicle, anomaly detection and recognition, and so on. In particular, the in-depth study of night color image enhancement technology is also one of the research hotspots of computer vision technology [2, 3]. In general, the brightness and contrast of color images at night will be significantly low, and a large number of local detail information and color information are easy to be hidden. However, clear images are the key prerequisite for understanding the real scene. Therefore, night color image enhancement has broad research prospects in the fields of public social security, urban traffic law enforcement, and so on [4]. Processing the target image through image enhancement technology is mainly to enhance the information concerned by people in the image according to the actual needs, which is conducive to the specific analysis and practical application in the future [5]. According to the actual needs, the image enhancement system designed by people needs to have the ability to deal with different environments adaptively. At present, researchers at home and abroad are still constantly engaged in the research of night color image enhancement technology and have achieved good results, but they are far from reaching the mature stage. Because of this, there is still a large research space in this field [6]. Figure 1 is a processing device and a processing method for enhancing the color of a plane image.Figure 1
Enhancement processing device and processing method of plane image color.


## 2. Literature Review

On dark nights, there is only a small amount of natural light, such as starlight and moonlight, which is very little compared with sunlight. Due to the lack of visible light at night, ordinary cameras can not be fully exposed, so the brightness and contrast of the obtained image are low, and the color and detail information are largely hidden. In recent years, with the continuous development of night vision technology, people pay more and more attention to color night vision technology. The current hardware instrument achievements mainly include low light night vision instrument, laser night vision instrument, and infrared thermal imager. They use a large number of invisible light bands to obtain more information sources for the night environment, such as medium wave infrared, near infrared, long wave infrared, short wave infrared, ultraviolet, and other light sources [7]. However, these instruments are relatively expensive, mainly used in the military field and have not been popularized. Therefore, we need to use some image enhancement methods to improve the image quality. Natural color effect and clear object details are the ultimate goal of night color image enhancement. The existing technical solutions mainly include multiple image fusion and single image enhancement. This paper aims at the research of image enhancement [8].Image enhancement technology, one of the important parts of digital image processing, has been widely used. Traditional image enhancement techniques mainly include spatial processing and frequency domain processing [9]. The spatial processing method is to directly process the pixels of the image, which mainly includes the histogram equalization method, specified return method, gray transformation method, and Retinex method. Among them, the histogram equalization method mainly converts the gray range of the gray histogram of the original image into uniform distribution, which improves the visual effect of the image, but this method is easy to lose the detailed information of the original image. Mi and others proposed an improved histogram equalization algorithm, which can effectively improve the problem of easy loss of detail information in traditional histogram equalization methods, but color images are prone to color distortion. The operation speed of the gray-scale transformation method is relatively fast, but it is difficult to determine the parameters, so different images cannot achieve the effect of adaptive adjustment, and there may be over enhancement [10]. Huang and others proposed a new method, which can improve the overall brightness and local contrast at the same time and effectively solve the adaptive problem in the gray transformation method, but the effect is not ideal for the image with low illumination [11]. The frequency domain method is to filter the image based on Fourier transform, which mainly includes high-pass filtering, low-pass filtering, and other processing methods. Low-pass or high-pass filtering can only smooth or sharpen the image. At present, many image enhancement processing techniques for filling traditional image enhancement methods have been proposed. Overall, the most effective method is the image enhancement technology based on the Retinex theoretical model [12].Night image enhancement is a special problem involving images with variable illumination conditions. The Retinex algorithm is an effective theory, which aims to simulate the human visual system (HVS) to achieve color constancy and dynamic range compression [13]. Kim and others put forward the final version of Retinex theory, that is, the so-called color constancy theory. Land believes that the color information obtained by the visual system is only related to the reflection essence of the object, but has nothing to do with the light intensity on the surface of the object [14]. The theory divides the image into two parts: one is the low-frequency part of the image, which corresponds to the brightness component of the object; the second is the high-frequency part of the image, which corresponds to the reflection component of the object surface [15]. Among the various improved algorithms based on Retinex theory, aiming at the different estimation methods of incident light components, they mainly include Retinex algorithm of random walk, Retinex algorithm based on iterative path, and Retinex algorithm of center/surround. In comparison, the center/surround Retinex algorithm is not only easy to implement and run but also has significantly improved running speed and better processing effect. It is the most widely used in practical application [16].Based on the current research, this paper proposes an improved MSR image enhancement algorithm based on the problems and defects of the existing Retinex image enhancement algorithm and enhances the night color image.


## 3. Research Methods

### 3.1. Color Model

The color model is an abstract mathematical model, also known as color space or color system. It is a model that uses a set of values to define color [17]. In essence, the color model is a way to explain the coordinate system and subspace, in which all colors are represented by a single point. The typical color model is generally divided into three dimensions, namely vector space. The corresponding points are used to represent a color in the color space, and the position coordinates are vectors with three components [18]. It can be seen that color space can quantify the ability of abstract color perception, so a color model is a powerful means to study color information [19]. At present, the commonly used color model is three-dimensional, because three different coordinate axes can be used to represent different characteristics [20]. There are many kinds of commonly used three-dimensional color models, and different color models also have great differences. For different research purposes of various problems, it is very necessary to select the appropriate color space before processing color images.At present, most color models are either hardware oriented or application-oriented. In digital image processing, hardware oriented RGB (red, green, and blue) color space is the most widely used at present. This model is usually used in color cameras and color monitors; in addition, CMY (cyan, magenta, and yellow) and CMYK (cyan, magenta, yellow, and black) models are mainly used for color printers; HSI (hue, saturation, and brightness) color space is more in line with human’s interpretation of color. It can also process the color information and gray information in the image separately. In the application of image enhancement, it can achieve good color retention and enhancement performance at the same time [21, 22]. HSI color model is completely different from the above two color models based on physics or process, which is - a perception based color model [23]. This color model can not only avoid the phenomenon of color deviation but also simplify the processing of color images to a great extent. The HSI color model proposed by Munsell is natural and intuitive for human beings because it is in line with human understanding of color [24].When processing color images, if the three components ofR, G, and B are processed separately, their correlation will be destroyed, resulting in the problem of color deviation. HSI color model can effectively solve this problem: first, convert the RGB image into the image represented by HSI color space, then keep the chroma component unchanged, only enhance the brightness component, and finally convert it into the image represented by RGB color space [25]. The flow chart of this process is shown in Figure 2.Figure 2
Flow chart of color image processing based on monochrome technology.


### 3.2. Retinex Algorithm

In the related research of image processing, image enhancement is a very popular research field at present. Because the existing image enhancement technology has not formed a unified theoretical method, there are many enhancement methods and research results, especially the image enhancement method based on Retinex theory. In 1964, the Retinex theoretical model was proposed by Edwin hland. Because Retinex is an abbreviation for the combination of retina and cortex, it is also called retina cerebral cortex theory. Retinex theoretical model explains the adjustment mode of the human visual system to the color and brightness of external objects and the color constancy of objects under different lighting conditions. According to Retinex theory, the color of the object seen by our eyes is actually the effect of the interaction between the incident light on its surface and the object. It has little to do with the spectral properties of the incident light received by our eyes but is closely related to the reflection characteristics of the object itself.Since the advent of the Retinex theoretical model, researchers in different periods have proposed many different versions of Retinex algorithms on the basis of it. Which can be roughly divided into the following categories: random walk Retinex algorithm, homomorphic filtering Retinex algorithm, Poisson equation method, Retinex algorithm based on iterative operation, and center/surround Retinex algorithm. The classification of the Retinex algorithm is mainly based on different illumination image estimation principles, so the overall process framework of the Retinex algorithm can be represented in Figure3.Figure 3
Overall block diagram of Retinex algorithm.Assuming that the starting point and ending point of the random path generated in an image areA and B, respectively, and the number of pixels on this path is n, and the gray values of each point are d1, d2, d3,……, dn, then the relative light dark relationship between A and B is expressed as formulas (1) and (2):(1)BA=logTd2d1×Td3d2×Td4d3×⋯⋯×Tdndn−1,(2)Tx=xx≤1,1x>1,where Tx is a threshold function; if the neighborhood pixel value of the current image cable is within the threshold range, it is considered that the light dark relationship between the two pixels has not changed.The Retinex algorithm has the following advantages: on the whole, the brightness of the image is less affected by the illumination; for extremely bright or dark images, it can eliminate the influence of lighting conditions, improve image contrast and improve image color distortion to a certain extent.


### 3.3. Improved MSR Image Enhancement Algorithm

For color image enhancement, this paper proposes an improved MSR image enhancement method based on the MSR algorithm, and its specific process is shown in Figure4. Because the traditional center/surround Retinex algorithm enhances the three color channels of R, G, and B, respectively, resulting in obvious color deviation in the enhanced synthetic RGB image, this algorithm first converts the input RGB image into the image represented by HSI color space, and separately enhances its brightness component I; nighttime images usually contain a large number of dark connected areas or local highlight areas. In this paper, an adaptive adjustment function is proposed to nonlinearly adjust the brightness component I of the image, improve the brightness of the dark area of the image, suppress the “halo” phenomenon that may be caused by the local highlight area, and compress its dynamic range; in addition, for the local detail enhancement of night color image, the bilateral filtering of three Gaussian model with neuron receptive field is introduced into the illuminance image estimation of MSR algorithm. The model can effectively maintain the edge characteristics of the image while enhancing the image contrast; finally, the color information of the enhanced RGB image is restored, and the final result image is output.Figure 4
Flow chart of improved MSR algorithm.For the RGB image enhanced by the brightness component I, in order to recover the color information of the image, theR′, G′, and B′ component values of the resulting image can be calculated by using the proportional values of the R, G, and B components of the original image and the brightness component. Assuming the enhanced luminance component, the mathematical expression is as follows fd3:(3)R′=RI∗I′,G′=GI∗I′,B′=BI∗I′.Equation (3) can be obtained from equation (2):(4)R′R=G′G=B′B=I′I,It can be seen that theR, G, and B color components of the original image and the enhanced image in the RGB color space are directly proportional because after image enhancement for the brightness image of the original image, the pixels corresponding to the R, G, and B color components have the same color, but the brightness is different. This method can overcome the problem of color distortion in the Retinex algorithm.


## 3.1. Color Model

The color model is an abstract mathematical model, also known as color space or color system. It is a model that uses a set of values to define color [17]. In essence, the color model is a way to explain the coordinate system and subspace, in which all colors are represented by a single point. The typical color model is generally divided into three dimensions, namely vector space. The corresponding points are used to represent a color in the color space, and the position coordinates are vectors with three components [18]. It can be seen that color space can quantify the ability of abstract color perception, so a color model is a powerful means to study color information [19]. At present, the commonly used color model is three-dimensional, because three different coordinate axes can be used to represent different characteristics [20]. There are many kinds of commonly used three-dimensional color models, and different color models also have great differences. For different research purposes of various problems, it is very necessary to select the appropriate color space before processing color images.At present, most color models are either hardware oriented or application-oriented. In digital image processing, hardware oriented RGB (red, green, and blue) color space is the most widely used at present. This model is usually used in color cameras and color monitors; in addition, CMY (cyan, magenta, and yellow) and CMYK (cyan, magenta, yellow, and black) models are mainly used for color printers; HSI (hue, saturation, and brightness) color space is more in line with human’s interpretation of color. It can also process the color information and gray information in the image separately. In the application of image enhancement, it can achieve good color retention and enhancement performance at the same time [21, 22]. HSI color model is completely different from the above two color models based on physics or process, which is - a perception based color model [23]. This color model can not only avoid the phenomenon of color deviation but also simplify the processing of color images to a great extent. The HSI color model proposed by Munsell is natural and intuitive for human beings because it is in line with human understanding of color [24].When processing color images, if the three components ofR, G, and B are processed separately, their correlation will be destroyed, resulting in the problem of color deviation. HSI color model can effectively solve this problem: first, convert the RGB image into the image represented by HSI color space, then keep the chroma component unchanged, only enhance the brightness component, and finally convert it into the image represented by RGB color space [25]. The flow chart of this process is shown in Figure 2.Figure 2
Flow chart of color image processing based on monochrome technology.


## 3.2. Retinex Algorithm

In the related research of image processing, image enhancement is a very popular research field at present. Because the existing image enhancement technology has not formed a unified theoretical method, there are many enhancement methods and research results, especially the image enhancement method based on Retinex theory. In 1964, the Retinex theoretical model was proposed by Edwin hland. Because Retinex is an abbreviation for the combination of retina and cortex, it is also called retina cerebral cortex theory. Retinex theoretical model explains the adjustment mode of the human visual system to the color and brightness of external objects and the color constancy of objects under different lighting conditions. According to Retinex theory, the color of the object seen by our eyes is actually the effect of the interaction between the incident light on its surface and the object. It has little to do with the spectral properties of the incident light received by our eyes but is closely related to the reflection characteristics of the object itself.Since the advent of the Retinex theoretical model, researchers in different periods have proposed many different versions of Retinex algorithms on the basis of it. Which can be roughly divided into the following categories: random walk Retinex algorithm, homomorphic filtering Retinex algorithm, Poisson equation method, Retinex algorithm based on iterative operation, and center/surround Retinex algorithm. The classification of the Retinex algorithm is mainly based on different illumination image estimation principles, so the overall process framework of the Retinex algorithm can be represented in Figure3.Figure 3
Overall block diagram of Retinex algorithm.Assuming that the starting point and ending point of the random path generated in an image areA and B, respectively, and the number of pixels on this path is n, and the gray values of each point are d1, d2, d3,……, dn, then the relative light dark relationship between A and B is expressed as formulas (1) and (2):(1)BA=logTd2d1×Td3d2×Td4d3×⋯⋯×Tdndn−1,(2)Tx=xx≤1,1x>1,where Tx is a threshold function; if the neighborhood pixel value of the current image cable is within the threshold range, it is considered that the light dark relationship between the two pixels has not changed.The Retinex algorithm has the following advantages: on the whole, the brightness of the image is less affected by the illumination; for extremely bright or dark images, it can eliminate the influence of lighting conditions, improve image contrast and improve image color distortion to a certain extent.


## 3.3. Improved MSR Image Enhancement Algorithm

For color image enhancement, this paper proposes an improved MSR image enhancement method based on the MSR algorithm, and its specific process is shown in Figure4. Because the traditional center/surround Retinex algorithm enhances the three color channels of R, G, and B, respectively, resulting in obvious color deviation in the enhanced synthetic RGB image, this algorithm first converts the input RGB image into the image represented by HSI color space, and separately enhances its brightness component I; nighttime images usually contain a large number of dark connected areas or local highlight areas. In this paper, an adaptive adjustment function is proposed to nonlinearly adjust the brightness component I of the image, improve the brightness of the dark area of the image, suppress the “halo” phenomenon that may be caused by the local highlight area, and compress its dynamic range; in addition, for the local detail enhancement of night color image, the bilateral filtering of three Gaussian model with neuron receptive field is introduced into the illuminance image estimation of MSR algorithm. The model can effectively maintain the edge characteristics of the image while enhancing the image contrast; finally, the color information of the enhanced RGB image is restored, and the final result image is output.Figure 4
Flow chart of improved MSR algorithm.For the RGB image enhanced by the brightness component I, in order to recover the color information of the image, theR′, G′, and B′ component values of the resulting image can be calculated by using the proportional values of the R, G, and B components of the original image and the brightness component. Assuming the enhanced luminance component, the mathematical expression is as follows fd3:(3)R′=RI∗I′,G′=GI∗I′,B′=BI∗I′.Equation (3) can be obtained from equation (2):(4)R′R=G′G=B′B=I′I,It can be seen that theR, G, and B color components of the original image and the enhanced image in the RGB color space are directly proportional because after image enhancement for the brightness image of the original image, the pixels corresponding to the R, G, and B color components have the same color, but the brightness is different. This method can overcome the problem of color distortion in the Retinex algorithm.


## 4. Result Analysis

### 4.1. Performance Verification of Improved MSR Algorithm

In order to verify the enhancement effect of this algorithm when applied to night color image enhancement, SSR algorithm, MSR algorithm, MSRCR algorithm, bilateral filtering Retinex algorithm, and this algorithm are compared. The original image selects the color image with a local light source or a large number of dark areas. The results are shown in Tables1and 2 and Figure 5.Table 1
Comparison of objective evaluation criteria of various algorithms in example image 1.
Mean valueStandard deviationInformation entropyAverage gradientOriginal image20.246212.56625.52472.7235SSR algorithm169.658470.11967,558233.3834MSR algorithm26.657232.79195.844412.4666MSRCR algorithm169.029525.84856.52766.8076Retinex algorithm for bilateral filtering71.721934.85777.00683.7907Algorithm in this paper88.965739.49507.13877.1070Table 2
Comparison of objective evaluation criteria of each algorithm of example image 2.
Mean valueStandard deviationInformation entropyAverage gradientOriginal image32.860136.65716.12614.2972SSR algorithm143.850188.44187.484219.8124MSR algorithm20.823346.91764.38907.8242MSRCR algorithm158.371519.30826.19485.0900Retinex algorithm for bilateral filtering80.770238.27037.13005.5405Algorithm in this paper103.380239.89457.23017.4264Figure 5
Average enhancement rate of the image by the algorithm.From the perspective of objective parameter evaluation, the average value, standard deviation, information entropy, and average gradient of example images 1 and 2 are improved by about 70%. Although individual parameters are lower than other algorithm parameters, on the whole, each parameter has been comprehensively improved. This algorithm not only enhances the brightness and contrast of the image but also maintains the detailed edge information of the image and the color characteristics of the object itself. The average enhancement rate is the highest among various algorithms, up to 95%.


## 4.1. Performance Verification of Improved MSR Algorithm

In order to verify the enhancement effect of this algorithm when applied to night color image enhancement, SSR algorithm, MSR algorithm, MSRCR algorithm, bilateral filtering Retinex algorithm, and this algorithm are compared. The original image selects the color image with a local light source or a large number of dark areas. The results are shown in Tables1and 2 and Figure 5.Table 1
Comparison of objective evaluation criteria of various algorithms in example image 1.
Mean valueStandard deviationInformation entropyAverage gradientOriginal image20.246212.56625.52472.7235SSR algorithm169.658470.11967,558233.3834MSR algorithm26.657232.79195.844412.4666MSRCR algorithm169.029525.84856.52766.8076Retinex algorithm for bilateral filtering71.721934.85777.00683.7907Algorithm in this paper88.965739.49507.13877.1070Table 2
Comparison of objective evaluation criteria of each algorithm of example image 2.
Mean valueStandard deviationInformation entropyAverage gradientOriginal image32.860136.65716.12614.2972SSR algorithm143.850188.44187.484219.8124MSR algorithm20.823346.91764.38907.8242MSRCR algorithm158.371519.30826.19485.0900Retinex algorithm for bilateral filtering80.770238.27037.13005.5405Algorithm in this paper103.380239.89457.23017.4264Figure 5
Average enhancement rate of the image by the algorithm.From the perspective of objective parameter evaluation, the average value, standard deviation, information entropy, and average gradient of example images 1 and 2 are improved by about 70%. Although individual parameters are lower than other algorithm parameters, on the whole, each parameter has been comprehensively improved. This algorithm not only enhances the brightness and contrast of the image but also maintains the detailed edge information of the image and the color characteristics of the object itself. The average enhancement rate is the highest among various algorithms, up to 95%.


## 5. Conclusion

In this paper, an improved MSR image enhancement algorithm is proposed. For the night color image, especially the night image with a local light source or a large number of dark connected areas, an adaptive brightness adjustment function is proposed according to the brightness and darkness of the image so that the details of the dark area and highlight area of the image can be significantly enhanced. In addition, this paper introduces the bilateral filtering with three Gaussian model of retinal neuron receptive field into the illuminance image estimation of MSR algorithm, which enhances the brightness and contrast of the image, maintains the edge detail information of the image, optimizes the defects of the combination of traditional bilateral filtering and Retinex algorithm, and the color is also well restored, which makes the monitoring image easier to identify and more conducive to a criminal investigation. It also lays a foundation for the followup image processing work.Although the algorithm based on Retinex can improve the brightness of the image one by one, the image quality of the other four algorithms based on Retinex can still be improved better:(1)
In the process of image enhancement based on computer vision virtual reality-based flat image color enhancement algorithm, it is necessary to separate the detail layer image and the base layer image from the brightness image, and then enhance the two layers of images. Reconstruction is performed to obtain an enhanced luminance image, and the computation speed is reduced in the process.(2)
The enhancement effect of the improved and reconstructed plane image color enhancement algorithm for images with uneven brightness distribution needs to be further strengthened, and the enhancement applicability of the algorithm to most images needs further research and exploration.



---

*Source: 9404874-2022-08-05.xml*