Video defogging method and device, electronic equipment and medium

By acquiring the background image and dark channel image of the foggy video and performing recursive filtering, the atmospheric transmittance estimate is directly determined, which solves the problems of complexity and low efficiency in existing video defogging processes and achieves a highly efficient video defogging effect.

CN120852228APending Publication Date: 2025-10-28GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510859379.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing technologies for video dehazing involve complex processes and high computational demands, resulting in low dehazing efficiency.

Method used

By acquiring the background image of the foggy video, the dark channel image is determined and recursive filtering is performed to obtain the target image. The atmospheric transmittance is directly estimated based on the target image, and finally defogging is performed.

Benefits of technology

It simplifies the dehazing process, reduces computational load, and improves video dehazing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852228A_ABST
    Figure CN120852228A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video defogging method and device, electronic equipment and a medium. The method comprises the following steps: acquiring a foggy video; determining a background image of the foggy video; determining a dark channel image of the background image according to the background image of the foggy video; performing recursive filtering processing on the dark channel image to obtain a target image; determining an atmospheric transmissivity estimation value according to the target image; and carrying out defogging processing on the foggy video according to the atmospheric transmissivity estimation value. According to the embodiment of the invention, the target image is obtained by carrying out recursive filtering processing on the dark channel image, the atmospheric transmissivity estimation value can be directly determined so as to carry out defogging processing, the process is simple, the calculation amount is small, and the defogging efficiency of the video can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video processing technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for dehazing video. Background Technology

[0002] Video images are a crucial source of information about our surroundings, but harsh environments such as strong light, fog, and darkness can hinder image capture, leading to blurred or indistinct images. This has necessitated the development of video image processing technologies, which have broad application prospects in fields such as video recording, security monitoring, and transportation, ensuring the safety and well-being of people in their daily lives.

[0003] Dehazing of foggy videos is a crucial video processing technique. Common techniques involve calculating the atmospheric light intensity of a foggy image using a dark channel prior, then using this intensity to calculate a rough value of the atmospheric transmittance. Finally, pixel-level fusion is used to optimize this rough transmittance, resulting in the final atmospheric transmittance, which is then applied to all frames of the video for dehazing.

[0004] Because the above defogging process is quite complex and involves a large amount of calculation, the defogging efficiency is not high. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a video dehazing method, apparatus, electronic device, and computer-readable storage medium that overcomes or at least partially solves the above problems.

[0006] On one hand, embodiments of the present invention provide a method for dehazing videos, the method comprising:

[0007] Get foggy videos;

[0008] Determine the background image of the foggy video;

[0009] Based on the background image of the foggy video, determine the dark channel image of the background image;

[0010] The dark channel image is recursively filtered to obtain the target image;

[0011] Based on the target image, determine the estimated atmospheric transmittance.

[0012] The foggy video is defogging based on the atmospheric transmittance estimate.

[0013] Optionally, the recursive filtering process performed on the dark channel image to obtain the target image includes:

[0014] The dark channel image is filtered to obtain the filtered image;

[0015] The filtered image is subjected to the filtering process again until the preset conditions are met;

[0016] The filtered image obtained when the preset conditions are met will be used as the target image.

[0017] Optionally, the recursive filtering process on the dark channel image to obtain the filtered image includes:

[0018] Determine the horizontal domain transform derivative and the vertical domain transform derivative of the background image;

[0019] Based on the horizontal domain transform derivative, the pixels of the dark channel image are subjected to horizontal filtering to obtain a horizontally filtered image.

[0020] Based on the vertical domain transform derivative, the pixels of the dark channel image are subjected to vertical filtering to obtain a vertically filtered image.

[0021] The filtered image is obtained based on the horizontally filtered image and the vertically filtered image.

[0022] Optionally, determining the horizontal domain transform derivative and the vertical domain transform derivative of the background image includes:

[0023] Determine the rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0024] Determine the absolute difference in pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0025] Determine the rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0026] Determine the absolute difference in pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0027] By combining the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the horizontal direction of the background image, the horizontal domain transform derivative of the background image is obtained.

[0028] The vertical domain transform derivative of the background image is obtained by combining the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the vertical direction.

[0029] Optionally, determining the target background image of the foggy video includes:

[0030] The foggy video is segmented to obtain multiple foggy video segments;

[0031] Determine the average pixel value of each pixel in the foggy video segment;

[0032] The background image of the foggy video clip is determined based on the average pixel value of each pixel in the foggy video clip.

[0033] Optionally, the background image of the foggy video clip is determined based on the initial background image of the foggy video clip;

[0034] The determined background image of the foggy video clip includes:

[0035] The initial background image of the foggy video clip is downsampled to obtain a background image; the number of pixels in the background image is less than the number of pixels in the initial background image.

[0036] Optionally, the method further includes:

[0037] Based on the pixels of the dark channel image, determine the estimated atmospheric light intensity;

[0038] The process of dehazing the foggy video based on the atmospheric transmittance estimate includes:

[0039] Based on the estimated atmospheric transmittance and the estimated atmospheric light intensity, the foggy video is defogging.

[0040] Optionally, determining the atmospheric light intensity estimate based on the pixels of the dark channel image includes:

[0041] The pixels in the dark channel image are sorted according to their brightness to obtain the sorting result;

[0042] Based on the sorting results, the target pixels are selected.

[0043] Based on the pixel value of the target pixel, the average pixel value of the target pixel is obtained, and the average pixel value of the target pixel is used as the atmospheric light intensity estimate.

[0044] Optionally, the step of dehazing the foggy video based on the atmospheric transmittance estimate includes:

[0045] If the estimated atmospheric transmittance is greater than the preset atmospheric transmittance, then the foggy video is defogging based on the estimated atmospheric transmittance.

[0046] If the estimated atmospheric transmittance is less than the preset atmospheric transmittance, then the foggy video is defogging based on the preset atmospheric transmittance.

