Image defogging method, system and device

By extracting the image brightness component and performing binarization, combined with a normalization model and an atmospheric scattering model, the problems of color cast in the sky region and halo effect in the depth-of-field abrupt change region are solved, thus improving the image dehazing effect and anti-interference ability.

CN115249218BActive Publication Date: 2026-02-24GUANGDONG RES INST OF WATER RESOURCES & HYDROPOWER
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210722657.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2026-02-24
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

Existing image dehazing techniques suffer from color casts and distortions in the sky and halo effects in areas with abrupt changes in depth of field. In particular, dark channel prior dehazing algorithms are ineffective in bright areas.

Method used

By extracting the luminance component of the image to be processed and binarizing it, the sky region and non-sky region are determined. Based on the region proportion, the transmittance is calculated using a normalized dark channel model or a normalized luminance model. In the transition region, a weighted fusion technique is used, combined with an atmospheric scattering model, to perform dehazing.

Benefits of technology

While maintaining the same computational complexity, it improves the image dehazing effect, solves the color cast problem in the sky area and the halo effect in the depth-of-field abrupt change area, and enhances the image's anti-interference ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115249218B_ABST
    Figure CN115249218B_ABST
Patent Text Reader

Abstract

The application discloses an image defogging method, system and device, which extracts the luminance component of a to-be-processed image and performs binarization to obtain a connected component set of a first image, and then determines a sky region and a non-sky region; the sky region proportion is calculated, and when the sky region proportion is less than a preset value, a normalized dark channel model is used to uniformly calculate the transmittance of the sky region and the non-sky region; when the sky region proportion is greater than or equal to the preset value, a normalized luminance model is used to calculate the transmittance of the sky region, and the normalized dark channel model is used to calculate the transmittance of the non-sky region; finally, an atmospheric scattering model is used to complete the defogging processing of the to-be-processed image. Compared with a traditional dark channel prior defogging algorithm, the application solves the problems of color deviation and distortion in the sky region and halo effect in the depth-of-field mutation region, improves the defogging effect of the image while keeping the calculation complexity unchanged, and enhances the anti-interference capability of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image dehazing method, system and apparatus. Background Technology

[0002] Images acquired under foggy or hazy weather conditions suffer from reduced contrast, color distortion, and blurring due to absorption and scattering by atmospheric water vapor and aerosols. This significantly diminishes the image's information clarity and usability, reducing the practicality of outdoor vision systems such as security monitoring and vehicle violation detection systems. It also directly impacts the image quality and command and decision-making efficiency of drones, limiting applications such as river patrols and target reconnaissance and identification. Therefore, researching fast and effective defogging algorithms is of paramount importance.

[0003] Existing image dehazing techniques can be broadly categorized into two types: The first type is based on image enhancement principles, primarily improving visual quality by increasing contrast and sharpness to achieve dehazing, such as color enhancement methods, contrast enhancement methods, Retinex, and homomorphic filtering. The second type is based on physical model principles, utilizing prior conditions and assumptions to restore a clear image by solving the inverse process of image degradation, such as dark channel prior dehazing algorithms and color line prior dehazing algorithms. Dehazing algorithms based on physical model principles consider the nature of image fogging, thus their image dehazing is more in line with objective laws and more practical. Dark channel prior dehazing algorithms, in particular, achieve good dehazing results in most situations. However, the prior conditions of dark channel prior dehazing algorithms are not applicable to bright areas such as the sky, leading to color casts and distortions in the sky region and halo effects in areas of abrupt depth changes. Summary of the Invention

[0004] One objective of this invention is to provide an image dehazing method, system, and apparatus that improves the image dehazing effect.

[0005] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of the present invention include:

[0006] On one hand, embodiments of the present invention provide an image dehazing method, comprising the following steps:

[0007] Extract the luminance component of the image to be processed to generate a first image, which is used to characterize the luminance of the image to be processed;

[0008] The first image is binarized to obtain the set of connected components of the first image;

[0009] The sky region and non-sky region are obtained based on the set of connected components;

[0010] If the proportion of the sky region is less than a preset value, the transmittance of the sky region and the non-sky region is calculated using a normalized dark channel model to generate a second image. The proportion of the sky region is the ratio of the sky region to the sum of the sky region and the non-sky region. The second image is used to characterize the transmittance of the sky region and the non-sky region.

