Image haze removal method, device and computer-readable storage medium

By filtering the dark channel value of the target image pixel point and calculating the preset formula, after correcting the transmittance value, the image is mist-transmissive, which solves the problems of high complexity and low efficiency in the prior art, and realizes efficient and simple image mist-transmissive processing.

CN115861092BActive Publication Date: 2025-07-01ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211438000.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2025-07-01
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

The existing digital mist-transmissive processing technology has high complexity and needs to be improved efficiency, making it difficult to effectively process the transmittance of pixel points, resulting in low image mist-transmissive processing efficiency.

Method used

By obtaining the dark channel value of each pixel point in the target image, performing filtering processing, it is brought into a preset formula to calculate the first transmittance value, and correcting the reference transmittance value according to the comparison, and finally performing mist-transmissive processing on the image according to the corrected transmittance value.

Benefits of technology

The transmittance correction process is simplified, the algorithm complexity is reduced, the efficiency and speed of image mist transmission processing are improved, and the good mist transmission effect is maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861092B_ABST
    Figure CN115861092B_ABST
Patent Text Reader

Abstract

The present application discloses an image haze removal method, apparatus and computer-readable storage medium. The image haze removal method includes: obtaining the dark channel value of each pixel point in the target image; performing filtering processing on the dark channel values of all pixel points to obtain the dark channel filtered value of each pixel point; substituting the dark channel filtered value of each pixel point into a first preset formula respectively as an independent variable to obtain the first transmittance value of each pixel point; in response to the first transmittance value of a pixel point not exceeding the first reference transmittance value corresponding to the pixel point, correcting the first transmittance value to the first reference transmittance value; in response to the first transmittance value of a pixel point exceeding the second reference transmittance value corresponding to the pixel point, correcting the first transmittance value of the pixel point to the second reference transmittance value; performing haze removal processing on the target image according to the first transmittance value of each pixel point. The method of the present application can reduce the difficulty of image haze removal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of image defogging, and particularly relates to an image defogging method, device, and computer-readable storage medium. Background Art

[0002] Particles such as tiny water droplets existing in the air absorb or scatter visible light, resulting in unclear images collected by a video acquisition device, thus making subsequent image processing and application scenarios more difficult. Therefore, it is necessary to perform defogging processing on the images to make them clear.

[0003] Defogging processing is mainly divided into two types: physical defogging processing and digital defogging processing. Physical defogging processing is optical defogging processing, mainly implemented by a camera lens, but it is expensive. Digital defogging processing is a back-end image restoration technology, with characteristics such as low cost and easy deployment. However, the current mainstream digital defogging processing technology has high complexity and the efficiency needs to be further improved. Summary of the Invention

[0004] This application provides an image defogging method, device, and computer-readable storage medium, which can reduce the difficulty of image defogging processing and improve the efficiency of image defogging processing.

[0005] In the first aspect of the embodiment of the present application, an image haze removal method is provided. The method includes: obtaining the dark channel value of each pixel point in the target image; performing filtering processing on the dark channel values of all the pixel points to obtain the dark channel filtered value of each pixel point; taking the dark channel filtered value of each pixel point as an independent variable and substituting it into a first preset formula to obtain the first transmittance value of each pixel point; for each pixel point, substituting the dark channel value of the pixel point into a second preset formula to obtain the first reference transmittance value of the pixel point, and in response to the first transmittance value of the pixel point not exceeding the first reference transmittance value corresponding to the pixel point, correcting the first transmittance value to the first reference transmittance value, where the first reference transmittance value corresponding to the pixel point is less than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by taking the dark channel value of the pixel point as an independent variable and substituting it into the first preset formula; and / or, for each pixel point, substituting the dark channel value of the pixel point into a third preset formula to obtain the second reference transmittance value of the pixel point, and in response to the first transmittance value of the pixel point exceeding the second reference transmittance value corresponding to the pixel point, correcting the first transmittance value of the pixel point to the second reference transmittance value, where the second reference transmittance value corresponding to the pixel point is greater than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by taking the dark channel value of the pixel point as an independent variable and substituting it into the first preset formula; performing haze removal processing on the target image according to the first transmittance value of each pixel point.

[0006] In the second aspect of the embodiment of the present application, an image haze removal device is provided. The image haze removal device includes a processor, a memory, and a communication circuit. The processor is respectively coupled to the memory and the communication circuit. Program data is stored in the memory, and the processor realizes the steps in the above method by executing the program data in the memory.

