Retinex-based edge-preserving color low-light image enhancement method
By converting low-light images from RGB to HSV color space, combined with improved Retinex enhancement and edge preservation layer processing, the problems of edge blurring and color unevenness in low-light images are solved, achieving natural image enhancement and detail preservation.
Patent Information
- Application Number
- CN202310231193.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-03-13
AI Technical Summary
Existing low-light image enhancement methods have problems with edge preservation and color uniformity, resulting in blurred image edges and non-natural human visual perception.
The low-light image is converted from the RGB color space to the HSV color space. The V channel is enhanced by improving Retinex enhancement and edge preservation layer processing, combined with adaptive histogram equalization and guided filtering. Dynamic range expansion and saturation adjustment are also performed, and finally the image is converted back to the RGB color space.
It effectively preserves edge information in low-light images, avoids excessive image enhancement and color difference, improves image brightness and color saturation, conforms to the natural perception of the human eye, and improves image quality.
Smart Images

Figure CN116309146B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically a Retinex-based edge-preserving color low-light image enhancement method. Background Technology
[0002] In modern military warfare, visual systems are considered one of the most important ways to acquire resources and strategic information on the battlefield. Since the outbreak of World War II, many wars, campaigns, and military operations have begun at night, and some combat operations have also completed their preparations at night. In the field of military operations, drones equipped with video acquisition devices can detect enemy activity and gather information from a distance, which has significant strategic importance in modern intelligence warfare.
[0003] Images acquired at night or in low-light conditions often exhibit characteristics such as low color contrast, poor resolution, high noise, narrow dynamic range, and poor visual quality. In such situations, low-quality images cannot meet military requirements for critical battlefield tasks such as reconnaissance and terrain surveying.
[0004] Image enhancement methods based on Retinex theory are among the most important in the field of low-light enhancement. In 1964, Edwin Land et al. proposed Retinex theory, also known as the retina-cortex theory. This theory posits that an image can be divided into illumination and reflection components, where the reflection component is independent of the illumination component and is an inherent property of the object. Therefore, inferring reflection characteristics from illumination characteristics is a standard step in the Retinex algorithm. Initially, Land et al. estimated the illumination component by randomly selecting pixels, comparing adjacent pixels to calculate the illumination value. Later, they proposed a center-around method to estimate the illumination value, known as the central Retinex algorithm, which determines the pixel weights by selecting an appropriate center-around function. Jobson et al., building upon the central Retinex algorithm, proposed the Single-Scale Retinex (SSR) algorithm. This algorithm was later further optimized by researchers into the Multi-Scale Retinex (MSR) algorithm and the Multi-Scale Retinex with Color Restoration (MSRCR) algorithm. The MSR algorithm uses three Gaussian kernels with different standard deviations for image convolution, and the filtering at three different scales improves the overall image quality. The MSRCR algorithm addresses the color distortion inherent in the MSR algorithm by introducing a color restoration factor to adjust the proportional relationship between the three color channels. However, low-light enhancement methods using the Retinex method often result in edge loss and uneven enhancement of the RGB three channels. This invention addresses this issue by proposing a Retinex-based edge-preserving color low-light image enhancement method, effectively handling the edge blurring problem. Summary of the Invention
[0005] The purpose of this invention is to propose an edge-preserving color low-light image enhancement method based on Retinex, in order to solve the problems of blurred edges and non-compliance with the natural perception of the human eye in existing low-light image enhancement methods.
[0006] The technical solution to achieve the purpose of this invention is: a Retinex-based edge-preserving color low-light image enhancement method, the specific steps of which are as follows:
[0007] Step 1: Convert the input low-light image from the RGB color space, which represents the three primary colors of red, green, and blue, to the HSV color space, which represents hue, saturation, and brightness.
[0008] Step 2: For the obtained original V component, perform improved Retinex enhancement processing and edge preservation layer processing consisting of adaptive histogram equalization and guided filtering respectively, and then weight the results of the two enhancement methods to achieve an average.
[0009] Step 3: Perform dynamic range expansion on the processed V channel;
[0010] Step 4: Adaptively adjust the saturation component S based on the enhanced new V component;
[0011] Step 5: Convert the processed image back from the HSV color space to the RGB color space.
[0012] Preferably, the specific method for improving the Retinex enhancement processing of the obtained raw V component is as follows:
[0013] Based on Retinex theory, the V-channel image is represented as the product of the illumination component and the reflection component, expressed as:
[0014] I(x,y)=L(x,y)gR(x,y)
[0015] In the formula, I(x,y) represents the original image of the V channel; L(x,y) represents the illumination in the current environment, i.e., the illumination component; and R(x,y) represents the inherent reflectivity of the object, i.e., the reflection component.
[0016] The original image is the initial V-channel image. The illumination component is obtained by bilateral filtering of the V-channel. A Gaussian kernel is convolved with the image, and the neighboring pixels of each pixel in the input image are weighted and averaged. The smooth and sharp edge output image is obtained by controlling the magnitude of the value. The specific formula for bilateral filtering is as follows:
[0017] W(i,j,k,l)=W s (i,j)*W r (i,j)
[0018] Among them, W s (i,j) and W r (i,j) represent the spatial proximity factor, (i,j) represent the pixel at the current position, and (k,l) represent the pixel at the center.
[0019] Perform a logarithmic transformation on the above formula, and then take the difference between the logarithm of the input image I(x,y) and the logarithm of the illumination component L(x,y);
[0020] log(R(x,y))=log(I(x,y))-log(L(x,y))
[0021] The obtained results are converted back to the real number field by exponential operation to obtain the V channel enhancement result obtained by the improved Retinex algorithm.
[0022] Preferably, the specific method for performing edge-preserving layer processing on the obtained original V component is as follows:
[0023] The original image is traversed for each pixel, and histogram transformation is calculated using the window around the pixel. The pixels are then mapped to obtain the result after adaptive histogram equalization.
[0024] The result of the adaptive histogram equalization method is enhanced by a guided filtering operation, with itself as the guiding image and the window size set to 3×3, to obtain the V flux after edge preservation layer processing.
[0025] The specific formula for guided filtering is:
[0026]
[0027] Among them, O i It is the output image, G i It is a guide image, a k and b k It is a local window ω k The linear coefficients;
[0028] The linear coefficients are as follows:
[0029]
[0030]
[0031] Where ε is the coefficient a that prevents linearity. k The regularization coefficient, μ, becomes excessively large. k G represents i In the local window ω k The average value within, Indicates at ω k The average value of the original image.
[0032] Preferably, the dynamic range of the V channel is extended, specifically by the following method:
[0033] A piecewise function is used to expand the dynamic range of grayscale, specifically:
[0034]
[0035] Among them, V amp V'(x,y) represents the V component amplified by the previous operation, while V'(x,y) represents the V component after dynamic range extension.
[0036] Preferably, the saturation S component is adaptively adjusted, specifically by the following method:
[0037] Step 4.1: Calculate the difference VS between the enhanced V flux and the original S flux;
[0038] Step 4.2: Use bilateral gamma transform combined with the difference between the two components to correct the saturation.
[0039] Preferably, the specific method for calculating the difference VS between the enhanced V flux and the original S flux is as follows:
[0040] The method for calculating the average value of the V component and the average value of the S component is as follows:
[0041]
[0042]
[0043] Where i represents the gray level, V'(i) is the number of pixels in the enhanced V channel at gray level i, M and N represent the length and width of the processed image, respectively, and S(i) represents the number of pixels in the S channel at gray level i.
[0044] The difference between the average value of the V component and the average value of the S component is used as the difference VS between the enhanced V flux and the original S flux.
[0045] Preferably, the specific method for correcting saturation using bilateral gamma changes combined with the difference between the two components is as follows:
[0046]
[0047] S1(x,y)=S(x,y) γ
[0048] S2(x,y)=1-(1-S(x,y)) γ
[0049] S'(x,y)=αS1(x,y)+(1-α)S2(x,y)
[0050] Where γ is the gamma correction parameter, S(x,y) is the value of the original saturation component, and α is the adaptive parameter, calculated using the following formula: S'(x,y) is the adaptively adjusted saturation.
[0051] Preferably, step 5 converts the HSV color space to the RGB color space, and the specific method is as follows:
[0052]
[0053] in, p=V×(1-S), q=v×(1-f×S), t=V×(1-(1-f)×S).
[0054] Compared with existing technologies, the significant advantages of this invention are as follows: This invention performs image processing in the HSV color space, and image enhancement only needs to focus on the luminance component V. Compared with enhancing the red, green, and blue channels of an image separately in the RGB color space, this invention saves processing time and avoids color difference phenomena caused by uneven enhancement of the three channels. This invention also introduces an improved Retinex method and an edge-preserving layer algorithm, which solves the edge blurring effect caused by the traditional Retinex method. The dynamic range expansion of the V channel avoids over-enhancement of the image, and the saturation component S adaptively adjusts with the processed V component, making the image more in line with the natural perception of the human eye. This invention preserves the edge information of low-light images while enhancing them, effectively handling problems such as low brightness, edge loss, and poor natural perception in low-light images. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0056] Figure 2 A schematic diagram of the results of segmented processing for edge-preserving layers.
[0057] Figure 3 A comparison of the visual effects of different methods used to process the bookshelf scene.
[0058] Figure 4 A comparison of the visual effects of different methods used to process a kitchen scene. Detailed Implementation
[0059] The following description, in conjunction with the accompanying drawings, further illustrates examples of the present invention.
[0060] A Retinex-based edge-preserving color low-light image enhancement method, such as Figure 1 As shown, the specific steps are as follows:
[0061] Step 1: Convert the input low-light image from the RGB color space (representing red, green, and blue primary colors) to the HSV color space (representing hue, saturation, and brightness). The conversion formula is as follows:
[0062]
[0063] Among them, T max and T min These are the maximum and minimum values of the red, green, and blue channels, respectively. The value range of H is [0, 360], and the value range of V is [0, 1].
[0064] Step 2: For the obtained raw V components, the improved Retinex enhancement method and the edge-preserving layer consisting of adaptive histogram equalization and guided filtering are applied respectively. Then, the enhancement results of the two methods are weighted and averaged. The specific process is as follows:
[0065] (1) Based on Retinex theory, the V-channel image is represented as the product of the illumination component and the reflection component, expressed as:
[0066] I(x,y)=L(x,y)gR(x,y)
[0067] In the formula, I(x,y) represents the original image of the V channel; L(x,y) represents the illumination in the current environment, i.e., the illumination component; and R(x,y) represents the inherent reflectivity of the object, i.e., the reflection component.
[0068] The original image is the initial V-channel image. The illumination component is obtained by bilateral filtering of the V-channel. A Gaussian kernel is convolved with the image, and the neighboring pixels of each pixel in the input image are weighted and averaged. The smooth and sharp edge output image is obtained by controlling the magnitude of the value. The specific formula for bilateral filtering is as follows:
[0069] W(i,j,k,l)=W s (i,j)*W r (i,j)
[0070] Among them, W s (i,j) and W r (i,j) represent the spatial proximity factor, (i,j) represent the pixel at the current position, and (k,l) represent the pixel at the center.
[0071] Among them, W s (i,j) and W r (i,j) represent spatial proximity factors, which are calculated using the following formulas:
[0072]
[0073]
[0074] Where, δ s It is the standard deviation of the spatial domain, δ r It is the standard deviation within the range;
[0075] Perform a logarithmic transformation on the above formula, and then take the difference between the logarithm of the input image I(x,y) and the logarithm of the illumination component L(x,y);
[0076] log(R(x,y))=log(I(x,y))-log(L(x,y))
[0077] The obtained results are converted back to the real number field by exponential operation to obtain the V channel enhancement result obtained by the improved Retinex algorithm.
[0078] (2) Traverse each pixel of the original image, calculate the histogram transformation using the window surrounding the pixel, and then map the pixel to obtain the result after adaptive histogram equalization. Apply a guided filter to the result enhanced by the adaptive histogram equalization method, using itself as the guiding image, to obtain the V flux after edge preservation layer processing. The expression for the guided filter is as follows:
[0079]
[0080] Among them, O i It is the output image, G i It is a guide image, a k and b k It is a local window ω k The linear coefficients. The specific method for determining the linear coefficients is as follows:
[0081] The expression for the cost function is as follows:
[0082]
[0083] Cost function The value of can be minimized using the least squares method, thus yielding an expression for the linear coefficients:
[0084]
[0085]
[0086] Where ε is the coefficient a that prevents linearity. k An excessively large regularization coefficient (ε) results in a more pronounced smoothing effect when the input image is used as the guide image. k G represents i In the local window ω k The average value within, at the same time Indicates at ω k The average value of the original image.
[0087] Since the pixels in the output image can be generated by linear coefficients in various windows, the following expression can be obtained:
[0088]
[0089] The processing results and details of the edge preservation layer are as follows: Figure 2 As shown, the V component image after edge preservation layer processing has clear edges and low noise level.
[0090] (4) The enhanced V-channel flux is obtained by weighted averaging the V-channel results obtained by the improved Retinex method and the V-channel results obtained by the edge-preserving layer, as shown in the following formula:
[0091] V amp =αV1+(1-α)V2
[0092] Where V1 represents the V component obtained by the improved SSR method, and V2 represents the V component obtained based on guided filtering.
[0093] Step 3: Dynamically expand the V channel after processing to avoid excessive concentration of grayscale values in high-grayscale areas, which could lead to over-enhancement. A piecewise function is used to expand the dynamic range of the grayscale. The approach to expanding the dynamic range is as follows: components with a dynamic range greater than 0.5 after enhancement are left unprocessed; components with a dynamic range less than 0.5 after enhancement are expanded using a quadratic equation, the corresponding expression of which is as follows:
[0094]
[0095] Among them, V amp V'(x,y) represents the V component amplified by the previous operation, while V'(x,y) represents the V component after dynamic range extension.
[0096] Step 4: Based on the enhanced new V component, adaptively adjust the saturation component S. The specific method is as follows:
[0097] (1) Calculate the difference VS between the enhanced V flux and the original S flux;
[0098] VS = V'mean - Smean
[0099] Where VS represents the average difference between the two components, V'mean is the average value of the enhanced V component, and V is the average value of the S component.
[0100] The expressions for calculating V'mean and Smean are as follows:
[0101]
[0102]
[0103] (2) Use a bilateral gamma transform to combine the difference between the two obtained components for saturation correction. To increase the value of the S component, the gamma parameter must be within the range of (0,1). Conversely, the parameter value needs to be greater than 1 to decrease the value of the S component. This operation is achieved using a piecewise function, the expression of which is as follows:
[0104]
[0105] S1(x,y)=S(x,y) γ
[0106] S2(x,y)=1-(1-S(x,y)) θ
[0107] S'(x,y)=αS1(x,y)+(1-α)S2(x,y)
[0108] Where θ is the gamma correction parameter, S(x,y) is the value of the original saturation component, and α is the adaptive parameter, calculated using the following formula: S'(x,y) represents the adaptively adjusted saturation. This paper uses a piecewise function to adaptively adjust the S channel.
[0109] Step 5: Convert the processed image back from the HSV color space to the RGB color space. The specific method is as follows:
[0110]
[0111] in, p=V×(1-S), q=v×(1-f×S), t=V×(1-(1-f)×S).
[0112] Example
[0113] The effects of this invention can be further illustrated by the following simulation experiments:
[0114] I. Experimental conditions:
[0115] Hardware platform: AMD Ryzen 74800H with Radeon Graphics 2.90GHz processor
[0116] Software simulation platform: MATLAB R2018a
[0117] II. Simulation Comparison Experiment:
[0118] To verify the effectiveness of this invention, comparative experiments were conducted with the BIMEF method, Dong method, LIME method, MF method, NPE method, and SRIE method. Figure 3 and Figure 4The images show the renderings of a bookshelf scene and a kitchen scene, respectively. (a) is a low-light image, (b) is a reference image under normal lighting, (c) is the result of the BIMEF method, (d) is the result of the Dong method, (e) is the result of the LIME method, (f) is the result of the MF method, (g) is the result of the NPE method, (h) is the result of the SRIE method, and (i) is the result of the method of this invention. As shown in the figures, the result processed by the method of this invention looks more natural, avoiding over-enhancement and under-enhancement, effectively improving the color saturation and contrast of the low-light image, and the visual effect is relatively clear. The low-light images processed by the BIMEF, MF, and SRIE algorithms are still dark, and the image enhancement effect is weak. In this dark environment, details such as the books in the bookshelf and the rice cooker in the kitchen cannot be well restored. The result processed by the LIME algorithm looks relatively natural overall, but there is over-enhancement in some areas of the scene, such as the bookshelf. The Dong algorithm amplifies noise while enhancing the image, resulting in obvious "dark spots" in the kitchen scene, which do not match the reference image. The image processed by the NPE algorithm exhibits color difference. When comparing the window in the kitchen scene, the colors of this image deviate from those of the reference image.
[0119] Objective evaluation was conducted using Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), and Natural Image Quality Evaluator (NIQE). The experimental results are shown in Table 1. PSNR is the most commonly used indicator for evaluating image quality, used to assess the signal-to-noise ratio resistance of the processed image. The signal-to-noise ratio resistance of an image is directly proportional to the PSNR value. SSIM is used to evaluate whether the structure of the image is distorted. The higher the SSIM value, the higher the similarity between the processed image and the reference image. NIQE is a no-reference evaluation indicator used to assess whether the image conforms to natural perception. The lower the NIQE value, the closer the image is to a natural image. As shown in Table 1, the PSNR values of the BIMEF and SRIE algorithms are relatively low, indicating weak noise resistance. Furthermore, the SSIM value of the image processed by SRIE is the lowest, showing only moderate effect on structure preservation and exhibiting some distortion. The method presented in this paper achieves the best PSNR, SSIM, and NIQE results compared to other classic traditional image enhancement algorithms. The comparison revealed that the present invention can clearly and naturally enhance images, retaining the detailed information of the image without changing the original structure of the image, while satisfying the visual model of the human eye.
[0120] Table 1 Quantitative comparison of different algorithms on the test graph.
[0121]
Claims
1. A Retinex-based edge-preserving color low-light image enhancement method, characterized in that, The specific steps are as follows: Step 1: Convert the input low-light image from the RGB color space, which represents the three primary colors of red, green, and blue, to the HSV color space, which represents hue, saturation, and brightness. Step 2: For the obtained raw V components, perform improved Retinex enhancement processing and edge-preserving layer processing consisting of adaptive histogram equalization and guided filtering respectively. Then, weighted average the results of the two enhancement methods. The specific method for improving Retinex enhancement processing of the obtained raw V components is as follows: Based on Retinex theory, the V-channel image is represented as the product of the illumination component and the reflection component, expressed as: I(x,y)=L(x,y)·R(x,y) In the formula, I(x,y) represents the original image of the V channel; L(x,y) represents the illumination in the current environment, i.e., the illumination component; and R(x,y) represents the inherent reflectivity of the object, i.e., the reflection component. The original image is the initial V channel image. The illumination component is obtained by bilateral filtering of the V channel. The Gaussian kernel is convolved with the image. The neighboring pixels of each pixel in the input image are weighted and averaged. The smooth and clear edge output image is obtained by controlling the value. The calculation formula for the V channel image is logarithmically transformed, and the difference between the logarithm of the input image I(x,y) and the logarithm of the illumination component L(x,y) is calculated. ln(R(x,y))=ln(I(x,y))-ln(L(x,y)) The obtained results are converted back to the real number field by exponential operation to obtain the V channel enhancement result obtained by the improved Retinex algorithm; The specific method for performing edge-preserving layer processing on the obtained raw V components is as follows: The process involves iterating through each pixel of the original V-channel image, calculating the histogram transformation using the window surrounding each pixel, mapping the pixels, and obtaining the result after adaptive histogram equalization. The result of the adaptive histogram equalization method is enhanced by a guided filtering operation, with itself as the guide image and the window size set to 3×3, to obtain the V flux after edge preservation layer processing. The specific formula for guided filtering is: Among them, O i It is the output image, G i It is a guide image, a k and b k It is a local window ω k The linear coefficients; The linear coefficients are as follows: Where ε is the coefficient α that prevents linearity k The regularization coefficient, μ, becomes excessively large. k C represents i In the local window ω k The average value within, Indicates at ω k The average value of the original image; The enhanced V-channel flux is obtained by weighted averaging the V-channel results obtained from the improved Retinex method and the edge-preserving layer, as shown in the following formula: V amp =α1V1+(1-α1)V2 Where V1 represents the V component obtained by the improved Retinex method, and V2 represents the V component obtained by the edge-preserving layer; Step 3: Perform dynamic range expansion on the enhanced V channel. The specific method is as follows: A piecewise function is used to expand the dynamic range of grayscale, specifically: V'(x,y) represents the V component after dynamic range expansion; Step 4: Adaptively adjust the saturation component S based on the V component after dynamic range expansion. The specific method is as follows: Step 4.1: Calculate the difference VS between the V component after dynamic range expansion and the original S flux. The specific method is as follows: The method for calculating the average value of the V component and the average value of the S component after dynamic range extension is as follows: Where i represents the gray level, V′(i) is the number of pixels of the V component at gray level i after dynamic range expansion, M and N represent the length and width of the processed image, respectively, and S(i) represents the number of pixels of the S channel at gray level i. The difference between the average value of the V component and the average value of the S component after dynamic range expansion is taken as the difference VS between the V component after dynamic range expansion and the original S flux. Step 4.2: Saturation correction is performed using a bilateral gamma transform combined with the difference (VS). The specific method is as follows: γ=1+(-1) 2-n *|VS| 2 , S1(x,y)=S(x,y) γ S2(x,y)=1-(1-S(x,y)) γ S'(x,y)=αS1(x,y)+(1-α)S2(x,y) Where γ is the gamma correction parameter, S(x,y) is the value of the original saturation component, and α is the adaptive parameter, calculated using the following formula: S′(x,y) is the adaptively adjusted saturation. Step 5: Convert the processed image back from the HSV color space to the RGB color space.
2. The Retinex-based edge-preserving color low-light image enhancement method according to claim 1, characterized in that, Step 5 converts the HSV color space to the RGB color space. The specific method is as follows: in, p=V×(1-S), q=V×(1-f×S), t=V×(1-(1-f)×S).