[0011] If the proportion of the sky region is greater than or equal to the preset value, the transmittance of the sky region is calculated using the normalized brightness model, the transmittance of the non-sky region is calculated using the normalized dark channel model, and the second image is generated in the transition region using weighted fusion technology.

[0012] Based on the second image and the image to be processed, an atmospheric scattering model is used to generate a third image, which is the dehazed version of the image to be processed.

[0013] An image dehazing method according to an embodiment of the present invention extracts the luminance component of the image to be processed and binarizes it to obtain the connected component set of the first image, thereby determining the sky region and non-sky region. The method calculates the proportion of the sky region, and when the proportion is less than a preset value, uses a normalized dark channel model to uniformly calculate the transmittance of the sky region and non-sky region. When the proportion is greater than or equal to the preset value, a normalized luminance model is used to calculate the transmittance of the sky region, and a normalized dark channel model is used to calculate the transmittance of the non-sky region. Finally, an atmospheric scattering model is used to complete the dehazing process of the image to be processed. Compared with traditional dark channel prior-based dehazing algorithms, this method solves the problems of color cast and distortion in the sky region and halo effects in areas with abrupt changes in depth of field. It improves the dehazing effect of the image while maintaining the same computational complexity and enhances the image's anti-interference ability.

[0014] In addition, the image dehazing method according to the above embodiments of the present invention may also have the following additional technical features:

[0015] Furthermore, in an image dehazing method according to an embodiment of the present invention, the step of extracting the luminance component of the image to be processed and generating a first image includes:

[0016] The luminance component of the image to be processed is extracted using HSV color transformation technology to generate the first image.

[0017] Furthermore, in one embodiment of the present invention, binarizing the first image to obtain the set of connected components of the first image includes:

[0018] Based on the first image, the first segmentation threshold is calculated using the maximum inter-class variance threshold segmentation algorithm;

[0019] The first segmentation threshold is optimized to obtain the second segmentation threshold;

[0020] The first image is segmented using the second segmentation threshold to obtain a binary image of the first image;

[0021] Image connectivity analysis is used to obtain all connected components of the binary graph, resulting in the set of connected components.

[0022] Furthermore, in one embodiment of the present invention, obtaining the sky region and non-sky region based on the connected component set includes:

[0023] The top connected component is retained and used as the sky region. The top connected component is the connected component located at the top of the first image in the set of connected components.

[0024] The connected components in the set of connected components, excluding the top connected component, are marked as the non-sky region.

[0025] Further, in one embodiment of the present invention, the step of calculating the transmittance of the sky region using a normalized luminance model, calculating the transmittance of the non-sky region using the normalized dark channel model, and generating the second image using a weighted fusion technique in the transition region includes:

[0026] The transmittance of the sky region is calculated using the normalized brightness model to generate a first transmittance map;

[0027] The transmittance of the non-sky region is calculated using the normalized dark channel model to generate a second transmittance map.

[0028] Calculate the weighted sum of the transmittance of adjacent pixels in the boundary region between the first transmittance map and the second transmittance map;

[0029] The second image is generated based on the first transmittance map, the second transmittance map, and the transmittance weighted sum.

[0030] Furthermore, in one embodiment of the present invention, generating a third image using an atmospheric scattering model based on the second image and the image to be processed includes:

[0031] The second image is refined using a guided filtering algorithm;

[0032] Based on the refined second image and the image to be processed, a fourth image is generated using the atmospheric scattering model;

[0033] The fourth image is enhanced using a contrast enhancement algorithm to generate the third image.

[0034] Furthermore, in one embodiment of the present invention, generating a fourth image using the atmospheric scattering model based on the refined second image and the image to be processed includes:

[0035] If the proportion of the sky region is less than the preset value, a first high-value pixel is selected. The first high-value pixel is the top 0.1% of the high-value pixels in the dark channel image of the sky region and the non-sky region, and the pixel average value of the image to be processed corresponding to the first high-value pixel is used as the global atmospheric light estimation value.

[0036] If the proportion of the sky region is greater than or equal to the preset value, a second high-value pixel is selected. The second high-value pixel is the top 0.1% of the high-value pixels in the dark channel image of the sky region, and the average pixel value of the image to be processed corresponding to the second high-value pixel is used as the global atmospheric light estimation value.

[0037] The global atmospheric light estimate and the refined second image are substituted into the atmospheric scattering model, and the fourth image is generated through calculation.

[0038] On the other hand, embodiments of the present invention propose an image dehazing system, comprising:

[0039] An extraction module is used to extract the luminance component of the image to be processed and generate a first image, wherein the first image is used to characterize the luminance of the image to be processed;

[0040] The binarization module is used to binarize the first image and obtain the set of connected components of the first image;

[0041] The region selection module is used to obtain the sky region and the non-sky region based on the set of connected components.

[0042] The first generation module is used to calculate the transmittance of the sky region and the non-sky region using a normalized dark channel model if the proportion of the sky region is less than a preset value, and generate a second image. The proportion of the sky region is the ratio of the sky region to the sum of the sky region and the non-sky region. The second image is used to represent the transmittance of the sky region and the non-sky region. If the proportion of the sky region is greater than or equal to the preset value, the module calculates the transmittance of the sky region using a normalized luminance model, calculates the transmittance of the non-sky region using a normalized dark channel model, and generates the second image using a weighted fusion technique in the transition region.

[0043] The second generation module is used to generate a third image based on the second image and the image to be processed using an atmospheric scattering model. The third image is the image of the image to be processed after dehazing.

[0044] On the other hand, embodiments of the present invention provide an image dehazing apparatus, comprising:

[0045] At least one processor;

[0046] At least one memory for storing at least one program;

[0047] When the at least one program is executed by the at least one processor, the at least one processor implements the image dehazing method.

[0048] The advantages and beneficial effects of the present invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the present application:

[0049] This invention extracts the luminance component of the image to be processed and binarizes it to obtain the connected component set of the first image, thereby determining the sky region and non-sky region. It calculates the proportion of the sky region, and when the proportion is less than a preset value, uses a normalized dark channel model to uniformly calculate the transmittance of both the sky and non-sky regions. When the proportion is greater than or equal to the preset value, it uses a normalized luminance model to calculate the transmittance of the sky region and a normalized dark channel model to calculate the transmittance of the non-sky region. Finally, it uses an atmospheric scattering model to complete the dehazing process of the image to be processed. Compared with traditional dark channel prior-based dehazing algorithms, this invention solves the problems of color cast and distortion in the sky region and halo effects in areas with abrupt changes in depth of field. It improves the dehazing effect of the image while maintaining the same computational complexity, and enhances the image's anti-interference capability. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of this application or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions in this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0051] Figure 1 This is a flowchart illustrating a specific embodiment of an image dehazing method according to the present invention;

[0052] Figure 2 This is a schematic diagram illustrating the processing effect of a specific embodiment of the image dehazing method of the present invention;

[0053] Figure 3 This is a schematic diagram illustrating the processing effect of another specific embodiment of the image dehazing method of the present invention;

[0054] Figure 4 This is a schematic diagram of a specific embodiment of an image dehazing system according to the present invention;

[0055] Figure 5 This is a schematic diagram of a specific embodiment of an image dehazing device according to the present invention. Detailed Implementation

[0056] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0057] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0058] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0059] Images acquired under foggy or hazy weather conditions suffer from reduced contrast, color distortion, and blurring due to absorption and scattering by atmospheric water vapor and aerosols. This significantly diminishes the image's information clarity and usability, reducing the practicality of outdoor vision systems such as security monitoring and vehicle violation detection systems. It also directly impacts the image quality and command and decision-making efficiency of drones, limiting applications such as river patrols and target reconnaissance and identification. Therefore, researching fast and effective defogging algorithms is of paramount importance.

[0060] Existing image dehazing techniques can be broadly categorized into two types: The first type is based on image enhancement principles, primarily improving visual quality by increasing contrast and sharpness to achieve dehazing. Examples include color enhancement methods, contrast enhancement methods, Retinex, and homomorphic filtering. The second type is based on physical model principles, utilizing prior conditions and assumptions to restore a clear image by solving the inverse process of image degradation. Examples include dark channel prior dehazing algorithms and color line prior dehazing algorithms. This type of method is based on atmospheric scattering models. Physical model-based dehazing algorithms consider the nature of image fogging, thus their dehazing process is more consistent with objective laws and more practical. Dark channel prior dehazing algorithms, in particular, achieve good dehazing results in most situations. However, the prior conditions of physical model-based dehazing algorithms are not applicable to bright areas such as the sky, leading to color casts and distortions in the sky region and halo effects in areas of abrupt depth changes.