[0007] In the third aspect of the embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to realize the steps in the above method.

[0008] The beneficial effect is that in the prior art, when correcting the first transmittance value of a pixel point, the method of edge-preserving filtering is generally used. However, the method of edge-preserving filtering has high complexity and long time consumption. In the solution of the present application, it is only necessary to compare the first transmittance value with the first reference transmittance value and / or the second reference transmittance value corresponding to the pixel point, which is simple to implement, has low complexity, fast execution speed, and has a good haze removal effect. Description of the Drawings

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

[0010] Figure 1 is a schematic flowchart of an implementation manner of the image defogging method of the present application;

[0011] Figure 2 is a schematic flowchart of determining the target atmospheric light value of the target image in the present application;

[0012] Figure 3 is a schematic diagram of the coordinate system established in the present application;

[0013] Figure 4 is a schematic structural diagram of an implementation manner of the image defogging device of the present application;

[0014] Figure 5 is a schematic structural diagram of another implementation manner of the image defogging device of the present application;

[0015] Figure 6 is a schematic structural diagram of an implementation manner of the computer-readable storage medium of the present application. Specific Embodiments

[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0017] It should be noted that the terms "first" and "second" in the present application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0018] Refer to Figure 1 , Figure 1 which is a schematic flowchart of an implementation of the image haze removal method of this application. The method includes:

[0019] S110: Obtain the dark channel value of each pixel point in the target image.

[0020] Specifically, the target image is an RGB image. For each pixel point in the target image, it has three components, namely the R (red) component, the G (green) component, and the B (blue) component.

[0021] In an application scenario, step S110 specifically includes: respectively determining the minimum value among the R component, the G component, and the B component of each pixel point, and then using all the obtained minimum values to construct a grayscale image with the same size as the target image. In this grayscale image, the pixel value of a pixel point is the minimum value corresponding to the pixel point at the same position in the target image. Then, perform minimum filter smoothing processing on the grayscale image, that is, in the grayscale image, take a rectangular window of a certain size centered on each pixel point in turn, and then for each rectangular window, perform the following steps: replace the pixel value at the center point of the rectangular window with the minimum pixel value in the rectangular window, so as to obtain the dark channel image of the target image. The pixel value of the pixel point in this dark channel image is the dark channel value corresponding to the pixel point at the same position in the target image.

[0022] In another application scenario, step S110 specifically includes: respectively determining the minimum value among the R component, the G component, and the B component of each pixel point as the dark channel value of each pixel point.

[0023] Specifically, for each pixel point, the following steps are performed:

[0024] Determine the minimum value among the R component, the G component, and the B component corresponding to the pixel point, and then determine this minimum value as the dark channel value of the pixel point.

[0025] Compared with the above application scenario, in this application scenario, directly determine the minimum value corresponding to the pixel point as the dark channel value of the pixel point, which can simplify the process and improve the efficiency of the whole method.

[0026] In other implementation manners, other methods can also be used to determine the dark channel value of each pixel point, and this application does not limit the specific process of determining the dark channel value.

[0027] S120: Perform filtering processing on the dark channel values of all pixel points to obtain the dark channel filtered value of each pixel point.

[0028] Specifically, the purpose of performing filtering processing on the dark channel values of all pixel points is to reduce the difference between the dark channel values of two adjacent pixel points.

[0029] Among them, the dark channel value of a pixel can reflect the depth of field to a certain extent. For the locally non-mutating region in the target image, its depth of field should be approximate. The locally non-mutating region refers to the region on the same plane or approximately the same plane of the same object in the target image. For example, assuming there is a billboard in the target image, the region on the same surface of the billboard is the locally non-mutating region.

[0030] Opposite to the locally non-mutating region is the mutating region. For example, if the target image is an image of a corner of a wall, the depth of field corresponding to the two different walls is different at this time, so the region corresponding to the corner is the mutating region.

[0031] In order to retain details and make the locally non-mutating region satisfy the approximate depth of field, the dark channel values of all pixels are filtered to narrow the dark channel values of adjacent two pixels, so that the dark channel filtered values of the pixels in the locally non-mutating region are similar after filtering.

[0032] Among them, in order to reduce the algorithm complexity and improve the efficiency, the filtering process can specifically be a simple mean filtering process. And during the filtering process, the size of the selected filtering window can be set according to actual needs, and the size of the filtering window can be proportional to the resolution of the target image.