[0047] On the other hand, embodiments of the present invention provide a video dehazing device, the device comprising:

[0048] The foggy video acquisition module is used to acquire foggy videos;

[0049] Background image determination module, used to determine the background image of the foggy video;

[0050] The dark channel image determination module is used to determine the dark channel image of the background image based on the background image of the foggy video.

[0051] The target image determination module is used to perform recursive filtering on the dark channel image to obtain the target image;

[0052] An atmospheric transmittance determination module is used to determine an estimated value of atmospheric transmittance based on the target image.

[0053] The defogging module is used to defog the foggy video based on the atmospheric transmittance estimate.

[0054] Optionally, the target image determination module includes:

[0055] The filtering submodule is used to filter the dark channel image to obtain the filtered image.

[0056] The preset condition satisfaction submodule is used to perform the filtering process on the filtered image again until the preset condition is met.

[0057] The first target image determination submodule uses the filtered image obtained when the preset conditions are met as the target image.

[0058] Optionally, the filtering submodule includes:

[0059] A domain transform derivative determination unit is used to determine the horizontal domain transform derivative and the vertical domain transform derivative of the background image;

[0060] The horizontally filtered image determination unit is used to perform horizontal filtering on the pixels of the dark channel image according to the horizontal domain transformation derivative to obtain a horizontally filtered image.

[0061] A vertically filtered image determination unit is used to perform vertical filtering on the pixels of the dark channel image according to the vertical domain transformation derivative to obtain a vertically filtered image.

[0062] The filtered image determination unit is used to obtain the filtered image based on the horizontal filtered image and the vertical filtered image.

[0063] Optionally, the domain transformation derivative determination unit includes:

[0064] The first rate of change determination subunit is used to determine the rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0065] The first absolute difference determination subunit is used to determine the absolute difference of pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0066] The second rate of change determination subunit is used to determine the rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0067] The second absolute difference determination subunit is used to determine the absolute difference of pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0068] The first domain transform derivative determination subunit is used to combine the pixel value change rate and the absolute difference of pixel value between adjacent pixels in the horizontal direction of the background image to obtain the horizontal domain transform derivative of the background image.

[0069] The second domain transform derivative determination subunit is used to combine the pixel value change rate and the absolute difference of the pixel value between adjacent pixels in the vertical direction of the background image to obtain the vertical domain transform derivative of the background image.

[0070] Optionally, the background image determination module includes:

[0071] The video segment determination submodule is used to segment the foggy video to obtain multiple foggy video segments;

[0072] The average pixel value determination submodule is used to determine the average pixel value of each pixel in the foggy video segment;

[0073] The first background image determination submodule is used to determine the background image of the foggy video clip based on the average pixel value of each pixel in the foggy video clip.

[0074] Optionally, the background image of the foggy video clip is determined based on the initial background image of the foggy video clip;

[0075] The first background image determination submodule includes:

[0076] The downsampling processing unit is used to downsample the initial background image of the foggy video clip to obtain a background image; the number of pixels in the background image is less than the number of pixels in the initial background image.

[0077] Optionally, the device further includes:

[0078] An atmospheric light intensity determination module is used to determine an estimated value of atmospheric light intensity based on the pixels of the dark channel image.

[0079] The defogging module includes:

[0080] The first defogging processing submodule is used to perform defogging processing on the foggy video based on the atmospheric transmittance estimate and the atmospheric light intensity estimate.

[0081] Optionally, the atmospheric light intensity determination module includes:

[0082] The sorting submodule is used to sort the pixels in the dark channel image according to their brightness to obtain the sorting result;

[0083] The pixel filtering submodule is used to filter and obtain target pixels based on the sorting results;

[0084] The first atmospheric light intensity determination submodule is used to obtain the average pixel value of the target pixel based on the pixel value of the target pixel, and use the average pixel value of the target pixel as the atmospheric light intensity estimate.

[0085] Optionally, the defogging module includes:

[0086] The first defogging processing submodule is used to perform defogging processing on the foggy video based on the atmospheric transmittance estimate if the atmospheric transmittance estimate is greater than the atmospheric transmittance preset value.

[0087] The second defogging processing submodule is used to perform defogging processing on the foggy video according to the preset atmospheric transmittance value if the estimated atmospheric transmittance value is less than the preset atmospheric transmittance value.

[0088] On the other hand, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the video dehazing method as described above.

[0089] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the video dehazing method described above.

[0090] The embodiments of the present invention have the following advantages:

[0091] This invention first acquires a foggy video and determines its background image and dark channel image. Then, it performs recursive filtering on the dark channel image to obtain a target image. The atmospheric transmittance estimate is directly determined from this target image, and finally, the foggy video is dehazed based on this atmospheric transmittance estimate. The target image obtained through recursive filtering directly determines the atmospheric transmittance estimate; the process is simple and computationally efficient, thus improving the dehazing efficiency of the video. Attached Figure Description

[0092] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0093] Figure 1 This is a flowchart of a video dehazing method provided in an embodiment of the present invention;

[0094] Figures 2A to 2F This is an application example diagram of a video dehazing method provided in an embodiment of the present invention;

[0095] Figure 3 This is a structural block diagram of a video defogging device provided in an embodiment of the present invention. Detailed Implementation

[0096] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0097] Video images are a crucial source of information about our surroundings, but harsh environments such as strong light, fog, and darkness can hinder image capture, leading to blurred or indistinct images. This has necessitated the development of video image processing technologies, which have broad application prospects in fields such as video recording, security monitoring, and transportation, ensuring the safety and well-being of people in their daily lives.

[0098] With the continuous improvement of science and technology, video surveillance equipment is increasingly used in daily life. However, in foggy weather, video images obtained by imaging equipment are severely degraded due to atmospheric scattering, resulting in a yellowish or whitish overall color and a sharp decrease in contrast, making it difficult to identify object features. Therefore, to improve the application value of video images in foggy weather, it is necessary to defog the degraded video to obtain clear video.

