Adaptive image defogging method and device based on dark channel prior

Through the adaptive image defog method of block feature analysis and dynamic transmittance adjustment, the transmittance estimation deviation problem of traditional methods in white scenes and highlighted areas is solved, achieving a more natural image recovery effect and higher versatility, and is suitable for applications with high real-time requirements such as security monitoring.

CN120278917APending Publication Date: 2025-07-08UNIV OF SCI & TECH BEIJING +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510606399.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Traditional image defogging methods use transmittance estimation deviations when dealing with white scenes and highlighted areas, resulting in overdark or distortion of the restored image and lack of adaptability to local fog concentration differences.

Method used

By blocking the input image, the brightness mean, brightness variance, color saturation, local dark channel mean and transmittance consistency characteristics are extracted, the white scene block is identified, and the transmittance regularization weighting parameters are dynamically adjusted, and the transmission is refined in combination with guide filtering to achieve accurate transmittance estimation.

Benefits of technology

It improves the robustness of the image defog removal method in white areas and highlight scenes, maintains natural recovery effect, adapts to various complex environments, has low computing load and good versatility, and is suitable for application scenarios with high real-time requirements such as security monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278917A_ABST
    Figure CN120278917A_ABST
Patent Text Reader

Abstract

The invention provides an adaptive image defogging method and device based on dark channel prior, and relates to the technical field of image processing. The method comprises the following steps: carrying out blocking processing on an input image, and extracting the following characteristics of each block: a brightness mean value, a brightness variance, color saturation, a local dark channel mean value and transmissivity consistency; on the basis of feature extraction, white scene blocks are identified, and transmittance regularization weighting parameters are set for the white scene blocks; calculating an inaccuracy index of each block according to the extracted features; dynamically adjusting the transmissivity regularization weighting parameter of each block based on the inaccuracy index and the white scene block identification result; and performing image defogging processing according to the adjusted transmissivity regularization weighting parameter. According to the method, the input image is subjected to block processing, various features of each block are extracted, and accurate transmissivity estimation and natural fogless image recovery are finally realized by combining white scene recognition, inaccurate degree quantization and dynamic parameter adjustment.
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 particularly to an adaptive image dehazing method and device based on dark channel prior. Background Art

[0002] Image dehazing technology is an important research direction in the fields of computer vision and image restoration. The research goal is to restore the true color, contrast, and clarity of the scene in a foggy image by eliminating the atmospheric scattering effect. Under foggy weather conditions, light is scattered by suspended particles (such as water droplets and dust) in the atmosphere during propagation, resulting in increased image brightness, reduced contrast, and color distortion. Traditional image enhancement methods, such as histogram equalization and contrast stretching, although they can improve the visibility of the image, often have difficulty in maintaining both color authenticity and detail clarity due to the lack of modeling of the atmospheric physical model. For example, histogram equalization may amplify noise, and contrast stretching may lead to over-enhancement or detail loss, especially in scenes with uneven fog concentration, where the effect is particularly limited.

[0003] The dark channel prior dehazing method (DCP) provides a solution. In the standard DCP method, the regularization weighting coefficient ω for calculating the transmittance uses a fixed value (usually taken as 0.95). Its advantages are simple algorithm and high computational efficiency, but there are obvious deficiencies in the processing of white scenes (such as snow fields and white walls) or complex fog concentration distributions. Due to the relatively high dark channel value (for example, 200 instead of 0), the transmittance is underestimated, and the restored image is too dark or distorted.

[0004] An improved method is to adjust ω according to the global brightness or contrast. For example, if the average brightness of the image exceeds a certain threshold (such as 150), ω is reduced to 0.8. This method attempts to alleviate the problem of high-brightness scenes, but global adjustment cannot reflect local fog concentration differences, and the effect is limited in images with coexisting white and non-white regions. Another improved method adjusts ω by block analysis of local brightness and standard deviation. For example, the image is divided into 15×15 blocks. If the average brightness of a certain block > 180 and the standard deviation < 15, then ω is reduced to 0.7. This method takes into account local characteristics, but only relies on brightness and contrast, ignoring information such as saturation and transmittance consistency, and the adjustment lacks systematicness. Summary of the Invention