[0033] Among them, the present application does not limit the specific process of the filtering process, and it can also be other methods such as maximum filtering or median filtering.

[0034] S130: Respectively take the dark channel filtered value of each pixel as the independent variable and substitute it into the first preset formula to obtain the first transmittance value of each pixel.

[0035] Specifically, for each pixel, substitute the corresponding dark channel filtered value into the first preset formula to obtain the corresponding first transmittance value.

[0036] In this embodiment, the first preset formula is as follows:

[0037] y = 1 - ω × x / A, where x is the independent variable, y is the dependent variable, ω is the preset haze-removing intensity, the range of ω is [0, 1], and A is the target atmospheric light value of the target image. That is to say, use the following formula to determine the first transmittance value corresponding to the pixel:

[0038] t i = 1 - ω × m i / A, where t i is the first transmittance value corresponding to pixel i, ω is the preset haze-removing intensity, the range of ω is [0, 1], m i is the dark channel filtered value corresponding to pixel i, and A is the target atmospheric light value of the target image.

[0039] In this embodiment, the smaller the first transmittance value corresponding to a pixel, the more fog exists at that pixel, and the greater the intensity of fog penetration for that pixel in the subsequent process.

[0040] In other embodiments, the first transmittance value of a pixel can also be determined according to other formulas, which are not limited herein. However, for the sake of convenience of description, the following will be described with the first preset formula being: y = 1 - ω×x / A.

[0041] Refer to Figure 2 , in this embodiment, the steps of determining the target atmospheric light value of the target image include:

[0042] S1311: Determine the first atmospheric light value corresponding to the R component, the second atmospheric light value corresponding to the G component, and the third atmospheric light value corresponding to the B component of the target image.

[0043] Specifically, all pixels can be sorted in descending order according to the dark channel filter value, and then the top N% of the pixels are found. According to the target image, the average value of the R component, the average value of the G component, and the average value of the B component corresponding to the top N% of the pixels are determined. Among them, the obtained average value of the R component is the first atmospheric light value corresponding to the R component of the target image, the obtained average value of the G component is the second atmospheric light value corresponding to the G component of the target image, and the obtained average value of the B component is the third atmospheric light value corresponding to the B component of the target image.

[0044] Alternatively, the pixel corresponding to the largest dark channel filter value can also be found, and then the R component corresponding to this pixel is determined as the first atmospheric light value corresponding to the R component of the target image, the G component corresponding to this pixel is determined as the second atmospheric light value corresponding to the G component of the target image, and the B component corresponding to this pixel is determined as the third atmospheric light value corresponding to the B component of the target image.

[0045] S1312: Determine the target atmospheric light value among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value.

[0046] Specifically, in this embodiment, the minimum value among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value is determined as the target atmospheric light value.

[0047] However, in other embodiments, the maximum value or the average value, etc., among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value can also be determined as the target atmospheric light value.

[0048] S140: For each pixel, substitute the dark channel value of the pixel into the second preset formula to obtain the first reference transmittance value of the pixel, and in response to the first transmittance value of the pixel not exceeding the first reference transmittance value corresponding to the pixel, correct the first transmittance value to the first reference transmittance value, where the first reference transmittance value corresponding to the pixel is less than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by substituting the dark channel value of the pixel as the independent variable into the first preset formula.

[0049] Specifically, in this embodiment, when using the above y = 1 - ω×x / A to determine the first transmittance value of a pixel, the second transmittance value of the pixel is also determined using y = 1 - ω×x / A, that is, the second transmittance value corresponding to the pixel is determined using the following formula:

[0050] T i = 1 - ω×M i / A, where T i is the second transmittance value corresponding to pixel i, ω is the preset fog penetration intensity, the range of ω is [0, 1], M i is the dark channel value corresponding to pixel i, and A is the target atmospheric light value of the target image.

[0051] Among them, the second transmittance value of the pixel is obtained according to the corresponding dark channel value, while the first transmittance value of the pixel is obtained according to the corresponding dark channel filter value. Therefore, compared with the first transmittance value, the second transmittance value of the pixel is closer to the true transmittance value of the pixel, that is, the gap between the second transmittance value of the pixel and the true transmittance value of the pixel is less than the gap between the first transmittance value of the pixel and the true transmittance value of the pixel, where the gap between the two transmittance values refers to the absolute value of the difference between the two transmittance values.