[0061] To address this issue, this invention proposes an image dehazing method, system, and apparatus. The method involves extracting the luminance component of the image to be processed and binarizing it to obtain the connected component set of the first image, thereby determining the sky region and non-sky regions. The method calculates the proportion of the sky region. When the sky region proportion is less than a preset value, a normalized dark channel model is used to uniformly calculate the transmittance of both the sky and non-sky regions. When the sky region proportion is greater than or equal to the preset value, a normalized luminance model is used to calculate the transmittance of the sky region, and a normalized dark channel model is used to calculate the transmittance of the non-sky region. Finally, an atmospheric scattering model is used to complete the dehazing process of the image to be processed. Compared with traditional dark channel prior-based dehazing algorithms, this method solves the problems of color cast and distortion in the sky region and halo effects in areas with abrupt changes in depth of field. It improves the dehazing effect of the image while maintaining the same computational complexity and enhances the image's anti-interference capability.

[0062] The following describes in detail, with reference to the accompanying drawings, an image dehazing method, system, and apparatus according to an embodiment of the present invention. First, an image dehazing method according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0063] Reference Figure 1This invention provides an image dehazing method, which can be applied to a terminal, a server, or software running on either a terminal or a server. The terminal can be a tablet, laptop, desktop computer, etc., but is not limited to these. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The image dehazing method in this invention mainly includes the following steps:

[0064] S101. Extract the luminance component of the image to be processed and generate the first image;

[0065] The first image is used to characterize the brightness of the image to be processed.

[0066] According to prior knowledge, in images containing a sky region (sky domain), the sky region generally has the characteristics of high brightness, large area, smooth pixel changes, and being located in the top region.

[0067] Therefore, in the embodiments of the present invention, a single frame of the image to be processed is obtained from a data source (such as mobile phone, video, drone image data, etc.), and the luminance component of the image to be processed is extracted using HSV color transformation technology to generate a luminance image, i.e., the first image.

[0068] Extracting the luminance component from the image to be processed:

[0069] V = max(R, G, B)

[0070] Wherein, R, G, and B correspond to the grayscale values ​​of the R, G, and B channels of the image to be processed, respectively.

[0071] S102. Binarize the first image to obtain the set of connected components of the first image;

[0072] In an embodiment of the present invention, an improved sky domain threshold segmentation algorithm is used to binarize the first image, and then image connectivity analysis technology is used to obtain all connected components of the binary image.

[0073] S102 can be further divided into the following steps S1021-S1024:

[0074] Step S1021: Based on the first image, the first segmentation threshold is calculated using the maximum inter-class variance thresholding algorithm.

[0075] Specifically, the segmentation threshold δ of the first image is calculated using the Otsu's Inter-Class Variance (OSTU) thresholding algorithm, which is the first segmentation threshold.

[0076] Step S1022: Optimize the first segmentation threshold to obtain a second segmentation threshold;

[0077] In an embodiment of the present invention, in order to reduce false detections in boundary regions and improve the reliability and accuracy of sky region identification, the first segmentation threshold obtained by OTU calculation in step S1021 is optimized to obtain a second segmentation threshold δ′:

[0078]

[0079] The second segmentation threshold δ′ remains within a reasonable range of [0, 255] while reducing false detections in the boundary region.

[0080] Step S1023: Segment the first image using the second segmentation threshold to obtain a binary image of the first image;

[0081] Step S1024: Use image connectivity analysis technology to obtain all connected components of the binary graph, and obtain the set of connected components.

[0082] Specifically, the portion of the binary image smaller than δ′ is regarded as a non-sky region pixel, and image connectivity analysis techniques, such as two-pass scanning or seed filling, are used on the remaining pixels to obtain all connected components of the binary image and mark them, thus obtaining a set of connected components.

[0083] S103. Obtain the sky region and non-sky region based on the connected component set;

[0084] In an embodiment of the present invention, the connected components located at the top of the first image are retained, and all other connected components marked differently from the top connected components are filled with pixels in the non-sky region to obtain the sky region. Specifically:

[0085] 1) Retain the top connected component and use the top connected component as the sky region. The top connected component is the connected component located at the top of the first image in the set of connected components.

[0086] 2) Fill the non-sky region with the other connected components in the connected component set except for the top connected component.

[0087] S104. If the proportion of the sky region is less than a preset value, the transmittance of the sky region and the non-sky region is calculated using a normalized dark channel model to generate a second image.

[0088] The sky region percentage is the ratio of the sky region to the sum of the sky region and the non-sky region, and the second image is used to characterize the transmittance of the sky region and the non-sky region.