[0099] Video dehazing requires attention not only to the correlation between adjacent frames but also to real-time performance. Therefore, video dehazing is more challenging than image dehazing, and has gradually become a popular research area. Current techniques typically use dark channel priors to calculate the atmospheric light intensity of the foggy image, then use this intensity to calculate a rough value of the atmospheric transmittance. This rough value is then optimized using pixel-level fusion to obtain the final atmospheric transmittance, which is then used to dehaze all frames of the video. This dehazing process is complex and computationally intensive, resulting in low efficiency.

[0100] One of the core concepts of this invention is that, after determining the background image of a foggy video and its dark channel image, a target image is obtained by recursively filtering the dark channel image. An atmospheric transmittance estimate can then be directly determined from this target image, and finally, the foggy video is dehazed based on this atmospheric transmittance estimate. The process is simple and computationally intensive, thereby improving the dehazing efficiency of the video.

[0101] Figure 1 This is a flowchart of a video dehazing method provided in an embodiment of the present invention.

[0102] like Figure 1 As shown, the method may specifically include the following steps:

[0103] Step 101: Obtain the foggy video.

[0104] In some embodiments, the foggy video can be video captured by shooting devices such as monitors, mobile phones, computers, and cameras. This invention does not limit the method of acquiring foggy video.

[0105] In practical applications, users can input foggy videos into electronic devices or systems with defogging capabilities. These devices or systems can then use the defogging method of this invention to achieve the defogging function, thereby obtaining a defogging video.

[0106] Step 102: Determine the background image of the foggy video.

[0107] In foggy videos, the background image typically refers to a relatively static background layer in the scene, such as fixed buildings, mountains, or roads, while the foreground consists of moving objects (such as vehicles or pedestrians). In dehazing algorithms based on atmospheric scattering models, the background image serves as a global reference for parameters such as atmospheric light intensity and atmospheric transmittance. The background image can act as a benchmark for dehazing, avoiding interference from foreground objects in parameter estimation.

[0108] The dehazing algorithm based on the atmospheric scattering model transforms the dehazing problem into the task of estimating atmospheric light intensity and atmospheric transmittance through physical modeling. The core lies in how to accurately estimate these two key parameters. Once the atmospheric light intensity and atmospheric transmittance are determined, the fogged image can be effectively restored to a dehazed image through the fog degradation calculation formula.

[0109] In some embodiments, step 102 specifically includes the following sub-steps:

[0110] Sub-step S11: The foggy video is segmented to obtain multiple foggy video segments.

[0111] Based on the total number of frames in the foggy video, the video is divided into segments with the same number of frames. A common background image is determined for each segment, thus establishing a common atmospheric light intensity and atmospheric transmittance. Using this common atmospheric light intensity and transmittance, each frame within the corresponding foggy video segment is dehazed, ultimately synthesizing a complete dehazed video.

[0112] As an example, if the total number of frames in foggy video A is 960, then foggy video A will be divided into 6 foggy video segments of 150 frames each and 1 foggy video segment of 60 frames each.

[0113] It is worth noting that the fewer the number of video segments, the more accurate the estimated atmospheric light intensity and atmospheric transmittance, resulting in better dehazing. However, as the number of video segments decreases, the video processing time may increase. Therefore, in practical applications, the number of video segments can be dynamically adjusted according to actual needs; this invention does not impose a specific value on the number of video segments.

[0114] Sub-step S12: Determine the average pixel value of each pixel in the foggy video segment.

[0115] Sub-step S13: Determine the background image of the foggy video segment based on the average pixel value of each pixel in the foggy video segment.

[0116] In some embodiments, the mean method is used to calculate the background image of each foggy video segment, determining the average pixel value of each pixel in the foggy video segment, and then using the average pixel value at each pixel location as the pixel value at the corresponding location in the background image. Based on the pixel values ​​at all locations in the background image, the background image is obtained using the following formula:

[0117]

[0118] Among them, I background Let n be the background image, n be the number of frames in the video clip, and I(x,y) be the pixel value of the video frame image I at position (x,y).

[0119] Determining the background image using the mean method can smooth out interference from abnormal bright spots and reduce estimation bias caused by image noise or local highlights. Furthermore, video dehazing typically requires real-time processing; the mean method only requires simple arithmetic operations, without iteration or optimization, making it fast and suitable for video stream processing, especially for rapid estimation of each frame or keyframe.

[0120] In some embodiments, the background image of the foggy video clip is determined based on an initial background image of the foggy video clip.

[0121] To improve the speed of calculating atmospheric light intensity and atmospheric scattering rate estimates, the background image determined by the mean method is used as the initial background image. The initial background image is further processed to reduce its pixel count, resulting in the final background image. The atmospheric light intensity and atmospheric scattering rate estimates are then calculated based on this background image, thereby reducing the amount of computation and improving the efficiency of defogging.

[0122] In some embodiments, sub-step S13 specifically includes the following sub-steps:

[0123] Sub-step S131: The initial background image of the foggy video clip is downsampled to obtain a background image; the number of pixels in the background image is less than the number of pixels in the initial background image.

[0124] In some embodiments, the downsampling process specifically includes: determining a downsampling factor; determining a mapping relationship between the pixel positions of the background image and the pixel positions of the initial target image based on the downsampling factor; determining the pixel value of each pixel in the background image based on the mapping relationship between the pixel positions of the background image and the pixel positions of the initial image, and the pixel value of the initial background image; and obtaining the background image based on the pixel value of each pixel in the background image.

[0125] The nearest neighbor interpolation downsampling method is used to reduce the length and width of the background image, respectively. The calculation formula is as follows:

[0126]

[0127] Among them, F() 1 / c This is a nearest neighbor interpolation downsampling algorithm, where c is the downsampling factor. The downsampling factor is used to determine the nearest pixel value of the target pixel in the initial background image, which is then used as the target pixel to obtain the final background image.