[0052] At the same time, in this embodiment, the second preset formula needs to satisfy: for each pixel, the first reference transmittance value obtained by substituting the dark channel value of the pixel into the second preset formula is less than or equal to the second transmittance value corresponding to the pixel.

[0053] In this embodiment, the second preset formula is: y = 1 - a×x / A, where x is the independent variable, y is the dependent variable, and the range of a is [ω, 1]. That is, the first reference transmittance value of the pixel is determined using the following formula:

[0054] P i = 1 - a×M i / A, where P i is the first reference transmittance value corresponding to pixel i, a is the first parameter, M i is the dark channel value of pixel i, and the value range of a is [ω, 1].

[0055] Among them, a can also be called the over-fog suppression parameter. The larger it is, the smaller the value of P i is, and the less the over-fog phenomenon can be reduced, that is, the weaker the ability to suppress over-fog.

[0056] Among them, although filtering the dark channel values of all pixel points can preserve details, for mutation regions, it will cause insufficient fog penetration or over-fog penetration. Specifically, for mutation regions, assume that there are adjacent pixel points A and pixel point B, and the depth of field corresponding to pixel point A and pixel point B differs greatly, that is, the dark channel values of pixel point A and pixel point B differ greatly. However, after filtering, the dark channel filter values of pixel point A and pixel point B differ less. As a result, the first transmittance values of pixel point A and pixel point B calculated based on the dark channel filter values will be one larger and one smaller. For the larger one, it will be determined later that the fog at this pixel point is smaller, thus reducing the fog penetration intensity and causing insufficient fog penetration. For the smaller one, it will be determined later that there is more fog at this pixel point, thus increasing the fog penetration intensity and causing over-fog penetration.

[0057] Therefore, for each pixel point, if its first transmittance value does not exceed the corresponding first reference transmittance value, and since the first reference transmittance value is less than or equal to the second transmittance value corresponding to the pixel point, it means that the first transmittance value of the pixel point is less than the corresponding second transmittance value. Furthermore, it means that the first transmittance value corresponding to the pixel point is on the small side. Later, it will be determined that there is more fog at this pixel point, and then the fog penetration intensity will be increased during fog penetration, resulting in the over-fog penetration phenomenon.

[0058] In order to reduce the over-fog penetration phenomenon, if the first transmittance value of a pixel point does not exceed the first reference transmittance value corresponding to the pixel point, then the first transmittance value of the pixel point is corrected to the first reference transmittance value, that is, the first transmittance value is increased.

[0059] S150: For each pixel point, substitute the dark channel value of the pixel point into the third preset formula to obtain the second reference transmittance value of the pixel point, and in response to the first transmittance value of the pixel point exceeding the second reference transmittance value corresponding to the pixel point, correct the first transmittance value of the pixel point to the second reference transmittance value, where the second reference transmittance value corresponding to the pixel point is greater than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by substituting the dark channel value of the pixel point as the independent variable into the first preset formula.

[0060] Specifically, the third preset formula needs to satisfy: for each pixel point, the second reference transmittance value obtained by substituting the dark channel value of the pixel point into the third preset formula is greater than or equal to the second transmittance value corresponding to the pixel point.

[0061] In this embodiment, the third preset formula is: y = 1 - b×x / A, where x is the independent variable, y is the dependent variable, and the range of b is [0, ω]. That is, the second reference transmittance value of the pixel is determined using the following formula:

[0062] Q i = 1 - b×M i / A, where Q i is the second reference transmittance value corresponding to pixel i, b is the second parameter, and M i is the dark channel value of pixel i, and the value range of b is [0, ω].

[0063] Among them, b is also called the under-fog suppression parameter. The larger it is, the smaller the value of Q i , and the more the under-fog phenomenon can be reduced, that is, the stronger the ability to suppress under-fog.

[0064] Specifically, for each pixel, if its first transmittance value exceeds the corresponding second reference transmittance value, and the second reference transmittance value is greater than or equal to the corresponding second transmittance value, it indicates that the first transmittance value of the pixel is greater than the corresponding second transmittance value. Furthermore, it shows that the first transmittance value corresponding to the pixel is on the high side. Subsequently, it will be determined that there is less fog at this pixel, and thus the fog penetration intensity will be reduced during fog penetration, resulting in the under-fog phenomenon.

[0065] To reduce the under-fog phenomenon, if the first transmittance value of a pixel exceeds the second reference transmittance value corresponding to the pixel, the first transmittance of the pixel is corrected to the second reference transmittance value, that is, the first transmittance is reduced.