[0005] To address the above problems, the objective of the present invention is to provide an adaptive image defogging method and device based on dark channel prior. By performing block processing on the input image, extracting various features of each block, combining white scene recognition and inaccuracy quantification, dynamically adjusting the ω parameter, and ultimately achieving accurate transmittance estimation and natural fog-free image restoration. The adaptive framework of the present invention does not rely on empirical parameters of specific scenes, has better generality and practicality, and can well meet application scenarios with high real-time requirements such as security monitoring and autonomous driving.

[0006] To solve the above technical problems, the present invention provides the following technical solutions:

[0007] On the one hand, an adaptive image defogging method based on dark channel prior is provided. The method includes the following steps:

[0008] S1. Perform block processing on the input image and extract the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency;

[0009] S2. On the basis of feature extraction, identify white scene blocks and set transmittance regularization weighting parameters for the white scene blocks;

[0010] S3. Calculate the inaccuracy index of each block according to the extracted features;

[0011] S4. Dynamically adjust the transmittance regularization weighting parameter of each block based on the inaccuracy index and the white scene block recognition result;

[0012] S5. Perform image defogging processing according to the adjusted transmittance regularization weighting parameter.

[0013] Optionally, in step S1, the input image is divided into multiple blocks of N×N pixels, and the calculation method of the brightness mean is as follows:

[0014]

[0015] where I(x) is the brightness value of pixel x in the block;

[0016] The calculation method of the brightness variance is as follows:

[0017]

[0018] where Var(I(x)) represents the variance of the average brightness of all pixels in the block;

[0019] The calculation method of the color saturation is as follows:

[0020]

[0021] Among them, Saturation(x) ∈ [0, 1] is the saturation value of pixel x within the block;

[0022] The calculation method of the local dark channel mean is as follows:

[0023]

[0024] Among them, J dark (x) is the dark channel value of pixel x within the block;

[0025] The calculation of the transmittance consistency is as follows:

[0026]

[0027] Among them, t(x) is the initial transmittance of pixel x within the block, and Var(t(x)) represents the difference between the initial transmittance within the block and the transmittance of the neighboring block.

[0028] Optionally, in step S2, for each block, calculate its brightness mean and brightness variance. If the current scene block satisfies the condition μ bright > 200, σ color < 10, then identify it as a white scene block and set a specific transmittance regularization weighting parameter.

[0029] Optionally, in step S3, the inaccuracy index E is calculated as follows:

[0030]

[0031] Among them, α, β, γ, δ are set weight coefficients, corresponding to the weights of brightness, saturation, local dark channel, and transmittance consistency respectively.

[0032] Optionally, in step S4, for non-white scene blocks, adopt a linear interpolation strategy to adjust the transmittance regularization weighting parameter:

[0033] ω new = ω default ·(1 - E)+ ω min ·E

[0034] Among them, ω new represents the adjusted transmittance regularization weighting parameter, ω default is the default value, ω min is the adjustment lower limit; when E ≈ 0, it means the current image block is an ordinary area, ω new ≈ 0.95, retain the default value; when E ≈ 1, it means the current image block is a highlighted area, adjust ω new → ω min , reduce the defogging intensity to protect details;

[0035] For the identified white scene blocks, directly set a specific value:

[0036] ω new = 0.5

[0037] Optionally, in step S5, according to the adjusted ω new calculate the initial transmittance of each block, and the formula is:

[0038]

[0039] where Ω(x) is a local block centered on pixel x, estimated from the top 0.1% brightest pixels in the dark channel;

[0040] calculate the normalized dark channel value within the block, C represents channels r, g, b, y is the pixel within Ω(x), and I C (y) represents the brightness of each channel of the local block, and A C represents the pixel value of the atmospheric light of each channel.

[0041] Optionally, step S5 further includes: using the guided filtering method to refine the output transmittance, specifically including:

[0042] Assume that the output transmittance is a linear transformation of the guidance image I within the local window:

[0043]

[0044] where t i is the output transmittance at pixel i, I i is the value of the guidance image at pixel i, w k is a local window centered on pixel k, a k and b k are the linear coefficients within window w k ;

[0045] Define the following cost function:

[0046]

[0047] where t 0i is the value of the initial transmittance at pixel i, ò is the regularization parameter, used to control the magnitude of a k to avoid overfitting;

[0048] By minimizing this cost function, take the partial derivatives of a k and b k respectively and set them equal to zero, and obtain:

[0049]

[0050] where w is the window w k the number of pixels within, μ k is the mean pixel value of the guidance image I within the window w k within; is the variance of the pixel values of the guidance image I within the window w k within; is the mean of the initial transmittance t0 within the window w k within;

[0051] For each pixel i, calculate the average value within all windows:

[0052]

[0053] In actual implementation, the calculation can be accelerated by taking the average of a k and b k respectively and then performing a linear transformation:

[0054]

[0055] Thus, we obtain:

[0056]

[0057] The smoothness and edge-preserving ability of the guided filter are determined by the window size and the regularization parameter ò, and t' i is the refined output transmittance.

[0058] Optionally, the step S5 further includes: using the refined transmittance and the atmospheric light to restore the fog-free image:

[0059]

[0060] where t0 represents the initial transmittance, t'(x) represents the refined transmittance, A represents the atmospheric light pixel value, I(x) is the observed image, and J(x) is the output fog-free image.

[0061] On the other hand, there is provided an adaptive image dehazing device based on the dark channel prior for implementing the method described in any one of the above, and the device includes:

[0062] A feature extraction module for performing block processing on the input image and extracting the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency;

[0063] An identification module for identifying white scene blocks based on the feature extraction and setting transmittance regularization weighting parameters for the white scene blocks;

[0064] An index calculation module for calculating the inaccuracy index of each block according to the extracted features;

[0065] A parameter adjustment module, configured to dynamically adjust the transmittance regularization weighting parameter of each block based on the inaccuracy degree index and the white scene block recognition result;

[0066] A defogging processing module, configured to perform image defogging processing according to the adjusted transmittance regularization weighting parameter.

[0067] On the other hand, an electronic device is provided, and the electronic device includes:

[0068] A processor;

[0069] A memory, on which computer-readable instructions are stored. When the computer-readable instructions are loaded and executed by the processor, the steps of the adaptive image defogging method as described above are implemented.

[0070] On the other hand, a computer-readable storage medium is provided, in which program codes are stored. The program codes can be called by a processor to execute the steps of the adaptive image defogging method as described above.

[0071] The beneficial effects brought by the technical solution provided by the present invention at least include:

[0072] (1) The present invention breaks through the limitation of the traditional fixed transmittance regularization weighting coefficient ω, and realizes more refined defogging control through an innovative block adaptive mechanism. Based on the inaccuracy index E calculated from local brightness, saturation, and dark channel features, the coefficient ω is dynamically adjusted, enabling the algorithm to intelligently distinguish different fog concentration regions and special scenes (such as snow fields, white walls), and effectively solving the problem of transmittance estimation deviation of traditional methods in white regions.

[0073] (2) The present invention has a lower operation load. Through an optimized block processing architecture and a lightweight feature extraction algorithm, the processing speed is improved compared with traditional methods, and it can meet the requirements of application scenarios with strict real-time requirements such as security monitoring.

[0074] (3) The adaptive framework of the present invention has excellent versatility and robustness. Different from traditional methods that rely on empirical parameters of specific scenes, the present invention realizes self-optimization of parameters through local feature analysis and can adapt to various complex environments (such as thick fog, thin fog, uneven fog, etc.). Experiments show that in extreme conditions (such as scenes where strong light coexists with thick fog), this method can still maintain a stable defogging effect.

[0075] (4) The method of the present invention retains the simplicity and high efficiency advantages of the traditional dark channel method. Without complex wavelet transforms or deep learning models, a qualitative improvement is achieved only through an improved parameter adjustment strategy. This design enables it to obtain dehazing quality close to that of deep learning-based methods while maintaining the light weight of the algorithm, and has unique advantages in scenarios with limited computing resources.

[0076] (5) The architecture design of the present invention has good scalability. By simply replacing modules, it can support integration with other advanced algorithms (such as deep learning), leaving room for further performance improvement. This design concept that balances performance and efficiency enables it to perform excellently in various actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following-described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0078] Figure 1 is a flowchart of an adaptive image dehazing method based on dark channel prior provided by an embodiment of the present invention;

[0079] Figure 2 is a schematic structural diagram of an adaptive image dehazing device based on dark channel prior provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0080] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the described embodiments of the present invention belong to the scope of protection of the present invention.

[0081] In the dehazing method based on Dark Channel Prior, the observed image affected by fog is expressed as:

[0082] I(x) = J(x)t(x) + A(1 - t(x)) (1)

[0083] where I(x) is the observed image, J(x) is the fog-free image, A is the atmospheric light pixel value, and t(x) is the transmittance. The dark channel prior method statistically finds that in the non-sky area of an outdoor fog-free image, there are at least low-intensity pixels in at least one color channel in the local area:

[0084] J dark (x) = min y∈Ω(x) (min c∈r,g,b J c (y)) ≈ 0 (2)

[0085] Based on this prior assumption, the transmittance can be estimated as follows:

[0086]

[0087] Among them, ω is the transmittance regularization weighting parameter, which is a kind of adjustment parameter. Usually, ω = 0.95 is taken to retain a small amount of fog and enhance the naturalness of the image. The atmospheric light A is estimated by selecting the highest brightness value corresponding to the original image among the top 0.1% brightest pixels in the dark channel. To eliminate the artifacts caused by block-by-block estimation, DCP usually uses soft matting or guided filtering to refine the transmittance map and finally restore the fog-free image:

[0088]

[0089] The above method usually adopts a globally fixed transmittance parameter ω = 0.95, which has obvious deficiencies in dealing with different fog concentration distributions and special scenes (such as high-brightness areas like snowfields and white walls), and it is difficult to distinguish local fog concentration differences, resulting in transmittance estimation deviations in white areas and problems such as over-saturation or color distortion.

[0090] In view of this, the embodiments of the present invention provide an adaptive image dehazing method based on dark channel prior, as Figure 1 shown, the processing flow of this method can include the following steps:

[0091] S1. Perform block processing on the input image, and extract the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency.

[0092] The input image is divided into multiple blocks of N×N pixels. This block division method can capture the local characteristics of the image and provide a basis for subsequent feature analysis and parameter adjustment. For each block, five types of features are extracted to comprehensively describe its content characteristics.

[0093] The brightness mean is used to evaluate the average illumination intensity within the block, and the calculation method is as follows:

[0094]

[0095] Among them, I(x) is the brightness value of pixel x within the block.

[0096] The brightness variance represents the degree of change in pixel values within a block, reflecting the complexity of the texture. The calculation method is as follows:

[0097]

[0098] Among them, Var(I(x)) represents the variance of the average brightness of all pixels within the block.

[0099] The color saturation reflects the vividness of the color within the block. The calculation method is as follows:

[0100]

[0101] Among them, Saturation(x) ∈ [0, 1] is the saturation value of pixel x within the block.

[0102] The local dark channel mean can quantitatively evaluate the effectiveness of the dark channel prior in the current image region. The calculation method is as follows:

[0103]

[0104] Among them, J dark (x) is the dark channel value of pixel x within the block.

[0105] The transmittance consistency measures the stability of the estimation by calculating the difference between the initial transmittance within the block and the transmittance of the neighboring blocks. The calculation is as follows:

[0106]

[0107] Among them, t(x) is the initial transmittance of pixel x within the block calculated based on the default ω = 0.95, and Var(t(x)) represents the difference between the initial transmittance within the block and the transmittance of the neighboring blocks. These features jointly provide a multi-dimensional basis for the subsequent ω adjustment.

[0108] S2. On the basis of feature extraction, identify white scene blocks to specifically optimize the defogging intensity and set the transmittance regularization weighting parameter for the white scene blocks.

[0109] For each block, calculate its brightness mean and brightness variance. If the current scene block meets the condition μ bright > 200, σ color < 10, then identify it as a white scene block and set a specific transmittance regularization weighting parameter. Based on the typical features of white scenes: high brightness (close to 255) and strong uniformity (small variation), identify white scene blocks such as snow fields, white walls, or highlight areas. The purpose of identifying white scene blocks is to set special ω values for these areas to avoid the problem of over-darkening or distortion caused by underestimated transmittance in traditional methods.

[0110] S3. Calculate the inaccuracy index for each block based on the extracted features.

[0111] Define the inaccuracy index E to quantify the applicability of the default ω = 0.95 in the current block. Considering features such as brightness, saturation, and dark channel comprehensively, the inaccuracy index E is calculated as follows:

[0112]

[0113] where α, β, γ, δ are set weight coefficients corresponding to the weights of brightness, saturation, local dark channel, and transmittance consistency respectively.