[0128] As an example, the initial background image has a size of 1080×1920. By using nearest neighbor interpolation downsampling to reduce both the length and width of the initial background image by a factor of 10, a background image with a size of 108×192 is obtained, reducing the number of pixels to 1 / 100 of the original. Based on this, the atmospheric light intensity estimate and atmospheric scattering rate estimate can be calculated, which can greatly reduce the amount of computation and improve the dehazing efficiency.

[0129] Step 103: Determine the dark channel image of the background image based on the background image of the foggy video.

[0130] In some embodiments, the pixel with the lowest pixel value in the RGB three channels of the background image is called a dark pixel, and the channel containing the dark pixel is called the dark channel. The formula for calculating the dark channel image is as follows:

[0131]

[0132] in, This represents one color channel of the RGB three-channel image, Ω(x) represents a small region centered at pixel x, and (r,g,b) represents the color space. The dark channel image representing the background image.

[0133] As can be understood, a dark channel image is a grayscale image that reflects the minimum values ​​of the three color channels (R, G, B) of each pixel in a local region of an image. Dark channel images can reflect the concentration distribution of fog and are used to determine the estimated values ​​of atmospheric light intensity and atmospheric scattering rate.

[0134] Step 104: Perform recursive filtering on the dark channel image to obtain the target image.

[0135] Recursive filtering refers to applying the following filtering method to a dark channel image to obtain a filtered image, and then applying the same filtering method to the filtered image again until a preset condition is met. The filtering method will be explained in detail later.

[0136] The target image is obtained through recursive processing using the same filtering method. The process is relatively simple, and the computational cost of filtering is small. This allows for rapid determination of the target image, thereby improving the efficiency of determining atmospheric transmittance estimates.

[0137] In some embodiments, step 104 specifically includes the following sub-steps:

[0138] Sub-step S21 involves filtering the dark channel image to obtain a filtered image.

[0139] In some embodiments, sub-step S21 specifically includes the following sub-steps:

[0140] Sub-step S211: Determine the horizontal domain transform derivative and the vertical domain transform derivative of the background image.

[0141] By performing domain transformation on the background image, we obtain the horizontal and vertical domain transformation derivatives. Domain transformation allows us to convert the image from the spatial domain to other transformation domains, thereby separating features at different scales and facilitating the extraction of key information.

[0142] In some embodiments, sub-step S211 specifically includes the following sub-steps:

[0143] Sub-step S2111: Determine the rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image.

[0144] The rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image is determined by calculating the partial derivative of the pixel values ​​in the horizontal direction. The formula for calculating the partial derivative in the horizontal direction is:

[0145]

[0146] in, This represents the pixel value at coordinates (x, y) of the background image. It represents the pixel value of the right-hand adjacent pixel in the same row.

[0147] The horizontal partial derivative calculates the local gradient of the background image in the horizontal direction, which can reflect the rate of change of pixel values ​​from left to right and detect the change of fog concentration in the horizontal direction.

[0148] Sub-step S2112: Determine the absolute difference in pixel values ​​between adjacent pixels in the horizontal direction of the background image.

[0149] The absolute difference in pixel values ​​between adjacent pixels in the horizontal direction of the background image is determined by calculating the 1-norm distance between them. The formula for calculating the 1-norm distance in the horizontal direction is as follows:

[0150]

[0151] in, This represents the pixel value at coordinates (x, y) of the background image. It represents the pixel value of the right-hand adjacent pixel in the same row.

[0152] The horizontal 1-norm distance calculates the absolute change in the value of adjacent pixels in the horizontal direction of the background image, which is used for the combined calculation of the derivative of the subsequent domain transformation.

[0153] Sub-step S2113: Determine the rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image.

[0154] The rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image is determined by calculating the partial derivative of the pixel values ​​in the vertical direction. The formula for calculating the partial derivative in the vertical direction is:

[0155]

[0156] in, This represents the pixel value at coordinates (x, y) of the background image. The pixel value is the value of the adjacent pixels below in the same column.

[0157] The vertical partial derivative calculates the local gradient of the background image in the vertical direction, which can reflect the rate of change of pixel values ​​from top to bottom and detect the change of fog concentration in the vertical direction.

[0158] Sub-step S2114: Determine the absolute difference in pixel values ​​between adjacent pixels in the vertical direction of the background image.

[0159] The absolute difference in pixel values ​​between adjacent pixels in the vertical direction of the background image is determined by calculating the 1-norm distance between them. The formula for calculating the 1-norm distance in the vertical direction is as follows:

[0160]

[0161] in, This represents the pixel value at coordinates (x, y) of the background image. The pixel value is the value of the adjacent pixels below in the same column.

[0162] The vertical 1-norm distance calculates the absolute change in the value of adjacent pixels in the processing direction of the background image, which is used for the combined calculation of the derivative of the subsequent domain transformation.

[0163] Sub-step S2115: Combine the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the horizontal direction of the background image to obtain the horizontal domain transformation derivative of the background image.

[0164] The formula for calculating the derivative of the horizontal domain transformation of the background image is:

[0165]

[0166] By combining the pixel value change rate and absolute pixel value difference between adjacent pixels in the horizontal direction using this calculation formula, the local variation features in the horizontal direction can be enhanced.

[0167] Sub-step S2116: Combine the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the vertical direction of the background image to obtain the vertical domain transform derivative of the background image.

[0168] The formula for calculating the derivative of the vertical domain transformation of the background image is:

[0169]

[0170] By combining the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the vertical direction using this calculation formula, the local variation features in the vertical direction can be enhanced.

[0171] Sub-step S212: Based on the horizontal domain transformation derivative, perform horizontal filtering on the pixels of the dark channel image to obtain a horizontally filtered image.