[0066] If the first transmittance value of a pixel exceeds the corresponding first reference transmittance value and does not exceed the corresponding second reference transmittance value, then the first transmittance of this pixel is relatively close to the second transmittance. The filtering process in step S120 has little impact on the accuracy of its first transmittance value. Therefore, to retain more details, the first transmittance value of the pixel remains unchanged.

[0067] In summary, for pixel i, if t i ≤P i , then let t i =P i = 1 - a×M i / A. If P i <t i ≤Q i , then keep t i = 1 - ω×m i / A. If t i ≥Q i , then let t i =Q i= 1 - b×M i / A。

[0068] For intuitive understanding, an explanation is given in combination with the Figure 3 coordinate system. Figure 3 The X-axis of the coordinate system represents the dark channel value of the pixel points. Figure 3 The expression of the solid line 1 in i is y = 1 - M i / A; the expression of the dashed line 2 is y = 1 - a×M i / A; the expression of the solid line 3 is y = 1 - ω×M i / A; the expression of the dashed line 4 is y = 1 - b×M

[0069] Assume there are four pixel points. Taking the dark channel value of the pixel points as the abscissa and the first transmittance value of the pixel points as the ordinate, the positions of these four pixel points are determined in the Figure 5 coordinate system, which are point 10, point 20, point 30, and point 40 respectively.

[0070] From Figure 3 it can be seen that for point 10, its first transmittance value does not exceed the corresponding first reference transmittance value, so the first transmittance value of point 10 is corrected to the first reference transmittance value, that is, the first transmittance value of point 10 is corrected to the first transmittance value corresponding to point 11, where point 11 is the intersection of the line passing through point 10 and perpendicular to the X-axis of the coordinate system and the dashed line 2.

[0071] For point 20 and point 30, their first transmittance values exceed the corresponding first reference transmittance value and do not exceed the corresponding second reference transmittance value, so the corresponding first transmittance values remain unchanged.

[0072] For point 40, its first transmittance value exceeds the corresponding second reference transmittance value, so the first transmittance value of point 40 is updated to the second reference transmittance value, that is, the first transmittance value of point 40 is corrected to the first transmittance value corresponding to point 41, where point 41 is the intersection of the line passing through point 40 and perpendicular to the X-axis of the coordinate system and the dashed line 4.

[0073] Among them, in order to avoid the need to compare t i with P i , Q i every time, and to improve the processing efficiency of the algorithm, t i is directly set to min{max(t i , 1 - a×M i / A), 1 - b×M i / A}, the same object of the above solution can be achieved at this time, that is, for any pixel, first take the maximum value of the first transmittance value of the pixel and the corresponding first reference transmittance value; then take the minimum value of the result of taking the maximum value and the second reference transmittance value corresponding to the pixel, and finally correct the first transmittance value of the pixel to the result of taking the minimum value.

[0074] Or t can also be directly set i = max{min(t i , 1 - b×M i / A), 1 - a×M i / A}, and the object of the above solution can also be achieved at this time.

[0075] It should be noted that this application does not limit the execution order of step S140 and step S150. Step S140 can be executed first, and then step S150, or step S150 can be executed first, and then step S140.

[0076] It should be noted that in this embodiment, both step S140 and step S150 are executed, but in other embodiments, only one of step S140 and step S150 can be executed.

[0077] For example, when only step S140 is executed, the solution is: when the first transmittance value of the pixel does not exceed the first reference transmittance value corresponding to the pixel, correct the first transmittance value of the pixel to the first reference transmittance value, otherwise keep the first transmittance value of the pixel unchanged. At this time, the phenomenon of excessive fog penetration can be reduced, but the phenomenon of insufficient fog penetration cannot be reduced.

[0078] For another example, when only step S150 is executed, the solution is: when the first transmittance value of the pixel exceeds the second reference transmittance value corresponding to the pixel, correct the first transmittance value of the pixel to the second reference transmittance value, otherwise keep the first transmittance value of the pixel unchanged. At this time, the phenomenon of insufficient fog penetration can be reduced, but the phenomenon of excessive fog penetration cannot be reduced.

[0079] S160: Perform fog penetration processing on the target image according to the first transmittance value of each pixel.

[0080] Specifically, according to the physical model of atmospheric scattering, after obtaining the first transmittance value of each pixel, fog penetration processing can be performed on the target image.