[0114] represents the brightness normalization value. The higher the value, the brighter the area, and the more likely the dark channel prior fails; 1 - μ sat represents the low saturation weight. The lower the saturation (such as gray - white areas), the more ω needs to be adjusted; represents the inverse of the dark channel value. The higher the dark channel value, the less the prior assumption holds. The value range of E is [0, 1]. The larger E is, the less suitable the default ω = 0.95 is for the current block, and a greater degree of adjustment is required.

[0115] S4. Dynamically adjust the transmittance regularization weighting parameter for each block based on the inaccuracy index and the white scene block recognition result.

[0116] For non - white scene blocks, adopt a linear interpolation strategy to adjust the transmittance regularization weighting parameter:

[0117] ω new = ω default ·(1 - E)+ω min ·E (11)

[0118] where, ω new represents the adjusted transmittance regularization weighting parameter, ω default is the default value, ω min is the adjustment lower limit; when E≈0, it indicates that the current image block is a normal area, ω new ≈0.95, and the default value is retained; when E≈1, it indicates that the current image block is a high - light area, adjust ω new →ω min , and reduce the defogging intensity to protect details.

[0119] For the identified white scene blocks, directly set a specific value:

[0120] ω new = 0.5 (12)

[0121] With a lower ω newReduce the defogging intensity further to ensure that the white areas are not over-enhanced and maintain a natural appearance.

[0122] S5. Perform image defogging processing according to the adjusted transmittance regularization weighting parameter.

[0123] According to the adjusted ω new Calculate the initial transmittance of each block using the formula:

[0124]

[0125] where Ω(x) is the local block centered at pixel x, estimated from the top 0.1% brightest pixels in the dark channel;

[0126] Calculate the normalized dark channel value within the block. C represents channels r, g, b, y is the pixel within Ω(x), and I C (y) represents the brightness of each channel of the local block, and A C represents the pixel value of the atmospheric light of each channel.

[0127] Since the initial transmittance is calculated block by block, there may be blocky artifacts. Therefore, the guided filter technique can be used to refine the transmittance. The guided filter smooths the transmittance while preserving edge information by using the input image itself as the guidance image, thus effectively reducing artifacts.

[0128] Refine the output transmittance using the guided filter method, specifically including:

[0129] Assume that the output transmittance is a linear transformation of the guidance image I within the local window:

[0130]

[0131] where t i is the output transmittance at pixel i, I i is the value of the guidance image at pixel i, w k is the local window centered at pixel k, a k and b k are the linear coefficients within the window w k ;

[0132] Define the following cost function:

[0133]

[0134] where t 0i is the value of the initial transmittance at pixel i, and ò is the regularization parameter used to control the size of a k to avoid overfitting;

[0135] By minimizing this cost function, taking partial derivatives with respect to a k and b k respectively and setting them equal to zero, we obtain:

[0136]

[0137] where w is the number of pixels within window w k , μ k is the mean pixel value of the guidance image I within window w k , is the variance of the pixel values of the guidance image I within window w k , is the mean of the initial transmittance t0 within window w k ;

[0138] For each pixel i, calculate the average value within all windows:

[0139]

[0140] In actual implementation, the calculation can be accelerated by taking the average of a k and b k respectively and then performing a linear transformation:

[0141]

[0142] Thus, we obtain:

[0143]

[0144] t' i is the refined output transmittance. The smoothness and edge-preserving ability of guided filtering are determined by the window size and the regularization parameter ò. A larger window will enhance the smoothing effect, while a smaller ò will make the output closer to the edge characteristics of the guidance image. Adjust these parameters according to the specific application scenario to achieve a balance between smoothing artifacts and retaining details. Through the above method, guided filtering can effectively refine the initial transmittance to obtain an optimized transmittance, thereby reducing blocky artifacts and improving the overall quality of image processing.

[0145] Finally, use the refined transmittance and the atmospheric light to recover the haze-free image:

[0146]

[0147] where t0 represents the initial transmittance, t'(x) represents the refined transmittance, A represents the pixel value of the atmospheric light, I(x) is the observed image, and J(x) is the output haze-free image.

