A guided filter-Retinex low-light image enhancement method based on PSO optimization
Patent Information
- Application Number
- CN202011198211.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-10-30
Smart Images

Figure CN112288652B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a guided filtering-Retinex low-illumination image enhancement method based on PSO optimization. Background Art
[0002] Due to factors such as environment and lighting, low-light images often have low brightness, poor contrast and contain noise, which is not only difficult to distinguish with the naked eye, but also brings challenges to subsequent image processing, such as target detection and video surveillance. Therefore, the enhancement of low-light images has always been a hot topic in the field of image processing and has very important practical significance.
[0003] The purpose of low-light image enhancement is to enhance dark areas, suppress highlight areas, and achieve image clarity. At present, many low-light image enhancement algorithms have been proposed at home and abroad, and three categories are widely used: the first category is based on histogram equalization (HE) methods. This type of method can effectively improve the contrast and has a fast processing speed, but it is prone to over-enhancement and loses detail information due to grayscale merging. The second category is based on the defogging model. DONG's method based on the defogging model enhances low-light images, mainly by flipping and defogging low-light images to achieve low-light image enhancement. Although the method based on the defogging model has a good enhancement effect on low-light images, the enhanced image is prone to artifacts at the edge. The third category is based on the Retinex theory. This is the most widely used algorithm in recent years. Its main principle is: the image observed by the human eye is represented as the product of the illumination component and the reflection component. The illumination component reflects the illumination condition, while the reflection component is an inherent attribute of the image and does not change due to the illumination condition. Therefore, by estimating and removing the illumination component in the original image, the reflection component can be obtained, thereby achieving image enhancement. The most classic ones are the single-scale Retinex (SSR) algorithm, the multi-scale Retinex (MSR) algorithm, and the MSR with color restoration (MSRCR) algorithm. The SSR algorithm performs Gaussian filtering estimation on the image, and the MSR algorithm can be seen as the linear weighted sum of multiple SSRs of different scales, which can effectively improve the contrast and brightness of the image, but it will also make the image edge less sharp and some colors distorted. The MSRCR algorithm introduces color restoration based on the MSR algorithm, so that the enhanced image will not be distorted, but the color of the image will deviate from the original color, and the overall color will be white.
[0004] Retinex has excellent characteristics in enhancing image contrast, brightness, and details, making it widely used in the field of image processing in recent years. Some new algorithms based on Retinex theory have also been proposed. AHN H et al. used guided filtering instead of Gaussian filtering to estimate the brightness component and proposed a high dynamic range image adaptive local tone mapping algorithm based on Retinex, which can better maintain the original color of the image. LI et al. proposed a weighted guided filtering, using adaptive factors as weights to improve the edge-preserving smoothing ability of the guided filtering, which can achieve sufficient smoothing without edge blurring, but there will be problems of increased noise. GUO XJ et al. proposed a low-illumination image enhancement algorithm based on illumination image estimation, that is, first taking the maximum value of the three RGB channels of the original low-illumination image to obtain the initial illumination image, and then continuously correcting the original illumination map through structural priors, and applying Gamma correction to adjust the illumination image, so as to obtain a globally smooth and edge-clear illumination image. WANGS et al. proposed a naturalness-preserving enhancement algorithm for non-uniform illumination images, and proposed to use the image after Gaussian smoothing as the guide image of the guided filter. Although it can be smoothed better, the enhanced image still has halos. Zhang Jie et al. proposed a low-light image enhancement algorithm based on iterative multi-scale guided filtering Retinex, which converts the image into YCbCr space, and then estimates the illumination image of the Y component using an iterative multi-scale guided filtering algorithm, eliminating various contrast details while maintaining the edge. FUX et al. proposed a low-light image enhancement algorithm based on multi-image fusion, which can effectively improve the local contrast of the image and better maintain the naturalness of the image. The above algorithms have achieved good enhancement effects in terms of image color preservation, noise removal, and enhancement of image contrast and details, but they cannot always achieve a good balance in terms of brightness, contrast enhancement, details and color preservation. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a guided filtering-Retinex low-illumination image enhancement method based on PSO optimization in view of the deficiencies in the above-mentioned prior art. The method has simple steps and is easy to implement. It can effectively improve image contrast and enhance image detail information. While removing image noise, it can well maintain image edge information, improve the distortion and halo phenomenon existing in Retinex, obtain good image visual effect, and has significant effect, which is easy to promote.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a guided filtering-Retinex low-light image enhancement method based on PSO optimization, comprising the following steps:
[0007] Step 1: Convert the original image from RGB space to HSV space, keeping the hue component H and saturation component S unchanged;
[0008] Step 2: Perform a wavelet decomposition on the brightness component V to obtain three high-frequency sub-images HL1, LH1, HH1 and a low-frequency sub-image LL1;
[0009] Step 3: Perform two-layer wavelet decomposition on the low-frequency LL1 sub-image to obtain three high-frequency sub-images HL2, LH2, HH2 and a low-frequency LL2 sub-image;
[0010] Step 4: Linearly enhance the three high-frequency sub-images HL2, LH2, and HH2 respectively to obtain enhanced high-frequency sub-images;
[0011] Step 5: Perform wavelet reconstruction on the enhanced high-frequency sub-image and the low-frequency LL2 sub-image to obtain a processed first-order approximate image LL1';
[0012] Step 6: Adopt adaptive median filtering to enhance the high-frequency HL1, LH1, and HH1 sub-images;
[0013] Step 7: Use the guided filter-Retinex based on PSO optimization to enhance the first approximate image LL1';
[0014] Step 8, performing wavelet reconstruction on the enhanced image obtained in step 6 and the enhanced image obtained in step 7 to obtain an enhanced brightness component V image;
[0015] Step 9: Synthesize the enhanced brightness component V image with the hue component H and the saturation component S, then convert the synthesized image from the HSV space to the RGB space, and perform gamma correction to obtain the final enhanced image.
[0016] In the above-mentioned guided filtering-Retinex low-illumination image enhancement method based on PSO optimization, the one-layer wavelet decomposition in step 2 and the two-layer wavelet decomposition in step 3 both use db4 wavelet for image decomposition.
[0017] In the above-mentioned guided filtering-Retinex low-illumination image enhancement method based on PSO optimization, the wavelet reconstruction in step 4 and the wavelet reconstruction in step 8 both use db4 wavelet for image reconstruction.
[0018] In the above-mentioned guided filtering-Retinex low-light image enhancement method based on PSO optimization, the specific steps of the guided filtering-Retinex based on PSO optimization in step 7 include:
[0019] Step 701, after reading the wavelet primary reconstruction image, first initialize the particle swarm, form an initial particle population N = 50, set the learning factor of the particle swarm c1 = c2 = 2, the inertia weight ω = 0.8, the maximum number of iterations 100 times, the initial speed V, set the search range of the guide filter kernel radius r to [2,30], and the search range of the regularization factor ε to [0.01,1];
[0020] Step 702, initializing the initial values of r and ε, performing guided filtering-Retinex enhancement on the image, and using a fitness function to evaluate the quality of the enhanced image, and calculating the fitness value;
[0021] Step 703: Calculate the fitness value of each particle according to the fitness function, evaluate each particle in the particle population, compare its current fitness value with the fitness value corresponding to its individual historical best position Pbest, and when the current fitness value is better than the fitness value corresponding to the individual historical best position Pbest, use the current position to update the individual historical best position Pbest;
[0022] Step 704: for each particle, compare the current fitness value with the fitness value corresponding to the global best position Gbest. When the current fitness value is better than the fitness value corresponding to the global best position Gbest, update the global best position Gbest with the current particle position.
[0023] Step 705: Update the speed and position of each particle;
[0024] Step 706: When the number of iterations reaches the required maximum number of iterations, execute step 707; when the number of iterations does not reach the required maximum number of iterations, return to step 702;
[0025] Step 707: Output the corresponding optimal parameter values r and ε to the guided filter-Retinex to enhance the image.
[0026] In the above-mentioned guided filtering-Retinex low-light image enhancement method based on PSO optimization, the fitness function Fitness in step 702 and step 703 is
[0027] Fitness=Contrast×Entropy
[0028] Among them, Contrast is the image contrast and Entropy is the image information entropy.
[0029] In the above-mentioned guided filtering-Retinex low-light image enhancement method based on PSO optimization, the gamma correction formula in step nine is V out =A*V inγ , where V in is the input image, V out is the output image, A is a constant, and γ is the only parameter that controls the degree of image brightness enhancement.
[0030] Compared with the prior art, the present invention has the following advantages:
[0031] 1. The method of the present invention has simple steps and is easy to implement.
[0032] 2. The present invention uses adaptive median filtering to process a large amount of noise information and detail information in the wavelet high-frequency component image, which can not only remove the noise but also has a good effect of preserving the details.
[0033] 3. The present invention adopts guided filtering optimized by particle swarm algorithm to estimate the illumination component, and realizes accurate extraction of the illumination component, which can not only improve the image brightness and contrast, but also enhance the image detail information.
[0034] 4. The present invention adopts gamma correction to improve the image brightness and enrich the detail information of dark areas to obtain better visual effects.
[0035] 5. The present invention can effectively improve image contrast, enhance image detail information, and while removing image noise, well preserve image edge information, improve the distortion and halo phenomenon existing in Retinex, obtain good image visual effects, and has significant effects, which is easy to promote.
[0036] In summary, the method of the present invention has simple steps and is easy to implement. It can effectively improve image contrast, enhance image detail information, and while removing image noise, it can well maintain image edge information, improve the distortion and halo phenomenon existing in Retinex, obtain good image visual effect, and has significant effect, which is easy to promote.
[0037] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flow chart of the method of the present invention;
[0039] Figure 2 It is a schematic diagram of the two-layer wavelet decomposition and reconstruction process in the method of the present invention;
[0040] Figure 3 The flowchart of the method of guided filtering-Retinex based on PSO optimization in the method of the present invention. DETAILED DESCRIPTION
[0041] like Figure 1As shown, the guided filtering-Retinex low-light image enhancement method based on PSO optimization of the present invention comprises the following steps:
[0042] Step 1: Convert the original image from RGB space to HSV space, keeping the hue component H and saturation component S unchanged;
[0043] Step 2: Perform a wavelet decomposition on the brightness component V to obtain three high-frequency sub-images HL1, LH1, HH1 and a low-frequency sub-image LL1;
[0044] Step 3: Perform two-layer wavelet decomposition on the low-frequency LL1 sub-image to obtain three high-frequency sub-images HL2, LH2, HH2 and a low-frequency LL2 sub-image;
[0045] Step 4: Linearly enhance the three high-frequency sub-images HL2, LH2, and HH2 respectively to obtain enhanced high-frequency sub-images;
[0046] Step 5: Perform wavelet reconstruction on the enhanced high-frequency sub-image and the low-frequency LL2 sub-image to obtain a processed first-order approximate image LL1';
[0047] Step 6: Adopt adaptive median filtering to enhance the high-frequency HL1, LH1, and HH1 sub-images;
[0048] Step 7: Use the guided filter-Retinex based on PSO optimization to enhance the first approximate image LL1';
[0049] Step 8, performing wavelet reconstruction on the enhanced image obtained in step 6 and the enhanced image obtained in step 7 to obtain an enhanced brightness component V image;
[0050] Step 9: Synthesize the enhanced brightness component V image with the hue component H and the saturation component S, then convert the synthesized image from the HSV space to the RGB space, and perform gamma correction to obtain the final enhanced image.
[0051] In this embodiment, the one-layer wavelet decomposition in step 2 and the two-layer wavelet decomposition in step 3 both use db4 wavelet to decompose the image.
[0052] In this embodiment, the wavelet reconstruction in step 4 and the wavelet reconstruction in step 8 both use db4 wavelet to reconstruct the image.
[0053] In specific implementation, each layer of wavelet decomposition can be decomposed into 4 sub-images, namely low-frequency sub-image LL, high-frequency horizontal sub-image HL, high-frequency vertical sub-image LH and high-frequency diagonal sub-image HH. The higher level of decomposition is just to further decompose the low-frequency components in the previous level of decomposition, so that the frequency resolution is getting higher and higher. The two-level wavelet decomposition process is as follows: Figure 2As shown, wavelet reconstruction is performed in the reverse direction.
[0054] In this embodiment, the specific steps of the guided filtering-Retinex based on PSO optimization in step 7 include:
[0055] Step 701, after reading the wavelet primary reconstruction image, first initialize the particle swarm, form an initial particle population N = 50, set the learning factor of the particle swarm to c1 = c2 = 2, the inertia weight ω = 0.8, the maximum number of iterations to 100 times, the initial speed V, set the search range of the guide filter kernel radius r to [2,30], and the search range of the regularization factor ε to [0.01,1];
[0056] Step 702, initializing the initial values of r and ε, performing guided filtering-Retinex enhancement on the image, and using a fitness function to evaluate the quality of the enhanced image, and calculating the fitness value;
[0057] Step 703: Calculate the fitness value of each particle according to the fitness function, evaluate each particle in the particle population, compare its current fitness value with the fitness value corresponding to its individual historical best position Pbest, and when the current fitness value is better than the fitness value corresponding to the individual historical best position Pbest, use the current position to update the individual historical best position Pbest;
[0058] Step 704: for each particle, compare the current fitness value with the fitness value corresponding to the global best position Gbest. When the current fitness value is better than the fitness value corresponding to the global best position Gbest, update the global best position Gbest with the current particle position.
[0059] Step 705: Update the speed and position of each particle;
[0060] Step 706: When the number of iterations reaches the required maximum number of iterations, execute step 707; when the number of iterations does not reach the required maximum number of iterations, return to step 702;
[0061] Step 707: Output the corresponding optimal parameter values r and ε to the guided filter-Retinex to enhance the image.
[0062] In this embodiment, the fitness function Fitness in step 702 and step 703 is
[0063] Fitness=Contrast×Entropy
[0064] Among them, Contrast is the image contrast and Entropy is the image information entropy.
[0065] In specific implementation, the fitness function takes into account the two indicators of image contrast and image information entropy. The optimization parameter obtained by using the evaluation function as the fitness function can improve the contrast and detail information of the enhanced image, and the overall effect is better. Specifically, the image contrast (Contrast) reflects the magnitude of the grayscale contrast of the image. The larger its value, the better the visual effect of the enhanced image. The image information entropy (Entropy) reflects the richness of image details. The larger its value, the richer its information content.
[0066] In this embodiment, the gamma correction formula in step nine is V out =A*V in γ , where V in is the input image, V out is the output image, A is a constant, and γ is the only parameter that controls the degree of image brightness enhancement.
[0067] In a specific implementation, the value of A is 1, and γ is the only parameter used to control the degree of enhancement of the image brightness. When γ is less than 1, the brightness is increased; when γ is greater than 1, the brightness is reduced.
[0068] In the specific implementation, the high-frequency component of the V image wavelet is processed by adaptive median filtering, and the low-frequency is processed by guided filtering-Retinex based on PSO. After wavelet reconstruction, the enhanced V image can be obtained, which is synthesized with the H and S images and converted back to RGB space. At this time, the image noise has been removed, the details and contrast have been enhanced, but the image is dark as a whole, and the brightness and contrast need to be further enhanced. The RGB image is gamma corrected to increase the image brightness and enrich the detail information of the dark area, so as to obtain a better visual effect.
[0069] In order to verify the effect of the method of the present invention, experiments were conducted on the method in the simulation software Matlab, and histogram equalization, single-scale Retinex and guided filtering algorithms were selected for comparison with the method.
[0070] Contrast, information entropy and peak signal-to-noise ratio are used to objectively evaluate the images processed by histogram equalization, SSR algorithm, guided filtering and this method. The evaluation results are shown in Table 1.
[0071] Table 1 Objective evaluation results of image quality obtained by different algorithms
[0072]
[0073] It can be seen from Table 1 that the image processed by this method is basically better than the SSR algorithm and the histogram algorithm in terms of contrast, information entropy, and peak signal-to-noise ratio. It is only lower than the SSR in terms of information entropy, but the image processed by the SSR algorithm has obvious color distortion. Compared with the guided filter, this method has better information entropy, indicating that the image enhanced by this method is richer in details. It is slightly inferior to the guided filter in terms of contrast and signal-to-noise ratio, but the guided filter has over-enhancement phenomenon. The image processed by this method has better visual effect.
[0074] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A guided filter-Retinex low-light image enhancement method based on PSO optimization, It is characterized in that The following steps are involved: Step 1: Convert the original image from RGB space to HSV space, keeping the hue component H and saturation component S unchanged; Step 2: Perform a wavelet decomposition on the brightness component V to obtain three high-frequency sub-images HL1, LH1, HH1 and a low-frequency sub-image LL1; Step 3: Perform two-layer wavelet decomposition on the low-frequency LL1 sub-image to obtain three high-frequency sub-images HL2, LH2, HH2 and a low-frequency LL2 sub-image; Step 4: Linearly enhance the three high-frequency sub-images HL2, LH2, and HH2 respectively to obtain enhanced high-frequency sub-images; Step 5: Perform wavelet reconstruction on the enhanced high-frequency sub-image and the low-frequency LL2 sub-image to obtain a processed first-order approximate image LL1'; Step 6: Adopt adaptive median filtering to enhance the high-frequency HL1, LH1, and HH1 sub-images; Step 7: Use the guided filter-Retinex based on PSO optimization to enhance the first approximate image LL1'; The specific steps of the guided filtering-Retinex based on PSO optimization include: Step 701: After reading the wavelet reconstructed image, the particle swarm is initialized first, the initial particle population N=50 is formed, and the learning factor c of the particle swarm is set. 1 =c 2 =2, inertia weight ω=0.8, maximum number of iterations 100 times, initial velocity V, set the search range of the guided filter kernel radius r to [2,30], and the search range of the regularization factor ε to [0.01,1]; Step 702, initializing the initial values of r and ε, performing guided filtering-Retinex enhancement on the image, and using a fitness function to evaluate the quality of the enhanced image, and calculating the fitness value; Step 703: Calculate the fitness value of each particle according to the fitness function, evaluate each particle in the particle population, compare its current fitness value with the fitness value corresponding to its individual historical best position Pbest, and when the current fitness value is better than the fitness value corresponding to the individual historical best position Pbest, use the current position to update the individual historical best position Pbest; The fitness function Fitness in step 702 and step 703 is: Fitness=Contrast×Entropy Among them, Contrast is the image contrast, Entropy is the image information entropy; Step 704: for each particle, compare the current fitness value with the fitness value corresponding to the global best position Gbest. When the current fitness value is better than the fitness value corresponding to the global best position Gbest, update the global best position Gbest with the current particle position. Step 705: Update the speed and position of each particle; Step 706: When the number of iterations reaches the required maximum number of iterations, execute step 707; when the number of iterations does not reach the required maximum number of iterations, return to step 702; Step 707: Output the corresponding optimal parameter values r and ε to the guided filter-Retinex to enhance the image; Step 8, performing wavelet reconstruction on the enhanced image obtained in step 6 and the enhanced image obtained in step 7 to obtain an enhanced brightness component V image; Step 9: Synthesize the enhanced brightness component V image with the hue component H and the saturation component S, then convert the synthesized image from the HSV space to the RGB space, and perform gamma correction to obtain the final enhanced image.
2. According to the PSO optimization-based guided filtering-Retinex low-light image enhancement method of claim 1, Features: The one-layer wavelet decomposition in step 2 and the two-layer wavelet decomposition in step 3 both use db4 wavelet to decompose the image.
3. According to the PSO optimization-based guided filtering-Retinex low-light image enhancement method of claim 1, Features: The wavelet reconstruction described in step 4 and the wavelet reconstruction described in step 8 both use db4 wavelet to reconstruct the image.
4. According to the PSO optimization-based guided filtering-Retinex low-light image enhancement method of claim 1, Features: The gamma correction formula in step nine is V out =A*V in γ , where V in is the input image, V out is the output image, A is a constant, and γ is the only parameter that controls the degree of image brightness enhancement.