[0172] Horizontal filtering is applied to the pixels of the dark channel image, including left-to-right filtering and right-to-left filtering.

[0173] The formula (1) for calculating the filter from left to right is:

[0174]

[0175] The calculation formula (2) for filtering from right to left is:

[0176]

[0177] The final horizontally filtered image can be represented as:

[0178]

[0179] Sub-step S213: Based on the vertical domain transformation derivative, perform vertical filtering on the pixels of the dark channel image to obtain a vertically filtered image.

[0180] Vertical filtering is applied to the pixels of the dark channel image, including top-to-bottom filtering and bottom-to-top filtering.

[0181] The calculation formula (3) for top-to-bottom filtering is:

[0182]

[0183] The calculation formula (4) for bottom-to-top filtering is:

[0184]

[0185] The final vertically filtered image obtained after vertical filtering can be represented as:

[0186]

[0187] Sub-step S214: Obtain the filtered image based on the horizontally filtered image and the vertically filtered image.

[0188] Combining the horizontally filtered image and the vertically filtered image, the filtered image can be represented as:

[0189]

[0190] Sub-step S22: The filtered image is subjected to the filtering process again until the preset conditions are met.

[0191] The D obtained from the first filtering process described above filtered (x,y) replaces the values ​​in formulas (1) and (2). The horizontally filtered image is calculated again; the D obtained from the first filtering process is then processed. filtered (x,y) replaces the values ​​in calculation formulas (3) and (4). The vertically filtered image is calculated again, and then combined to obtain the image after the second filtering.

[0192] In some embodiments, the preset condition is the number of filtering iterations. In some embodiments, the preset condition is that the filtered image meets a preset requirement.

[0193] Sub-step S23: The filtered image obtained when the preset conditions are met is taken as the target image.

[0194] In some embodiments, the preset condition is the number of filtering iterations. As an example, setting the number of filtering iterations to 3 will result in the condition obtained in sub-step S22 being... The filtering process is performed again, that is, the calculation of formulas (1)(2)(3)(4) is performed. Replace with The final calculation yielded Will The image has been identified as the target image.

[0195] The number of filtering iterations in the above embodiments was obtained experimentally. If the number of filtering iterations is less than 3, the filtering operation time is short, and sharp signals in the image are preserved, but smooth parts of the image are not well processed. If the number of filtering iterations is greater than 3, smooth parts of the image are processed, but sharp signals are not well preserved, and the filtering operation time is long. By adopting 3 recursive filtering iterations, both sharp signals in the image can be preserved, smooth areas can be processed well, and the filtering operation time is also short.

[0196] Step 105: Determine the estimated atmospheric transmittance value based on the target image.

[0197] The atmospheric transmittance estimate is the complementary image of the target image, and can be represented as:

[0198]

[0199] When the preset condition is set to filter three times, a high-quality target image can be obtained, that is, the complementary image of the target image is of high quality, which can improve the accuracy of atmospheric transmittance estimation, and the processing time is short, thus ensuring the efficiency of dehazing.

[0200] Step 106: Perform defogging processing on the foggy video based on the atmospheric transmittance estimate.

[0201] By recursively filtering the dark channel image, the target image is obtained. The atmospheric transmittance estimate is then directly determined from this target image, and finally, the foggy video is dehazed based on this atmospheric transmittance estimate. The process is simple, computationally inefficient, and improves video dehazing efficiency.

[0202] In some embodiments, step 106 specifically includes the following sub-steps:

[0203] Sub-step S41: If the estimated atmospheric transmittance is greater than the preset atmospheric transmittance, then the foggy video is defogging based on the estimated atmospheric transmittance.

[0204] In sub-step S42, if the estimated atmospheric transmittance is less than the preset atmospheric transmittance, the foggy video is defogging according to the preset atmospheric transmittance.

[0205] To prevent the atmospheric transmittance estimate determined from the target image from being zero, a minimum transmittance is set as the atmospheric transmittance preset value ε, which is a very small constant. As an example, ε is 0.1.

[0206] If the atmospheric transmittance estimate determined based on the target image is greater than ε, then the foggy video is defogging based on the atmospheric transmittance estimate; if the atmospheric transmittance estimate is less than ε, then the foggy video is defogging based on ε. This ensures the accuracy of the atmospheric transmittance estimate and improves the reliability of the defogging process.

[0207] In some embodiments, the method further includes: determining an atmospheric light intensity estimate based on the pixels of the dark channel image.

[0208] After determining the atmospheric transmittance estimate using the above methods, it is also necessary to combine it with the atmospheric light intensity estimate to complete the defogging process for the foggy video.

[0209] In some embodiments, step 106 specifically includes the following sub-steps:

[0210] Sub-step S31: Based on the estimated atmospheric transmittance and the estimated atmospheric light intensity, perform defogging processing on the foggy video.

[0211] Based on the fog degradation model, fog-free video images can be reconstructed using atmospheric light intensity estimates and atmospheric transmittance estimates. The calculation formula is as follows:

[0212]

[0213] Where I(x,y) and J(x,y) are the foggy image and its corresponding defogging image of the same frame in the video, respectively.

[0214] In some embodiments, the overall brightness of the initially dehazed image is relatively dark. A gamma correction algorithm can be used to enhance the brightness of the initially dehazed image. The calculation formula is as follows:

[0215] q = p 1 / gamma

[0216] Where gamma is the gamma coefficient, p is the initial dehazed image, and p is the final dehazed image.

[0217] After brightness enhancement, each frame of the final dehazed image can be merged to synthesize a complete dehazed video.

[0218] In some embodiments, sub-step S31 specifically includes the following sub-steps:

[0219] Sub-step S311: Sort the pixels in the dark channel image according to their brightness to obtain a sorting result.

[0220] Sub-step S312: Based on the sorting results, target pixels are selected.

