Simulation fogging method and system for road traffic scene image
By obtaining dark channel images and atmospheric light values in fog simulation technology, adjusting the light transmission factor and correcting the road surface transmission rate, combining the scattering rate statistical model, fog treatment models under different haze levels are generated, which solves the problem of unnatural fog effect in the existing technology, and achieves a more accurate and natural haze simulation in traffic scenes.
Patent Information
- Application Number
- CN202510500324.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-21
AI Technical Summary
When existing fog simulation technology deals with traffic scenes containing a large number of unnatural areas, it is easy to have problems such as unnatural fog effect, color distortion, and uneven contrast, which affects the effectiveness of model training.
By acquiring dark channel images and overall atmospheric light values, introducing and adjusting light transmission adjustment factors, generating an initial transmittance mist map, and by correcting the transmittance of the pavement area, expanding the contrast difference between the pavement and its surroundings, ensuring an accurate estimate of transmittance. Then, based on the corrected transmittance fog map, a scattering statistical model is introduced to determine the corresponding atmospheric extinction coefficients in the scattering ranges of different haze levels, and a fog addition treatment model under different haze levels is generated.
It realizes a more accurate simulation of the haze environment in real traffic scenes, ensuring the naturalness of the fog effect and the balance of contrast, thereby improving the effectiveness of model training.
Smart Images

