A Low-illumination Image Enhancement Method Simulating the Degradation Mechanism in Foggy Weather
Through the low-illumination image enhancement method that simulates the foggy day degradation mechanism, combined with decreasing cutting, genetic algorithm, atmospheric light value estimation, dark primary color priors, guiding filtering and gamma correction technology, the problem of inaccurate atmospheric light value estimation in the prior art is solved, and a more efficient image enhancement effect is achieved.
Patent Information
- Application Number
- CN202510292774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-13
AI Technical Summary
Existing low-illumination image enhancement techniques ignore the influence of strong light sources or white objects in the estimation of atmospheric light values, resulting in the inability to accurately distinguish pixels representing atmospheric light values in images containing multiple lighting conditions and complex scenes.
The low-illumination image enhancement method is adopted to simulate the degradation mechanism of foggy days, and the brightness and contrast adaptive compensation is performed by generating virtual haze images, combining decreasing cutting and genetic algorithms to optimize atmospheric light value estimation, coarse transmittance calculation based on dark primary color priors, guided filtering and refined transmittance maps, and gamma correction technology.
The accuracy and robustness of atmospheric light value estimation are improved, and the transmittance map is obtained that is more in line with the scene, which significantly improves the effect of image restoration, reduces artifacts, enhances image details, denoising, and maintains structural information and details restoration.
Smart Images