[0221] Sub-step S313: Based on the pixel value of the target pixel, obtain the average pixel value of the target pixel, and use the average pixel value of the target pixel as an estimated value of atmospheric light intensity.

[0222] In the dark channel image of the background image, the pixels are sorted according to their brightness, and the top 0.1% of the pixels are selected as target pixels. The average pixel value of the target pixels is calculated and used as the atmospheric light intensity estimate of the corresponding foggy video segment of the background image.

[0223] By sorting and filtering the top 0.1% of pixels, the candidate positions of atmospheric light can be accurately located. At the same time, there is no need to calculate complex features pixel by pixel, resulting in low computational complexity and suitability for real-time processing.

[0224] In some embodiments, to prevent the atmospheric light intensity estimate determined based on the average pixel value from approaching the maximum pixel value of 255, an atmospheric light intensity threshold is set. When the calculated atmospheric light intensity estimate is greater than the atmospheric light intensity threshold, the atmospheric light intensity threshold is used as the final atmospheric light intensity estimate.

[0225] The formula for calculating the estimated atmospheric light intensity is:

[0226]

[0227] Where A is the estimated atmospheric light intensity, and k is the number of pixels in the top 0.1% of the sorted results. max This represents the maximum threshold for estimating atmospheric light intensity.

[0228] As an example, the dark channel image of the background image has 20,736 pixels. The top 0.1% of the brightest pixels are approximately 20, and their positions are determined. Finally, the pixels corresponding to these 20 positions are found in the background image, and the average pixel value of these 20 pixels is calculated. In this embodiment, the maximum threshold for atmospheric light intensity is set to 220. The calculated average pixel value is compared with the maximum threshold for atmospheric light intensity, and the smaller value is taken as the estimated atmospheric light intensity value.

[0229] As an example, the atmospheric light intensity threshold is set to 220. In practical applications, the atmospheric light intensity threshold can be determined experimentally, for example, by comparing visual effects, or by using objective parameters of the defogging effect (such as average gradient / contrast / edge intensity).

[0230] This invention improves the efficiency of video dehazing by segmenting a foggy video into multiple foggy video segments, calculating the background image of the foggy video segments using the mean method, and reducing the number of pixels in the background image by using a downsampling method, thereby reducing the number of pixels in subsequent calculation and processing.

[0231] Furthermore, a recursive filtering method was employed to determine the atmospheric transmittance estimation method. The design of the recursive filter is relatively simple, allowing the atmospheric transmittance estimate to be obtained with only a small amount of computation. This simplifies the processing procedure and further reduces the amount of computation.

[0232] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0233] Figure 2 is an application example of a video dehazing method provided in an embodiment of the present invention.

[0234] To enable those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention will be described with reference to FIG2 by way of example:

[0235] 1) Select foggy video 1 and foggy video 2

[0236] Both videos are 1080×1920 in size. The duration of video 1 with fog is 32 seconds and the total number of frames is 960; the duration of video 2 with fog is 29 seconds and the total number of frames is 870. Figure 2A This is the 200th frame of video 1 with fog. Figure 2B This is the 200th frame of video 2 with fog.

[0237] 2) Process foggy video 1 and foggy video 2 to determine the background image of each video segment.

[0238] Foggy video 1 is divided into 6 segments of 150 frames per second and 1 segment of 60 frames per second. Foggy video 2 is divided into 7 segments of 120 frames per second and 1 segment of 30 frames per second.

[0239] The mean value method is used to calculate the average pixel value at the same pixel position in each video segment, and this value is used as the pixel value at that pixel position in the background image, thus obtaining the background image. Figure 2C The background image in frame 200 of the foggy video 1, where walking pedestrians have been removed; Figure 2D This is the background image for frame 200 in foggy video 2, where moving vehicles have been removed.

[0240] Alternatively, the nearest neighbor interpolation downsampling method can be used to reduce the length and width of the background image corresponding to each video segment by a factor of 10. Then, the size of all background images corresponding to foggy video 1 and foggy video 2 will change from 1080×1920 to 108×192, and the number of pixels in the background image will be reduced to 1 / 100 of the original.

[0241] 3) Determine the dark channel image of each background image.

[0242] Calculate the lowest pixel value of each pixel in the RGB three channels of each background image, and construct the dark channel image of the background image using these pixel values.

[0243] 4) Determine the atmospheric light intensity estimate for each video segment.

[0244] Extract the position information of the top 0.1% of the brightest pixels in the dark channel image. In this example, the dark channel image of a background image has a total of 20736 pixels, and the top 0.1% of the brightest pixels are approximately 20. Obtain the position information of these 20 pixels. Finally, find the pixels corresponding to these 20 positions in the background image and calculate the average pixel value of these 20 pixels.

[0245] Additionally, the maximum threshold for atmospheric light intensity is set to 220. The calculated average pixel value is compared with the maximum threshold for atmospheric light intensity, and the smaller value is taken as the estimated value of atmospheric light intensity.

[0246] 5) Determine the estimated atmospheric transmittance for each video segment.

[0247] First, a domain transformation is performed on the background image, sequentially calculating the partial derivatives of pixel values ​​in the horizontal and vertical directions, the 1-norm distance between adjacent pixels, and the horizontal and vertical domain transformation derivatives. Then, the dark channel image of the background image is recursively filtered three times using the horizontal and vertical domain transformation derivatives to obtain the target image. Finally, the complementary image of the target image is calculated.

[0248] Meanwhile, a preset value for atmospheric transmittance is set, and the calculated complementary image is compared with the preset value for atmospheric transmittance. The larger value is taken as the estimated value for atmospheric transmittance.

[0249] In addition, two parameters in the recursive filtering method affect the atmospheric transmittance estimate: the filter window size and the filter ambiguity. A smaller filter window size results in stronger edge intensity in the atmospheric transmittance image, making the feature information of objects in the image more prominent; conversely, a larger filter window size results in weaker edge intensity and more blurred object features. A higher filter ambiguity leads to a more blurred atmospheric transmittance image, lower edge intensity, less feature information of objects in the image, and an overall image that tends towards a dark white color.