[0089] Optionally, the default value is 1%.

[0090] In embodiments of the present invention, based on steps S101-S103, different global atmospheric light value estimation models are established for two cases: the proportion of the sky region is less than a preset value and the proportion of the sky region is greater than or equal to a preset value. It is understood that in computer vision and computer imaging, the fogging process of an image is usually expressed using an atmospheric scattering model, as follows:

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

[0092] Where x represents the spatial coordinates of a pixel, I(x) represents the grayscale value of the foggy image (i.e., the grayscale value of the image to be processed), J(x) represents the image after defogging, i.e., the fourth image in this embodiment of the invention, A represents the global atmospheric light estimation value, t(x) represents the transmittance, J(x)t(x) represents the incident light attenuation term, which is used to describe the radiation component of the reflected light from the target after attenuation in the propagation medium, and A[1-t(x)] represents the atmospheric light imaging model, which is used to describe the radiation component generated by the scattering of ambient atmospheric light on the target.

[0093] It is understandable that, since the brightness of the sky region is mainly produced by atmospheric light, the dark channel value of the sky region is very close to the global atmospheric light estimate. In addition, the dark channel of a foggy image can be regarded as an approximation of the fog density, so it can be assumed that the high value region of the dark channel image is produced by the radiation of atmospheric light.

[0094] The formula for calculating the dark channel image is:

[0095]

[0096] I c (y) represents the pixel value of a certain pixel y∈Ω(x) in the image to be processed, corresponding to the channel c∈{R,G,B}.

[0097] Specifically, in one embodiment of the present invention, if the sky region accounts for less than 1%, the transmittance of the sky region and the non-sky region is calculated using the normalized dark channel model, that is, the transmittance of the entire image is calculated using the normalized dark channel model to generate a transmittance map, i.e., the second image.

[0098] When the sky area accounts for less than 1%, the transmittance of the sky area and the non-sky area is as follows:

[0099]

[0100] Where w represents the adjustment factor, with a value range of [0.9, 1]. Generally, a value of w of 0.95 can meet the needs of most scenarios; A c This indicates that the global atmospheric light estimate corresponds to the component value of channel c∈{R,G,B}.

[0101] S105. If the proportion of the sky region is greater than or equal to the preset value, the transmittance of the sky region is calculated using the normalized brightness model, the transmittance of the non-sky region is calculated using the normalized dark channel model, and the second image is generated in the transition region using weighted fusion technology.

[0102] According to prior knowledge, the dark channel prior holds true for fog-free non-sky regions. However, for fog-free sky regions, the dark channel value is often large (not zero), rendering the dark channel prior invalid and resulting in a large error in calculating the transmittance of the sky region based on the dark channel prior. In the embodiments of the present invention, when the proportion of the sky region is greater than or equal to a preset value, a normalized luminance model is used to calculate the transmittance of the sky region, and a normalized dark channel model is used to calculate the transmittance of the non-sky region.

[0103] Specifically, step S105 can be further divided into the following steps S1051-S1054:

[0104] Step S1051: Calculate the transmittance of the sky region using the normalized brightness model to generate a first transmittance map; wherein, the transmittance of the sky region is calculated using the normalized brightness model:

[0105]

[0106] Where γ represents the transmittance coefficient of the normalized luminance model, with a value range of [1, 6]. Generally, a value of γ = 3.5 can meet the requirements of most scenarios; V represents the luminance component of the image to be processed; V * V represents the maximum value of the luminance component. To reduce the impact of data noise, V * Generally, 90% of V is taken.

[0107] Step S1052: Calculate the transmittance of the non-sky region using the normalized dark channel model to generate a second transmittance map;

[0108] The transmittance in the non-sky region was calculated using a normalized dark channel model.

[0109]

[0110] Step S1053: Calculate the weighted sum of the transmittance of adjacent pixels in the boundary region between the first transmittance map and the second transmittance map;

[0111] The transmittance weighted sum of adjacent pixels in the boundary region between the first and second transmittance maps is as follows:

[0112] t bound (x)=t sky (x)×(1-λ)+t non-sky (x+1)×λ

[0113] Wherein, λ represents the transmittance weighting factor of the boundary between the sky region and the non-sky region.

[0114] Step S1054: Generate the second image based on the first transmittance map, the second transmittance map, and the transmittance weighted sum.