[0081] For example, for each pixel, the fog-penetrated pixel value can be determined according to the following formula:

[0082] OUT 1i =(IN 1i - A1) / ti +A1;

[0083] OUT 2i =(IN 2i –A2) / t i +A2;

[0084] OUT 3i =(IN 3i –A3) / t i +A3;

[0085] Wherein, t i is the first transmittance value of pixel point i, and OUT 1i , OUT 2i , OUT 3i are the R component, G component and B component after haze removal of pixel point i respectively, and IN 1i , IN 2i , IN 3i are the R component, G component and B component before haze removal of pixel point i respectively, and A1, A2, and A3 are the first atmospheric light value corresponding to the R component, the second atmospheric light value corresponding to the G component, and the third atmospheric light value corresponding to the B component of the target image respectively.

[0086] In the prior art, when correcting the first transmittance value of a pixel point, an edge-preserving filtering method is generally used. However, the edge-preserving filtering method has high complexity and long time consumption. In the solution of this embodiment, it is only necessary to compare the first transmittance value with the first reference transmittance value and the second reference transmittance value corresponding to the pixel point, which is simple to implement, has low complexity, fast execution speed and good haze removal effect.

[0087] Refer to Figure 4 , Figure 4 which is a schematic structural diagram of an embodiment of the image haze removal device of the present application. The image haze removal device 200 includes a processor 210, a memory 220, and a communication circuit 230. The processor 210 is respectively coupled to the memory 220 and the communication circuit 230. Program data is stored in the memory 220. The processor 210 realizes the method steps in any of the above embodiments by executing the program data in the memory 220. For the detailed steps, reference can be made to the above embodiments and will not be elaborated here.

[0088] Wherein, the image haze removal device 200 can be any device with image processing capabilities such as a computer, a mobile phone, etc., which is not limited herein.

[0089] Refer to Figure 5 , Figure 5It is a schematic structural diagram of another embodiment of the image haze removal device of the present application. The image haze removal device 300 includes an acquisition module 310, a filtering module 320, a determination module 330, a correction module 340, and a haze removal module 350 that are connected in sequence.

[0090] The acquisition module 310 is used to acquire the dark channel value of each pixel point in the target image.

[0091] The filtering module 320 is used to perform filtering processing on the dark channel values of all pixel points to obtain the dark channel filtered value of each pixel point.

[0092] The determination module 330 is used to substitute the dark channel filtered value of each pixel point into the first preset formula as an independent variable respectively to obtain the first transmittance value of each pixel point.

[0093] The correction module 340 is used to, for each pixel point, substitute the dark channel value of the pixel point into the second preset formula to obtain the first reference transmittance value of the pixel point, and in response to the first transmittance value of the pixel point not exceeding the first reference transmittance value corresponding to the pixel point, correct the first transmittance value to the first reference transmittance value, where the first reference transmittance value corresponding to the pixel point is less than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by substituting the dark channel value of the pixel point into the first preset formula as an independent variable; and / or, for each pixel point, substitute the dark channel value of the pixel point into the third preset formula to obtain the second reference transmittance value of the pixel point, and in response to the first transmittance value of the pixel point exceeding the second reference transmittance value corresponding to the pixel point, correct the first transmittance value of the pixel point to the second reference transmittance value, where the second reference transmittance value corresponding to the pixel point is greater than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by substituting the dark channel value of the pixel point into the first preset formula as an independent variable.

[0094] The haze removal module 350 is used to perform haze removal processing on the target image according to the first transmittance value of each pixel point.

[0095] Wherein, when the image haze removal device 300 is working, it executes the steps in the image haze removal method in any one of the above embodiments. For detailed steps, reference can be made to the above relevant content and will not be elaborated here.

[0096] Wherein, the image haze removal device 300 can be any device with image processing capabilities such as a computer, a mobile phone, etc., and is not limited here.

[0097] Refer to Figure 6 , Figure 6 It is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 400 stores a computer program 410, and the computer program 410 can be executed by a processor to implement the steps in any one of the above methods.

[0098] Among them, the computer-readable storage medium 400 may specifically be a device such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store the computer program 410, or it may also be a server storing the computer program 410. The server can send the stored computer program 410 to other devices for running, or it can also run the stored computer program 410 by itself.

