A method and system for simulating fogging of road traffic scene images
By acquiring dark channel images and atmospheric light values, adjusting the transmittance factor, correcting the road surface transmittance, and combining the scattering rate model, a fog processing model is generated for different haze levels. This solves the problem of unnatural fog effects in existing technologies and achieves more accurate fog simulation, which is suitable for autonomous driving and intelligent transportation.
Patent Information
- Application Number
- CN202510500324.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-04-21
AI Technical Summary
When dealing with traffic scenes containing a large number of unnatural areas, existing fog simulation technology is prone to problems such as unnatural fog effects, color distortion, and uneven contrast, which affects the effectiveness of model training.
By acquiring dark channel images and overall atmospheric light values, introducing a deformed fog degradation model and adjusting the transmittance adjustment factor, an initial transmittance fog map is generated. The transmittance of the road surface area is corrected, and the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined by combining the scattering rate statistical model, thus generating fog processing models for different haze levels.
It achieves a more natural and accurate fogging effect, improves the realism and stability of fogging simulation, and provides high-quality training data support, making it suitable for the fields of autonomous driving and intelligent transportation.
Smart Images

Figure CN120031745B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of artificial intelligence, intelligent traffic simulation and computer data processing, and in particular relates to a method and system for simulating fogging of road traffic scene images. Background Art
[0002] Existing fog simulation technologies are mainly based on fog imaging models for simulation, including transmittance estimation methods based on dark channel priors (DCPs) and optical simulation methods based on scattering models. However, when dealing with traffic scenes containing a large number of non-natural areas (such as roads), traditional fogging methods are prone to unnatural fogging effects, color distortion, uneven contrast, etc., which affect the effectiveness of model training. In summary, since existing fog simulation technologies require multi-factor and multi-level fog simulation reasons, there is a need for a fogging technology that can more accurately simulate the foggy environment of real traffic scenes. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for simulating fogging of road traffic scene images to solve the above-mentioned technical problems existing in the prior art.
[0004] To solve the above technical problems, the present invention provides a method for simulating fogging of road traffic scene images, comprising:
[0005] Obtain the dark channel image and the overall atmospheric light value, introduce and adjust the transmittance adjustment factor under the deformed fog degradation model, generate the initial transmittance fog map, and determine the estimated image transmittance to ensure the control of the strength of the dehazing effect and determine the balance point of the dark channel prior application, thereby ensuring accurate transmittance estimation;
[0006] Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, generating a corrected transmittance fog map to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation.
[0007] Based on the modified transmittance fog map, a scattering rate statistical model is introduced to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels. This provides a basis for processing the haze concentration of the original traffic image based on the characteristics of the scattering rate.
[0008] Based on the original traffic image, the atmospheric extinction coefficients of different haze levels are used to generate fog processing models under different haze levels according to the deformed fog degradation model, so as to obtain haze images under different haze levels according to the atmospheric extinction coefficients under different haze concentrations.
[0009] Preferably, before obtaining the dark channel image and the overall atmospheric light value, the method further includes:
[0010] Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory; the high-brightness pixel area is determined in the dark channel image, and the original traffic area corresponding to the high-brightness pixel area is determined in the original traffic image, and the three-channel values of the original traffic area are determined as the estimated value of the atmospheric light value.
[0011] Preferably, the introducing and adjusting the transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance includes:
[0012] Based on the fog degradation model, the three channels of atmospheric light are deformed to generate a deformed fog degradation model.
[0013] Based on the deformed fog degradation model, a filtered fog degradation model is generated through quadratic minimum filtering;
[0014] Based on the filtered fog degradation model and the prior conformity requirement of the dark channel, the prior fog degradation model is obtained;
[0015] Based on the a priori fog degradation model, an initial transmittance model is formed by introducing a transmittance adjustment factor. Based on the initial transmittance model, an initial transmittance fog map is generated by adjusting the transmittance adjustment factor of the initial transmittance model, and an estimated image transmittance is determined. The adjustment range of the transmittance adjustment factor of the initial transmittance model is 0 to 1.
[0016] Wherein, the estimated image transmittance function is:
[0017]
[0018] Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; Used to index a local window around a pixel, wherein x is the center of the local window and y is any position in the local window; Used to index three channels, wherein C is any one of the three channels; is the light transmittance adjustment factor; To estimate the image transmittance;
[0019] The step of introducing and adjusting the transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance further includes:
[0020] Generate a pre-evaluation basis through edge detection:
[0021] Based on the original traffic image, the three channels are weighted and summed according to the sensitivity of the human eye through the weighted averaging method to obtain the original grayscale image;
[0022] Based on the original grayscale image, the original denoised image is generated through image blurring to avoid incorrect edge responses in subsequent gradient calculations;
[0023] Based on the original denoised image, the horizontal gradient convolution kernel, vertical gradient convolution kernel, gradient amplitude and gradient direction of the gradient model are generated through gradient synthesis processing, including:
[0024] The horizontal gradient convolution kernel is:
[0025]
[0026] The vertical gradient convolution kernel is:
[0027]
[0028] The gradient amplitude is:
[0029]
[0030] The gradient direction is:
[0031] θ = arctan (Gy / Gx)
[0032] The Gx is the horizontal gradient convolution kernel; the Gy is the vertical gradient convolution kernel; the G is the gradient amplitude; the θ is the gradient direction;
[0033] Based on the original denoised image, by traversing each pixel of the image, comparing the gradient values of adjacent pixels according to their gradient directions, suppressing the non-maximum values in the image, and forming a suppressed image to make the edges clearer and sharper;
[0034] Based on the suppressed image, if the current pixel of the image is higher than the high threshold or lower than the low threshold, the pixels with gradient values higher than the high threshold are directly marked as strong edges, the pixels with gradient values between the low threshold and the high threshold are marked as weak edges, and the pixels with gradient values lower than the low threshold are marked as non-edges, and a marked image is formed;
[0035] Based on the marked image, by traversing all pixels with weak edges, it is determined whether there is a strong edge in the current neighborhood. If there is a strong edge, the weak edge is promoted to a strong edge; otherwise, it is regarded as a non-edge and used for the real edge of the image break, so as to remove isolated noise points and form an optimized image;
[0036] Based on the optimized image, strong edges are determined as valid edges, weak edges are filtered or connected, and at the same time, non-edge areas are kept as black edges to form a pre-estimated image;
[0037] The step of introducing and adjusting the transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance further includes:
[0038] Gradient weighting and adjusted transmittance:
[0039] Based on the pre-estimated image, the transmittance gradient is generated through the gradient vector model;
[0040] Based on the transmittance gradient, a weight allocation strategy is used to assign weights to each position according to the size or direction of the gradient, generating high-gradient areas and low-gradient areas. The high-gradient areas are used to emphasize the optimization of areas sensitive to transmittance changes, while the low-gradient areas are used to reduce the interference with uniform areas.
[0041] Based on the low gradient area, the continuous linear gradient weighting coefficient is generated through the exponential weighting model;
[0042] Based on the high gradient area, the piecewise linear gradient weighting coefficient is generated through the piecewise weighted model;
[0043] Based on the continuous linear gradient weighting coefficient and the piecewise linear gradient weighting coefficient, the transmittance of the estimated image is generated by enhancing the transmittance model of the specific area;
[0044] The enhanced specific area transmittance model is:
[0045]
[0046] described is the target transmittance; is the original transmittance; Dynamic adjustment of continuous linear gradient weighting coefficients and piecewise linear gradient weighting coefficients according to gradient or domain.
[0047] Preferably, the step of increasing the contrast difference between the road surface and its surroundings by correcting the transmittance of the road surface area to generate the corrected transmittance fog map includes:
[0048] Based on the initial penetration fog image, the estimated image transmittance of the first enlarged road is obtained by nonlinear compression of the image grayscale, and the contrast difference between the first enlarged road surface and its surroundings is used to generate a first contrast difference fog image;
[0049] Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily expanded by the maximum class variance binary method to generate a second contrast difference fog map by second-expanding the contrast difference between the road surface and its surroundings.
[0050] Preferably, the image grayscale nonlinear compression includes:
[0051] If the transmittance of the road surface area is lower than that of its surrounding area, the transmittance of the current road surface area is squared using the image grayscale nonlinear compression function. A first contrast difference fog map is generated based on the transmittance of the current road surface area to reduce the transmittance of the road surface area and increase the transmittance level difference between the road surface area and its surrounding area.
[0052] Wherein, the image grayscale nonlinear compression function is:
[0053]
[0054] Among them, the is the transmittance after nonlinear compression processing;
[0055] The maximum class variance binary method includes:
[0056] Based on image segmentation threshold;
[0057] If the pixel values of the road surface area and its surrounding areas are greater than the image segmentation threshold, the current area is determined to be a road surface area, and the transmittance of the current area is configured to 1 through a binarization function;
[0058] Otherwise, the current area is determined to be its surrounding area, and the transmittance of the current area is configured to 0 through a binarization function, and a second ratio difference fog map is generated based on the transmittance of the current road area and the transmittance of its surrounding areas;
[0059] Wherein, the binarization function is:
[0060]
[0061] Among them, the is the transmittance after binarization processing; is the transmittance threshold.
[0062] Preferably, the determining of the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels by introducing a scattering rate statistical model comprises:
[0063] Based on the linear relationship between different haze levels and their corresponding scattering rate intervals, the atmospheric extinction coefficients of different levels corresponding to the scattering rate intervals of different haze levels are calculated through a scattering rate statistical model, wherein the different haze levels include slight haze, light haze, moderate haze, and heavy haze;
[0064] Wherein, the scattering rate statistical model is:
[0065]
[0066] Among them, the is the pixel depth; is the haze concentration parameter; is the atmospheric extinction coefficient of different levels.
[0067] Preferably, generating the fog processing model under different haze levels according to the atmospheric extinction coefficient of different haze levels and the deformed fog degradation model includes:
[0068] Based on the original traffic image, the modified transmittance fog map corrected by the overall atmospheric light value is superimposed on the original traffic image to generate a deformed fog degradation model;
[0069] According to the atmospheric extinction coefficient at different levels, the fog processing model under different haze levels is generated through the deformed fog degradation model;
[0070] Generate haze images at different haze levels through haze processing models at different haze levels;
[0071] The deformed fog degradation model is:
[0072]
[0073] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0074] Preferably, the dark channel processing based on dark channel prior theory includes:
[0075] Based on the original traffic image, a local window corresponding to each pixel point in the original traffic image is determined; based on the corresponding local window, three-channel pixel values corresponding to the local window are calculated to form a local window three-channel pixel value set; based on the local window three-channel pixel value set, a minimum channel value is obtained by minimum value extraction;
[0076] Based on the minimum channel value, the window minimum value is obtained by sliding the window as the basic unit for the minimum channel, and the dark channel value of the current pixel is obtained according to the dark channel model;
[0077] The dark channel model includes:
[0078]
[0079] Among them, the is the pixel value of channel c at position y in the original traffic image; is the value of pixel x in the dark channel image.
[0080] Preferably, determining a high-brightness pixel area in the dark channel image, determining an original traffic area corresponding to the high-brightness pixel area in the original traffic image, and determining the three-channel values of the original traffic area as the estimated value of the atmospheric light value includes:
[0081] Based on the dark channel image, according to the preferred threshold range, the highest luminosity area is screened to obtain the highest luminosity area; based on the highest luminosity area, the highest three channel values are selected and the overall atmospheric light value is determined according to the atmospheric light value estimation model, wherein the preferred threshold range is 0 to 0.1;
[0082] The atmospheric light value estimation model:
[0083]
[0084] Among them, the is the preferred threshold; , where I(x) is the pixel value at position x in the initial through-fog image; A is the overall atmospheric light value; is the preferred coefficient.
[0085] At the same time, the present invention also provides a simulated fogging system for road traffic scene images, comprising:
[0086] Based on any of the above-mentioned simulated fogging methods, the simulated fogging system includes a simulated fogging platform, which is used to:
[0087] Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory; high-brightness pixel areas are determined in the dark channel image, and the original traffic area corresponding to the high-brightness pixel areas is determined in the original traffic image, and the three-channel values of the original traffic area are determined as the estimated values of the atmospheric light value;
[0088] Obtain the dark channel image and the overall atmospheric light value, introduce and adjust the transmittance adjustment factor under the deformed fog degradation model, generate the initial transmittance fog map, and determine the estimated image transmittance to ensure the control of the strength of the dehazing effect and determine the balance point of the dark channel prior application, thereby ensuring accurate transmittance estimation;
[0089] Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, generating a corrected transmittance fog map to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation.
[0090] Based on the modified transmittance fog map, a scattering rate statistical model is introduced to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels. This provides a basis for processing the haze concentration of the original traffic image based on the characteristics of the scattering rate.
[0091] Based on the original traffic image, the atmospheric extinction coefficients of different haze levels are used to generate fog processing models under different haze levels according to the deformed fog degradation model, so as to obtain haze images under different haze levels according to the atmospheric extinction coefficients under different haze concentrations. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0093] Figure 1 It is a structural flow chart of the simulated fogging method of the present invention;
[0094] Figure 2 It is an algorithm flow chart of the simulated fogging method of the present invention;
[0095] Figure 3 It is a color space diagram under the RGB model of the fogging simulation method of the present invention;
[0096] Figure 4 is the original traffic image of the fogging simulation method of the present invention;
[0097] Figure 5 is a dark channel image of the simulated fogging method of the present invention;
[0098] Figure 6 is the initial transmittance fog map of the simulated fogging method of the present invention;
[0099] Figure 7 It is a modified transmittance fog map of the simulated fogging method of the present invention;
[0100] Figure 8 This is a set of haze images at different haze levels using the simulated haze adding method of the present invention (set of images);
[0101] Figure 9 It is a scattering rate chart of the simulated fogging method of the present invention.
[0102] Reference numerals:
[0103] S101-Based on the original traffic image, a dark channel image is generated by dark channel processing based on dark channel prior theory;
[0104] S102-determine a high-brightness pixel area in the dark channel image, determine an original traffic area corresponding to the high-brightness pixel area in the original traffic image, and determine the three-channel values of the original traffic area as an estimated value of the atmospheric light value;
[0105] S103 - Obtain the dark channel image and the overall atmospheric light value, introduce and adjust the transmittance adjustment factor under the deformed fog degradation model, generate an initial transmittance fog map, and determine the estimated image transmittance to ensure the intensity of the defogging effect and determine the balance point of the dark channel prior application, thereby ensuring accurate transmittance estimation;
[0106] S104 - Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, thereby generating a corrected transmittance fog map to ensure that the transmittance of the road surface area accurately reflects its position in the scene and the degree of light attenuation;
[0107] S105 - Based on the modified transmittance fog map, a scattering rate statistical model is introduced to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels. This provides a basis for processing the haze concentration of the original traffic image based on the characteristics of the scattering rate.
[0108] S106 - Based on the original traffic image, the atmospheric extinction coefficients of different haze levels are used to generate fog processing models at different haze levels according to the deformed fog degradation model, so as to obtain haze images at different haze levels according to the atmospheric extinction coefficients at different haze concentrations. DETAILED DESCRIPTION
[0109] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0110] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0111] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0112] The present invention will be further explained below with reference to specific embodiments.
[0113] Example 1:
[0114] like Figure 1-9 As shown, this embodiment provides a method for simulating fogging of a road traffic scene image, comprising:
[0115] Obtain a dark channel image and overall atmospheric light values, introduce and adjust a transmittance adjustment factor under the deformed fog degradation model, generate an initial transmittance fog map, and determine an estimated image transmittance to ensure control of the intensity of the defogging effect and determine a balance point for the use of the dark channel prior, thereby ensuring accurate transmittance estimation (S103);
[0116] Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, thereby generating a corrected transmittance fog map to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation (S104);
[0117] Based on the modified transmittance fog image, a scattering rate statistical model is introduced to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels, so as to provide a corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate (S105);
[0118] Based on the original traffic image, the atmospheric extinction coefficients of different haze levels are used to generate fog processing models at different haze levels according to the deformed fog degradation model, so as to obtain haze images at different haze levels according to the atmospheric extinction coefficients at different haze concentrations ( S106 ).
[0119] This solution generally includes four major steps, namely, the first step: transmittance estimation; the second step: transmittance fog map correction; the third step: haze concentration classification; and the fourth step: obtaining haze-added images at different haze levels. The first step ensures the balance between controlling the intensity of the defogging effect and determining the dark channel prior application, thereby ensuring accurate transmittance estimation. The second step ensures that the transmittance of the road area can correctly reflect its position in the scene and the degree of light attenuation. The third step provides the original traffic image with a corresponding haze concentration processing basis based on the characteristics of the scattering rate. The fourth step obtains haze-added images at different haze levels based on the atmospheric extinction coefficient at different haze concentrations. Specifically:
[0120] Step 1: Based on the transmittance estimation of dark channel prior, the present invention first performs dark channel prior processing on the input clear image and calculates the transmittance of the fog-free image. The transmittance calculation formula is as follows:
[0121]
[0122] Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; Used to index a local window around a pixel; Used to index three channels; is the light transmittance adjustment factor; To estimate the image transmittance.
[0123] Step 2: Road area transmittance correction
[0124] Because the dark channel prior method may lead to inaccurate transmittance estimation when processing large road areas, the present invention adopts a grayscale nonlinear compression method and a maximum inter-class variance binary method to correct the transmittance. The following formula uses grayscale nonlinear compression to enhance the contrast of the transmittance image and improve the separability of the road area.
[0125]
[0126] Use the OSTU binarization algorithm to automatically determine the threshold and separate the road area:
[0127]
[0128] Step 3: Fog simulation based on fog imaging model
[0129] The present invention combines the fog imaging model with the transmittance correction to perform fog simulation. The mathematical model of fog processing is as follows:
[0130]
[0131] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0132] Step 4: Multi-level haze simulation
[0133] For different haze concentrations, the present invention introduces a scattering rate statistical model and simulates different levels of haze based on the atmospheric extinction coefficient, covering light, moderate and heavy haze.
[0134]
[0135] Among them, the is the pixel depth; is the haze concentration parameter; at the same time, the present invention proposes a simulated fogging technology for road traffic scenes, which combines dark channel prior theory, road transmittance correction and fog imaging model to achieve a more natural and accurate fogging effect; the present invention can be widely used in the fields of autonomous driving, intelligent transportation and computer vision, providing high-quality training data support for related algorithms, and has important engineering application value; through the multi-factor and multi-level fogging simulation method for road traffic scenes of this scheme, by comprehensively considering depth of field information, road area transmittance correction and haze scattering rate statistical model, the authenticity and stability of fogging simulation are improved.
[0136] Before obtaining the dark channel image and the overall atmospheric light value, the method further includes:
[0137] Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory (S101). High-brightness pixel areas are determined in the dark channel image, and the original traffic area corresponding to the high-brightness pixel areas is determined in the original traffic image. The three-channel values of the original traffic area are determined as estimated values of the atmospheric light value (S102).
[0138] like Figure 3As shown, the RGB cube includes various combinations of red, green, and blue; including 8 basic colors: black, blue, green, cyan, magenta, purple, yellow, and white. One corner of the RGB cube is black, that is, the components of the three colors are all zero; the other corner is white, that is, the components of the three colors are all maximum values (usually 255); the other corners represent other pure colors, such as pure red, pure green, pure blue, etc. Each set of vector values represents a color in the color space. The value range of each parameter is: R: 0-255; G: 0-255; B: 0-255; Based on the dark channel prior theory, 5,000 haze-free outdoor images were randomly selected, the sky area was manually cropped out, and their dark channels were calculated using a window size of 15x15. It was found that in most non-sky areas, the pixel value of at least one color channel is very low or even close to 0. The expression is as follows:
[0139]
[0140] like Figure 4 、 5 As shown in the figure, the dark channel is essentially a new image obtained by performing quadratic minimum simplification on the three channels of the image under the RGB model;
[0141]
[0142] In the above formula, is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; Used to index a local window around a pixel; Used to index the three channels; calculate the overall atmospheric light value theoretically. In practice, we can use the dark channel image to obtain the overall atmospheric light value from the image. If the pixel corresponding to the maximum value of the three channels in the dark channel image is still used as the reference target for the overall atmospheric light, then its estimation will be biased. To reduce the bias and improve the limit, the present invention sets a threshold t0: generally set to a small value of 0.1, that is:
[0143]
[0144] The step of introducing and adjusting the transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance includes:
[0145] Based on the fog degradation model, the three channels of atmospheric light are deformed to generate a deformed fog degradation model.
[0146] Based on the deformed fog degradation model, a filtered fog degradation model is generated through quadratic minimum filtering;
[0147] Based on the filtered fog degradation model and the prior conformity requirement of the dark channel, the prior fog degradation model is obtained;
[0148] Based on the a priori fog degradation model, an initial transmittance model is formed by introducing a transmittance adjustment factor. Based on the initial transmittance model, an initial transmittance fog map is generated by adjusting the transmittance adjustment factor of the initial transmittance model, and an estimated image transmittance is determined. The adjustment range of the transmittance adjustment factor of the initial transmittance model is 0 to 1.
[0149] Wherein, the estimated image transmittance function is:
[0150]
[0151] Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; Used to index a local window around a pixel, wherein x is the center of the local window and y is any position in the local window; Used to index three channels, wherein C is any one of the three channels; is the light transmittance adjustment factor; To estimate the image transmittance.
[0152] like Figure 4 、 6 As shown in Figure 2, the following foggy image degradation model is widely used in computer vision. The transmittance of the haze image is calculated using this model as follows:
[0153]
[0154] In the above formula, represents the pixel value at position x in the image affected by fog, the pixel value of the observed real scene; Represents the pixel value at position x in the fog-free image, that is, the pixel value of the real scene; is the transmittance of the scene at point x, which indicates the degree of attenuation of light when it passes through haze; is atmospheric light, which is a constant in the entire image and represents the illumination intensity of distant objects in the scene; the above model is transformed into:
[0155]
[0156] Where C means three channels; for two minimum filtering, we assume that the sliding window centered at pixel x The transmittance of the inner region is the same as defined by And the value of A is also given, take two minimum operations on the above formula; we can deduce that:
[0157]
[0158] In the original fog-free image and atmospheric light Calculate the estimated transmittance when it is known, and introduce a parameter between 0 and 1 To adjust. The corrected transmittance is:
[0159]
[0160] The introduction of adjustment parameters is mainly based on the following two aspects: First, controlling the intensity of the defogging effect: No matter how good the air quality is, there will always be trace amounts of aerosol particles in the atmosphere. It is precisely because of the presence of these particles that the image is given the characteristic of depth. If they are completely eliminated, the fogged image scene will not be realistic enough. Second, finding a balance point: Although the dark channel assumes that the minimum value of the three channels in all areas is zero, the pixels of the dark channel images in actual images are mostly close to zero rather than completely zero. Therefore, we need to introduce adjustment parameters to find the balance point of the dark channel prior application to ensure accurate estimation of transmittance, which further affects the quality of the defogging effect. Combined with the current relevant research literature on transmittance calculation, based on multiple experimental comparisons, the adjustment parameter value in the simulation is 0.95.
[0161] At the same time, in determining the estimated image transmittance, the method of estimating transmittance by enhancing the edge and analyzing the gradient distribution includes:
[0162] Step 1: Edge detection and gradient calculation:
[0163] Create a grayscale image
[0164] 1. Basic conversion method
[0165] The weighted average method adds up the three RGB channels according to the sensitivity of the human eye. Formula:
[0166] Gray=0.299R+0.587G+0.114B;
[0167] Single-channel extraction directly takes one of the R, G, and B channels (for example, the G channel is usually closest to the brightness perceived by the human eye).
[0168] Selection criteria: Green channel: Most sensitive to brightness changes, often used for general scenes. Red channel: Highlights warm-toned objects (such as skin and fire). Blue channel: Enhances cool-toned details (such as the sky and water).
[0169] 2. Enhanced Method
[0170] The role of adaptive histogram equalization (CLAHE): avoids over-enhancement caused by global equalization.
[0171] Edge-enhanced grayscale image
[0172] Combining edge detection (such as Sobel operator) to highlight details: a model-based generation method
[0173] 3. Model-based Generation Methods
[0174] Deep learning (such as CycleGAN) scenarios: Generate grayscale images of a specific style (such as artistic sketches).
[0175] Contrast Limited Adaptive Histogram Equalization (CLAHE)
[0176] Edge Detection
[0177] 1. Gradient-based edge detection
[0178] Principle: Locate the edge by calculating the gradient change of pixel grayscale values in the image.
[0179] Core idea: The gradient amplitude at the edge is higher and the direction points to the edge normal.
[0180] Sobel operator
[0181] Steps: Use 3x3 convolution kernels in the horizontal and vertical directions to calculate the gradients separately. Combine the gradient magnitude and direction to get the edge map.
[0182]
[0183] Image preprocessing
[0184] Grayscale conversion: Converts a color image to black and white, as edge detection focuses on brightness changes rather than color differences. Gaussian blur: Uses a Gaussian filter to blur the image, removing high-frequency noise (such as salt and pepper noise) and preventing erroneous edge responses during subsequent gradient calculations.
[0185] Calculating gradients
[0186] Horizontal gradient (Gx): Use a horizontal Sobel kernel (similar to a symmetric matrix with 0 in the middle) to convolve with the image to highlight vertical edges (such as object contours).
[0187] Vertical gradient (Gy): Use a vertical Sobel kernel (similar to a matrix with all zeros in the middle row) to convolve with the image to highlight horizontal edges (such as text baselines).
[0188] Gradient synthesis: Calculate the gradient magnitude of each pixel using the Pythagorean theorem ( ), and determine the gradient direction (θ = arctan (Gy / Gx)).
[0189] Non-maximum suppression (NMS) refines edges: It traverses each pixel and compares the gradient values of adjacent pixels based on their gradient direction. Only the local maximum value in the gradient direction is retained, eliminating edge "burrs" and making the edges clearer and sharper.
[0190] Dual threshold processing, set thresholds: define a high threshold (such as 150) and a low threshold (such as 50).
[0191] Classification of pixels: Pixels with gradient values above the high threshold are directly marked as strong edges (white). Pixels with gradient values between the low and high thresholds are marked as weak edges (gray). Pixels with gradient values below the low threshold are marked as non-edges (black).
[0192] Hysteresis thresholding and edge connection: All weak edge pixels are traversed to check whether there is a strong edge in their neighborhood. If so, the weak edge is promoted to a strong edge; otherwise, it is considered a non-edge. This step connects broken true edges and removes isolated noise points.
[0193] Output result: In the final image, strong edges (white) are the detected valid edges, weak edges are filtered or connected, and non-edge areas remain black.
[0194] Key technical details: The role of gradient direction: used to determine the comparison direction (such as horizontal, vertical or diagonal direction) during non-maximum suppression.
[0195] Threshold selection principle: the high threshold should be large enough to avoid misjudgment, and the low threshold should be small enough to retain potential edges. Usually the ratio of high to low threshold is 1:2 or 1:3.
[0196] Noise resistance: Preprocessing Gaussian blur and a larger Sobel kernel (such as 5x5) can improve the algorithm's robustness to noise.
[0197] Step 2: Gradient weighting and transmittance adjustment:
[0198] Transmittance gradient calculation
[0199] Gradient definition: Transmittance gradient refers to the rate of change of transmittance in space, which is usually calculated using numerical differentiation (such as finite difference method) or automatic differentiation technology. For example, for two-dimensional materials, the gradient vector can be expressed as:
[0200]
[0201] described is the gradient vector in the X direction; is the gradient vector in the Y direction;
[0202] Gradient Direction: The gradient direction points to the direction of the fastest increase in transmittance, and its modulus reflects the severity of the change. High-gradient regions typically correspond to material interfaces, structural abrupt changes, or locations with strong light scattering.
[0203] Weight Assignment Strategy: Gradient Weighting: Assigns a weight to each location based on the magnitude or direction of the gradient. For example, high-gradient regions are assigned higher weights to prioritize optimization of areas sensitive to transmittance changes. Low-gradient regions are assigned lower weights to minimize intervention in uniform areas. Weight Function: Common weight functions include exponential functions, piecewise functions (e.g., dynamically adjusted based on a gradient threshold), and machine learning-based adaptive weighting.
[0204] Optimization Objectives and Applications: Homogenize transmittance: Bring the transmittance of high-gradient areas closer to the target value, reducing spatial variations. Enhance specific areas: In optical design, assign higher weights to areas requiring high transmittance (such as the center of a lens) to prioritize their performance. Suppress noise or scattering: In imaging systems, gradient weighting can be used to suppress edge blur or scattering noise, improving image clarity.
[0205] Weight function design, exponential weighting:
[0206]
[0207] Among them, α is a tuning parameter used to control the sensitivity of the weight to the gradient.
[0208] Piecewise linear weighting:
[0209] Optimize the objective function
[0210]
[0211] Minimize the transmittance variance:
[0212]
[0213] in, is the target average transmittance, is the gradient weighting coefficient.
[0214] Enhance transmittance in specific areas:
[0215]
[0216] in, is the target transmittance distribution, Can be dynamically adjusted based on gradients or domain knowledge.
[0217] like Figure 4 、 7As shown in the figure, the brightness of the road surface area in the transmittance image of the traffic scene is contrary to expectations, that is, the road surface area is darker than the distant scenery area. This situation occurs because the dark channel prior method has errors when processing the transmittance of large gray or white areas in the image (such as the road), resulting in an inaccurate estimate of the road surface transmittance. Therefore, in addition to using the dark channel prior method to dehaze the entire image, the present invention also requires additional correction of the road surface transmittance to ensure that the transmittance of the road surface area accurately reflects its position in the scene and the degree of light attenuation.
[0218] The image grayscale nonlinear compression includes:
[0219] If the transmittance of the road surface area is lower than that of its surrounding area, the transmittance of the current road surface area is squared using the image grayscale nonlinear compression function. A first contrast difference fog map is generated based on the transmittance of the current road surface area to reduce the transmittance of the road surface area and increase the transmittance level difference between the road surface area and its surrounding area.
[0220] Wherein, the image grayscale nonlinear compression function is:
[0221]
[0222] Among them, the is the transmittance after nonlinear compression processing;
[0223] The present invention then employs grayscale nonlinear compression, using quadratic expansion to dilate the difference between the road transmittance value and the surrounding grayscale area. The maximum class variance binary method is then used to further increase the difference between the foreground (road surface area) and the background (road surrounding area). It is found that the transmittance value of the road surface area in traffic scenes is significantly lower than that of the surrounding area. Therefore, the present invention uses the grayscale nonlinear compression method, that is, performing a quadratic square process on the road area transmittance, to further reduce the transmittance value of the road area, widening the transmittance level difference between it and the surrounding area, thereby successfully extracting the road surface area. The nonlinear compression transmittance is calculated as follows:
[0224]
[0225] In the above formula, represents the original estimated transmittance, that is, the transmittance image derived based on the dark channel assumption and the atmospheric model formula; This represents the transmittance image after nonlinear compression processing, also known as grayscale nonlinear compression transmittance. By squaring the image transmittance, the grayscale range between the road and surrounding areas is readjusted, further increasing the contrast. This enhances the darker areas (road surface) in the image, thereby improving the visual quality. The contrast before and after compression demonstrates that the road area is more distinct in the transmittance image after grayscale nonlinear compression.
[0226] The maximum class variance binary method includes:
[0227] Based on image segmentation threshold;
[0228] If the pixel values of the road surface area and its surrounding areas are greater than the image segmentation threshold, the current area is determined to be a road surface area, and the transmittance of the current area is configured to 1 through a binarization function;
[0229] Otherwise, the current area is determined to be its surrounding area, and the transmittance of the current area is configured to 0 through a binarization function, and a second ratio difference fog map is generated based on the transmittance of the current road area and the transmittance of its surrounding areas;
[0230] Wherein, the binarization function is:
[0231]
[0232] Among them, the is the transmittance after binarization processing; is the transmittance threshold;
[0233] To further enhance the distinction between the road and background, this paper employs image binarization segmentation, thereby further increasing the transmittance difference between the road and background areas. Assume that there is a threshold TH that can segment the image into two categories: (image areas with pixel values < TH) and (image areas with pixel values > TH). The pixel means of these two categories are set to A1 and A2, respectively, and the overall image pixel means are set to m1 and m2. The percentage of the image area occupied by A1 is p1, and similarly, the percentage of the image area occupied by A1 is p2. Thus, we can conclude:
[0234]
[0235] Step a1: Find the threshold TH. According to the concept of variance, the inter-class variance expression is:
[0236]
[0237] The gray level that maximizes the above formula is the OTSU threshold.
[0238] Step a2: Segmentation and binarization. The binary image calculated based on the compressed transmittance map further increases the transmittance difference between the road and the background area, thereby reducing the probability of misclassification:
[0239]
[0240] Step a3: Image road surface extraction. After secondary processing, the division of the road area in the transmittance image is still not accurate enough. The present invention finally extracts the road surface area in the image through a series of operations such as whitening the edges of the distant area, filling holes and inverting.
[0241] The corrected transmittance image corresponding to the road area is then combined with the original transmittance image corresponding to the non-road area to obtain an overall transmittance image that matches the actual scene. The smaller the horizontal coordinate of a pixel in the road area, that is, the closer it is to the top of the image, the deeper the scene depth should be, the higher the transmittance value, and the greater the brightness. The corrected transmittance value is shown in the following formula:
[0242]
[0243] In the above formula, Represents the coordinates of the pixel points in the transmittance image to be processed, and Represent the row coordinate values of the nearest and farthest points in the road area, Indicates the nearest point in the road area, relative to represents the farthest point, T represents the original transmittance image calculated in, Represents the previously demarcated road range. The transmittance-corrected image of the road area in the traffic scene shows that the abnormal performance of the transmittance map in the road area has been largely resolved, making the brightness of the corrected road in the transmittance map close to that of the surrounding area, effectively expressing the scene depth information of the road area.
[0244] Step 3: Edge enhancement and region fusion:
[0245] Edge Enhancement
[0246] Image preprocessing, grayscale conversion: Convert color images to black and white images because edge detection focuses on brightness changes rather than color differences.
[0247] Gaussian Blur: Uses a Gaussian filter to blur the image, eliminating high-frequency noise (such as salt and pepper noise) and avoiding incorrect edge responses in subsequent gradient calculations.
[0248] Calculating gradients
[0249] Horizontal gradient (Gx): Use a horizontal Sobel kernel (similar to a symmetric matrix with 0 in the middle) to convolve with the image to highlight vertical edges (such as object contours).
[0250] Vertical gradient (Gy): Use a vertical Sobel kernel (similar to a matrix with all zeros in the middle row) to convolve with the image to highlight horizontal edges (such as text baselines).
[0251] Gradient synthesis: Calculate the gradient magnitude of each pixel using the Pythagorean theorem ( ), and determine the gradient direction (θ = arctan (Gy / Gx)).
[0252] Non-maximum suppression (NMS): Refines edges by traversing each pixel and comparing the gradient values of adjacent pixels based on their gradient direction. Only the local maximum value in the gradient direction is retained, eliminating edge "burrs" and making the edges clearer and sharper.
[0253] Dual Thresholding: Set thresholds: define a high threshold (such as 150) and a low threshold (such as 50).
[0254] Classification of pixels: Pixels with gradient values above the high threshold are directly marked as strong edges (white). Pixels with gradient values between the low and high thresholds are marked as weak edges (gray). Pixels with gradient values below the low threshold are marked as non-edges (black).
[0255] Hysteresis Thresholding: Connecting Edges: Traverse all weak edge pixels and check whether there is a strong edge in their 8-neighborhood. If so, the weak edge is promoted to a strong edge; otherwise, it is considered a non-edge. This step connects broken true edges and removes isolated noise points.
[0256] Output result: In the final image, strong edges (white) are the detected valid edges, weak edges are filtered or connected, and non-edge areas remain black.
[0257] Key technical details:
[0258] (1) The role of gradient direction: used to determine the comparison direction (such as horizontal, vertical or diagonal direction) during non-maximum suppression.
[0259] (2) Threshold selection principle: The high threshold needs to be large enough to avoid misjudgment, and the low threshold needs to be small enough to retain potential edges. Usually the ratio of high to low threshold is 1:2 or 1:3.
[0260] (3) Noise resistance: Preprocessing Gaussian blur and a larger Sobel kernel (such as 5x5) can improve the algorithm's robustness to noise.
[0261] Regional integration
[0262] I. Definition and Objectives of Regional Integration
[0263] Definition: Integrate the edge information of multiple images or the edge features of the same image after different processing to eliminate splicing traces, enhance edge coherence or extract more complete edge details.
[0264] Core objectives:
[0265] Eliminate seams in image stitching or multimodal fusion.
[0266] Improve the integrity of edge detection results (e.g., combining outputs from different algorithms).
[0267] Enhance the visual effect of the image (such as fusing the edge enhancement result with the original image).
[0268] Example steps (panorama stitching):
[0269] Image registration → detection of overlapping areas → calculation of fusion weights (e.g. based on gradient magnitude) → weighted fusion.
[0270] Regional fusion of multimodal images, scenarios: infrared and visible light images, MRI and CT images, etc. Method:
[0271] Feature-level fusion: extract edges separately and merge them (such as superimposing Canny edges and deep learning edge detection results).
[0272] Decision-level fusion: select edges of different modalities based on confidence (e.g., fusion using Dempster-Shafer theory).
[0273] Fusion of edge detection results: Goal: Combine the advantages of different algorithms (such as Sobel's positioning accuracy and Canny's noise resistance).
[0274] 2. Strategy:
[0275] Logical OR: Directly merge all edge pixels. Voting: Count the edge locations detected by multiple algorithms and retain high-frequency areas. Deep Learning Fusion: Train the network to learn the weight distribution of different edge maps.
[0276] The enhanced edge is fused with the original image. Method:
[0277] Overlay fusion:
[0278] Blending modes: Use Soft Light, Overlay, and other blending modes in Photoshop to enhance edge contrast.
[0279] Parameter control:
[0280] α: Edge strength coefficient (usually 0.1-0.5).
[0281] First, perform binarization or threshold processing on the edge map to avoid noise interference.
[0282] 3. Parameter Tuning and Techniques
[0283] Edge detection parameter optimization, Canny threshold: threshold1: low threshold (recommended 30-50), controls edge continuity. threshold2: high threshold (recommended 80-150), controls edge accuracy.
[0284] Sobel kernel size:
[0285] ksize=3 is suitable for general scenarios, and ksize=5 can enhance noise robustness.
[0286] Improvements to gradient weighting: Direction selectivity: weighting only horizontal or vertical gradients (e.g., prioritizing horizontal gradients in road scenes). Non-local gradient statistics: calculating the mean gradient of a local neighborhood to avoid the influence of isolated noise points.
[0287] Post-processing smoothing: Bilateral filtering: Smooth the adjusted transmittance map, retaining edges while reducing noise.
[0288] By correcting the transmittance of the road surface area to increase the contrast difference between the road surface and its surroundings, the corrected transmittance fog map is generated, including:
[0289] Based on the initial penetration fog image, the estimated image transmittance of the first enlarged road is obtained by nonlinear compression of the image grayscale, and the contrast difference between the first enlarged road surface and its surroundings is used to generate a first contrast difference fog image;
[0290] Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily expanded by the maximum class variance binary method to generate a second contrast difference fog map by second-expanding the contrast difference between the road surface and its surroundings.
[0291] The method of introducing a scattering rate statistical model to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels includes:
[0292] Based on the linear relationship between different haze levels and their corresponding scattering rate ranges, the atmospheric extinction coefficients of different levels corresponding to the scattering rate ranges of different haze levels are calculated through a scattering rate statistical model, where the different haze levels include slight haze, light haze, moderate haze, and heavy haze.
[0293] Wherein, the scattering rate statistical model is:
[0294]
[0295] Among them, the is the pixel depth; is the haze concentration parameter; is the atmospheric extinction coefficient of different levels.
[0296] By deducing the optical model, the relationship between the pixel values of the depth image and the transmittance image is demonstrated. By leveraging the statistical laws between different haze concentrations and atmospheric optical property evaluation indicators, we set scattering characteristic values for five haze levels, thereby changing the central visibility distance range under different haze concentration scenes while effectively preserving depth of field information. This results in a haze treatment effect that fits actual haze scenes, is unaffected by road conditions, and has wide applicability. Regarding the scattering formula:
[0297]
[0298] If X1 is independent of X2, then it can be written as:
[0299]
[0300] Finally, it is concluded that:
[0301]
[0302] At the same time, the present invention also provides a method for fitting empirical data to form "visibility" and "extinction coefficient", the steps of which are as follows:
[0303] Step 1: Measure the extinction coefficient (σ) in the target area by manual observation or transmission instrument. Generally, a reference instrument is used.
[0304] Step 2: Measure visibility (V) in the designated target area using a scatterometer.
[0305] Step 3: Based on the linear formula y=kx, deduce and fit the first extinction coefficient empirical formula, that is, V=kσ; where k is the fitting coefficient;
[0306] Step 4: After the above fitting, the fitting coefficient is obtained as follows: in the case of clean atmosphere or water droplet mist: k≈4; in the case of polluted atmosphere with multi-size aerosols: k may fluctuate between 3.0 and 5.0. Under such conditions, the typical values of 3, 4, and 5 can be used as fitting values;
[0307] In this way, through Steps 1-4, the problem of k value deviation caused by the particle size and composition (such as hygroscopic properties and refractive index) of particles in the atmosphere affecting the extinction efficiency in practical applications can be solved.
[0308] Step 5: Based on the linear formula y=kx+b, deduce and fit the second extinction coefficient empirical formula, that is, V'=kσ+b; where k is the fitting coefficient and b is the correction coefficient;
[0309] Step 6: Directly measure σ using a transmission instrument, and then obtain V' using the empirical formula for the first extinction coefficient.
[0310] Step 7: Measure the intensity of atmospheric scattered light using a scattering instrument and calculate the extinction coefficient σ' based on the particle scattering model;
[0311] Step 8: Use the transmission instrument as a reference (directly measure σ) to calibrate the scattering instrument and correct the conversion error between scattering efficiency and extinction coefficient;
[0312] Step 9: Contrast Adjustment: The human eye's contrast threshold may vary in different scenarios (e.g., for aerial observation, b=2% corresponds to k=4.2). Therefore, the k value needs to be adjusted based on the application.
[0313] Step 10: When there are vertical stratifications in the atmosphere, such as inversion layers, or uneven local pollution levels, it is necessary to measure the extinction coefficient in sections, or use remote sensing equipment such as lidar to obtain profile data, and then integrate and calculate visibility.
[0314] Step 11: Correction of particle characteristics: (1) Particle size distribution: Fine particles have higher extinction efficiency than coarse particles; (2) Hygroscopicity: When humidity increases, particles expand and extinction increases, such as the significant impact of humidity on visibility on hazy days; (3) Chemical composition: The strong light absorption of black carbon will further reduce visibility. Correction method: Combine the particle size spectrometer and chemical composition monitoring data to establish a more complex extinction model:
[0315] b=f(PM2.5, RH, particle size)
[0316] Step 12: Nighttime visibility correction: The influence of artificial light sources needs to be considered at night. The relationship between light intensity and visible distance is combined with the first extinction coefficient empirical formula to establish the relationship between light range and extinction coefficient.
[0317] In this way, through Step 5-12, the problem of needing to correct the k value in practical applications can be solved, that is, when the aerosol is mainly composed of fine particles (such as PM2.5), the extinction efficiency is higher, the visibility is lower under the same σ;
[0318] Summary: The core relationship between visibility and extinction coefficient is established through the empirical formula for the first extinction coefficient, theoretically V = kσ. In practical applications, the constant k must be calibrated or corrected based on atmospheric composition, particulate matter properties, and the observation scenario. Quantitative conversion between the two is achieved through theoretical derivation, field-measured fitting, or instrument calibration. Ultimately, the b value is obtained through b = f (PM2.5, RH, particle size), or other correction formulas. This corrects the first extinction coefficient empirical formula, resulting in the second extinction coefficient empirical formula, ultimately establishing a linear relationship between the extinction coefficient (σ) and visibility (V).
[0319] The method of generating fog processing models at different haze levels according to the atmospheric extinction coefficients of different haze levels and the deformed fog degradation model includes:
[0320] Based on the original traffic image, the modified transmittance fog map corrected by the overall atmospheric light value is superimposed on the original traffic image to generate a deformed fog degradation model;
[0321] According to the atmospheric extinction coefficient at different levels, the fog processing model under different haze levels is generated through the deformed fog degradation model;
[0322] Generate haze images at different haze levels through haze processing models at different haze levels;
[0323] The deformed fog degradation model is:
[0324]
[0325] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0326] like Figure 4 、 8 As shown, based on the fog degradation model:
[0327]
[0328] The transmittance map after the overall atmospheric light value A and the modified road surface is extracted , and after the depth map correction and the original image Utilizing the scattering properties of haze concentrations, haze-enhanced images at different haze levels are obtained. When objectively evaluating images after haze simulation, three classic metrics—structural similarity, detail information, and overall hue—play a crucial role in assessing overall image quality. Structural similarity reveals the impact of haze simulation on image structure preservation, detail information reflects the degree to which haze obscures image detail, and overall hue reflects the accuracy of color reproduction and the degree of improvement in image visual quality during the haze simulation process. Higher values for these three evaluation metrics indicate a greater similarity between the image and the original, haze-free image, richer detail information, and better overall color reproduction. By combining these three evaluations, we can comprehensively and objectively reflect the quality of images after haze simulation, providing a scientific basis for further optimizing haze simulation algorithms. Therefore, this paper proposes a comprehensive evaluation metric (SIO) calculated using these three factors as multipliers. Higher values for this metric indicate higher readability and more comprehensive information contained in the processed image, meaning that the overall haze effect is less ideal.
[0329] The dark channel processing based on dark channel prior theory includes:
[0330] Based on the original traffic image, a local window corresponding to each pixel point in the original traffic image is determined; based on the corresponding local window, three-channel pixel values corresponding to the local window are calculated to form a local window three-channel pixel value set; based on the local window three-channel pixel value set, a minimum channel value is obtained by minimum value extraction;
[0331] Based on the minimum channel value, the window minimum value is obtained by taking the sliding window as the basic unit for the minimum channel, and the dark channel value of the current pixel is obtained according to the dark channel model.
[0332] The dark channel model includes:
[0333]
[0334] Among them, the is the pixel value of channel c at position y in the original traffic image; is the value of pixel x in the dark channel image.
[0335] like Figure 4 、 5As shown in Figure 1, the calculation process for the dark channel image can be divided into two main steps: First, local minimum calculation. A local window is first determined for each pixel in the image. Then, the pixel values for each channel (red, green, and blue) within this window are calculated and minimized to obtain the minimum channel value. Second, global minimum selection is performed. For the minimum channel, the window minimum is calculated using a sliding window as the basic unit, and this is used as the dark channel value at that pixel. Through these two steps, the dark channel image shown below is obtained.
[0336] Determining a high-brightness pixel area in the dark channel image, determining an original traffic area corresponding to the high-brightness pixel area in the original traffic image, and determining the three-channel values of the original traffic area as an estimated value of the atmospheric light value S102 includes:
[0337] Based on the dark channel image, according to the preferred threshold range, the highest luminosity area is screened to obtain the highest luminosity area; based on the highest luminosity area, the highest three channel values are selected and the overall atmospheric light value is determined according to the atmospheric light value estimation model, wherein the preferred threshold range is 0 to 0.1.
[0338] The atmospheric light value estimation model:
[0339]
[0340] Among them, the is the preferred threshold; , where I(x) is the pixel value at position x in the initial through-fog image; A is the overall atmospheric light value; is the preferred coefficient.
[0341] The A value is selected by applying the highest luminosity point in the dark channel image in the dark channel prior theory. That is, a small number of pixels with the highest brightness value are first found from the dark channel image, and then the corresponding positions of these pixels are found in the original haze image. The three-channel values are used as the estimated values of the atmospheric light value, thereby improving the accuracy and reliability of the A value.
[0342] At the same time, the present invention also provides a simulated fogging system for road traffic scene images, comprising:
[0343] Based on the above-mentioned simulated fogging method, the simulated fogging system includes a simulated fogging platform, which is used to:
[0344] Based on the original traffic image, a dark channel image is generated by dark channel processing based on dark channel prior theory (S101); a high-brightness pixel area is determined in the dark channel image, and an original traffic area corresponding to the high-brightness pixel area is determined in the original traffic image, and three-channel values of the original traffic area are determined as estimated values of atmospheric light values (S102);
[0345] Obtain a dark channel image and overall atmospheric light values, introduce and adjust a transmittance adjustment factor under the deformed fog degradation model, generate an initial transmittance fog map, and determine an estimated image transmittance to ensure control of the intensity of the defogging effect and determine a balance point for the use of the dark channel prior, thereby ensuring accurate transmittance estimation (S103);
[0346] Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, thereby generating a corrected transmittance fog map to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation (S104);
[0347] Based on the modified transmittance fog image, a scattering rate statistical model is introduced to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels, so as to provide a corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate (S105);
[0348] Based on the original traffic image, the atmospheric extinction coefficients of different haze levels are used to generate fog processing models at different haze levels according to the deformed fog degradation model, so as to obtain haze images at different haze levels according to the atmospheric extinction coefficients at different haze concentrations ( S106 ).
[0349] The fogging simulation technology of the present invention can be widely used in: (1) autonomous driving data enhancement: improving the recognition ability of autonomous driving AI models in foggy and hazy weather; (2) intelligent traffic monitoring: generating synthetic foggy images to test and optimize the performance of traffic cameras in bad weather; (3) target recognition training: providing richer training data for computer vision algorithms and improving recognition accuracy in bad weather. The present invention proposes a simulated fogging technology for road traffic scenes, combining dark channel prior theory, road transmittance correction and foggy imaging model to achieve a more natural and accurate fogging effect. The present invention can be widely used in the fields of autonomous driving, intelligent transportation and computer vision, providing high-quality training data support for related algorithms, and has important engineering application value.
[0350] Example 2:
[0351] Based on the first embodiment, the specific method for calculating the overall atmospheric light value in step 4 includes:
[0352] First, filter the dark channel image A 0.1% pixel count is used to ensure that the selected pixels are not affected by natural imagery. A first maximum value extraction is performed on each of the three channels of the dark channel pixel. A second maximum value extraction is then performed on the region, finding the pixel location of the maximum value (the brightest point in each channel) and recording it as [a, b]. Finally, the pixel corresponding to the dark channel maximum point is found in the original image. The three-channel values are the three vectors of the overall atmospheric light value, which serve as an estimate of the atmospheric light value.
[0353] Estimation model based on atmospheric light values:
[0354]
[0355] After the operation, the overall atmospheric light value A corresponding to the example image is (0.9294, 0.9294, 0.9373).
[0356] Example 3:
[0357] Based on the first embodiment, the specific calculation method for estimating transmittance includes:
[0358] Substitute the obtained A value into the following formula:
[0359]
[0360] Calculate the estimated transmittance map of the haze image, such as Figure 4 、 6 As shown, by comparing the two images above, we can see that the transmittance image provides information about the depth of field in the image. With the help of the transmittance image, we can better understand the depth distribution of different areas in the image, that is, the distance of objects. In the transmittance image of the traffic road scene, the transmittance value calculated for the near-field area is relatively high, so it appears brighter, while the transmittance value calculated for the distant area is relatively low, so it appears dim. To address the abnormal performance of the transmittance image in the road area, the present invention will correct the transmittance of the road area.
[0361] Example 4:
[0362] like Figure 9 As shown, based on online observations of Tianjin and The observed atmospheric visibility, (aerosol scattering coefficient), (aerosol absorption coefficient) and AOD (atmospheric optical thickness) lead to the conclusion that as the haze level increases, the scattering rate gradually increases, and the range of scattering rates under different levels of haze weather is statistically analyzed. The present invention uses the characteristics of scattering rate to provide a basis for modifying the corresponding haze concentration in the original image, and provides a reasonable range of aerosol extinction coefficients, i.e., scattering coefficients, under slight haze, light haze, moderate haze, and heavy haze. After reasonable analysis, the present invention's scattering rates under these five haze levels are as follows: Figure 9 As shown, this embodiment also confirms the positive relationship between haze concentration and scattering rate, which provides an expected range for the fogging experimental effect achieved under different haze levels by controlling the scattering rate in the first embodiment.
[0363] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for simulating fogging of road traffic scene images, characterized in that: include: Obtain the dark channel image and the overall atmospheric light value, introduce the transmittance adjustment factor under the deformed fog degradation model, generate the initial transmittance fog map, and determine the estimated image transmittance; The method of introducing a transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance includes: Based on the fog degradation model, the three channels of atmospheric light are deformed to generate a deformed fog degradation model. Based on the deformed fog degradation model, a filtered fog degradation model is generated through quadratic minimum filtering; Based on the filtered fog degradation model and the prior conformity requirement of the dark channel, the prior fog degradation model is obtained; Based on the a priori fog degradation model, an initial transmittance model is formed by introducing a transmittance adjustment factor. Based on the initial transmittance model, an initial transmittance fog map is generated by adjusting the transmittance adjustment factor of the initial transmittance model, and an estimated image transmittance is determined. The adjusted transmittance adjustment factor of the initial transmittance model has an adjustment range of 0 to 1. Wherein, the estimated image transmittance function is: Among them, the To estimate the image transmittance; is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; A local window around an index pixel, wherein x is the center of the local window and y is any position in the local window; Used to index three channels, wherein the C is any one of the three channels; is the light transmission adjustment factor; Based on the initial transmittance fog map and the estimated image transmittance, the transmittance of the road surface area is corrected to increase the contrast difference between the road surface and its surroundings, thereby generating a corrected transmittance fog map. Based on the modified transmittance fog map, the atmospheric extinction coefficient corresponding to the scattering rate range of different haze levels is determined by introducing a scattering rate statistical model. Based on the original traffic image, the atmospheric extinction coefficients at different haze levels are used to generate fog processing models at different haze levels according to the deformed fog degradation model. This allows haze-enhanced images at different haze levels to be obtained based on the atmospheric extinction coefficients at different haze concentrations. The step of introducing a transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance further includes: Based on the pre-estimated image, the transmittance gradient is generated through the gradient vector model; Based on the transmittance gradient, a weight allocation strategy is used to assign weights to each position according to the size or direction of the gradient, generating high-gradient areas and low-gradient areas. The high-gradient areas are used to emphasize the optimization of areas sensitive to transmittance changes, while the low-gradient areas are used to reduce the interference with uniform areas. Based on the low gradient area, the continuous linear gradient weighting coefficient is generated through the exponential weighting model; Based on the high gradient area, the piecewise linear gradient weighting coefficient is generated through the piecewise weighted model; Based on the continuous linear gradient weighting coefficient and the piecewise linear gradient weighting coefficient, the estimated image transmittance is generated by enhancing the transmittance model of the specific area.
2. The simulated fogging method according to claim 1, wherein: Before obtaining the dark channel image and the overall atmospheric light value, the method further includes: Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory; the high-brightness pixel area is determined in the dark channel image, and the original traffic area corresponding to the high-brightness pixel area is determined in the original traffic image, and the three-channel values of the original traffic area are determined as the estimated value of the atmospheric light value.
3. The simulated fogging method according to claim 1, wherein: The step of introducing a transmittance adjustment factor under the deformed fog degradation model to generate an initial transmittance fog map and determining the estimated image transmittance further includes: Generate a pre-evaluation basis through edge detection: Based on the original traffic image, the three channels are weighted and summed according to the sensitivity of the human eye through the weighted averaging method to obtain the original grayscale image; Based on the original grayscale image, the original denoised image is generated through image blurring to avoid incorrect edge responses in subsequent gradient calculations; Based on the original denoised image, the horizontal gradient convolution kernel, vertical gradient convolution kernel, gradient amplitude and gradient direction of the gradient model are generated through gradient synthesis processing, including: The horizontal gradient convolution kernel is: The vertical gradient convolution kernel is: The gradient amplitude is: The gradient direction is: The Gx is the horizontal gradient convolution kernel; the Gy is the vertical gradient convolution kernel; the G is the gradient amplitude; the θ is the gradient direction; Based on the original denoised image, by traversing each pixel of the image, comparing the gradient values of adjacent pixels according to their gradient directions, suppressing the non-maximum values in the image, and forming a suppressed image to make the edges clearer and sharper; Based on the suppressed image, if the current pixel of the image is higher than the high threshold or lower than the low threshold, the pixels with gradient values higher than the high threshold are directly marked as strong edges, the pixels with gradient values between the low threshold and the high threshold are marked as weak edges, and the pixels with gradient values lower than the low threshold are marked as non-edges, and a marked image is formed; Based on the marked image, by traversing all pixels with weak edges, it is determined whether there is a strong edge in the current neighborhood. If there is a strong edge, the weak edge is promoted to a strong edge; otherwise, it is regarded as a non-edge and used for the real edge of the image break, so as to remove isolated noise points and form an optimized image; Based on the optimized image, strong edges are determined as valid edges, weak edges are filtered or connected, and at the same time, non-edge areas are kept as black edges to form a pre-estimated image; The enhanced specific area transmittance model is: described is the target transmittance; is the original transmittance; Dynamic adjustment of continuous linear gradient weighting coefficients and piecewise linear gradient weighting coefficients according to gradient or domain.
4. The simulated fogging method according to claim 1, wherein: By correcting the transmittance of the road surface area to increase the contrast difference between the road surface and its surroundings, the corrected transmittance fog map is generated, including: Based on the initial transmittance fog map, the estimated image transmittance of the first enlarged road is obtained by nonlinear compression of the image grayscale, and the contrast difference between the first enlarged road surface and its surroundings is used to generate a first contrast difference fog map; Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily expanded by the maximum class variance binary method to generate a second contrast difference fog map by second-expanding the contrast difference between the road surface and its surroundings.
5. The simulated fogging method according to claim 4, characterized in that: include: The image grayscale nonlinear compression includes: If the transmittance of the road surface area is lower than that of its surrounding area, the transmittance of the current road surface area is squared using the image grayscale nonlinear compression function. A first contrast difference fog map is generated based on the transmittance of the current road surface area to reduce the transmittance of the road surface area and increase the transmittance level difference between the road surface area and its surrounding area. Wherein, the image grayscale nonlinear compression function is: Among them, the is the transmittance after nonlinear compression processing; The maximum class variance binary method includes: Based on image segmentation threshold; If the pixel values of the road surface area and its surrounding areas are greater than the image segmentation threshold, the current area is determined to be the road surface area, and the transmittance of the current area is configured to 1 through the binarization function; Otherwise, the current area is determined to be its surrounding area, and the transmittance of the current area is configured to 0 through a binarization function, and a second ratio difference fog map is generated based on the transmittance of the current road area and the transmittance of its surrounding areas; Wherein, the binarization function is: Among them, the is the transmittance after binarization processing; is the transmittance threshold.
6. The simulated fogging method according to claim 1, characterized in that: The method of introducing a scattering rate statistical model to determine the atmospheric extinction coefficient corresponding to the scattering rate intervals of different haze levels includes: Based on the linear relationship between different haze levels and their corresponding scattering rate intervals, the atmospheric extinction coefficients of different levels corresponding to the scattering rate intervals of different haze levels are calculated through a scattering rate statistical model, wherein the different haze levels include slight haze, light haze, moderate haze, and heavy haze; Wherein, the scattering rate statistical model is: Among them, the is the pixel depth; is the haze concentration parameter; is the atmospheric extinction coefficient of different levels.
7. The simulated fogging method according to claim 1, characterized in that: The method of generating fog processing models at different haze levels according to the atmospheric extinction coefficients at different haze levels and the deformed fog degradation model includes: Based on the original traffic image, the modified transmittance fog map corrected by the overall atmospheric light value is superimposed on the original traffic image to generate a deformed fog degradation model; According to the atmospheric extinction coefficient at different levels, the fog processing model under different haze levels is generated through the deformed fog degradation model; Generate haze images at different haze levels through haze processing models at different haze levels; The deformed fog degradation model is: Among them, the is the atmospheric extinction coefficient of different levels, is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
8. The simulated fogging method according to claim 2, wherein: The dark channel processing based on dark channel prior theory includes: Based on the original traffic image, a local window corresponding to each pixel point in the original traffic image is determined; based on the corresponding local window, three-channel pixel values corresponding to the local window are calculated to form a local window three-channel pixel value set; based on the local window three-channel pixel value set, a minimum channel value is obtained by minimum value extraction; Based on the minimum channel value, the window minimum value is obtained by sliding the window as the basic unit for the minimum channel, and the dark channel value of the current pixel is obtained according to the dark channel model; The dark channel model includes: Among them, the is the pixel value of channel c at position y in the original traffic image; is the value of pixel x in the dark channel image, A local window around an index pixel, wherein x is the center of the local window and y is any position in the local window; Used to index three channels, where C is any one of the three channels.
9. The simulated fogging method according to claim 2, characterized in that: Determining a high-brightness pixel area in the dark channel image, determining an original traffic area corresponding to the high-brightness pixel area in the original traffic image, and determining the three-channel values of the original traffic area as an estimated value of the atmospheric light value includes: Based on the dark channel image, according to the threshold range, the highest luminosity area is screened to obtain the highest luminosity area; based on the highest luminosity area, the overall atmospheric light value is determined according to the atmospheric light value estimation model using the highest three channel values, wherein the threshold range is 0 to 0.1; The atmospheric light value estimation model: Among them, the is the threshold value; , where I(x) is the pixel value at position x in the initial transmittance fog map; A is the overall atmospheric light value; is the coefficient.
Citation Information
Patent Citations
Traffic image fog adding method under digital twinning
CN114998147A
Method for image defogging based on dark channel prior
US20240104702A1