[0115] Specifically, in the embodiments of the present invention, the transmittance weighted sum t obtained in step S1053 is used. bound (x) replaces the transmittance value of the original pixel to obtain the transmittance map, i.e., the second image, which makes the transition at the boundary between the sky area and the non-sky area smoother and improves the edge visual effect of the second image.

[0116] S106. Based on the second image and the image to be processed, generate a third image using an atmospheric scattering model.

[0117] The third image is the image after the image to be processed has been dehazed.

[0118] S106 can be further divided into the following steps S1061-S1063:

[0119] Step S1061: Refine the second image using a guided filtering algorithm;

[0120] In an embodiment of the present invention, a guided filtering algorithm is used to filter the second image, specifically including the following steps:

[0121] 1) Apply mean filtering to the guiding image I and the second image P using a window of radius r to obtain the mean value. I and mean P ;

[0122] 2) Apply mean filtering to I*I (* denotes matrix multiplication) and I*P using a window with radius r to obtain corrII and corrIP respectively;

[0123] 3) Calculate the covariances covII and covIP of I*I and I*P respectively:

[0124]

[0125] 4) Calculate parameters a and b:

[0126]

[0127] Where e is the regularization parameter.

[0128] 5) Apply mean filtering to the image formed by parameters a and b using a window with radius r to obtain the mean value. a and mean b ;

[0129] 6) According to mean a and mean b The filtered image, i.e., the refined second image q, is calculated as follows:

[0130] q = mean a *I+mean b

[0131] Step S1062: Based on the refined second image and the image to be processed, generate a fourth image using the atmospheric scattering model;

[0132] Specifically, as described in step S104, in computer vision and computer imaging, the fogging process of an image is usually expressed using an atmospheric scattering model, as follows:

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

[0134] It is understandable that, since the brightness of the sky region is mainly produced by atmospheric light, the dark channel value of the sky region is very close to the global atmospheric light estimate. In addition, the dark channel of a foggy image can be regarded as an approximation of the fog density, so it can be assumed that the high value region of the dark channel image is produced by the radiation of atmospheric light.

[0135] The formula for calculating the dark channel image is:

[0136]

[0137] I c (y) represents the pixel value of a certain pixel y∈Ω(x) in the image to be processed, corresponding to the channel c∈{R,G,B}.

[0138] In an embodiment of the present invention, a fourth image is generated using an atmospheric scattering model based on the refined second image and the image to be processed, specifically including the following steps:

[0139] 1) If the proportion of the sky region is less than the preset value, select the first high value pixel. The first high value pixel is the first 0.1% of the high value pixels of the dark channel image of the sky region and the non-sky region, and use the pixel average value of the image to be processed corresponding to the first high value pixel as the global atmospheric light estimation value A.

[0140] 2) If the proportion of the sky region is greater than or equal to the preset value, select the second highest value pixel. The second highest value pixel is the top 0.1% of the high value pixels in the dark channel image of the sky region, and use the average pixel value of the image to be processed corresponding to the second highest value pixel as the global atmospheric light estimation value A.

[0141] 3) Substitute the global atmospheric light estimate A and the refined second image (including transmittance values) into the atmospheric scattering model, and generate the fourth image J through calculation.

[0142] In an embodiment of the present invention, a tolerance mechanism is introduced to prevent the transmittance from becoming too low. A lower limit value t0 of the transmittance is set (generally 0.1), which yields the dehazed image, i.e., the fourth image J.

[0143]

[0144] Where t(x) represents the transmittance value obtained after calculation by the guided filtering algorithm.

[0145] Step S1063: The fourth image is enhanced using a contrast enhancement algorithm to generate the third image.

[0146] Specifically, since the fourth image obtained in step S1062 has an overall dark tone, in this embodiment of the invention, a contrast enhancement algorithm is used to enhance the fourth image. By increasing the grayscale difference between the brightest and darkest pixels, the overall brightness and contrast are improved to obtain the third image. The specific mathematical model is as follows:

[0147] Y=(1-α)×I mean +α×I

[0148] Where I represents the input image, i.e., the fourth image; I mean I represents the grayscale mean of the image; α represents the contrast adjustment factor. When α>1, the contrast is enhanced, and when α<1, the contrast is reduced.

[0149] Figure 2 and Figure 3 The image dehazing method of this invention is shown in the processing effect diagram of two images to be processed (compared to the traditional dehazing algorithm based on the physical model principle - dark channel prior dehazing algorithm).