[0250] In this example, the filter window size is set to 50 and the filter ambiguity is set to 1.5. The atmospheric transmittance estimate calculated by this method is more accurate.

[0251] 6) Perform dehazing processing on foggy video 1 and foggy video 2.

[0252] The atmospheric light intensity and atmospheric transmittance estimates calculated for each background image can be considered as the common atmospheric light intensity and atmospheric transmittance for all images within the corresponding video segment. Based on the fog degradation model, the defogging images are calculated using the atmospheric light intensity and atmospheric transmittance estimates corresponding to each foggy image frame. Finally, the defogging images of all frames are merged into a defogging video.

[0253] In addition, since the overall brightness of the video image after dehazing is relatively low, a gamma correction algorithm is used to enhance the brightness of the dehazed image. The selection of the gamma coefficient in the gamma correction algorithm affects the degree of brightness enhancement. In this example, after experimentation, a gamma coefficient of 0.8 was selected. When the gamma coefficient is selected as 0.8, the quality of the dehazed image is the highest. Figure 2E This is the image after dehazing, frame 200 of the foggy video 1, relative to... Figure 2A The clarity is significantly improved; Figure 2F This is the image after dehazing, frame 200 of the foggy video 2, relative to... Figure 2B The clarity is significantly improved.

[0254] The above method divides the foggy video into multiple foggy video segments, calculates the background image of the foggy video segment using the mean method, and adopts a downsampling method to reduce the number of pixels in the background image, thereby reducing the number of pixels in the subsequent calculation and processing process and improving the efficiency of video dehazing.

[0255] Furthermore, a recursive filtering method was employed to determine the atmospheric transmittance estimation method. The design of the recursive filter is relatively simple, allowing the atmospheric transmittance estimate to be obtained with only a small amount of computation. This simplifies the processing procedure and further reduces the amount of computation.

[0256] Figure 3 This is a structural block diagram of a video defogging device provided in an embodiment of the present invention.

[0257] like Figure 3 As shown in the figure, a video dehazing device provided in this embodiment of the invention may specifically include the following modules:

[0258] Foggy video acquisition module 301 is used to acquire foggy videos;

[0259] Background image determination module 302 is used to determine the background image of the foggy video;

[0260] Dark channel image determination module 303 is used to determine the dark channel image of the background image based on the background image of the foggy video;

[0261] The target image determination module 304 is used to perform recursive filtering on the dark channel image to obtain the target image;

[0262] Atmospheric transmittance determination module 305 is used to determine an estimated value of atmospheric transmittance based on the target image;

[0263] The defogging module 306 is used to perform defogging processing on the foggy video based on the atmospheric transmittance estimate.

[0264] In some embodiments, the target image determination module 304 includes:

[0265] The filtering submodule is used to filter the dark channel image to obtain the filtered image.

[0266] The preset condition satisfaction submodule is used to perform the filtering process on the filtered image again until the preset condition is met.

[0267] The first target image determination submodule uses the filtered image obtained when the preset conditions are met as the target image.

[0268] In some embodiments, the filtering submodule includes:

[0269] A domain transform derivative determination unit is used to determine the horizontal domain transform derivative and the vertical domain transform derivative of the background image;

[0270] The horizontally filtered image determination unit is used to perform horizontal filtering on the pixels of the dark channel image according to the horizontal domain transformation derivative to obtain a horizontally filtered image.

[0271] A vertically filtered image determination unit is used to perform vertical filtering on the pixels of the dark channel image according to the vertical domain transformation derivative to obtain a vertically filtered image.

[0272] The filtered image determination unit is used to obtain the filtered image based on the horizontal filtered image and the vertical filtered image.

[0273] In some embodiments, the domain transformation derivative determination unit includes:

[0274] The first rate of change determination subunit is used to determine the rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0275] The first absolute difference determination subunit is used to determine the absolute difference of pixel values ​​between adjacent pixels in the horizontal direction of the background image;

[0276] The second rate of change determination subunit is used to determine the rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0277] The second absolute difference determination subunit is used to determine the absolute difference of pixel values ​​between adjacent pixels in the vertical direction of the background image;

[0278] The first domain transform derivative determination subunit is used to combine the pixel value change rate and the absolute difference of pixel value between adjacent pixels in the horizontal direction of the background image to obtain the horizontal domain transform derivative of the background image.

[0279] The second domain transform derivative determination subunit is used to combine the pixel value change rate and the absolute difference of the pixel value between adjacent pixels in the vertical direction of the background image to obtain the vertical domain transform derivative of the background image.

[0280] In some embodiments, the background image determination module 302 includes:

[0281] The video segment determination submodule is used to segment the foggy video to obtain multiple foggy video segments;

[0282] The average pixel value determination submodule is used to determine the average pixel value of each pixel in the foggy video segment;

[0283] The first background image determination submodule is used to determine the background image of the foggy video clip based on the average pixel value of each pixel in the foggy video clip.

[0284] In some embodiments, the background image of the foggy video clip is determined based on an initial background image of the foggy video clip;

[0285] In some embodiments, the first background image determination submodule includes:

[0286] The downsampling processing unit is used to downsample the initial background image of the foggy video clip to obtain a background image; the number of pixels in the background image is less than the number of pixels in the initial background image.

[0287] In some embodiments, the apparatus further includes:

[0288] An atmospheric light intensity determination module is used to determine an estimated value of atmospheric light intensity based on the pixels of the dark channel image.

[0289] In some embodiments, the defogging module 306 includes:

[0290] The first defogging processing submodule is used to perform defogging processing on the foggy video based on the atmospheric transmittance estimate and the atmospheric light intensity estimate.

[0291] Optionally, the atmospheric light intensity determination module includes:

[0292] The sorting submodule is used to sort the pixels in the dark channel image according to their brightness to obtain the sorting result;

[0293] The pixel filtering submodule is used to filter and obtain target pixels based on the sorting results;

[0294] The first atmospheric light intensity determination submodule is used to obtain the average pixel value of the target pixel based on the pixel value of the target pixel, and use the average pixel value of the target pixel as the atmospheric light intensity estimate.

[0295] In some embodiments, the defogging module 306 includes:

[0296] The first defogging processing submodule is used to perform defogging processing on the foggy video based on the atmospheric transmittance estimate if the atmospheric transmittance estimate is greater than the atmospheric transmittance preset value.

[0297] The second defogging processing submodule is used to perform defogging processing on the foggy video according to the preset atmospheric transmittance value if the estimated atmospheric transmittance value is less than the preset atmospheric transmittance value.

[0298] This invention improves the efficiency of video dehazing by segmenting a foggy video into multiple foggy video segments, calculating the background image of the foggy video segments using the mean method, and reducing the number of pixels in the background image by using a downsampling method, thereby reducing the number of pixels in subsequent calculation and processing.

[0299] Furthermore, a recursive filtering method was employed to determine the atmospheric transmittance estimation method. The design of the recursive filter is relatively simple, allowing the atmospheric transmittance estimate to be obtained with only a small amount of computation. This simplifies the processing procedure and further reduces the amount of computation.

[0300] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.

[0301] This invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described video dehazing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0302] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described video dehazing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0303] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0304] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0305] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. 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.

[0306] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0307] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0308] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0309] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0310] The present invention provides a detailed description of a video dehazing method, apparatus, electronic device, and computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for dehazing video, characterized in that, The method includes: Get foggy videos; Determine the background image of the foggy video; Based on the background image of the foggy video, determine the dark channel image of the background image; The dark channel image is recursively filtered to obtain the target image; Based on the target image, determine the estimated atmospheric transmittance. The foggy video is defogging based on the atmospheric transmittance estimate.

2. The defogging method according to claim 1, characterized in that, The recursive filtering process performed on the dark channel image to obtain the target image includes: The dark channel image is filtered to obtain the filtered image; The filtered image is subjected to the filtering process again until the preset conditions are met; The filtered image obtained when the preset conditions are met is used as the target image.

3. The defogging method according to claim 2, characterized in that, The step of filtering the dark channel image to obtain the filtered image includes: Determine the horizontal domain transform derivative and the vertical domain transform derivative of the background image; Based on the horizontal domain transform derivative, the pixels of the dark channel image are subjected to horizontal filtering to obtain a horizontally filtered image. Based on the vertical domain transform derivative, the pixels of the dark channel image are subjected to vertical filtering to obtain a vertically filtered image. The filtered image is obtained based on the horizontally filtered image and the vertically filtered image.

4. The defogging method according to claim 3, characterized in that, Determining the horizontal domain transform derivative and the vertical domain transform derivative of the background image includes: Determine the rate of change of pixel values ​​between adjacent pixels in the horizontal direction of the background image; Determine the absolute difference in pixel values ​​between adjacent pixels in the horizontal direction of the background image; Determine the rate of change of pixel values ​​between adjacent pixels in the vertical direction of the background image; Determine the absolute difference in pixel values ​​between adjacent pixels in the vertical direction of the background image; By combining the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the horizontal direction of the background image, the horizontal domain transform derivative of the background image is obtained. The vertical domain transform derivative of the background image is obtained by combining the rate of change of pixel values ​​and the absolute difference of pixel values ​​between adjacent pixels in the vertical direction.

5. The defogging method according to claim 1, characterized in that, Determining the target background image of the foggy video includes: The foggy video is segmented to obtain multiple foggy video segments; Determine the average pixel value of each pixel in the foggy video segment; The background image of the foggy video clip is determined based on the average pixel value of each pixel in the foggy video clip.

6. The defogging method according to claim 5, characterized in that, The background image of the foggy video clip is determined based on the initial background image of the foggy video clip; The determined background image of the foggy video clip includes: The initial background image of the foggy video segment is downsampled to obtain the background image; The background image has fewer pixels than the initial background image.

7. The defogging method according to claim 1, characterized in that, The method further includes: Based on the pixels of the dark channel image, determine the estimated atmospheric light intensity; The process of dehazing the foggy video based on the atmospheric transmittance estimate includes: Based on the estimated atmospheric transmittance and the estimated atmospheric light intensity, the foggy video is defogging.

8. The defogging method according to claim 7, characterized in that, Determining the atmospheric light intensity estimate based on the pixels of the dark channel image includes: The pixels in the dark channel image are sorted according to their brightness to obtain the sorting result; Based on the sorting results, the target pixels are selected. Based on the pixel value of the target pixel, the average pixel value of the target pixel is obtained, and the average pixel value of the target pixel is used as the atmospheric light intensity estimate.

9. The defogging method according to claim 1, characterized in that, The process of dehazing the foggy video based on the atmospheric transmittance estimate includes: If the estimated atmospheric transmittance is greater than the preset atmospheric transmittance, then the foggy video is defogging based on the estimated atmospheric transmittance. If the estimated atmospheric transmittance is less than the preset atmospheric transmittance, then the foggy video is defogging based on the preset atmospheric transmittance.

10. A video dehazing device, characterized in that, The device includes: The foggy video acquisition module is used to acquire foggy videos; Background image determination module, used to determine the background image of the foggy video; The dark channel image determination module is used to determine the dark channel image of the background image based on the background image of the foggy video. The target image determination module is used to perform recursive filtering on the dark channel image to obtain the target image; An atmospheric transmittance determination module is used to determine an estimated value of atmospheric transmittance based on the target image. The defogging module is used to defog the foggy video based on the atmospheric transmittance estimate.

11. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the video dehazing method as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the video dehazing method as described in any one of claims 1-9.