[0099] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. An image defogging method, characterized in that, Including: Obtaining the dark channel value of each pixel in the target image; Performing filtering processing on the dark channel values of all the pixels to obtain the dark channel filtered value of each pixel; Taking the dark channel filtered value of each pixel as an independent variable and substituting it into a first preset formula to obtain the first transmittance value of each pixel; For each pixel, substituting the dark channel value of the pixel into a second preset formula to obtain the first reference transmittance value of the pixel, and in response to the first transmittance value of the pixel not exceeding the first reference transmittance value corresponding to the pixel, correcting the first transmittance value to the first reference transmittance value, wherein the first reference transmittance value corresponding to the pixel is less than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by taking the dark channel value of the pixel as an independent variable and substituting it into the first preset formula; And / or, for each pixel, substituting the dark channel value of the pixel into a third preset formula to obtain the second reference transmittance value of the pixel, and in response to the first transmittance value of the pixel exceeding the second reference transmittance value corresponding to the pixel, correcting the first transmittance value of the pixel to the second reference transmittance value, wherein the second reference transmittance value corresponding to the pixel is greater than or equal to the corresponding second transmittance value, and the corresponding second transmittance value is obtained by taking the dark channel value of the pixel as an independent variable and substituting it into the first preset formula; Performing haze removal processing on the target image according to the first transmittance value of each pixel.

2. The method according to claim 1, wherein The method specifically includes: Performing a maximum value processing on the first transmittance value of the pixel and the corresponding first reference transmittance value; Performing a minimum value processing on the result of the maximum value processing and the second reference transmittance value corresponding to the pixel; Correcting the first transmittance value of the pixel to the result of the minimum value processing.

3. The method according to claim 1, characterized in that The step of taking the dark channel filtered value of each pixel as an independent variable and substituting it into a first preset formula to obtain the first transmittance value of each pixel includes: Taking the dark channel filtered value of each pixel as an independent variable and substituting it into the following first preset formula respectively to obtain the first transmittance value of each pixel as a dependent variable: First preset formula: y = 1 - ω×x / A, where x is the independent variable, y is the dependent variable, ω is a preset haze removal intensity, the range of ω is [0,1], and A is the target atmospheric light value of the target image.

4. The method according to claim 3, wherein When performing the step of, for each pixel, substituting the dark channel value of the pixel into a second preset formula to obtain the first reference transmittance value of the pixel, the step of, for each pixel, substituting the dark channel value of the pixel into a second preset formula to obtain the first reference transmittance value of the pixel includes: Substitute the dark channel value of each said pixel point as the independent variable into the following second preset formula respectively, to obtain the first reference transmittance value of each said pixel point as the dependent variable: Second preset formula: y = 1 - a×x / A, where x is the independent variable, y is the dependent variable, and the range of a is [ω, 1].

5. The method according to claim 3, characterized in that, When performing the step of, for each said pixel point, substituting the dark channel value of the pixel point into a third preset formula to obtain the second reference transmittance value of the pixel point, the step of, for each said pixel point, substituting the dark channel value of the pixel point into a third preset formula to obtain the second reference transmittance value of the pixel point, includes: Substitute the dark channel value of each said pixel point as the independent variable into the following third preset formula respectively, to obtain the second reference transmittance value of each said pixel point as the dependent variable: Third preset formula: y = 1 - b×x / A, where x is the independent variable, y is the dependent variable, and the range of b is [0, ω].

6. The method according to claim 3, wherein The method further includes: Determine a first atmospheric light value corresponding to the R component, a second atmospheric light value corresponding to the G component, and a third atmospheric light value corresponding to the B component of the target image; Among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value, determine the target atmospheric light value of the target image.

7. The method according to claim 6, wherein The step of, among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value, determining the target atmospheric light value of the target image, includes: Determine the minimum value among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value as the target atmospheric light value.

8. The method according to claim 1, characterized in that, The step of obtaining the dark channel value of each pixel point in the target image includes: Respectively determine the minimum value among the R component, G component, and B component of each said pixel point as the dark channel value of each said pixel point.

9. An image haze removal device, characterized in that, The image defogging device includes a processor, a memory, and a communication circuit. The processor is respectively coupled to the memory and the communication circuit. Program data is stored in the memory. The processor executes the program data in the memory to implement the steps in the method according to any one of claims 1 - 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 - 8.

Citation Information

Patent Citations

  • Dark channel based rapid defogging method and system

    CN105354806A

  • Image processing method and device, storage medium and electronic device

    CN114331920A