Traffic scene image defogging method and system based on improved dark channel

Through the improved dark channel method, combined with corrosion and atmospheric light estimation, and refined transmission image processing, the problems of real-time performance and color distortion of the existing defogging algorithm in foggy image processing are solved, and more accurate and natural dehazing is achieved. Fog effect, suitable for traffic monitoring systems.

CN118747727AActive Publication Date: 2024-10-08JIANGNAN UNIV
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410693970.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-08
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

Existing defogging algorithms rely on image structural features, have poor real-time performance and serious color distortion, especially when the image gradient is not obvious, and perform poorly, and methods based on statistics and transformation are essentially image enhancement methods and fail to effectively remove them. The effect of fog.

Method used

Using an improved dark channel method, the corrosion image is generated through the corrosion operation, the atmospheric light value is estimated, the transmission map is generated and refined, combined with color fidelity adjustment, the dehazed image is generated, including a corrosion module, a calculation module and a data processing module .

Benefits of technology

It can effectively remove the blur and color distortion of foggy images, improve image details and contrast, and reduce the loss of important information. It is suitable for traffic monitoring systems and ensures traffic safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747727A_ABST
    Figure CN118747727A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and particularly provides a traffic scene image defogging method and system based on an improved dark channel, and the method comprises the steps: obtaining a traffic scene image; performing corrosion operation on the traffic scene image to generate a corrosion image; calculating the corrosion image according to an improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value; calculating the traffic scene image through dark channel estimation to generate a transmission graph; the transmission image is refined, and a refined transmission image is generated; generating a defogged image according to the traffic scene image, the atmospheric light estimation value and the refined transmission image; and performing color fidelity processing on the defogged image to obtain a target image. A series of problems that the image shot in foggy days is easily influenced by fog or haze, so that the details of the image are fuzzy, the contrast ratio is low, and important information of the image is lost are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for defogging traffic scene images based on an improved dark channel. Background Art

[0002] In order to ensure the normal operation of the traffic monitoring system, the research on defogging is of great practical significance. However, the current defogging methods still have problems such as relying on the structural characteristics of the image, poor real-time performance, and poor performance for images with severe color distortion and unclear image gradient structure.

[0003] The defogging algorithm based on the physical model mainly considers the imaging principle of fog and the light attenuation principle of foggy days, and considers the scattering and attenuation of light to establish a model. The atmospheric scattering model is mainly composed of the incident light attenuation model and the atmospheric light imaging model. By analyzing the captured image light, the image acquisition process is modeled according to the light scattering effect and the atmospheric optical model, thereby decomposing the defogging image. However, the defogging effect depends on the structural characteristics of the image, and the subsequent processing does not restore the color of the image to a high degree.

[0004] The dehazing algorithm based on non-physical models achieves the dehazing effect by enhancing image details and strengthening image edges, thereby obtaining more detailed information. Specific algorithms include: histogram equalization, color level enhancement algorithm, Retinex algorithm, wavelet and curvelet transform, etc. The biggest feature of the Retinex dehazing algorithm is the constancy of color, that is, it is believed that the color and brightness of objects perceived by the human eye are only related to the interaction between light and objects. The histogram equalization algorithm achieves the purpose of dehazing by uniformizing the grayscale distribution of the image and enhancing the visual contrast. Wavelet transform decomposes the original signal into sub-signals with different frequency characteristics and directional characteristics, and localizes the image through local features so that the image is enhanced at multiple scales and the useful information is amplified to achieve the purpose of enhancing the image.

[0005] The dehazing algorithm based on non-physical models mainly uses the mathematical and statistical features of the image itself for restoration. Whether it is the algorithm based on histogram equalization, Retinex dehazing algorithm, wavelet transform or homomorphic filtering algorithm, the essence of them is to amplify the details of the original image through certain statistics and transformations, and their essence is image enhancement.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] To this end, the technical problem to be solved by the present invention is to overcome the problems in the prior art, whether it is the histogram equalization-based algorithm, the Retinex dehazing algorithm, or the wavelet transform and homomorphic filtering algorithm, which essentially amplify the detail features of the original image through certain statistics and transformations, and are essentially image enhancement methods.