Figure CN120031745A_ABST
Abstract
Description
Technical Field
[0001] The 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] The existing fogging simulation technology is mainly based on the fog imaging model for simulation, including the transmittance estimation method based on the dark channel prior (DCP) and the optical simulation method based on the scattering model; however, when dealing with traffic scenes containing a large number of non-natural areas (such as roads), the traditional fogging method is prone to unnatural fogging effects, color distortion, uneven contrast and other problems, which affect the effectiveness of model training; in summary, since the existing fogging simulation technology requires multi-factor and multi-level fogging simulation reasons, there is a need for a fogging technology that can more accurately simulate the haze 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 technical problems existing in the prior art.
[0004] In order to solve the above technical problems, the present invention provides a method for simulating fogging of road traffic scene images, comprising: 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 intensity of the control defogging effect and determine the balance point of the dark channel prior application, thereby ensuring the accurate estimation of the transmittance; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; Based on the modified transmittance fog map, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined by introducing the scattering rate statistical model, so as to provide the corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate; Based on the original traffic image, the atmospheric extinction coefficient of different haze levels is used to generate the fog processing model under different haze levels according to the deformed fog degradation model, so as to obtain the haze images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations.
[0005] Preferably, before acquiring the dark channel image and the overall atmospheric light value, the method further comprises: 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, 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 values of the atmospheric light values.
[0006] Preferably, 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 comprises: Based on the fog degradation model, the deformed fog degradation model is generated by deforming the three channels of atmospheric light; Based on the deformed fog degradation model, a filtered fog degradation model is generated through secondary minimum filtering; Based on the filtered fog degradation model, according to 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, and 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, wherein the adjustment range of the adjusted transmittance adjustment factor of the initial transmittance model is 0 to 1; Wherein, the estimated image transmittance function is:
[0007] Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; A local window around a pixel is used to index the 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 a light transmission adjustment factor; To estimate the image transmittance; 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 also 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 average method to obtain the original grayscale image; Based on the original grayscale image, the original denoised image is generated through image blurring to avoid erroneous edge responses in subsequent gradient calculations; Based on the original denoised image, the horizontal gradient convolution kernel, the vertical gradient convolution kernel, the gradient amplitude and gradient direction of the gradient model are generated through gradient synthesis processing, including: The horizontal gradient convolution kernel is:
[0008] The vertical gradient convolution kernel is:
[0009] The gradient amplitude is:
[0010] The gradient direction is: θ = arctan (Gy / Gx) 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 of 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, which is used for the real edge of the image break, to remove isolated noise points, and form an optimized image; Based on the optimized image, the strong edge is determined as the valid edge, the weak edge is filtered or connected, and at the same time, the non-edge area is kept as a black edge, and a pre-estimated image is formed; 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 also includes: Gradient weighting and adjusted transmittance: 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, wherein the high gradient areas are optimized to emphasize the sensitive areas to the transmittance change, and the low gradient areas are used to reduce the interference with the 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; The enhanced specific area transmittance model is:
[0011] Said 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.
[0012] Preferably, the step of increasing the contrast difference between the road surface and its surroundings by correcting the transmittance of the road surface area, and generating the corrected transmittance fog map comprises: Based on the initial penetration fog image, the estimated image transmittance of the first enlarged road by nonlinear compression of the image grayscale is used to generate a first contrast difference fog image by the contrast difference between the first enlarged road surface and its surroundings; Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily enlarged by the maximum class variance binary method to generate a second contrast difference fog map by second enlarging the contrast difference between the road surface and its surroundings.
[0013] Preferably, the image grayscale nonlinear compression includes: If the transmittance of the road surface area is lower than the transmittance of its surroundings, the transmittance of the current road surface area is subjected to a quadratic square root process through an image grayscale nonlinear compression function, and a first contrast difference fog image 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 surroundings; Wherein, the image grayscale nonlinear compression function is:
[0014] 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 as the road surface area, and the transmittance of the current area is configured to 1 through a binarization function; Otherwise, the current area is determined as 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:
[0015] Among them, the is the transmittance after binarization processing; is the transmittance threshold.
[0016] 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: Based on the linear relationship between different haze levels and their corresponding scattering rate intervals, different levels of atmospheric extinction coefficients corresponding to the scattering rate intervals of different haze levels are statistically calculated through a scattering rate statistical model, wherein the different haze levels include slight haze, light haze, moderate haze, and severe haze; Wherein, the scattering rate statistical model is:
[0017] Among them, the is the pixel depth; is the haze concentration parameter; is the atmospheric extinction coefficient of different levels.
[0018] Preferably, generating the fogging processing model under different haze levels according to the atmospheric extinction coefficients of different haze levels and the deformed fog degradation model comprises: Based on the original traffic image, the modified transmittance fog image 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 coefficients of different levels, the fog processing models under different haze levels are generated through the deformed fog degradation model; Through the fog processing models under different haze levels, haze images under different haze levels are generated; The deformed fog degradation model is:
[0019] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0020] Preferably, the dark channel processing based on dark channel a priori 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, a three-channel pixel value corresponding to the local window is 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 minimum window 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; The dark channel model includes:
[0021] Among them, the is the pixel value of channel c at position y in the original traffic image; is the value at pixel x in the dark channel image.
[0022] Preferably, determining the high-brightness pixel area in the dark channel image, determining the 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 values of the atmospheric light value comprises: 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; The atmospheric light value estimation model:
[0023] 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.
[0024] At the same time, the present invention also provides a simulated fogging system for road traffic scene images, comprising: Based on any of the above-mentioned simulated fogging methods, the simulated fogging system includes a simulated fogging platform, and the simulated fogging platform is used to: Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory; 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 the three-channel values of the original traffic area are determined as estimated values of the atmospheric light value; 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 intensity of the control defogging effect and determine the balance point of the dark channel prior application, thereby ensuring the accurate estimation of the transmittance; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; Based on the modified transmittance fog map, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined by introducing the scattering rate statistical model, so as to provide the corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate; Based on the original traffic image, the atmospheric extinction coefficient of different haze levels is used to generate the fog processing model under different haze levels according to the deformed fog degradation model, so as to obtain the haze images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a structural flow chart of the simulated fogging method of the present invention; Figure 2 It is an algorithm flow chart of the simulated fogging method of the present invention; Figure 3 It is a color space diagram under the RGB model of the simulated fogging method of the present invention; Figure 4 is the original traffic image of the simulated fogging method of the present invention; Figure 5 is a dark channel image of the simulated fogging method of the present invention; Figure 6 is the initial transmittance fog map of the simulated fogging method of the present invention; Figure 7 is a modified transmittance fog map of the simulated fogging method of the present invention; Figure 8 These are haze-added images at different haze levels using the simulated haze-adding method of the present invention (group of images); Fig. 9 It is a scattering rate chart of the simulated fogging method of the present invention.
[0027] Reference numerals: S101-based on the original traffic image, a dark channel image is generated by dark channel processing based on dark channel prior theory; 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 the estimated value of the atmospheric light value; 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 image, 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 estimation of the transmittance; S104-Based on the initial through-fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; S105-Based on the modified transmittance fog map, by introducing a scattering rate statistical model, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined, so as to provide a corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate; S106-Based on the original traffic image, through the atmospheric extinction coefficient of different haze levels, according to the deformed fog degradation model, a fogging processing model under different haze levels is generated, so as to obtain haze images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations. DETAILED DESCRIPTION
[0028] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0030] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0031] The present invention is further explained below in conjunction with specific implementation modes.
[0032] Embodiment 1: like Figure 1-9 As shown, the present embodiment provides a method for simulating fogging of a road traffic scene image, comprising: 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 image, and determine the estimated image transmittance to ensure the intensity of the defogging effect is controlled and the balance point of the dark channel prior application is determined, thereby ensuring accurate estimation of the transmittance S103; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated 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; Based on the modified transmittance fog image, by introducing a scattering rate statistical model, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined, so as to provide a corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate S105; Based on the original traffic image, through the atmospheric extinction coefficients of different haze levels, according to the deformed fog degradation model, a fogging processing model under different haze levels is generated, so as to obtain haze images under different haze levels according to the atmospheric extinction coefficients under different haze concentrations S106.
[0033] This scheme generally includes four steps, namely, the first step: transmittance estimation; the second step: transmittance fog map correction; the third step: haze concentration classification; the fourth step: obtaining haze-added images under different haze levels; wherein, through the first step, it is achieved to ensure the intensity of controlling the defogging effect and determining the balance point of the dark channel prior application, thereby ensuring the accurate estimation of the transmittance; through the second step, it is achieved to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; through the third step, it is achieved to provide the original traffic image with the corresponding haze concentration processing basis according to the characteristics of the scattering rate; through the fourth step, it is achieved to obtain haze-added images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations; specifically: 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:
[0034] 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 a light transmission adjustment factor; To estimate the image transmittance.
[0035] Step 2: Road area transmittance correction Since the dark channel prior method may cause 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.
[0036]
[0037] The OSTU binarization algorithm is used to automatically determine the threshold and separate the road area:
[0038] Step 3: Fog simulation based on foggy imaging model The present invention combines the fog imaging model with the transmittance correction to perform fogging simulation. The mathematical model of fogging processing is as follows:
[0039] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0040] Step 4: Multi-level haze simulation For different haze concentrations, the present invention introduces a scattering rate statistical model and performs different levels of haze simulation based on the atmospheric extinction coefficient, covering light, moderate and heavy haze.
[0041]
[0042] 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 the 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, and provides 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 the depth of field information, road area transmittance correction and haze scattering rate statistical model, the authenticity and stability of the fogging simulation are improved.
[0043] 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 S101 is generated through dark channel processing based on dark channel prior theory; 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 the three-channel values of the original traffic area are determined as estimated values of the atmospheric light value S102.
[0044] like Figure 3 As 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 of the diagonal 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:
[0045] 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;
[0046] 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 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 of the overall atmospheric light, then its valuation will be biased. In order to reduce the deviation and increase the limit, the present invention sets a threshold t0: generally set to a smaller value of 0.1, that is:
[0047] The method 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: Based on the fog degradation model, the deformed fog degradation model is generated by deforming the three channels of atmospheric light; Based on the deformed fog degradation model, a filtered fog degradation model is generated through secondary minimum filtering; Based on the filtered fog degradation model, according to 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, and 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, wherein the adjustment range of the adjusted transmittance adjustment factor of the initial transmittance model is 0 to 1; Wherein, the estimated image transmittance function is:
[0048] Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; A local window around a pixel is used to index the 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 a light transmission adjustment factor; To estimate the image transmittance.
[0049] like Figure 4 , 6 As shown in the figure, the following haze image degradation model is widely used in computer vision. The transmittance of the haze image will be obtained through this model, as follows:
[0050] 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, indicating 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 light intensity of distant objects in the scene; the above model is transformed into:
[0051] Where C means three channels; for two minimum filtering, we assume that the sliding window centered on 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 for the above formula; we can deduce:
[0052] In the original fog-free image and atmospheric light Calculate the estimated transmittance when known, and introduce a parameter between 0 and 1 To adjust. The corrected transmittance is:
[0053] The introduction of adjustment parameters mainly considers the following two aspects: First, control the intensity of the defogging effect: no matter how good the air quality is, there will always be trace aerosol particles in the atmosphere. It is because of the existence of these particles that the image is given the characteristics of depth. If they are completely eliminated, the fogged image scene is not realistic enough. Second, find the 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 the actual image 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 the accurate estimation of the transmittance and further affect the quality of the defogging effect. Combined with the current relevant research on the estimated transmittance calculation literature, based on multiple experimental comparisons, the adjustment parameters in the simulation are all taken as 0.95.
[0054] At the same time, in determining the estimated image transmittance, the method of estimating the transmittance by enhancing the edge and analyzing the gradient distribution includes: The first step: edge detection and gradient calculation: Create a grayscale image 1. Basic conversion method The weighted average method adds up the three RGB channels according to the sensitivity of the human eye. Formula: Gray=0.299R+0.587G+0.114B; 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).
[0055] Selection criteria: Green channel: Most sensitive to brightness changes, often used in general scenes. Red channel: Highlights warm-toned objects (such as skin, fire). Blue channel: Enhances cool-toned details (such as the sky, water).
[0056] 2. Enhanced Method The role of adaptive histogram equalization (CLAHE): avoid over-enhancement caused by global equalization.
[0057] Edge Enhanced Grayscale Image Combined with edge detection (such as Sobel operator) to highlight details: model-based generation method 3. Model-based Generation Method Deep learning (such as CycleGAN) scenario: Generate grayscale images of a specific style (such as artistic sketches).
[0058] Contrast Limited Adaptive Histogram Equalization (CLAHE) Edge Detection 1. Gradient-based edge detection Principle: Locate the edge by calculating the gradient change of pixel grayscale values in the image.
[0059] Core idea: The gradient amplitude at the edge is higher and its direction points to the edge normal direction.
[0060] Sobel operator Steps: Use 3x3 convolution kernels in horizontal and vertical directions to calculate the gradients respectively. Combine the gradient magnitude and direction to get the edge map.
[0061]
[0062] Image preprocessing Grayscale conversion: Convert a color image to black and white, because edge detection focuses on brightness changes rather than color differences. Gaussian blur: Use a Gaussian filter to blur the image to remove high-frequency noise (such as salt and pepper noise) and avoid incorrect edge responses in subsequent gradient calculations.
[0063] Computing Gradients 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).
[0064] 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).
[0065] Gradient synthesis: The gradient magnitude of each pixel is calculated using the Pythagorean theorem ( ), and determine the gradient direction (θ = arctan (Gy / Gx)).
[0066] Non-maximum suppression (NMS), refine edge: traverse each pixel and compare the gradient values of adjacent pixels according to their gradient direction. Only the local maximum value in the gradient direction is retained to eliminate the "burrs" on the edge and make the edge clearer and sharper.
[0067] Dual threshold processing, set thresholds: define a high threshold (such as 150) and a low threshold (such as 50).
[0068] Classified 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).
[0069] Hysteresis threshold processing, connecting edges: traverse all weak edge pixels and check whether there is a strong edge in their neighborhood. If there is, the weak edge is promoted to a strong edge; otherwise, it is considered as a non-edge. This step can connect broken real edges and remove isolated noise points.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] Noise immunity: Preprocessing Gaussian blur and larger Sobel kernel (such as 5x5) can improve the algorithm's robustness to noise.
[0074] Step 2: Gradient weighting and transmittance adjustment: Transmittance gradient calculation Gradient definition: Transmittance gradient refers to the rate of change of transmittance in space, which is usually calculated by numerical differentiation (such as finite difference method) or automatic differentiation technology. For example, for two-dimensional materials, the gradient vector can be expressed as:
[0075] Said is the gradient vector in the X direction; is the gradient vector in the Y direction; Gradient direction: The gradient direction points to the direction where the transmittance increases fastest, and its modulus reflects the severity of the change. High gradient areas usually correspond to material interfaces, structural mutations, or locations with strong light scattering.
[0076] Weighting strategy: Gradient weighting: Assign weights to each location based on the size or direction of the gradient. For example: High gradient areas: assign higher weights to emphasize optimization of sensitive areas of transmittance changes. Low gradient areas: lower weights to reduce intervention in uniform areas. Weighting functions: Common weighting functions include exponential functions, piecewise functions (such as dynamic adjustment based on gradient thresholds), or adaptive weights based on machine learning.
[0077] Optimization goals and applications: Homogenize transmittance: Make the transmittance of high gradient areas close to the target value and reduce spatial differences. Enhance specific areas: In optical design, give higher weights to areas that require high transmittance (such as the center of the lens) and prioritize their performance. Suppress noise or scattering: In imaging systems, gradient weighting is used to suppress edge blur or scattering noise and improve image clarity.
[0078] Weight function design, exponential weighting:
[0079] Among them, α is an adjustment parameter used to control the sensitivity of the weight to the gradient.
[0080] Piecewise linear weighting: Optimizing the objective function
[0081] Minimize the transmittance variance:
[0082] in, is the target average transmittance, is the gradient weighting coefficient.
[0083] Enhance the transmittance of specific areas:
[0084] in, is the target transmittance distribution, Can be adjusted dynamically based on gradients or domain knowledge.
[0085] like Figure 4 , 7 As shown, in the transmittance image of the road surface area of the traffic scene, the brightness of the road surface area is opposite to what is expected, that is, the road surface area is darker than the distant view area. This situation occurs because the dark channel prior method has errors when processing the transmittance of large gray or white areas (such as roads) in the image, resulting in inaccurate estimation of the transmittance of the road surface area; therefore, in addition to using the dark channel prior method to defog the entire image, the present invention also requires additional corrections to the transmittance of the road surface area to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; The image grayscale nonlinear compression comprises: If the transmittance of the road surface area is lower than the transmittance of its surroundings, the transmittance of the current road surface area is subjected to a quadratic square root process through an image grayscale nonlinear compression function, and a first contrast difference fog image 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 surroundings; Wherein, the image grayscale nonlinear compression function is:
[0086] Among them, the is the transmittance after nonlinear compression processing; The present invention then adopts grayscale nonlinear compression, using quadratic expansion of the difference between the road transmittance value and the surrounding grayscale area; then adopts the maximum class variance binary method to further increase the difference between the foreground (road surface area) and the background (road surrounding area) and the foreground; it is found that the transmittance value of the road surface area in the traffic scene is significantly lower than that of the surrounding area, so the present invention uses the grayscale nonlinear compression method, that is, the road area transmittance is processed quadratically to further reduce the transmittance value of the road area, and widen 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:
[0087] 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; It represents the transmittance image after nonlinear compression processing, also known as grayscale nonlinear compression transmittance. With the help of this square processing of image transmittance, the grayscale range of the road and the surrounding area is readjusted, and the contrast is further increased, that is, the darker area (road surface) in the image is enhanced to a greater extent, thereby improving the visual effect of the image. Through the contrast effect before and after compression, it is determined that the road area in the transmittance image after grayscale nonlinear compression processing is more obvious.
[0088] 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 as the road surface area, and the transmittance of the current area is configured to 1 through a binarization function; Otherwise, the current area is determined as 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:
[0089] Among them, the is the transmittance after binarization processing; is the transmittance threshold; In order to further enhance the difference between the road and the background, the present invention adopts image binarization segmentation, thereby further increasing the transmittance difference between the road and its background area. Assume that there is a threshold TH, which can divide the image into two categories (image area with pixel value < TH) and (image area with pixel value > TH); the pixel means of these two types of areas are set to A1 and A2, and the overall image pixel mean values are set to m1 and m2; the percentage of A1 in the image area is p1, and similarly, the percentage is p2; thus:
[0090] Step a1: Find the threshold TH. According to the concept of variance, the expression of inter-class variance is:
[0091] The gray level that maximizes the above formula is the OTSU threshold.
[0092] Step a2: Segmentation binarization. The binary image calculated based on the compressed transmittance image further increases the transmittance difference between the road and its background area, thereby reducing the probability of misclassification:
[0093] Step a3: Image road surface extraction. The division of the road area in the transmittance map after secondary processing 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 edge of the distant area, filling holes and negating.
[0094] Then, the corrected transmittance area image corresponding to the road area is combined with the original transmittance area image corresponding to the non-road area to obtain an overall transmittance image that conforms to the actual scene. The smaller the horizontal coordinate of the pixel point in the road area, that is, the closer it is to the top of the image, the deeper the corresponding scene depth should be, the higher the transmittance value, and the greater the brightness. The corrected transmittance value is shown in the following formula:
[0095] In the above formula, represents the coordinates of the pixel points in the transmittance image to be processed, and Represents 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, Indicates the previously divided road range. For the image of the road area after transmittance correction in the traffic scene, it can be seen that the abnormal performance problem of the transmittance map in the road area has been basically solved, so that the brightness of the corrected road in the transmittance map is close to the brightness value of the surrounding area, that is, the scene depth information of the road area is reasonably expressed.
[0096] The third step: edge enhancement and regional fusion: Edge Enhancement Image preprocessing, grayscale conversion: Convert color images to black and white images because edge detection focuses on brightness changes rather than color differences.
[0097] Gaussian blur: Use a Gaussian filter to blur the image to remove high-frequency noise (such as salt and pepper noise) and avoid incorrect edge responses in subsequent gradient calculations.
[0098] Computing Gradients 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).
[0099] 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).
[0100] Gradient synthesis: The gradient magnitude of each pixel is calculated using the Pythagorean theorem ( ), and determine the gradient direction (θ = arctan (Gy / Gx)).
[0101] Non-maximum suppression (NMS): Refine the edge: traverse each pixel and compare the gradient values of adjacent pixels according to their gradient direction. Only the local maximum value in the gradient direction is retained to eliminate the "burrs" on the edge and make the edge clearer and sharper.
[0102] Dual Thresholding: Set thresholds: define a high threshold (such as 150) and a low threshold (such as 50).
[0103] Classified 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).
[0104] Hysteresis threshold processing: Connecting edges: Traverse all weak edge pixels and check whether there is a strong edge in their 8-neighborhood. If there is, the weak edge is promoted to a strong edge; otherwise, it is regarded as a non-edge. This step can connect the broken real edges and remove isolated noise points.
[0105] 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.
[0106] Key technical details: (1) The role of gradient direction: used to determine the comparison direction (such as horizontal, vertical or diagonal direction) during non-maximum suppression.
[0107] (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.
[0108] (3) Noise resistance: Preprocessing Gaussian blur and a larger Sobel kernel (such as 5x5) can improve the algorithm's robustness to noise.
[0109] Regional integration I. Definition and Objectives of Regional Integration Definition: Integrate the edge information of multiple images or the edge features of the same image after different processing to eliminate stitching traces, enhance edge coherence or extract more complete edge details.
[0110] Core objectives: Eliminate seams in image stitching or multimodal fusion.
[0111] Improve the integrity of edge detection results (e.g. combining outputs from different algorithms).
[0112] Enhance the visual effect of the image (such as merging the edge enhanced result with the original image).
[0113] Example steps (panorama stitching): Image registration → detection of overlapping areas → calculation of fusion weights (e.g. based on gradient magnitude) → weighted fusion.
[0114] Regional fusion of multimodal images, scenarios: infrared and visible light images, MRI and CT images, etc. Methods: Feature-level fusion: extract edges separately and merge them (such as superimposing Canny edges and deep learning edge detection results).
[0115] Decision-level fusion: select edges of different modalities based on confidence (e.g., fusion using Dempster-Shafer theory).
[0116] Fusion of edge detection results: Goal: Combine the advantages of different algorithms (such as Sobel's positioning accuracy and Canny's noise resistance).
[0117] 2. Strategy: Logical OR: directly merge all edge pixels. Voting mechanism: count the edge positions detected by multiple algorithms and retain high-frequency areas. Deep learning fusion: train the network to learn the weight distribution of different edge maps.
[0118] The enhanced edge is merged with the original image, method: Overlay Fusion:
[0119] Blending modes: Use Soft Light, Overlay, and other modes in Photoshop to enhance edge contrast.
[0120] Parameter control: α: edge strength coefficient (usually 0.1-0.5).
[0121] First, perform binarization or threshold processing on the edge image to avoid noise interference.
[0122] 3. Parameter Tuning and Techniques Edge detection parameter optimization, Canny threshold: threshold1: low threshold (recommended 30~50), control edge continuity. threshold2: high threshold (recommended 80~150), control edge accuracy.
[0123] Sobel kernel size: ksize=3 is suitable for general scenarios, and ksize=5 can enhance noise robustness.
[0124] Improvements in gradient weighting: Direction selectivity: weight only the gradients in the horizontal or vertical direction (e.g., road scenes prioritize horizontal gradients). Non-local gradient statistics: calculate the mean gradient of the local neighborhood to avoid the influence of isolated noise points.
[0125] Post-processing smoothing: Bilateral filtering: Smooth the adjusted transmittance map, retaining edges while reducing noise.
[0126] By correcting the transmittance of the road surface area to expand the contrast difference between the road surface and its surroundings, the corrected transmittance fog map is generated, including: Based on the initial penetration fog image, the estimated image transmittance of the first enlarged road by nonlinear compression of the image grayscale is used to generate a first contrast difference fog image by the contrast difference between the first enlarged road surface and its surroundings; Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily enlarged by the maximum class variance binary method to generate a second contrast difference fog map by second enlarging the contrast difference between the road surface and its surroundings.
[0127] 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, different levels of atmospheric extinction coefficients corresponding to the scattering rate intervals of different haze levels are statistically calculated through a scattering rate statistical model, wherein the different haze levels include slight haze, light haze, moderate haze, and heavy haze.
[0128] Wherein, the scattering rate statistical model is:
[0129] Among them, the is the pixel depth; is the haze concentration parameter; is the atmospheric extinction coefficient of different levels.
[0130] By deducing the optical model, the relationship between the pixel values of the depth image and the transmittance image is proved. With the help of the statistical law between different haze concentrations and the evaluation index of atmospheric optical properties, the scattering characteristic values under five haze levels are set to change the central visibility distance range under different haze concentration scenes, while effectively retaining the depth of field information, and obtaining a haze treatment effect that fits the actual haze scene, is not affected by the road, and has a wide range of applicability. Regarding the scattering formula:
[0131] If X1 is independent of X2, then it can be written as:
[0132] Finally, it is concluded that:
[0133] 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: Step 1: Measure the extinction coefficient (σ) in the set target area through manual observation or transmission instrument. Generally, a reference instrument is used. Step 2: Measure visibility (V) in the set target area using a scatterometer. Step 3: Based on the linear formula y=kx, the first extinction coefficient empirical formula is deduced and fitted, that is, V=kσ; where k is the fitting coefficient; Step 4: After the above fitting, the fitting coefficient is obtained as follows: in the case of clean atmosphere or water droplet fog: 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; In this way, through Step 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; Step 5: Based on the linear formula y=kx+b, the empirical formula of the second extinction coefficient is deduced and fitted, that is, V'=kσ+b; where k is the fitting coefficient; b is the correction coefficient; Step 6: Directly measure σ using a transmission instrument, and then obtain V' using the first extinction coefficient empirical formula.
[0134] Step 7: Measure the intensity of atmospheric scattered light through a scattering instrument and calculate the extinction coefficient σ' based on the particle scattering model; 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; Step 9: Contrast adjustment: In different scenarios, the contrast threshold of the human eye may change (for example, b=2% for aerial observation corresponds to k=4.2), and the k value needs to be adjusted according to the application.
[0135] 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.
[0136] 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 haze days; (3) Chemical composition: The strong light absorption of black carbon will further reduce visibility. Correction method: Combine particle size spectrometer and chemical composition monitoring data to establish a more complex extinction model: b=f(PM2.5, RH, particle size) Step 12: Night 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.
[0137] In this way, through Step 5-12, the problem that in practical applications, 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 σ, and the k value needs to be corrected can be solved; Summary: The core relationship between visibility and extinction coefficient is established through the first extinction coefficient empirical formula, which is theoretically V=kσ. In practical applications, the constant k needs to be calibrated or corrected according to the atmospheric composition, particle characteristics, and observation scenes, and the quantitative conversion between the two is achieved through theoretical derivation, measured fitting, or instrument calibration. Finally, the b value is obtained through b=f (PM2.5, RH, particle size), or other correction formulas, so that the first extinction coefficient empirical formula can be corrected, thereby obtaining the second extinction coefficient empirical formula, and finally establishing a linear relationship between the extinction coefficient (σ) and visibility (V).
[0138] The method of generating fogging processing models under different haze levels according to the atmospheric extinction coefficients of different haze levels and the deformed fog degradation model includes: Based on the original traffic image, the modified transmittance fog image 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 coefficients of different levels, the fog processing models under different haze levels are generated through the deformed fog degradation model; Through the fog processing models under different haze levels, haze images under different haze levels are generated; The deformed fog degradation model is:
[0139] Among them, the is the original traffic image; is the initial transmittance fog map; Add haze to the final image.
[0140] like Figure 4 , 8As shown, based on the fog degradation model:
[0141] 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 , using the scattering rate properties under haze concentration, haze images under different haze levels are obtained. When the image after fogging simulation is objectively evaluated, the three classic indicators of structural similarity, detail information and overall hue play a vital role in the evaluation of the overall quality of the image. Structural similarity reveals the influence of fogging simulation on the retention of image structure, detail information reflects the degree of obstruction of image details by haze, and overall hue reflects the accuracy of color restoration and the degree of improvement of image visual quality during fogging simulation. The larger the values of these three evaluation indicators, the more similar the image is to the original haze-free image, the richer the information of the details, and the more restored the overall color. Combining the evaluation of these three aspects, the image quality after fogging simulation can be comprehensively and objectively reflected, thereby providing a scientific basis for further optimizing the fogging simulation algorithm. Therefore, the present invention proposes a comprehensive evaluation index SIO calculated by taking these three factors as multiplication factors. The larger the value of this index, the higher the readability of the processed image and the more comprehensive and rich the information contained, that is, the less ideal the overall comprehensive effect of fogging.
[0142] The dark channel processing based on dark channel priori 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, a three-channel pixel value corresponding to the local window is 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 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.
[0143] The dark channel model includes:
[0144] Among them, the is the pixel value of channel c at position y in the original traffic image; is the value at pixel x in the dark channel image.
[0145] like Figure 4 , 5As shown in the figure, the calculation process of the dark channel image can be divided into two main steps: The first step: local minimum calculation. First, a local window is determined for each pixel in the image. Then, the pixel value of each channel (red, green, and blue) is calculated in the window to extract the minimum value and obtain the minimum channel value. The second step: global minimum selection. For the minimum channel, the window minimum value is calculated with the sliding window as the basic unit, which is used as the dark channel value at the pixel point. Through these two steps, the dark channel diagram can be obtained.
[0146] The step of determining a high-brightness pixel region in the dark channel image, determining an original traffic region corresponding to the high-brightness pixel region in the original traffic image, and determining the three-channel values of the original traffic region as the estimated value of the atmospheric light value S102 includes: 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 optimized 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.
[0147] The atmospheric light value estimation model:
[0148] 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.
[0149] The A value is selected by using 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 positions corresponding to 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.
[0150] At the same time, the present invention also provides a simulated fogging system for road traffic scene images, comprising: Based on the above-mentioned simulated fogging method, the simulated fogging system includes a simulated fogging platform, and the simulated fogging platform is used to: 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 the three-channel values of the original traffic area are determined as estimated values of the atmospheric light value S102; 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 image, and determine the estimated image transmittance to ensure the intensity of the defogging effect is controlled and the balance point of the dark channel prior application is determined, thereby ensuring accurate estimation of the transmittance S103; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated 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; Based on the modified transmittance fog image, by introducing a scattering rate statistical model, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined, so as to provide a corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate S105; Based on the original traffic image, through the atmospheric extinction coefficients of different haze levels, according to the deformed fog degradation model, a fogging processing model under different haze levels is generated, so as to obtain haze images under different haze levels according to the atmospheric extinction coefficients under different haze concentrations S106.
[0151] 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 simulation 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.
[0152] Embodiment 2: Based on the first embodiment, the specific method for calculating the overall atmospheric light value in step 4 includes: First, filter the dark channel image. 0.1% pixels are used to ensure that the selected pixels will not be disturbed by natural image scenes; secondly, the three channels of the dark channel pixels are extracted for the first time. Then the second maximum value extraction is performed on the area to find the pixel location of the maximum value (the brightest point in each channel) and record it as [a, b]. Finally, the corresponding pixel point of the dark channel maximum point is found in the original image, and its three-channel value is the three vectors of the overall atmospheric light value as the estimated value of the atmospheric light value; Estimate the model based on atmospheric light values:
[0153] After the operation, the overall atmospheric light value A corresponding to the example image is (0.9294, 0.9294, 0.9373).
[0154] Embodiment three: Based on the first embodiment, the specific calculation method for estimating the transmittance includes: Substitute the obtained A value into the following formula:
[0155] Calculate the estimated transmittance map of the haze image, such as Figure 4 , 6 As shown, by comparing the above two figures, we can find 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 of field distribution of different areas in the image, that is, the distance of the object; in the transmittance image of the traffic road scene, except for other areas outside the road surface, the transmittance value calculated for the near view area is relatively high, so it will appear brighter; the transmittance value calculated for the distant view area is relatively low, so it will appear dim. In view of the abnormal performance of the transmittance image in the road area, the present invention will correct the transmittance of the road surface area.
[0156] Embodiment 4: like Fig. 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 the 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 scattering rates of the present invention under these five haze levels are as follows: Fig. 9 As shown, this embodiment also confirms the positive relationship between haze concentration and scattering rate, and provides an expected range for the fogging experiment effect under different haze levels achieved by controlling the scattering rate in the first embodiment.
[0157] 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned 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 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 intensity of the control defogging effect and determine the balance point of the dark channel prior application, thereby ensuring the accurate estimation of the transmittance; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; Based on the modified transmittance fog map, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined by introducing the scattering rate statistical model, so as to provide the corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate; Based on the original traffic image, the atmospheric extinction coefficient of different haze levels is used to generate the fog processing model under different haze levels according to the deformed fog degradation model, so as to obtain the haze images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations.
2. The method for simulating fogging according to claim 1, characterized in that: 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, 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 values of the atmospheric light values.
3. The simulated fogging method according to claim 1, characterized in that: The method 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: Based on the fog degradation model, the deformed fog degradation model is generated by deforming the three channels of atmospheric light; Based on the deformed fog degradation model, a filtered fog degradation model is generated through secondary minimum filtering; Based on the filtered fog degradation model, according to 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, and 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, wherein the adjustment range of the adjusted transmittance adjustment factor of the initial transmittance model is 0 to 1; Wherein, the estimated image transmittance function is: Among them, the is the minimum pixel value in the RGB channels; is the atmospheric light of three channels; A local window around a pixel is used to index the 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 a light transmission adjustment factor; To estimate the image transmittance; 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 also 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 average method to obtain the original grayscale image; Based on the original grayscale image, the original denoised image is generated through image blurring to avoid erroneous edge responses in subsequent gradient calculations; Based on the original denoised image, the horizontal gradient convolution kernel, the vertical gradient convolution kernel, the 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: θ = arctan (Gy / Gx) 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 of 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, which is used for the real edge of the image break, to remove isolated noise points, and form an optimized image; Based on the optimized image, the strong edge is determined as the valid edge, the weak edge is filtered or connected, and at the same time, the non-edge area is kept as a black edge, and a pre-estimated image is formed; 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 also includes: Gradient weighting and adjusted transmittance: 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, wherein the high gradient areas are optimized to emphasize the sensitive areas to the transmittance change, and the low gradient areas are used to reduce the interference with the 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; The enhanced specific area transmittance model is: Said 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, characterized in that: By correcting the transmittance of the road surface area to expand the contrast difference between the road surface and its surroundings, the corrected transmittance fog map is generated, including: Based on the initial penetration fog image, the estimated image transmittance of the first enlarged road by nonlinear compression of the image grayscale is used to generate a first contrast difference fog image by the contrast difference between the first enlarged road surface and its surroundings; Based on the contrast difference fog map, the estimated image transmittance of the road is secondarily enlarged by the maximum class variance binary method to generate a second contrast difference fog map by second enlarging 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 comprises: If the transmittance of the road surface area is lower than the transmittance of its surroundings, the transmittance of the current road surface area is subjected to a quadratic square root process through an image grayscale nonlinear compression function, and a first contrast difference fog image 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 surroundings; 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 as the road surface area, and the transmittance of the current area is configured to 1 through a binarization function; Otherwise, the current area is determined as 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, different levels of atmospheric extinction coefficients corresponding to the scattering rate intervals of different haze levels are statistically calculated through a scattering rate statistical model, wherein the different haze levels include slight haze, light haze, moderate haze, and severe 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 fogging processing models under different haze levels by using atmospheric extinction coefficients of different haze levels and according to the deformed fog degradation model includes: Based on the original traffic image, the modified transmittance fog image 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 coefficients of different levels, the fog processing models under different haze levels are generated through the deformed fog degradation model; Through the fog processing models under different haze levels, haze images under different haze levels are generated; The deformed fog degradation model is: Among them, the 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, characterized in that: The dark channel processing based on dark channel priori 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, a three-channel pixel value corresponding to the local window is 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 minimum window 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; 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 at pixel x in the dark channel image.
9. The simulated fogging method according to claim 2, characterized in that: The step of determining a high-brightness pixel area in a dark channel image, determining an original traffic area corresponding to the high-brightness pixel area in an original traffic image, and determining the three-channel values of the original traffic area as estimated values of the atmospheric light value comprises: 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; The atmospheric light value estimation model: 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.
10. A simulated fogging system for road traffic scene images, characterized in that: include: Based on the simulated fogging method according to any one of claims 1 to 9, the simulated fogging system comprises a simulated fogging platform, and the simulated fogging platform is used for: Based on the original traffic image, a dark channel image is generated through dark channel processing based on dark channel prior theory; 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 the three-channel values of the original traffic area are determined as estimated values of the atmospheric light value; 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 intensity of the control defogging effect and determine the balance point of the dark channel prior application, thereby ensuring the accurate estimation of the transmittance; Based on the initial penetration fog map and the estimated image transmittance, the contrast difference between the road surface and its surroundings is enlarged by correcting the transmittance of the road surface area, and a corrected transmittance fog map is generated to ensure that the transmittance of the road surface area can correctly reflect its position in the scene and the degree of light attenuation; Based on the modified transmittance fog map, the atmospheric extinction coefficient corresponding to the scattering rate interval of different haze levels is determined by introducing the scattering rate statistical model, so as to provide the corresponding haze concentration processing basis for the original traffic image according to the characteristics of the scattering rate; Based on the original traffic image, the atmospheric extinction coefficient of different haze levels is used to generate the fog processing model under different haze levels according to the deformed fog degradation model, so as to obtain the haze images under different haze levels according to the atmospheric extinction coefficient under different haze concentrations.
Citation Information
Patent Citations
Traffic image fog adding method under digital twinning
CN114998147A
Intelligent driving high-precision scene generation method and system based on synthetic fog
CN118657879A
Method for image defogging based on dark channel prior
US20240104702A1
Cited By
Panoramic fog scene image generation method and device based on depth information
CN122089603A
Simulation method and device of fog environment and storage medium
CN122175842A