Image haze removal method, device and computer-readable storage medium
By acquiring and filtering the dark channel value of the processed image, and using preset formulas to calculate and correct the transmittance value, the problem of high complexity of digital fog transmission processing is solved, and an efficient image fog transmission effect is achieved.
Patent Information
- Application Number
- CN202211431593.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-11-15
AI Technical Summary
The existing digital mist treatment technology has high complexity and efficiency needs to be improved, resulting in difficulty in image processing.
By obtaining the dark channel value of the target image, performing filtering processing, the transmittance value is calculated using a preset formula, and the transmittance value is corrected according to the evaluated value to achieve mist transmissive treatment.
Improve the efficiency of image mist-transmissive processing, reduce excessive mist-transmissive and insufficient mist-transmissive, and ensure image clarity.
Smart Images

Figure CN115908177B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of image haze removal, and particularly relates to an image haze removal 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 captured by video acquisition devices, making subsequent image processing and application scenarios more difficult. Therefore, it is necessary to perform haze removal processing on the images to make them clear.
[0003] Haze removal processing is mainly divided into two types: physical haze removal processing and digital haze removal processing. Physical haze removal processing is optical haze removal processing, mainly realized by camera lenses, but it is expensive. Digital haze removal processing is a backend image restoration technology, which has the characteristics of low cost and easy deployment. However, the current mainstream digital haze removal processing technology has high complexity and the efficiency needs to be further improved. Summary of the Invention
[0004] This application provides an image haze removal method, device, and computer-readable storage medium, which can improve the efficiency of image haze removal processing.
[0005] In the first aspect of the embodiments of this 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; according to the first transmittance value of each pixel point, respectively determining at least one evaluation value of each pixel point, where the at least one evaluation value represents the accuracy of the first transmittance value of the pixel point relative to the second transmittance value, and the second transmittance value is obtained by taking the dark channel value of the pixel point as an independent variable and substituting it into a second preset formula; according to the at least one evaluation value of each pixel point, respectively correcting the first transmittance value of each pixel point to obtain the transmittance correction value of each pixel point; and performing haze removal processing on the target image according to the transmittance correction value of each pixel point.
[0006] In the second aspect of the embodiments of this 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 a third aspect of the embodiments 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 implement the steps in the above method.
[0008] The beneficial effect is that when correcting the first transmittance value corresponding to a pixel point in the present application, it is only necessary to correct the first transmittance value corresponding to the pixel point according to at least one evaluation value corresponding to the pixel point, which can achieve fast and accurate correction of the transmittance value, thereby improving the efficiency of image haze removal processing. BRIEF 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 drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings, where:
[0010] Figure 1 is a schematic flowchart of an implementation manner of the image haze removal 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 structural diagram of an implementation manner of the image haze removal device of the present application;
[0013] Figure 4 is a schematic structural diagram of another implementation manner of the image haze removal device of the present application;
[0014] Figure 5 is a schematic structural diagram of an implementation manner of the computer-readable storage medium of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0015] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all 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.
[0016] It should be noted that the terms "first" and "second" in this application are only for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of this application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise 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.
[0017] Refer to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the image haze removal method of this application. The method includes:
[0018] S110: Obtain the dark channel value of each pixel point in the target image.
[0019] 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.
[0020] In one 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, successively take a rectangular window of a certain size centered on each pixel point, 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.
[0021] 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.
[0022] Specifically, for each pixel point, the following steps are performed:
[0023] 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.
[0024] Compared with the above application scenarios, in this application scenario, the minimum value corresponding to a pixel is directly determined as the dark channel value of the pixel, which can simplify the process and improve the efficiency of the whole method.
[0025] In other embodiments, other methods can also be used to determine the dark channel value of each pixel, and the present application does not limit the specific process of determining the dark channel value.
[0026] S120: Filter the dark channel values of all pixels to obtain the dark channel filtered value of each pixel.
[0027] Specifically, filter the dark channel values of all pixels to reduce the difference between the dark channel values of two adjacent pixels.
[0028] Among them, the dark channel value of a pixel can reflect the depth of field to a certain extent. For the locally non - mutant region in the target image, its depth of field should be approximately the same. The locally non - mutant 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 - mutant region.
[0029] Opposite to the locally non - mutant region is the mutant region. For example, if the target image is an image of a corner of a wall, at this time, the depth of field corresponding to two different walls is different, so the region corresponding to the corner is the mutant region.
[0030] In order to retain details and make the locally non - mutant region satisfy the approximate depth of field, filter the dark channel values of all pixels to narrow the dark channel values of two adjacent pixels, so that the dark channel filtered values of the pixels in the locally non - mutant region are similar after filtering.
[0031] 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 this filtering window can be proportional to the resolution of the target image.
[0032] Among them, the present application does not limit the specific process of the filtering process, and other methods such as maximum filtering or median filtering can also be used.
[0033] S130: Substitute the dark channel filtered value of each pixel into the first preset formula as an independent variable to obtain the first transmittance value of each pixel.
[0034] Specifically, for each pixel, substitute the corresponding dark channel filtered value into the first preset formula to obtain the corresponding first transmittance value.
[0035] In this embodiment, the first preset formula is as follows:
[0036] y = 1 - ω × x / A, where x is the independent variable, y is the dependent variable, ω is the preset fog-penetrating intensity, the range of ω is [0, 1], and A is the target atmospheric light value of the target image. That is, the following formula is used to determine the first transmittance value corresponding to the pixel:
[0037] t i = 1 - ω × m i / A, where t i is the first transmittance value corresponding to pixel i, ω is the preset fog-penetrating intensity, the range of ω is [0, 1], m i is the dark channel filtering value corresponding to pixel i, and A is the target atmospheric light value of the target image.
[0038] In this embodiment, the smaller the first transmittance value corresponding to the pixel, the more fog exists at that pixel, and the greater the intensity of fog penetration for that pixel in the subsequent process.
[0039] In other embodiments, the first transmittance value of the pixel can also be determined according to other formulas, which are not limited herein.
[0040] Refer to Figure 2 , in this embodiment, the steps for determining the target atmospheric light value of the target image include:
[0041] 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.
[0042] Specifically, all pixels can be sorted in descending order according to the dark channel filtering value, then the top N% of the pixels are found, and 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.
[0043] Alternatively, the pixel corresponding to the largest dark channel filtering 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.
[0044] S1312: Determine the target atmospheric light value among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value.
[0045] 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.
[0046] 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.
[0047] S140: According to the first transmittance value of each pixel point, determine at least one evaluation value for each pixel point respectively. The at least one evaluation value characterizes the accuracy rate of the first transmittance value of the pixel point relative to the second transmittance value. The second transmittance value is obtained by substituting the dark channel value of the pixel point as the independent variable into the second preset formula.
[0048] Specifically, in this embodiment, the corresponding second transmittance value is determined according to the following second preset formula:
[0049] T i = 1 - M i / A, where T i is the second transmittance value corresponding to pixel point i, M i is the dark channel value corresponding to pixel point i, and A is the target atmospheric light value of the target image.
[0050] In other embodiments, the second transmittance value of the pixel point can also be determined according to other formulas. For example, the second transmittance value corresponding to pixel point i is determined according to the following formula:
[0051] T i = 1 - ω × M i / A, where T i is the second transmittance value corresponding to pixel point i, ω is the preset fog penetration intensity, the range of ω is [0, 1], M i is the dark channel value corresponding to pixel point i, and A is the target atmospheric light value of the target image.
[0052] Among them, the second transmittance value of the pixel point is obtained according to the corresponding dark channel value, and the first transmittance value of the pixel point is obtained according to the corresponding dark channel filtering value. Therefore, compared with the first transmittance value, the second transmittance value of the pixel point is closer to the true transmittance value of the pixel point. That is to say, the gap between the second transmittance value of the pixel point and the true transmittance value of the pixel point is smaller than the gap between the first transmittance value of the pixel point and the true transmittance value of the pixel point. Among them, the gap between the two transmittance values refers to the absolute value of the difference between the two transmittance values.
[0053] Meanwhile, for each pixel, there is at least one evaluation value, and at least one evaluation value corresponding to each pixel characterizes the accuracy of the first transmittance value of the pixel relative to the second transmittance value. Since the second transmittance value of the pixel is closer to the true transmittance value of the pixel, at least one evaluation value corresponding to the pixel can also characterize the accuracy of the first transmittance value of the pixel relative to the true transmittance value.
[0054] The evaluation value corresponding to the pixel can be one or multiple, and there is no limit here.
[0055] S150: According to at least one evaluation value of each pixel, the first transmittance value of each pixel is corrected respectively to obtain the transmittance correction value of each pixel.
[0056] Specifically, although filtering the dark channel values of all pixels can retain details, for the mutation region, it will cause insufficient fog penetration or excessive fog penetration. Specifically, for the mutation region, assume there are adjacent pixels A and B. The depth of field corresponding to pixels A and B varies greatly, that is, the dark channel values of pixels A and B vary greatly. However, after filtering, the dark channel filtered values of pixels A and B vary little. As a result, the first transmittance values of pixels A and B calculated based on the dark channel filtered values will be one larger and one smaller. For the larger one, it will be determined later that the fog at this pixel 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, thus increasing the fog penetration intensity and causing excessive fog penetration.
[0057] Therefore, in order to reduce the phenomenon of excessive fog penetration or insufficient fog penetration, for any pixel, its first transmittance value needs to be corrected.
[0058] Specifically, for each pixel, the following steps are performed: According to the corresponding at least one evaluation value, the corresponding first transmittance value is corrected to obtain the transmittance correction value corresponding to the pixel.
[0059] Since at least one evaluation value corresponding to the pixel can characterize the accuracy of the first transmittance value of the pixel relative to the true transmittance value, the first transmittance value of the pixel can be corrected according to the corresponding at least one evaluation value.
[0060] S160: According to the transmittance correction value of each pixel, fog penetration processing is performed on the target image.
[0061] Specifically, according to the physical model of atmospheric scattering, after obtaining the transmittance correction value of each pixel, fog penetration processing can be performed on the target image.
[0062] For example, for each pixel, the pixel value after haze removal can be determined according to the following formula:
[0063] OUT 1i =(IN 1i -A1) / T i +A1;
[0064] OUT 2i =(IN 2i –A2) / T i +A2;
[0065] OUT 3i =(IN 3i –A3) / T i +A3;
[0066] where T i is the transmittance correction value of pixel i, OUT 1i , OUT 2i , OUT 3i are the R component, G component and B component of pixel i after haze removal respectively, IN 1i , IN 2i , IN 3i are the R component, G component and B component of pixel i before haze removal 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.
[0067] It can be seen from the above that when correcting the first transmittance value corresponding to a pixel in this application, it is only necessary to correct the first transmittance value corresponding to the pixel according to at least one evaluation value corresponding to the pixel, which can achieve fast and accurate correction of the transmittance value, thereby improving the efficiency of image haze removal processing.
[0068] In this embodiment, at least one evaluation value of a pixel includes a first evaluation value and a second evaluation value. When the first transmittance value of the pixel is less than the corresponding second transmittance value, the first evaluation value of the pixel is greater than zero and the second evaluation value is equal to zero; when the first transmittance value of the pixel is greater than the corresponding second transmittance value, the first evaluation value of the pixel is equal to zero and the second evaluation value is greater than zero; when the first transmittance value of the pixel is equal to the corresponding second transmittance value, both the first evaluation value and the second evaluation value are equal to zero.
[0069] Specifically, the above settings can make it that when the first evaluation value is greater than zero, it means that the first transmittance value of the pixel is less than the corresponding second transmittance value, and when the second evaluation value is greater than zero, it means that the first transmittance value of the pixel is greater than the corresponding second transmittance value.
[0070] When the first transmittance value is less than the corresponding second transmittance value, it indicates that the first transmittance value of the pixel is on the low side. Subsequently, it will be determined that there is more fog at this pixel, and thus the fog penetration intensity will be increased, resulting in an over-fog-penetration phenomenon. When the first transmittance value is greater than the corresponding second transmittance value, it indicates that the first transmittance value of 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 decreased, resulting in an insufficient-fog-penetration phenomenon.
[0071] Therefore, based on the first evaluation value and the second evaluation value corresponding to the pixel, it can be determined whether there is an over-fog-penetration or insufficient-fog-penetration phenomenon at the pixel. Thus, based on the first evaluation value and the second evaluation value corresponding to the pixel, the first transmittance value of the pixel can be corrected.
[0072] In this embodiment, the step S150 of correcting the first transmittance value of each pixel includes:
[0073] (a) The difference obtained by subtracting the second evaluation value of each pixel from the first transmittance value of each pixel is determined as the first difference of each pixel.
[0074] (b) The sum of the first difference of each pixel and the first evaluation value of the pixel is determined respectively.
[0075] (c) The sum value corresponding to each pixel is determined as the transmittance correction value of each pixel respectively.
[0076] Specifically, for pixel i, its corresponding first evaluation value is denoted as tb i , and its corresponding second evaluation value is denoted as tw i . Then, the transmittance correction value corresponding to pixel i is determined according to the following formula:
[0077] T i =t i -tw i +tb i .
[0078] It can be understood that for the pixel with over-fog-penetration, since its tw i is equal to zero, so its T i =t i +tb i . That is, for the pixel with over-fog-penetration, correcting the first transmittance value means increasing the first transmittance value, thereby reducing the over-fog-penetration phenomenon. For the pixel with insufficient-fog-penetration, since its tb i is equal to zero, so its T i =t i -tw i, that is, for the pixel points with insufficient haze penetration, correcting the first transmittance value means reducing the first transmittance value, thereby reducing the phenomenon of insufficient haze penetration. For the pixel points that neither have excessive haze penetration nor insufficient haze penetration, the corresponding tw i and tb i are both equal to zero, then T i = t i , and the first transmittance value of the pixel point remains unchanged.
[0079] That is to say, through the above formula, both the phenomenon of excessive haze penetration and the phenomenon of insufficient haze penetration can be reduced.
[0080] It should be noted that in other embodiments, the first transmittance value of the pixel point can be corrected only by using the first evaluation value, that is, at this time T i = t i + tb i , only reducing the phenomenon of excessive haze penetration; or the second transmittance value of the pixel point can be corrected only by using the second evaluation value, that is, at this time T i = t i - tw i , only reducing the phenomenon of insufficient haze penetration.
[0081] In this embodiment, the first evaluation value and the second evaluation value corresponding to each pixel point are determined according to the following formula:
[0082] tb i = max[t i , T i - t i ;
[0083] tw i = t i - min[t i , T i .
[0084] That is, the first evaluation value of the pixel point is equal to the difference between the first value and the first transmittance value of the pixel point, and the first value is the maximum value of the first transmittance value and the second transmittance value of the pixel point; the second evaluation value of the pixel point is equal to the difference between the first transmittance value of the pixel point and the second value, and the second value is the minimum value of the first transmittance value and the second transmittance value of the pixel point.
[0085] At the same time, in order to retain more details, when tb i is less than the first threshold, tb i is updated to zero, and when tw i is less than the second threshold, tw i is updated to zero.
[0086] Specifically, when tb iWhen it is less than the first threshold, it indicates that the over-fogging phenomenon of pixel point i is not very serious. In order to preserve details, the over-fogging phenomenon of this pixel point will not be corrected; when tw i When it is less than the second threshold, it indicates that the under-fogging phenomenon of pixel point i is not very serious, so the under-fogging phenomenon of this pixel point will not be corrected.
[0087] Among them, the first threshold and the second threshold can be the same or different, and the first threshold and the second threshold can be obtained by designers based on experience or calculated according to the maximum between-class variance, which is not limited here.
[0088] In other embodiments, other methods can also be used to determine the first evaluation value and the second evaluation value corresponding to the pixel point. For example, for any pixel point, if its corresponding first transmittance value is less than the corresponding second transmittance value, the corresponding first evaluation value is set to A (A > zero); if its corresponding first transmittance value is greater than the corresponding second transmittance value, the corresponding second evaluation value is set to B (B > zero). That is to say, for two pixel points with over-fogging phenomenon, the corresponding first evaluation values are the same, and this first evaluation value is set in advance. Similarly, for two pixel points with under-fogging phenomenon, the corresponding second evaluation values are the same, and this second evaluation value is also set in advance. At this time, when correcting the first transmittance value of the pixel point, there is no need to judge whether the first evaluation value is greater than the first threshold and whether the second evaluation value is greater than the second threshold. The first transmittance value can be directly corrected according to the first evaluation value and the second evaluation value to obtain the corrected transmittance value of the pixel point.
[0089] In this embodiment, both whether the first evaluation value is less than the first threshold and whether the second evaluation value is less than the second threshold are judged. However, in other embodiments, only whether the first evaluation value is less than the first threshold or only whether the second evaluation value is less than the second threshold can be judged.
[0090] In the above solution, it is described that at least one evaluation value corresponding to the pixel point includes the first evaluation value and the second evaluation value. However, in other embodiments, at least one evaluation value corresponding to the pixel point may only include the first evaluation value or only include the second evaluation value. It can be understood that when only the first evaluation value is included, only the over-fogging phenomenon can be reduced, and when only the second evaluation value is included, only the under-fogging phenomenon can be reduced.
[0091] Refer to Figure 3 , Figure 3It 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 implements the steps in the method of 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.
[0092] Among them, the image haze removal device 200 can be any device with image processing capabilities, such as a computer, a mobile phone, etc., and is not limited here.
[0093] Refer to Figure 4 , Figure 4 It 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 first determination module 330, a second determination module 340, a correction module 350, and a haze removal module 360 that are connected in sequence.
[0094] The acquisition module 310 is used to acquire the dark channel value of each pixel point in the target image.
[0095] 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.
[0096] The first 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 to obtain the first transmittance value of each pixel point.
[0097] The second determination module 340 is used to respectively determine at least one evaluation value for each pixel point according to the first transmittance value of each pixel point. The at least one evaluation value characterizes the accuracy rate of the first transmittance value of the pixel point relative to the second transmittance value. The second transmittance value is obtained by substituting the dark channel value of the pixel point into the second preset formula.
[0098] The correction module 350 is used to respectively correct the first transmittance value of each pixel point according to at least one evaluation value of each pixel point to obtain the transmittance correction value of each pixel point.
[0099] The haze removal module 360 is used to perform haze removal processing on the target image according to the transmittance correction value of each pixel point.
[0100] Among them, when the image haze removal device 300 is working, it executes the steps in the image haze removal method in any of the above embodiments. For the detailed steps, reference can be made to the above relevant content and will not be elaborated here.
[0101] Among them, 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 herein.
[0102] Refer to Figure 5 , Figure 5 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 of the above methods.
[0103] Among them, the computer-readable storage medium 400 can specifically be a device such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store the computer program 410, or it can 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.
[0104] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural 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; According to the first transmittance value of each pixel, respectively determining at least one evaluation value of each pixel, where the at least one evaluation value characterizes the accuracy rate of the first transmittance value of the pixel relative to a second transmittance value, and the second transmittance value is obtained by taking the dark channel value of the pixel as an independent variable and substituting it into a second preset formula; According to the at least one evaluation value of each pixel, respectively correcting the first transmittance value of each pixel to obtain the transmittance correction value of each pixel; Performing haze removal processing on the target image according to the transmittance correction value of each pixel.
2. The method according to claim 1, wherein The at least one evaluation value of the pixel includes a first evaluation value and a second evaluation value; When the first transmittance value of the pixel is less than the corresponding second transmittance value, the first evaluation value of the pixel is greater than zero, and the second evaluation value is equal to zero; When the first transmittance value of the pixel is greater than the corresponding second transmittance value, the first evaluation value of the pixel is equal to zero, and the second evaluation value is greater than zero; When the first transmittance value of the pixel is equal to the corresponding second transmittance value, both the first evaluation value and the second evaluation value are equal to zero.
3. The method according to claim 2, wherein The step of respectively correcting the first transmittance value of each pixel according to the at least one evaluation value of each pixel to obtain the transmittance correction value of each pixel includes: Respectively determining the difference obtained by subtracting the second evaluation value of each pixel from the first transmittance value of each pixel as the first difference of each pixel; Respectively determining the sum value of the first difference of each pixel and the first evaluation value of the pixel; Respectively taking the sum value corresponding to each pixel as the transmittance correction value of each pixel.
4. The method according to claim 2, wherein The first evaluation value of the pixel is equal to the difference between a first value and the first transmittance value of the pixel, and the first value is the maximum value of the first transmittance value and the second transmittance value of the pixel; the second evaluation value of the pixel is equal to the difference between the first transmittance value of the pixel and a second value, and the second value is the minimum value of the first transmittance value and the second transmittance value of the pixel; Before the step of respectively correcting the first transmittance value of each pixel according to the at least one evaluation value of each pixel to obtain the transmittance correction value of each pixel, it further includes: In response to the first evaluation value being less than a first threshold, updating the first evaluation value to zero; And / or, in response to the second evaluation value being less than a second threshold, updating the second evaluation value to zero.
5. The method according to claim 1, wherein The step of taking the dark channel filtering value of each pixel point as an independent variable and substituting it into the first preset formula to obtain the first transmittance value of each pixel point includes: Taking the dark channel filtering value of each pixel point as an independent variable and substituting it into the following first preset formula respectively to obtain the first transmittance value of each pixel point as the dependent variable: First preset formula: y = 1 - ω×x / A, where x is the independent variable, y is the dependent variable, ω is the preset fog penetration intensity, the range of ω is [0,1], and A is the target atmospheric light value of the target image.
6. The method according to claim 1, wherein Taking the dark channel value of the pixel point as an independent variable and substituting it into the following second preset formula to obtain the second transmittance value of the pixel point: Second preset formula: y = 1 - x / A, where x is the independent variable, y is the dependent variable, and A is the target atmospheric light value of the target image.
7. The method according to claim 5 or 6, characterized in that, The step of determining the target atmospheric light value of the target image includes: Determining 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; Determining the target atmospheric light value among the first atmospheric light value, the second atmospheric light value, and the third atmospheric light value.
8. The method according to claim 1, wherein The step of obtaining the dark channel value of each pixel point in the target image includes: 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.
9. An image haze removal device, characterized in that, The image fog penetration 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 method according to any one of claims 1-8 by executing the program data in the memory.
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 realize the steps in the method according to any one of claims 1-8.
Citation Information
Patent Citations
Image defogging improvement method based on dark channel prior
CN110148093A
Dark channel prior defogging method based on low complexity MF
CN111563852A