[0150] Combination Figure 2 , Figure 3As described in steps S101-S106, this invention extracts the luminance component of the image to be processed and binarizes it to obtain the connected component set of the first image, thereby determining the sky region and non-sky region. It calculates the proportion of the sky region, and when the proportion is less than a preset value, uses a normalized dark channel model to uniformly calculate the transmittance of both the sky and non-sky regions. When the proportion is greater than or equal to the preset value, it uses a normalized luminance model to calculate the transmittance of the sky region and a normalized dark channel model to calculate the transmittance of the non-sky region. Finally, it uses an atmospheric scattering model to complete the dehazing process of the image to be processed. Compared with traditional dehazing algorithms based on physical model principles, this invention solves the problems of color cast and distortion in the sky region and halo effects in areas with abrupt changes in depth of field. While maintaining the same computational complexity, it improves the dehazing effect of the image and enhances the image's anti-interference capability.

[0151] Secondly, an image dehazing system according to an embodiment of this application will be described with reference to the accompanying drawings.

[0152] Figure 4 This is a schematic diagram of an image dehazing system according to an embodiment of this application.

[0153] The system specifically includes:

[0154] Extraction module 401 is used to extract the brightness component of the image to be processed and generate a first image, wherein the first image is used to characterize the brightness of the image to be processed;

[0155] Binarization module 402 is used to binarize the first image to obtain the set of connected components of the first image;

[0156] The region selection module 403 is used to obtain the sky region and non-sky region based on the connected component set;

[0157] The first generation module 404 is configured to: if the proportion of the sky region is less than a preset value, calculate the transmittance of the sky region and the non-sky region using a normalized dark channel model to generate a second image, wherein the proportion of the sky region is the ratio of the sky region to the sum of the sky region and the non-sky region, and the second image is used to characterize the transmittance of the sky region and the non-sky region; if the proportion of the sky region is greater than or equal to the preset value, calculate the transmittance of the sky region using a normalized brightness model, calculate the transmittance of the non-sky region using a normalized dark channel model, and generate the second image in the transition region using a weighted fusion technique;

[0158] The second generation module 405 is used to generate a third image based on the second image and the image to be processed using an atmospheric scattering model. The third image is the image of the image to be processed after dehazing.

[0159] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0160] Reference Figure 5 This application provides an image dehazing device, comprising:

[0161] At least one processor 501;

[0162] At least one memory 502 is used to store at least one program;

[0163] When the at least one program is executed by the at least one processor 501, the at least one processor 501 implements the image dehazing method described in steps S101-S106.

[0164] Similarly, the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0165] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the inventive techniques. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0166] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or may be implemented in separate physical devices or software modules. It should be noted that a detailed discussion of the implementation details of each module is unnecessary for understanding this application; those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.

[0167] If the aforementioned functions are implemented as 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 this application, in essence, or the part that contributes to the prior art, or the technical solution itself, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several programs to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0168] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques recognized in the art: discrete logic circuits with logic gates that implement logic functions for data signals, application-specific integrated circuits (ASICs) with suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0169] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

[0170] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. An image dehazing method, characterized in that, Includes the following steps: Extract the luminance component of the image to be processed to generate a first image, which is used to characterize the luminance of the image to be processed; The first image is binarized to obtain the set of connected components of the first image; The sky region and non-sky region are obtained based on the set of connected components; If the proportion of the sky region is less than a preset value, the transmittance of the sky region and the non-sky region is calculated using a normalized dark channel model to generate a second image. The proportion of the sky region is the ratio of the sky region to the sum of the sky region and the non-sky region. The second image is used to characterize the transmittance of the sky region and the non-sky region. If the proportion of the sky region is greater than or equal to the preset value, the transmittance of the sky region is calculated using the normalized brightness model, the transmittance of the non-sky region is calculated using the normalized dark channel model, and the second image is generated in the transition region using weighted fusion technology. Based on the second image and the image to be processed, an atmospheric scattering model is used to generate a third image, which is the dehazed image of the image to be processed. The step of binarizing the first image to obtain the set of connected components of the first image includes: Based on the first image, the first segmentation threshold is calculated using the maximum inter-class variance threshold segmentation algorithm; The first segmentation threshold is optimized to obtain a second segmentation threshold; the second segmentation threshold is expressed by the following formula: Where δ is the first segmentation threshold, and the second segmentation threshold δ ′ While reducing false positives in the boundary region, it remains within a reasonable range of [0, 255]. The first image is segmented using the second segmentation threshold to obtain a binary image of the first image; Image connectivity analysis is used to obtain all connected components of the binary graph, resulting in the set of connected components.