[0148] Different from the traditional method that uses a fixed transmittance regularization weighting parameter ω, the present invention dynamically determines the optimal ω value for each image block according to the local features of the input image. This adaptive mechanism can flexibly adjust the defogging intensity according to the fog concentration distribution and scene content, ensuring accurate transmittance estimation by the algorithm in different regions. This dynamic adjustment ability makes the defogging effect more natural and optimizes the balance between defogging intensity and detail retention.

[0149] Through block feature analysis and dynamic adjustment of ω, the present invention significantly improves the robustness of the traditional dark channel method in white areas and high-brightness scenes, effectively solving the problems of underestimated transmittance and color distortion that are prone to occur in these areas by the traditional method. Moreover, the method of the present invention does not rely on empirical parameters of specific scenes, but realizes the adaptive optimization of the ω parameter through image content analysis, making it applicable to a variety of foggy scenes (such as natural landscapes, urban street scenes, snow scenes, etc.), with higher generality and practical value.

[0150] Correspondingly, an embodiment of the present invention also provides an adaptive image defogging device based on dark channel prior, as Figure 2 shown, the device includes:

[0151] A feature extraction module 201, configured to perform block processing on the input image and extract the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency;

[0152] An identification module 202, configured to identify white scene blocks on the basis of feature extraction and set transmittance regularization weighting parameters for the white scene blocks;

[0153] An index calculation module 203, configured to calculate the inaccuracy index of each block according to the extracted features;

[0154] A parameter adjustment module 204, configured to dynamically adjust the transmittance regularization weighting parameter of each block based on the inaccuracy index and the white scene block identification result;

[0155] A defogging processing module 205, configured to perform image defogging processing according to the adjusted transmittance regularization weighting parameter.

[0156] For ease of description, Figure 2 only the main components of the device are shown. The device of this embodiment can be used to execute Figure 1 the technical solutions of the method embodiments shown, and its implementation principles and technical effects are similar, which will not be elaborated here.

[0157] In an exemplary embodiment, the present invention also provides an electronic device, and the electronic device includes:

[0158] A processor;

[0159] A memory, on which computer-readable instructions are stored. When the computer-readable instructions are loaded and executed by the processor, the steps of the adaptive image defogging method as described above are implemented.

[0160] In an exemplary embodiment, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the steps of the adaptive image defogging method as described above. For example, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0161] It should be noted that in this document, the term "including", "comprising" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or terminal device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.

[0162] When referring to "an embodiment", "embodiment", "exemplary embodiment", "some embodiments" and the like in the specification, it indicates that the described embodiment may include a specific feature, structure or characteristic, but not necessarily every embodiment includes the specific feature, structure or characteristic. Additionally, when combining an embodiment to describe a specific feature, structure or characteristic, implementing such feature, structure or characteristic in combination with other embodiments (whether explicitly described or not) should be within the knowledge of those skilled in the relevant art.

[0163] It should be understood that in various embodiments of the present invention, the magnitudes of the serial numbers of the above processes do not mean the order of execution is prior or subsequent. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0164] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0165] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0167] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or this part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0168] The present invention covers any substitutions, modifications, equivalent methods, and solutions made within the essence and scope of the present invention. For the public to have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention. However, those skilled in the art can fully understand the present invention without these detailed descriptions. In addition, in order to avoid unnecessary confusion to the essence of the present invention, well-known methods, processes, procedures, components, and circuits are not described in detail.

[0169] The foregoing are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. An adaptive image dehazing method based on the dark channel prior, characterized in that, It includes the following steps: S1. Perform block processing on the input image, and extract the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency; S2. On the basis of feature extraction, identify white scene blocks and set transmittance regularization weighting parameters for the white scene blocks; S3. Calculate the inaccuracy index of each block according to the extracted features; S4. Dynamically adjust the transmittance regularization weighting parameters of each block based on the inaccuracy index and the white scene block identification result; S5. Perform image defogging processing according to the adjusted transmittance regularization weighting parameters.

2. The adaptive image defogging method according to claim 1, wherein In the step S1, the input image is divided into multiple blocks of N×N pixels, and the calculation method of the brightness mean is as follows: where I(x) is the brightness value of pixel x in the block; The calculation method of the brightness variance is as follows: where Var(I(x)) represents the variance of the average brightness of all pixels in the block; The calculation method of the color saturation is as follows: where Saturation(x)∈[0,1] is the saturation value of pixel x in the block; The calculation method of the local dark channel mean is as follows: Among them, J dark (x) is the dark channel value of the pixel x within the block; The transmittance consistency is calculated as follows: where t(x) is the initial transmittance of pixel x in the block, and Var(t(x)) represents the difference between the initial transmittance in the block and the transmittance of the neighboring block.