[0008] In order to solve the above technical problems, a first aspect of the present invention provides a traffic scene image defogging method based on an improved dark channel, the method comprising:

[0009] Acquire traffic scene images;

[0010] Performing an erosion operation on the traffic scene image to generate an eroded image;

[0011] Calculating the corrosion image according to an improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value;

[0012] Calculating the traffic scene image by dark channel estimation to generate a transmission map;

[0013] Refining the transmission map to generate a refined transmission map;

[0014] generating a defogging image according to the traffic scene image, the atmospheric light estimation value and the refined transmission map;

[0015] The dehazed image is processed for color fidelity to obtain a target image.

[0016] In one embodiment of the present invention, the step of performing an erosion operation on the traffic scene image to generate an eroded image includes:

[0017] generating a minimum pixel value according to the traffic scene image;

[0018] Calculating the minimum pixel value through a minimum filter to generate a dark channel value;

[0019] The dark channel value is calculated to generate a corrosion image.

[0020] In one embodiment of the present invention, the step of generating a minimum pixel value according to the traffic scene image comprises:

[0021] Converting the traffic scene image into a grayscale image;

[0022] Traversing each pixel of the grayscale image by a sliding window technique;

[0023] The minimum pixel value within the sliding window is calculated.

[0024] In one embodiment of the present invention, the step of calculating the dark channel value to generate the eroded image includes:

[0025] Selecting the minimum dark channel value among the dark channel values;

[0026] The minimum dark channel value is calculated according to the erode function to obtain an eroded image.

[0027] In one embodiment of the present invention, the step of calculating the corrosion image according to the improved atmospheric light estimation algorithm to obtain the atmospheric light estimation value includes:

[0028] Acquire a plurality of pixel points from the eroded image;

[0029] Calculate the color value of the pixel;

[0030] A plurality of the color values ​​are averaged to obtain an atmospheric light estimation value.

[0031] In one embodiment of the present invention, the step of refining the transmission map to generate a refined transmission map includes:

[0032] The transmission map is refined according to guided filtering to generate a refined transmission map.

[0033] In one embodiment of the present invention, the step of performing color fidelity processing on the defogging image to obtain a target image includes:

[0034] Adjusting the brightness and contrast of the dehazed image to generate an initial dehazed image;

[0035] Determining whether the initial dehazed image achieves color balance;

[0036] If yes, generate the target image;

[0037] If not, the brightness and contrast of the dehazed image are adjusted until color balance is achieved.

[0038] A second aspect of the present invention provides a traffic scene image defogging system based on an improved dark channel, the system comprising: a corrosion module, a calculation module and a data processing module;

[0039] The corrosion module is configured to: acquire a traffic scene image; perform a corrosion operation on the traffic scene image to generate a corrosion image;

[0040] The calculation module is configured to: calculate the corrosion image according to the improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value; calculate the traffic scene image by dark channel estimation to generate a transmission map;

[0041] The data processing module is configured to: refine the transmission map to generate a refined transmission map; generate a defogging image according to the traffic scene image, the atmospheric light estimation value and the refined transmission map; and perform color fidelity processing on the defogging image to obtain a target image.

[0042] The third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect or any possible implementation of the first aspect is implemented.

[0043] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.

[0044] The above technical solution of the present invention has the following advantages compared with the prior art:

[0045] The traffic scene image defogging method and system based on the improved dark channel described in the present invention solves a series of problems such as images taken on foggy days are easily affected by fog or haze, resulting in blurred image details, low contrast and loss of important image information. In addition, it can also be combined with a traffic monitoring system to effectively process traffic image information, ensure the normal operation of the traffic monitoring system, reduce traffic safety hazards, and contribute to the transportation industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0047] Figure 1 It is a flow chart of a traffic scene image defogging method and system based on an improved dark channel provided by the present invention;