2. The image dehazing method according to claim 1, characterized in that, The step of extracting the luminance component of the image to be processed and generating the first image includes: The luminance component of the image to be processed is extracted using HSV color transformation technology to generate the first image.

3. The image dehazing method according to claim 1, characterized in that, The step of obtaining the sky region and non-sky region based on the connected component set includes: The top connected component is retained and used as the sky region. The top connected component is the connected component located at the top of the first image in the set of connected components. The connected components in the set of connected components, excluding the top connected component, are marked as the non-sky region.

4. The image dehazing method according to claim 1, characterized in that, The process of calculating the transmittance of the sky region using a normalized brightness model, calculating the transmittance of the non-sky region using the normalized dark channel model, and generating the second image using a weighted fusion technique in the transition region includes: The transmittance of the sky region is calculated using the normalized brightness model to generate a first transmittance map; The transmittance of the non-sky region is calculated using the normalized dark channel model to generate a second transmittance map. Calculate the weighted sum of the transmittance of adjacent pixels in the boundary region between the first transmittance map and the second transmittance map; The second image is generated based on the first transmittance map, the second transmittance map, and the transmittance weighted sum.

5. The image dehazing method according to claim 1, characterized in that, The step of generating a third image based on the second image and the image to be processed using an atmospheric scattering model includes: The second image is refined using a guided filtering algorithm; Based on the refined second image and the image to be processed, a fourth image is generated using the atmospheric scattering model; The fourth image is enhanced using a contrast enhancement algorithm to generate the third image.

6. The image dehazing method according to claim 5, characterized in that, The step of generating a fourth image using the atmospheric scattering model based on the refined second image and the image to be processed includes: If the proportion of the sky region is less than the preset value, a first high-value pixel is selected. The first high-value pixel is the top 0.1% of the high-value pixels in the dark channel image of the sky region and the non-sky region, and the pixel average value of the image to be processed corresponding to the first high-value pixel is used as the global atmospheric light estimation value. If the proportion of the sky region is greater than or equal to the preset value, a second high-value pixel is selected. The second high-value pixel is the top 0.1% of the high-value pixels in the dark channel image of the sky region, and the average pixel value of the image to be processed corresponding to the second high-value pixel is used as the global atmospheric light estimation value. The global atmospheric light estimate and the refined second image are substituted into the atmospheric scattering model, and the fourth image is generated through calculation.

7. An image dehazing system, characterized in that, include: An extraction module is used to extract the luminance component of the image to be processed and generate a first image, wherein the first image is used to characterize the luminance of the image to be processed; The binarization module is used to binarize the first image and obtain the set of connected components of the first image; The step of binarizing the first image to obtain the set of connected components of the first image includes: Based on the first image, the first segmentation threshold is calculated using the maximum inter-class variance threshold segmentation algorithm; The first segmentation threshold is optimized to obtain a second segmentation threshold; the second segmentation threshold is expressed by the following formula: Where δ is the first segmentation threshold, and the second segmentation threshold δ ′ While reducing false positives in the boundary region, it remains within a reasonable range of [0, 255]. The first image is segmented using the second segmentation threshold to obtain a binary image of the first image; Image connectivity analysis techniques are used to obtain all connected components of the binary graph, resulting in the set of connected components. The region selection module is used to obtain the sky region and the non-sky region based on the set of connected components. The first generation module is used to calculate the transmittance of the sky region and the non-sky region using a normalized dark channel model if the proportion of the sky region is less than a preset value, and generate a second image. The proportion of the sky region is the ratio of the sky region to the sum of the sky region and the non-sky region. The second image is used to represent the transmittance of the sky region and the non-sky region. If the proportion of the sky region is greater than or equal to the preset value, the module calculates the transmittance of the sky region using a normalized luminance model, calculates the transmittance of the non-sky region using a normalized dark channel model, and generates the second image using a weighted fusion technique in the transition region. The second generation module is used to generate a third image based on the second image and the image to be processed using an atmospheric scattering model. The third image is the image of the image to be processed after dehazing.

8. An image dehazing device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements an image dehazing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Dark channel prior based single-image defogging method

    CN106251301A