3. The adaptive image defogging method according to claim 2, wherein In the step S2, for each block, calculate its brightness mean value and brightness variance. If the current scene block meets the condition μ bright > 200, σ color < 10, then identify it as a white scene block and set a specific transmittance regularization weighting parameter.

4. The adaptive image defogging method according to claim 2, characterized in that, In the step S3, the inaccuracy index E is calculated as follows: where α, β, γ, δ are set weight coefficients, corresponding to the weights of brightness, saturation, local dark channel, and transmittance consistency respectively.

5. The adaptive image defogging method according to claim 4, wherein In the step S4, for non-white scene blocks, a linear interpolation strategy is used to adjust the transmittance regularization weighting parameters: ω new = ω default ·(1 - E)+ω min ·E Among them, ω new represents the adjusted transmittance regularization weighting parameter, ω default is the default value, ω min is the lower limit of adjustment; when E≈0, it means the current image block is an ordinary area, ω new ≈0.95, keep the default value; when E≈1, it means the current image block is a highlighted area, adjust ω new →ω min , reduce the defogging intensity to protect details; For the identified white scene blocks, a specific value is directly set: ω new = 0.

5.

6. The adaptive image defogging method according to claim 5, wherein In the step S5, according to the adjusted ω new calculate the initial transmittance of each block, and the formula is: where Ω(x) is the local block centered on pixel x, which is estimated by the top 0.1% brightest pixels in the dark channel; Calculate the normalized dark channel value within the computational block. C represents channels r, g, and b, y is the pixel within Ω(x), and I C (y) represents the brightness of each channel of the local block, and A C represents the pixel value of the atmospheric light for each channel.

7. The adaptive image defogging method according to claim 6, wherein The step S5 further includes: using a guided filter method to refine the output transmittance, specifically including: Assume that the output transmittance is a linear transformation of the guidance image I within the local window: where t i is the output transmittance at pixel i, I i is the value of the guidance image at pixel i, w k is a local window centered at pixel k, a k and b k are the linear coefficients within window w k ; Define the following cost function: where t 0i is the value of the initial transmittance at pixel i, and ò is the regularization parameter used to control the magnitude of a k to avoid overfitting; By minimizing this cost function, taking the partial derivatives with respect to a k and b k respectively and setting them equal to zero, we obtain: where w is the window w k and the number of pixels within it, μ k is the mean of the pixel values of the guidance image I within the window w k and is the variance of the pixel values of the guidance image I within the window w k and is the mean of the initial transmittance t0 within the window w k ;​​ For each pixel i, calculate the average value within all windows: In actual implementation, the calculation can be accelerated by taking the averages of a k and b k respectively and then performing a linear transformation: Thus, we get: The smoothness and edge-preserving ability of guided filtering are determined by the window size and the regularization parameter ò, t' i is the refined output transmittance.

8. The adaptive image defogging method according to claim 7, characterized in that The step S5 further includes: using the refined transmittance and atmospheric light to restore the fog-free image: where t0 represents the initial transmittance, t'(x) represents the refined transmittance, A represents the atmospheric light pixel value, I(x) is the observed image, and J(x) is the output fog-free image.

9. An adaptive image dehazing device based on dark channel prior, the device is used to implement the method according to any one of claims 1 to 8, characterized in that, The device includes: A feature extraction module for performing block processing on the input image and extracting the following features of each block: brightness mean, brightness variance, color saturation, local dark channel mean, and transmittance consistency; An identification module for identifying white scene blocks on the basis of feature extraction and setting transmittance regularization weighting parameters for the white scene blocks; An index calculation module for calculating the inaccuracy index of each block according to the extracted features; A parameter adjustment module for dynamically adjusting the transmittance regularization weighting parameters of each block based on the inaccuracy index and the white scene block identification result; A defogging processing module for performing image defogging processing according to the adjusted transmittance regularization weighting parameters.

10. An electronic device, characterized in that, The electronic device includes: Processor; A memory storing computer-readable instructions, which, when loaded and executed by the processor, implement the method according to any one of claims 1 to 8.