[0048] Figure 2 It is a system architecture diagram of a traffic scene image defogging method and system based on an improved dark channel provided by the present invention. DETAILED DESCRIPTION

[0049] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0050] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0051] Reference Figure 1 As shown, the present invention provides a traffic scene image defogging method based on an improved dark channel, the method comprising:

[0052] S100, acquiring a traffic scene image;

[0053] In step S100, an input traffic scene image is received, and the traffic scene image is RGB image data. In addition, the present application supports various common image formats, such as JPEG, PNG, etc.

[0054] S200, performing a corrosion operation on the traffic scene image to generate a corrosion image;

[0055] In step S200, the traffic scene image is subjected to an erosion operation, and the step of generating an eroded image includes: generating a minimum pixel value according to the traffic scene image; calculating the minimum pixel value through a minimum value filter to generate a dark channel value; and calculating the dark channel value to generate an eroded image. The step of generating a minimum pixel value according to the traffic scene image includes: converting the traffic scene image into a grayscale image; traversing each pixel of the grayscale image through a sliding window technique; and calculating the minimum pixel value within the sliding window. The step of calculating the dark channel value to generate an eroded image includes: selecting the minimum dark channel value among the dark channel values; and calculating the minimum dark channel value according to an erode function to obtain an eroded image.

[0056] In the actual application scenario, the input RGB image is converted to a grayscale image. The sliding window technique is used to traverse each pixel of the grayscale image and calculate the minimum value within the sliding window. For each pixel in the sliding window, the dark channel is calculated using a minimum filter. Since the original image data usually exists in the form of a multidimensional array in computer vision and image processing, it can be operated directly on the multidimensional array. The minimum value of the three RGB channel values ​​is selected, and the minimum value is extracted using the erosion operation. Then, the smallest of these minimum values ​​is selected as the dark channel value of the pixel. The calculated minimum dark channel value is eroded using the erode function to reduce the range of the area with higher brightness. The core function of the erosion operation is to reduce the range of the area with higher brightness so as to more accurately simulate the area with the least illumination. This step helps to more accurately estimate the thickness of the propagation medium in the dehazing algorithm. The shape and size of the structural element in the erosion operation are adjusted according to the specific application to obtain the best performance. The optimized method reduces the calculation time by reducing array operations and utilizing built-in functions. The optimized method reduces the storage requirements for temporary data because there is no need to store separate color channels.

[0057] S300, calculating the corrosion image according to an improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value;

[0058] In step S300, the corrosion image is calculated according to the improved atmospheric light estimation algorithm, and the step of obtaining the atmospheric light estimation value includes: obtaining multiple pixel points from the corrosion image; calculating the color values ​​of the pixel points; and averaging the multiple color values ​​to obtain the atmospheric light estimation value.

[0059] In practical application scenarios, the current atmospheric light estimation method uses some of the brightest pixels in the image. This method may be affected by abnormal bright spots in the image. We introduce a more robust statistical method based on the estimation of the average mode, which helps to reduce the impact of outliers. The estimation of atmospheric light is a key step. This application aims to improve the naturalness and accuracy of the overall dehazing effect through an improved atmospheric light estimation method. The core of this method is to select the pixel with the highest dark channel value in the image, that is, the area most affected by atmospheric light, and then calculate the average color value of these areas as the estimated value of atmospheric light. The specific method is:

[0060] Get the brightest pixels from the eroded image. First, calculate the number of pixels to consider, which is based on the dark channel of the image and a user-defined percentage. This percentage determines what proportion of the brightest pixels are selected from all pixels to estimate the atmospheric light. Sort all the pixel values ​​of the dark channel and get the index of the brightest pixels. Then use these indices to extract the corresponding color values ​​from the original image. Average the color values ​​of the selected brightest pixels and use the result as the estimate of the atmospheric light. This average is calculated independently for each color channel over all the selected pixels. Exclude outliers, such as color points that deviate too far from the average, to prevent extreme values ​​from affecting the final result. The function finally returns the calculated color value of the atmospheric light, which will be used in subsequent steps.

[0061] S400, calculating the traffic scene image by dark channel estimation to generate a transmission map;

[0062] In step S400, the traffic scene image is calculated by dark channel estimation to generate a transmission map, which describes the degree of light absorption by the scene depth.

[0063] S500, refining the transmission map to generate a refined transmission map;

[0064] In step S500, the transmission map is refined, and the step of generating a refined transmission map includes: refining the transmission map according to guided filtering to generate a refined transmission map.

[0065] In practical application scenarios, refining the transmission map is critical for restoring image details and colors. Using guided filtering to refine the transmission map is an effective method because it can remove image noise and over-smoothed areas while maintaining edges. We define a function to implement guided filtering using OpenCV's cv2.ximgproc.guidedFilter method. This function requires four parameters: the guide image I (original image), the input image p (the image to be filtered, such as a rough transmission map), the radius r (which defines the size of the local area of ​​the filter), and the regularization parameter eps (which controls the degree of smoothing).

[0066] After calculating the preliminary transmission map et (for example, the transmission map obtained by dark channel prior), we use guided filtering to refine this transmission map to obtain a refined transmission map. In this process, the original image I is used as the guided map and the preliminary transmission map et is used as the image to be filtered. By using guided filtering to refine the transmission map, the quality of image dehazing can be significantly improved and the visual effect of the real scene can be better restored.

[0067] S600, generating a defogging image according to the traffic scene image, the atmospheric light estimation value and the refined transmission map;

[0068] In step S600, a dehazed image is obtained by jointly restoring the traffic scene image, the atmospheric light estimation value and the refined transmission map.

[0069] S700: Perform color fidelity processing on the defogging image to obtain a target image.

[0070] In step S700, the dehazed image is processed for color fidelity, and the steps of obtaining a target image include: adjusting the brightness and contrast of the dehazed image to generate an initial dehazed image; determining whether the initial dehazed image achieves color balance; if so, generating a target image; if not, adjusting the brightness and contrast of the dehazed image until color balance is achieved.

[0071] In practical application scenarios, in order to improve the color fidelity of the image after dehazing, adding color balancing processing is an important step. It can help adjust the color distribution of the image to make it more balanced and natural. By adjusting the brightness and contrast of the dehazed image to achieve color balance, the visual effect of the image is improved. If the dehazed image does not achieve color balance, it is necessary to readjust the brightness and contrast of the dehazed image until color balance is achieved.

[0072] Color balancing improves the color distribution by adjusting the brightness boundaries of an image. The specific steps include calculating the lower and upper brightness bounds, then limiting the color values ​​in the image to be between these two limits and remapping them into the entire color space.

[0073] In the final stage of the dehazing algorithm, the dehazed image is color balanced. This step is performed after the image is restored in order to improve the visual quality of the image.

[0074] Reference Figure 2 As shown, the second aspect of the present invention provides a traffic scene image defogging system based on an improved dark channel, the system comprising: a corrosion module 100, a calculation module 200 and a data processing module 300;

[0075] The corrosion module 100 is configured to: acquire a traffic scene image; perform a corrosion operation on the traffic scene image to generate a corrosion image;

[0076] The calculation module 200 is configured to: calculate the corrosion image according to the improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value; calculate the traffic scene image by dark channel estimation to generate a transmission map;

[0077] The data processing module 300 is configured to: refine the transmission map to generate a refined transmission map; generate a defogged image based on the traffic scene image, the atmospheric light estimation value and the refined transmission map; and perform color fidelity processing on the defogged image to obtain a target image.