Figure CN119850493B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and particularly relates to a low-light image enhancement method that simulates the degradation mechanism of foggy days. Background Art
[0002] During the image shooting process, due to the limitations of ambient illumination and equipment, problems such as insufficient image brightness, low contrast, and unclear details often occur. This directly affects the visual experience of observers and reduces the accuracy of subsequent tasks of computer vision systems, such as image segmentation, object detection, and recognition processing. To solve these problems, low-light image enhancement technology is particularly important. Through image processing and enhancement algorithms, the quality and clarity of images can be effectively improved, and the detection and recognition capabilities of targets can be enhanced.
[0003] In recent years, by observing the image features of a large number of low-light images and their inverted images, researchers have found that the inverted images of low-light images are highly similar to foggy-day images. Based on this correlation, they proposed an algorithm for low-light image enhancement by applying the dark channel prior theory.
[0004] Although the above method improves the quality of low-light images to a certain extent, it ignores the influence of strong light sources or white objects in the estimation of the atmospheric light value. In images containing multiple lighting conditions and complex scenes, it is impossible to accurately distinguish the pixels representing the atmospheric light value. Therefore, it is necessary to improve it. Summary of the Invention
[0005] The purpose of the present invention is to provide a low-light image enhancement method that simulates the degradation mechanism of foggy days, improve the accuracy and robustness of the atmospheric light value estimation, obtain a transmittance map that better conforms to the scene, and improve the effect of image restoration.
[0006] To achieve the above object, the present invention discloses a low-light image enhancement method that simulates the degradation mechanism in foggy weather. The method includes the following steps: Step S100, generating a virtual haze image: performing an inversion process on the input low-light image to obtain a virtual haze image; Step S200, decreasing cutting combined with genetic algorithm search for atmospheric light estimation: S210, performing regional rough positioning on the virtual haze image using the decreasing cutting method, and gradually subdividing the image into smaller regions by setting a segmentation threshold; S220, using the genetic algorithm to perform fine positioning on the initially segmented regions, evaluating the quality of each candidate atmospheric light region, and optimizing the atmospheric light value region by combining tournament selection, crossover, and mutation operations to finally obtain an accurate atmospheric light value estimation; Step S300, calculating the rough transmittance based on the dark channel prior: S310, calculating the dark channel image of the virtual haze image according to the dark channel prior theory; S320, further improving the accuracy of the dark channel image through weighted minimum filtering; S330, performing morphological operations including erosion and dilation on the dark channel image to retain the minimum information of the local structure and smooth the image to obtain a rough transmittance image; Step S400, refining the transmittance map: performing refinement processing on the rough transmittance image using a guided filter, constructing a linear model and using the original image as a guidance map, and calculating the linear coefficients of the filter by combining the local mean and local variance to achieve smoothing of the transmittance map while retaining the edge details of the image; Step S500, dehazing the virtual haze image and enhancing low light: restoring a haze-free image according to the refined transmittance image, the atmospheric light value, and the atmospheric scattering model; performing an inversion process on the haze-free image to obtain an enhanced low-light image, achieving the enhancement effect of the low-light image; Step S600, adaptive compensation of brightness and contrast: performing brightness and contrast enhancement on the enhanced low-light image using an optimized gamma correction strategy, and adjusting the parameters of the power transformation to make the brightness distribution of the image more in line with the perception characteristics of the human eye, further improving the visual effect of the image.
[0007] In the step S100, the representation of the inversion process is: , where I(i, j) and J(i, j) are the pixel values of the virtual haze image and the low-light image respectively.
[0008] The step S210 includes: gradually subdividing the image into smaller regions, calculating the average value and standard deviation of the pixel intensities in the quadrants, and continuing to decompose and calculate the quadrant with the largest difference; determining the termination condition of the subdivision by setting a segmentation threshold, and if the product of the pixel values in the length and width directions of the sub-quadrant is less than the set value, stop the decomposition; during each segmentation process, the program checks the current region to determine whether it should be further subdivided or saved as a leaf node, and through a quarter recursive traversal, extracts the effectively smallest segmented regions from the leaf nodes to ensure that subsequent processing only focuses on these parts that are meaningful for analysis.
[0009] The step S220 includes: after the preliminary segmentation of the image region is completed by decremental cutting, generating an initial population of a genetic algorithm based on the leaf node data obtained by the decremental cutting. Among them, regions are randomly selected from the leaf nodes to initialize a candidate solution population, and each solution corresponds to a potential atmospheric light value region. Assuming that the number of leaf node regions after decremental cutting is N, the number of individuals in the initial population is set to P, where P < N. The gene of each individual is represented by the coordinates of the leaf node: , is the coordinate of the upper left corner of the region, is the width and height of the region. The genetic algorithm is used to optimize the atmospheric light value region. Among them, the optimization process includes: S221, defining a fitness function, which combines the average value and variance of the pixel brightness in the region to evaluate the quality of each candidate atmospheric light region. The larger the value of the fitness function, the more likely the region is to be the best atmospheric light value region. Specifically, the ratio of the average brightness to the variance is used to measure the level and uniformity of the average brightness. The higher the average brightness and the smaller the variance, the larger the value of the fitness function. The evaluation formula is expressed as: , , , where represents the average brightness in the region , represents the brightness variance in the region , is a constant used to avoid division-by-zero errors; S222, performing a selection operation, adopting a tournament selection mechanism, randomly selecting K individuals for comparison, and selecting the individual with the highest fitness value to enter the next generation, where K is a preset positive integer; S223, performing a crossover operation, randomly selecting two individuals as parents, selecting multiple crossover points in the gene sequences of the parents, and exchanging gene segments to generate two new individuals; S224, performing a mutation operation, randomly adjusting some genes of the individual with a preset mutation probability to avoid the algorithm prematurely converging to a local optimum. The formula for the mutation operation is: , where is a random vector used to adjust the coordinates of the individual; S225, running the genetic algorithm multiple times, and taking the average value of the brightness intensity of the best region as the finally output atmospheric light value.
[0010] Step S310 includes: S311. For each pixel point of the input image, obtain the RGB three-channel values of all pixel points within the local window centered on this pixel point; S312. Calculate the minimum value of the RGB channels of each pixel point within the local window, and form a numerical set with the minimum values of the RGB channels of all pixel points within this local window; S313. Determine the minimum value in the numerical set as the dark channel pixel value of this central pixel point; S314. Set a window size adjustment mechanism: Dynamically adjust the size of the local window according to the statistical characteristics of the image brightness histogram, specifically satisfying: When the average brightness value of the image is higher than the first brightness threshold, adjust the window size to the first preset size; When the average brightness value is between the first brightness threshold and the second brightness threshold, keep the reference window size unchanged; When the average brightness value is lower than the second brightness threshold, adjust the window size to the second preset size; where the first preset size is larger than the reference window size, and the second preset size is smaller than the reference window size.
[0011] Step S320 includes: Assign a weight value to each pixel in the image , and this weight value is determined by the brightness feature and color feature of the pixel. Among them, pixels located at the center of the dark area and with a brightness value lower than the preset threshold are given a larger weight value; The weighted minimum filtering is expressed as: , and generate an optimized dark channel image through the weighted minimum calculation result.
[0012] Step S330 includes: Perform an erosion operation. By sliding a structuring element in the image, take the minimum value within the current local window as the central pixel value of the new image. The erosion operation is expressed as: , where represents the structuring element centered on . Use a structuring element with the first preset pixel area in the flat area and a structuring element with the second preset pixel area in the area with rich texture. The first preset pixel area is larger than the second preset pixel area;
[0013] Perform a dilation operation. By sliding the structuring element, take the maximum value within the window as the central pixel value. The dilation operation is expressed as: , and obtain a rough transmission rate image through the above operations.
[0014] Step S400 includes: S410. Calculate the transmission rate based on the dark channel prior assumption. The transmission rate calculation formula is: , where ω is a constant with a value of 0.95, and A is the atmospheric light value; S420. Use guided filtering to refine the transmission rate. The guided filtering formula is: , where represents the filtered transmission rate image. is the original input image. and are the linear coefficients of the filter, 、 are calculated by the following formula: , , where, and are the local mean and local variance respectively, is the regularization parameter used to balance the filtering effect and noise suppression; adaptively adjust the window radius and regularization parameter of the guided filter according to the image size, and use the original image as the guidance image to filter the transmission map to retain the image edge details while smoothing the transmission map.
[0015] The S500 includes: S510, perform constraint processing on the refined transmission rate. By setting the lower limit value t0 of the transmission rate, prevent image artifacts caused by too small transmission rate. The transmission rate correction is expressed as: , where t(x) is the transmission rate at pixel point x, and t0 is the preset lower limit threshold of the transmission rate; S520, based on the corrected transmission rate, restore the input virtual haze image to a haze-free image according to the atmospheric scattering model. The restoration formula is expressed as: , where J(x) is the haze-free image, I(x) is the virtual haze image, and A is the atmospheric light value. S530, perform inversion processing on the haze-free image to obtain a low-light enhanced image. The inversion processing is expressed as: , where K(i, j) and L(i, j) are the pixel values of the low-light enhanced image and the haze-free image respectively.
[0016] The step S600 specifically includes: perform brightness enhancement on the low-light enhanced image using gamma correction. The gamma correction performs a power transformation on the pixel values of the image so that the brightness distribution of the image more conforms to the perception characteristics of the human eye; the gamma correction is expressed as: , where c and γ are both positive numbers, V in is the pixel value to be processed, and V out is the output pixel value of the gamma correction.
[0017] In summary, the beneficial effects of the present invention are as follows: The present invention proposes a low-light image enhancement method that simulates the degradation mechanism in foggy weather. This method is based on an improved dark channel prior algorithm and is used to improve the quality of low-light images. By combining progressive cutting and genetic algorithms, the estimation of the atmospheric light value is optimized, enhancing the contrast and brightness of the image; adaptively adjusting the window size improves the accuracy of the dark channel image, and the combination of progressive cutting and genetic algorithms enhances the estimation accuracy and robustness of the atmospheric light value; guided filtering technology is used to refine the transmission rate map, improving the defogging effect; through an improved gamma correction technology, balanced adjustment of the image brightness is achieved. Overall, this method shows significant advantages in reducing artifacts, enhancing image details, denoising, maintaining structural information, and detail restoration. Description of the Drawings
[0018] Figure 1 It is a diagram of the atmospheric scattering model;
[0019] Figure 2 It is the flowchart of low-light image enhancement in the present invention;
[0020] Figure 3 It is a virtual haze image and its histogram. Among them, (a) is a group of low-light images and the average gray histogram corresponding to this group of images, (b) is a group of virtual haze images and the average gray histogram corresponding to this group of images, and (c) is a group of real haze images and the gray histogram corresponding to this group of images;
[0021] Figure 4 It is the flowchart of calculating the atmospheric light value;
[0022] Figure 5 It is an example diagram of the progressive cutting result. Among them, (a) is the first example diagram of the progressive cutting result, (b) is the second example diagram of the progressive cutting result, (c) is the third example diagram of the progressive cutting result, and (d) is the fourth example diagram of the progressive cutting result;
[0023] Figure 6 It is an example diagram of the best area of the atmospheric light value;
[0024] Figure 7 It is an example diagram of calculating the transmission rate map. Among them, (a) is the original image of a group of low-light images, (b) is the operation example diagram of a group of pseudo-haze images, (c) is the operation example diagram of a group of dark primary color prior images, (d) is the example diagram of a group of morphological operation images, and (e) is the operation example diagram of a group of transmission rate images;
[0025] Figure 8 It is an example diagram of the low-light image enhancement result in the present invention. Among them, (a) is the original image of a group of low-light images, and (b) is the enhanced image of a group of low-light images;
[0026] Figure 9 It is a comparison chart of enhanced local effects for multiple algorithms. Among them, from left to right in the figure are 4 groups of original low-light images and local images of dataset M, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively. From top to bottom, they are divided into 4 groups with a total of 8 rows;
[0027] Figure 10 It is a diagram of the enhancement results of different algorithms on the DICM dataset. Among them, from left to right in the figure are 3 original low-light images on the DICM dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively. They are divided into 3 rows from top to bottom according to different images;
[0028] Figure 11 It is a diagram of the enhancement results of different algorithms on the LIME dataset. Among them, from left to right in the figure are 3 original low-light images on the LIME dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively. They are divided into 3 rows from top to bottom according to different images;
[0029] Figure 12 It is a diagram of the enhancement results of different algorithms on the LOW dataset. Among them, from left to right in the figure are 3 original low-light images on the LOW dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively. They are divided into 3 rows from top to bottom according to different images;
[0030] Figure 13 It is a result histogram of different algorithms on the DICM, LIME, LOW, and FUSION datasets. Specific implementation manner
[0031] 1. Theoretical basis of the present invention
[0032] 1.1 Atmospheric scattering model
[0033] Referring to Figure 1 , when studying low-light image enhancement, the commonly used physical model is the atmospheric scattering model in the defogging model. The atmospheric scattering model is described by the incident light attenuation model and the atmospheric imaging model:
[0034] (1)
[0035] represents the distance between the scene point and the imaging system, i.e., the depth of field, represents the wavelength of the light, is the irradiance of the light at x = 0; is the atmospheric scattering coefficient, and are the direct attenuation term and the ambient light term respectively.
[0036] The simplified model expression is as follows:
[0037] (2)
[0038] where A is the atmospheric light value, x represents the pixels of the image, t(x) is the transmittance, I(x) is the hazy image captured in foggy weather, and J(x) is the clear image obtained under normal lighting conditions.
[0039] The transmittance is expressed by the following equation:
[0040] (3)
[0041] β represents the atmospheric attenuation coefficient. If the medium in the atmosphere is evenly distributed, β is regarded as a constant, and d(x) represents the depth of the scene, which can be understood as the distance from the pixel point to the image capture device.
[0042] For the convenience of understanding, formula (2) is usually expressed as:
[0043] (4)
[0044] 1.2 Dark Channel Prior Dehazing Theory
[0045] The Dark Channel Prior theory is a rule obtained after people analyze and statistically process a large number of fog-free images: in the non-sky area, at least one color component has a very small intensity and is close to 0 at some pixel points, which can be expressed as:
[0046] (5)
[0047] Ω(x) is a local window centered on x, and c is one of the color channels, is any one of the RGB three channels of the image J(x), is the corresponding dark channel of the image.
[0048] After operating on formula (2), we get:
[0049] (6)
[0050] Take the minimum operation twice on both sides of formula (6):
[0051] (7)
[0052] According to the Dark Channel Prior theory, we can get:
[0053] (8)
[0054] The simplified transmittance calculation formula is as follows:
[0055] (9)
[0056] In actual situations, a correction factor ω (0 < ω < 1) is introduced to control the degree of defogging. Generally, ω is taken as 0.95, and a certain amount of fog is retained in the image. The transmittance calculation formula is as follows:
[0057] (10)
[0058] At this time, the transmittance can be obtained. The atmospheric light value A is taken as the maximum value among the top 0.1% of the pixels with the highest brightness in the dark channel image. After obtaining t(x) and A, substitute them into the formula to restore the defogged image.
[0059] Based on the above theoretical basis, the present invention proposes a low-light image enhancement method that simulates the foggy day degradation mechanism, further optimizes the calculation methods of the atmospheric light value and the transmittance, and improves the image enhancement effect.
[0060] 2. Embodiments of the present invention
[0061] The following combines the drawings and embodiments to further describe in detail the specific implementation manners of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0062] Referring to Figure 2 , the present invention applies the image defogging theory based on the atmospheric scattering model to low-light image enhancement. First, the input low-light image is inverted to obtain a virtual haze image, and an improved dark channel prior defogging algorithm is designed for image defogging processing, and then inverted again to obtain the final low-light image enhancement map. In the present invention, the patch size adaptive adjustment mechanism is used in the calculation of the dark channel image, and morphological operations and guided filtering are performed for refinement, improving the accuracy of the transmittance calculation. In the calculation of the atmospheric light value, a combination of decreasing cutting and genetic algorithm is used. The image is segmented by the method based on decreasing cutting, and the atmospheric light value region is further optimized and estimated by the genetic algorithm, improving the accuracy and robustness of the atmospheric light value estimation.
[0063] Step S100, generating a virtual haze image
[0064] To obtain a virtual haze image, first, the low-light image needs to be inverted. There are some commonalities between the inverted image and the foggy image. The calculation method is as follows:
[0065] (11)
[0066] Among them, I(i, j) and J(i, j) are the virtual haze image and the low-light image respectively.
[0067] Figure 3 For the comparison results, where (a) is the low-light image, (b) is the virtual haze image obtained by inverting the image in (a), and (c) is the real haze image. The right histograms are the average gray distribution histograms calculated from the left images in (a), (b), and (c). It can be seen that the gray distributions of the virtual haze image and the real haze image are similar. It is possible to consider using an image defogging method to defog the virtual haze image and then invert the image to the low-light enhancement result.
[0068] Step S200: Atmospheric light estimation by combining decreasing cutting and genetic algorithm search
[0069] In image defogging, enhancement, and other computer vision tasks, accurately extracting the region of the atmospheric light value is of substantial importance. In the traditional dark channel defogging algorithm, usually the top 0.1% of the pixels with the largest intensity in the dark channel image are selected as the estimation of the atmospheric light value. However, this method is easily affected by noise and outliers, which may lead to inaccurate selection of the atmospheric light value. To address this problem, the present invention proposes a method combining decreasing cutting and genetic algorithm to obtain a more accurate atmospheric light value, and the specific process is as Figure 4 shown.
[0070] Step S200 specifically includes:
[0071] (1) Coarse positioning of the decreasing cutting region
[0072] Decreasing cutting is an effective data structure for recursively partitioning an image. In this module, the program gradually subdivides the image into smaller regions. By setting a segmentation threshold, the program determines the termination condition for subdivision. If the product of the pixel values in the length and width directions of the sub-quadrant is less than 100, stop the decomposition.
[0073] In each segmentation process, the program checks the current region to determine whether to further subdivide it or save the region as a leaf node. Finally, through a quarter of recursive traversal, the effective smallest regions after segmentation are extracted from the leaf nodes, ensuring that subsequent processing only focuses on these parts that are meaningful for analysis. Some experimental results are as Figure 5 shown. Among them, Figure 5 in, (a) is the first instance image of the decreasing cutting result, (b) is the second instance image of the decreasing cutting result, (c) is the third instance image of the decreasing cutting result, and (d) is the fourth instance image of the decreasing cutting result.
[0074] (2) Fine positioning by genetic algorithm
[0075] After the initial segmentation of the image region is completed by decreasing cutting, the initial population of the genetic algorithm is generated on this basis. The generation of the initial population depends on the leaf node data obtained by decreasing cutting. At this stage, regions are randomly selected from these leaf nodes to initialize a population of candidate solutions, that is, each solution corresponds to a potential atmospheric light value region. This initial population provides diversity for the genetic algorithm and also lays the foundation for subsequent optimization. Suppose the number of leaf node regions after decreasing cutting is N, then the number of individuals in the initial population is set to P, usually P < N, and each individual The gene of can be represented by the coordinates of the leaf node:
[0076] (12)
[0077] Among them, is the coordinate of the upper left corner of the region, is the width and height of the region.
[0078] The optimization process of the genetic algorithm is the core part of the whole algorithm. At this stage, the atmospheric light value region is optimized through multiple steps. The fitness function is the core of the genetic algorithm and is used to evaluate the quality of each individual in the population, that is, the fitness of each candidate atmospheric light region. The evaluation of fitness combines the average value and variance of the pixel brightness in the region, and the ratio of the average brightness to the variance is used to measure the level and uniformity of the average brightness. The brighter the region, the more likely it represents a more credible atmospheric light region. A small variance means that the brightness distribution in the region is more uniform, which means more representative lighting characteristics. The evaluation formula is:
[0079] (13)
[0080] (14)
[0081] (15)
[0082] Among them, represents the average brightness in the region , represents the brightness variance in the region , is a very small constant to avoid division by zero error. The higher the average brightness , the more likely it is that the region is an atmospheric light value region, while the smaller the variance , the more uniform the brightness distribution in the region. Therefore, the larger the fitness function value, the more likely it is that the region is the best atmospheric light value region.
[0083] Secondly, selection, crossover, and mutation operations are performed. During the selection process, the tournament selection mechanism is used. Randomly select K individuals for comparison (in the present invention, K = 3 is selected), and select the individual with the highest fitness value to enter the next generation. This method compares the fitness of multiple randomly selected individuals and selects the best one to ensure that high-fitness individuals are retained in the offspring population. The formula is expressed as:
[0084] (16)
[0085] The crossover operation selects multiple crossover points between two individuals and exchanges the corresponding gene intervals to generate new individuals, increasing the population diversity. Randomly select two individuals and as the parents. Select multiple crossover points in the gene sequences of the parents, exchange gene segments, and generate two new individuals and . The formula is expressed as:
[0086] (17)
[0087] The mutation operation applies mutation to the generated new individuals to randomly adjust some genes (coordinates) of the individuals with a small probability. The setting of the mutation probability is to prevent the algorithm from converging to the local optimum prematurely and ensure the ability to explore new search spaces. And by randomly adjusting some genes of the generated individuals, the algorithm is prevented from falling into the local optimum prematurely.
[0088] (18)
[0089] Among them, is a random vector used to make a small adjustment to the coordinates of the individual, and the mutation probability is set to = 0.01.
[0090] To enhance the stability and robustness of the algorithm, a mechanism for running the genetic algorithm multiple times is designed. The genetic algorithm will be run multiple times, and the average value of the brightness intensity of the best region will be used as the final output atmospheric light value. Run the genetic algorithm n times and record the average brightness of the best solution each time , take the average of the best solutions of all runs, and obtain the final estimated atmospheric light value:
[0091] (19)
[0092] In the present invention, set , the optimal atmospheric light region is directly marked on the original image in the form of a rectangular box. By combining the global optimization capabilities of decremental cutting and genetic algorithms, the algorithm proposed in the present invention can efficiently and accurately estimate the atmospheric light value region in the image. Decremental cutting can effectively reduce the search space and improve the processing efficiency, while the genetic algorithm ensures the accuracy and stability of the final estimation result. This method shows excellent performance when dealing with complex and variable scenes, and can provide a reliable basis for subsequent image enhancement operations. The experimental results are as Figure 6 shown.
[0093] Step S300, rough transmittance calculation based on dark channel prior
[0094] In the dark channel calculation, the dark channel pixel value of the input image is obtained by taking the minimum value of the minimum values of the RGB channels of each pixel within a small window centered at that point. According to the brightness distribution of the image, the window size used for dark channel calculation is adaptively adjusted.
[0095] To ensure that the window size adapts to the brightness distribution of the image, first analyze the brightness distribution and adaptively adjust the window size. When the brightness of the image is concentrated in the highlight area, that is, when most pixel values are high, appropriately increase the window size such as 9×9; when the brightness distribution is relatively uniform, maintain a medium-sized window such as 7×7; if there are many dark areas in the image, that is, when most pixel values are low, then reduce the window size such as 3×3. That is: when the average brightness is higher than 180, select a 9×9 window. When the average brightness is between 80 and 180, select a 7×7 window. When the average brightness is lower than 80, select a 3×3 window.
[0096] To further improve the accuracy of the dark channel image, weighted minimum filtering is introduced. In the traditional dark channel calculation process, it may be affected by noise or misjudgment in non-haze regions. To solve this problem, a weight is assigned to each pixel, and this weight is defined based on the brightness and color of the pixel. Pixels that are darker and closer to the center of the dark area are assigned higher weights. The formula for weighted minimum filtering is:
[0097] (20)
[0098] By calculating the weighted minimum value, a more accurate dark channel image can be generated.
[0099] Next, morphological operations are performed on the generated dark channel image. First is erosion. The erosion operation slides a structuring element in the image and takes the minimum value within the current local window as the central pixel value in the new image, thereby reducing the influence of the bright regions in the image on the dark channel result and retaining the minimum information of the local structure. The erosion operation can be expressed as:
[0100] (21)
[0101] where represents the structuring element centered at . A larger structuring element such as 5×5 is used in flat regions, and a smaller structuring element such as 3×3 is used in regions with rich textures, thereby reducing the influence of the bright regions on the result. The erosion operation not only retains the lowest value in the local region but also effectively reduces the interference of the bright regions on the result.
[0102] To avoid losing image details during the erosion operation, the dark channel image is dilated using the same structuring element as that for erosion. Dilation is the inverse operation of erosion. By sliding the structuring element, the maximum value within the window is taken as the central pixel value to smooth the dark channel image and compensate for the information lost during the erosion operation.
[0103] The dilation operation can be expressed as:
[0104] (22)
[0105] The dilation operation smooths the dark channel image by expanding the minimum value in the local region, avoiding the influence of extreme values generated in the image on the final low-light image enhancement effect. The operation result is as shown in (d) of Figure 7 . Figure 7 Figure (d) in Figure 7 is an example diagram of a set of morphological operation images. In addition,
[0106] in
[0107] Figure (a) is a set of original low-light images, (b) is an example diagram of the operations on a set of pseudo-haze images, and (c) is an example diagram of the operations on a set of dark channel prior images.
[0108] Through the above steps, combined with the dark channel calculation with an adaptive patch size, weighted minimum filtering, and morphological operations (erosion and dilation), the dark channel of the low-light image can be calculated more accurately, and further the processing effect of low-light image enhancement can be optimized.
[0109] (23)
[0110] For ω = 0.95 of the present invention, in order to improve the accuracy of transmittance estimation and maintain edge details, the present invention uses guided filtering to refine the preliminarily estimated transmittance. Guided filtering is an edge-preserving filter that can perform smoothing while maintaining image edge details. Its formula is as follows:
[0111] (24)
[0112] In the formula: represents the filtered transmittance image, is the original input image. and are the linear coefficients of the filter, which can be calculated by the following formula:
[0113] (25)
[0114] (26)
[0115] and are the local mean and local variance respectively, is the regularization parameter used to balance the filtering effect and noise suppression. In the present invention, by adaptively adjusting the radius and regularization parameter of the guided filter according to the image size and using the original image as the guidance map , combined with the transmittance map for filtering. This can ensure the smoothness of the transmittance map while retaining the edge details of the image. The operation example is as shown in Figure 7 in (e). Figure 7 In (e) of
[0116] is the operation example diagram of a group of transmittance images.
[0117] After refining the transmittance, it is necessary to constrain it to avoid image artifacts caused by too small transmittance values. The present invention adopts the following tolerance mechanism to correct the transmittance value:
[0118] (27)
[0119] Among them, is the set lower limit value to ensure that the transmittance will not be too small, thus avoiding artifacts during the defogging process. The final fog-free image can be restored by the following formula:
[0120] (28)
[0121] After dehazing the virtual haze image, the original low-illumination image can be enhanced by performing the inverse operation according to formula (11).
[0122] Step S600, Adaptive Compensation of Brightness and Contrast
[0123] During the dehazing process, the enhancement of brightness and contrast is to improve the visual effect of the image, making the dehazed image clearer and more natural. This algorithm proposes an optimized gamma correction strategy to enhance brightness.
[0124] Gamma correction is used to perform a power transformation on the pixel values of the image, making the brightness distribution of the image more in line with the perception characteristics of the human eye. The formula for gamma correction is as follows:
[0125]
[0126] In the formula, both c and γ are positive numbers, V in is the pixel value to be processed, and V out is the output pixel value of gamma correction.
[0127] 3. Experiments and Analyses on the Present Invention
[0128] Next, the effect of the low-illumination image enhancement method provided by the present invention for simulating the foggy weather degradation mechanism is verified through implementation.
[0129] To verify the effectiveness of the method provided by the present invention, we built a test platform, ran multiple advanced image enhancement algorithms on the low-illumination images in multiple datasets. The dataset M used in the present invention is a collection of multiple publicly available low-illumination image datasets. The present invention also ran the Dong algorithm, IBOOST algorithm, LDR algorithm, and PLM algorithm on the publicly available datasets DICM, LIME, LOW, and FUSION, and conducted experimental comparisons.
[0130] 3.1 Subjective Evaluation
[0131] We conducted a subjective perception analysis of the algorithm results from the aspect of visual perception. Figure 8 This is an example diagram of the low-illumination image enhancement result in the present invention. Among them, (a) is the original image of a group of low-illumination images, and (b) is the enhanced image of a group of low-illumination images. Figure 8 This shows some results obtained by running the present invention on dataset M, intuitively reflecting the effect of the present invention. To fully demonstrate the superiority of the present invention, we ran multiple advanced algorithms on dataset M and magnified and showed some details. Some results are as Figure 9 shown. Figure 9Comparison chart of enhanced local effects for multiple algorithms. Among them, from left to right in the figure are 4 groups of original low-illumination images and local images of dataset M, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively. To verify the effectiveness of the present invention, we ran multiple advanced low-illumination image enhancement algorithms on the DICM dataset, LIME dataset, LOW dataset, and FUSION dataset, and conducted comparative experiments. Some experimental results were selected, such as Figure 10 , Figure 11 , Figure 12 as shown. Figure 10 Enhancement result diagram of different algorithms on the DICM dataset. Among them, from left to right in the figure are 3 original low-illumination images on the DICM dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively; Figure 11 Enhancement result diagram of different algorithms on the LIME dataset. Among them, from left to right in the figure are 3 original low-illumination images on the LIME dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively; Figure 12 Enhancement result diagram of different algorithms on the LOW dataset. Among them, from left to right in the figure are 3 original low-illumination images on the LOW dataset, as well as the image enhancement effect diagrams obtained by using the DONG method, IBOOST method, LDR method, PLM method, and the method of the present invention respectively.
[0132] It can be seen from the above figures that in the process of processing the details of the image, the Dong algorithm is overly smoothed or blurred, showing the deficiency of the algorithm in retaining details. The edge enhancement and color processing of the image sometimes appear too exaggerated, especially the edge lines are too prominent. The IBOOST algorithm has the problem of oversharpening, resulting in slight artifacts in the edge area, especially local color distortion may occur when processing complex scenes. The LDR algorithm is slightly blurred in some areas, and the enhancement effect is not ideal when processing extremely low-illumination images. The PLM algorithm introduces some noise in the detail restoration, affecting the naturalness of the image. The color processing of this algorithm is not balanced, resulting in slight color deviation.
[0133] Compared with the Dong algorithm, IBOOST algorithm, LDR algorithm, and PLM algorithm, the low-light image enhancement method for simulating foggy weather degradation mechanism provided by the present invention has the following advantages: (1) It performs excellently in enhancing image brightness and contrast, and can significantly improve the overall visual effect of the image; (2) It performs well in color restoration, avoiding serious color deviation problems, making the image look more real and natural; (3) In terms of detail restoration, the present invention performs outstandingly, can display more image information, and effectively suppresses noise. Generally speaking, the present invention shows obvious advantages in the field of low-light image enhancement, is suitable for scenarios that require significant improvement in brightness and contrast, and at the same time maintains good naturalness and detail retention.
[0134] 3.2 Objective Evaluation
[0135] In terms of objective image quality evaluation, we selected reference-based image quality evaluation metrics and reference-free image quality evaluation metrics to verify the effectiveness of the algorithm. For reference-based image quality evaluation metrics, we selected: peak signal-to-noise ratio, structural similarity, mean squared error. For reference-free image quality evaluation metrics, we selected: entropy, average gradient, edge intensity. The experimental data tables are all the average values of the results after running the image enhancement algorithm on several low-light images included in dataset M. The experimental data chart data of reference-free image quality evaluation metrics are obtained by running different low-light image enhancement algorithms on the DICM dataset, LIME dataset, LOW dataset, and FUSION dataset. Ten images are randomly selected from each dataset, and the average value of the running results is taken.
[0136] 3.3.1 Image Quality Evaluation of Reference Images
[0137] The present invention is compared with several existing algorithms through detailed experimental data. In these comparisons, several evaluation metrics are used to quantify the performance of each algorithm in image enhancement. These metrics include peak signal-to-noise ratio (PSNR), structural similarity index (SSIM), and mean squared error (MSE). (1) The peak signal-to-noise ratio PSNR represents the ratio of the peak of the image signal to the noise. Based on the error between corresponding pixel points, this metric can better reflect the reconstruction quality of the image signal. The larger the value, the smaller the distortion of the image signal and the better the image quality. (2) The structural similarity SSIM is based on the assumption that the human eye extracts structured information in the image and is a metric for measuring the similarity between two images. It comprehensively evaluates through the brightness, contrast, and structural characteristics of the image. The numerical result of the structural similarity is in the range [0, 1]. The larger the value, the smaller the gap between the output image and the distortion-free image, that is, the higher the image quality and the better the visual effect. (3) The mean squared error MSE measures the square difference between the actual value of each pixel in the input image and the pixel value in the reference image. A low mean squared error indicates a small difference between the actual pixel value and the reference image pixel value, that is, the higher the image quality.
[0138] Table 1 Image Quality Evaluation Table with Reference Images
[0139] Dong IBOOST LDR PLM The present invention PSNR 16.85 16.51 13.81 14.91 17.09 SSIM 0.68 0.72 0.59 0.65 0.74 MSE 1751.92 2156.48 4142.64 2508.38 1617.19
[0140] As can be seen from Table 1, the PSNR value and SSIM value of the present invention are the highest, and the MSE value of the present invention is the lowest. From this, it can be shown that: The present invention performs excellently in terms of image quality, achieving the best in all three metrics of PSNR, SSIM, and MSE, indicating its excellent capabilities in noise suppression, structure preservation, and error minimization. Due to effective noise suppression, the enhanced image is clearer and richer in details. Good structure preservation makes the enhanced image look natural and not distorted due to enhancement. Error minimization ensures that image details are retained, and textures and edges are clearer. Less noise and distortion make the enhanced image more visually comfortable and more suitable for human eyes to view.
[0141] 3.3.2 Image Quality Evaluation without Reference Images
[0142] In terms of image quality assessment without a reference image, we selected several metrics: entropy, average gradient, and edge strength. (1) Entropy is an important metric commonly used to evaluate image quality, reflecting the information content and complexity of the image. Entropy evaluates the image quality by measuring the randomness of pixel distribution in the image. The larger the entropy value, the more information the image contains, the richer the details, and the better the image quality. (2) The average gradient is calculated based on the gray values of the image and is used to measure the sharpness and detail expression ability of the image, representing the relative sharpness of the image. The larger the average gradient, the more levels the image has, the richer the image details and edge information, and the higher the image quality. (3) Edge strength is used to measure the sharpness and detail performance of the image. It is an important concept in image processing. Substantially, it is the magnitude of the gradient of edge points and reflects the edges of the image. That is, the larger the edge strength of the image, the better, and the higher the image quality.
[0143] Table 2 Image Quality Assessment Table for Images without a Reference Image
[0144] Dong IBOOST LDR PLM The present invention Entropy 7.03 7.14 7.11 7.21 7.31 Average gradient 7.01 6.80 6.27 7.67 9.21 Edge strength 69.34 67.34 63.13 77.06 91.44
[0145] Figure 13 Shows the results of different algorithms on the DICM, LIME, LOW, and FUSION datasets.
[0146] Comparisons show that the entropy value, average gradient value, and edge strength value of the present invention are the highest. In particular, the edge strength value is much higher than that of other algorithms, indicating that the present invention can effectively retain and enhance the detail information of the image during the processing. The present invention can better enhance the details and contrast of the image in terms of improving image sharpness. The edges of the image enhanced by the present invention are clear, and it has excellent performance in retaining and enhancing image edges. Generally speaking, the present invention has excellent performance in noise suppression, information retention, sharpness improvement, and edge enhancement.
[0147] In summary, the present invention provides a low-light image enhancement method that simulates the foggy weather degradation mechanism. This method is based on an improved dark channel prior algorithm and is used to improve the quality of low-light images. In terms of the technical solution, the present invention optimizes the estimation of the atmospheric light value by combining progressive cutting and genetic algorithms, enhancing the contrast and brightness of the image. Specifically, adaptively adjusting the window size improves the accuracy of the dark channel image, and the combination of progressive cutting and genetic algorithms improves the estimation accuracy and robustness of the atmospheric light value. In addition, the present invention also uses the guided filter technology to refine the transmission rate map to improve the defogging effect and balances the image brightness through an improved gamma correction technology. Experimental results show that the present invention shows significant advantages in reducing artifacts, enhancing image details, denoising, maintaining structural information, and detail restoration.
Claims
1. A low-light image enhancement method simulating foggy weather degradation mechanism, characterized in that: The method comprises the following steps: Step S100, generating a virtual haze image: performing inversion processing on the input low-illumination image to obtain a virtual haze image; Step S200, atmospheric light estimation by descending cutting combined with genetic algorithm search: S210, using descending cutting method to roughly locate the region of the virtual haze image, and by setting the segmentation threshold, the image is gradually subdivided into smaller regions; S220, using genetic algorithm to accurately locate the region after preliminary segmentation, evaluate the pros and cons of each candidate atmospheric light region, and optimize the atmospheric light value region by combining tournament selection, crossover and mutation operations, and finally obtain accurate atmospheric light value estimation; The evaluation of each candidate atmospheric light region in step S220 includes: S221, define a fitness function, which combines the average value and variance of the pixel brightness in the area to evaluate the quality of each candidate atmospheric light area. The larger the value of the fitness function, the more likely the area is to be the best atmospheric light value area. Specifically, the level and uniformity of the average brightness are measured by comparing the brightness average value and the variance. The higher the brightness average value and the smaller the variance, the larger the fitness function value. The evaluation formula is expressed as: , , , in, Indicates area The average brightness within Indicates area The brightness variance within is a constant used to avoid division by zero errors; Step S300, calculating the coarse transmittance based on the dark color prior: S310, calculating the dark channel image of the virtual haze image according to the dark color prior theory; S320, further improving the accuracy of the dark channel image by weighted minimum filtering; S330, performing morphological operations including corrosion and expansion on the dark channel image to retain the minimum information of the local structure and smooth the image to obtain a coarse transmittance image; Step S310 includes: S311, for each pixel point of the input image, obtaining RGB three-channel values of all pixels points in a local window centered on the pixel point; S312, calculating the minimum value of the RGB channels of each pixel in the local window, and forming a value set with the minimum values of the RGB channels of all the pixels in the local window; S313, determining the minimum value in the value set as the dark channel pixel value of the central pixel; S314, setting a window size adjustment mechanism: dynamically adjusting the size of the local window according to the statistical characteristics of the image brightness histogram, specifically satisfying: When the average brightness value of the image is higher than a first brightness threshold, adjusting the window size to a first preset size; When the average brightness value is between the first brightness threshold and the second brightness threshold, maintaining the reference window size unchanged; When the average brightness value is lower than a second brightness threshold, adjusting the window size to a second preset size; Wherein, the first preset size is larger than the reference window size, and the second preset size is smaller than the reference window size; Step S400, transmittance map refinement: the rough transmittance image is refined by using guided filtering, by constructing a linear model and using the original image as a guided map, combining the local mean and local variance to calculate the linear coefficient of the filter, so as to achieve smoothing of the transmittance map while retaining the edge details of the image; Step S500, virtual haze image defogging and low illumination enhancement: restore a haze-free image according to the refined transmittance image, the atmospheric light value, and the atmospheric scattering model; perform inversion processing on the haze-free image to obtain an enhanced low illumination image, thereby achieving an enhancement effect of the low illumination image; Step S600, adaptive compensation of brightness and contrast: the optimized gamma correction strategy is used to enhance the brightness and contrast of the enhanced low-light image, and the parameters of the power transformation are adjusted to make the brightness distribution of the image more consistent with the perception characteristics of the human eye, thereby further improving the visual effect of the image.
2. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: In step S100, the negation process is represented as follows: , Among them, I (i, j) and J (i, j) are the pixel values of the virtual haze image and the low-light image respectively.
3. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S210 includes: Gradually subdivide the image into smaller areas, calculate the average and standard deviation of the quadrant pixel intensity, and continue to decompose and calculate the quadrant with the largest difference; By setting the segmentation threshold, the program determines the termination condition of the subdivision. If the product of the pixel values in the length and width directions of the sub-quadrant is less than the set value, the decomposition stops; During each segmentation process, the program checks the current area to determine whether it should be further subdivided or saved as a leaf node. Through a quarter of recursive traversal, the effective minimum area after segmentation is extracted from the leaf node, ensuring that subsequent processing is only focused on those parts that are meaningful for analysis.
4. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S220 includes: After the preliminary segmentation of the image region is completed by decremental cutting, an initial population of the genetic algorithm is generated based on the leaf node data obtained from the decremental cutting. Among them, regions are randomly selected from the leaf nodes to initialize a candidate solution population, and each solution corresponds to a potential atmospheric light value region. Assuming that the number of leaf node regions after decremental cutting is N, the number of individuals in the initial population is set to P, where P < N. The gene of each individual is represented by the coordinates of the leaf node: , is the coordinate of the upper left corner of the region, is the width and height of the region. The genetic algorithm is used to optimize the atmospheric light value region. Among them, the optimization process includes: S221, define fitness function; S222, performing a selection operation, using a tournament selection mechanism, randomly selecting K individuals for comparison, and selecting the individual with the highest fitness value to enter the next generation, where K is a preset positive integer; S223, performing a crossover operation, randomly selecting two individuals as parents, selecting multiple crossover points in the gene sequences of the parents, and exchanging gene fragments to generate two new individuals; S224, perform a mutation operation to randomly adjust some genes of the individual with a preset mutation probability to prevent the algorithm from converging to the local optimum too early. The formula for the mutation operation is: , in, is a random vector used to adjust the coordinates of the individual; S225, running the genetic algorithm multiple times, and obtaining the average brightness intensity of the best area as the final output atmospheric light value.
5. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S320 includes: Assign a weight value to each pixel in the image , the weight value is determined by the brightness characteristics and color characteristics of the pixel, wherein the pixel located in the center of the dark area and having a brightness value lower than a preset threshold is assigned a larger weight value; The weighted minimum filter is expressed as: , The optimized dark channel image is generated by weighted minimum calculation results.
6. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S330 includes: Perform the erosion operation by sliding a structural element in the image and taking the minimum value in the current local window as the center pixel value of the new image. The erosion operation is expressed as: , in, Indicates A structural element with a first preset pixel area as the center is used in a flat area, and a structural element with a second preset pixel area is used in an area with rich textures, wherein the first preset pixel area is larger than the second preset pixel area; Perform the expansion operation, by sliding the structural element, and take the maximum value in the window as the central pixel value. The expansion operation is expressed as: , Through the above operation, a rough transmittance image is obtained.
7. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S400 includes: S410, calculating the transmittance based on the dark channel priori assumption, the transmittance calculation formula is: , Among them, ω is a constant with a value of 0.95, and A is the atmospheric light value; S420, using guided filtering to refine the transmittance, the guided filtering formula is: , in, represents the filtered transmittance image, is the original input image, and are the linear coefficients of the filter, , Calculated by the following formula: , , in, and are the local mean and local variance, respectively. It is a regularization parameter used to balance filtering effect and noise suppression; The window radius and regularization parameter of the guided filter are adaptively adjusted according to the image size, and the transmittance map is filtered using the original image as the guided image to smooth the transmittance map while retaining the image edge details.
8. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The S500 includes: S510, constraining the refined transmittance, by setting the transmittance lower limit t0, to prevent the transmittance from being too small to cause image artifacts. The transmittance correction is expressed as: , Wherein, t(x) is the transmittance at pixel point x, and t0 is the preset lower limit threshold of transmittance; S520, based on the corrected transmittance, the input virtual haze image is restored to a haze-free image according to the atmospheric scattering model, and the restoration formula is expressed as: , Among them, J(x) is the haze-free image, I(x) is the virtual haze image, and A is the atmospheric light value; S530, performing inversion processing on the fog-free image to obtain a low-illumination enhanced image. The inversion processing is expressed as: K(i,j)=255-L(i,j), Among them, K(i, j) and L(i, j) are the pixel values of the low-light enhanced image and the haze-free image, respectively.
9. The low-illumination image enhancement method simulating fog degradation mechanism according to claim 1, characterized in that: The step S600 specifically includes: Gamma correction is used to enhance the brightness of low-light enhanced images. The gamma correction performs a power transformation on the pixel values of the image so that the brightness distribution of the image is more consistent with the perception characteristics of the human eye. The gamma correction is expressed as: , Among them, c and γ are both positive numbers, V in is the pixel value to be processed, V out is the gamma-corrected output pixel value.
Citation Information
Patent Citations
Method for enhancing low-light video image based on space-time accumulation and image degradation model
CN106327450A