[0078] The effects of the above-mentioned system when applying the above-mentioned method can be found in the description of the above-mentioned method embodiment, which will not be repeated here.

[0079] The third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect or any possible implementation of the first aspect is implemented.

[0080] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.

[0081] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0085] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A traffic scene image defogging method based on an improved dark channel, characterized in that: The method comprises: Acquire traffic scene images; Performing an erosion operation on the traffic scene image to generate an eroded image; Calculating the corrosion image according to an improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value; Calculating the traffic scene image by dark channel estimation to generate a transmission map; Refining the transmission map to generate a refined transmission map; generating a defogging image according to the traffic scene image, the atmospheric light estimation value and the refined transmission map; The dehazed image is processed for color fidelity to obtain a target image.

2. The traffic scene image defogging method based on an improved dark channel according to claim 1, characterized in that: The step of performing an erosion operation on the traffic scene image to generate an eroded image comprises: generating a minimum pixel value according to the traffic scene image; Calculating the minimum pixel value through a minimum value filter to generate a dark channel value; The dark channel value is calculated to generate a corrosion image.

3. The traffic scene image defogging method based on an improved dark channel according to claim 2, characterized in that: The step of generating a minimum pixel value according to the traffic scene image comprises: Converting the traffic scene image into a grayscale image; Traversing each pixel of the grayscale image by a sliding window technique; The minimum pixel value within the sliding window is calculated.

4. The traffic scene image defogging method based on an improved dark channel according to claim 2, characterized in that: The step of calculating the dark channel value to generate a corrosion image includes: Selecting the minimum dark channel value among the dark channel values; The minimum dark channel value is calculated according to the erode function to obtain an eroded image.

5. The traffic scene image defogging method based on an improved dark channel according to claim 1, characterized in that: The step of calculating the corrosion image according to the improved atmospheric light estimation algorithm to obtain the atmospheric light estimation value comprises: Acquire a plurality of pixel points from the eroded image; Calculate the color value of the pixel; A plurality of the color values ​​are averaged to obtain an atmospheric light estimation value.

6. The traffic scene image defogging method based on an improved dark channel according to claim 1, characterized in that: The step of refining the transmission map to generate a refined transmission map includes: The transmission map is refined according to guided filtering to generate a refined transmission map.

7. The traffic scene image defogging method based on an improved dark channel according to claim 1, characterized in that: The step of performing color fidelity processing on the defogging image to obtain a target image comprises: Adjusting the brightness and contrast of the dehazed image to generate an initial dehazed image; Determining whether the initial dehazed image achieves color balance; If yes, generate the target image; If not, the brightness and contrast of the dehazed image are adjusted until color balance is achieved.

8. A traffic scene image defogging system based on an improved dark channel, characterized in that: The system comprises: a corrosion module, a calculation module and a data processing module; The corrosion module is configured to: acquire a traffic scene image; perform corrosion operation on the traffic scene image to generate a corrosion image; The calculation module is configured to: calculate the corrosion image according to the improved atmospheric light estimation algorithm to obtain an atmospheric light estimation value; calculate the traffic scene image by dark channel estimation to generate a transmission map; The data processing module is configured to: refine the transmission map to generate a refined transmission map; generate a defogging image according to the traffic scene image, the atmospheric light estimation value and the refined transmission map; and perform color fidelity processing on the defogging image to obtain a target image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the traffic scene image defogging method based on an improved dark channel as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a traffic scene image defogging method based on an improved dark channel as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Remote sensing image de-fogging method based on dark channel prior model

    CN106530257A

  • Image defogging method and system

    CN106780380A

  • Improved dark channel prior single width atomization image restoration method based on physical model

    CN107274366A

  • Dark channel and image segmentation-based traffic image defogging method and system

    CN107301623A

  • Dark primary color prior image defogging method through image guided filter

    CN107798670A