Image defogging method and system
By combining the image processing chip and data processor in the image dehuminating system, using the data processor to calculate the image to remove the fog parameters, and use the image processing chip for fog processing to solve the complexity of the image deodorization and high cost in the existing technology. The problem has achieved efficient image removal effects.
Patent Information
- Application Number
- CN202111327321.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-11-10
AI Technical Summary
In the prior art, the image defog scheme based on software algorithms has complex operations, resulting in a large operating burden, while the hardware-based scheme requires a large amount of hardware resources, resulting in high costs.
By combined with image processing chips and data processors, the fog algorithm configured by the data processor configuration is used to calculate the first fog parameter, and the image processing chip is used to process the processing image based on this parameter to process the misty processing.
Simplify the complexity of the image removal operation process, give full play to the advantages of hardware resources, achieve a good fogment effect, and use less hardware resources at the same time.
Smart Images

Figure CN114092346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image defogging method and system. Background Art
[0002] The haze environment has a great impact on the image / video quality. By defogging the image / video, the visibility of the image / video can be increased, thereby improving the image / video quality. At present, the relevant technology proposes a software algorithm-based image defogging solution and a hardware-based image defogging solution. Among them, the image defogging solution based on the software algorithm mostly adopts the basic principle based on the dark channel prior. Although this solution can achieve a good defogging effect, its calculation process is relatively complicated, resulting in a heavy operating burden on the execution subject of the solution; the hardware-based image defogging solution requires a large amount of hardware resources, resulting in a high cost of image defogging. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide an image defogging method and system, which can not only simplify the complexity of the image defogging operation process, but also give full play to the computing advantages of hardware resources to achieve better defogging effect.
[0004] In a first aspect, an embodiment of the present invention provides an image defogging method, which is applied to an image defogging system including an image processing chip and a data processor, wherein the data processor is configured with an image defogging algorithm, and the method includes: reading a previous frame image corresponding to an image to be processed by the image processing chip, and generating a grayscale image and a dark channel image corresponding to the previous frame image; calculating a first defogging parameter based on the image defogging algorithm, the grayscale image and the dark channel image by the data processor; reading the first defogging parameter and the image to be processed by the image processing chip, and defogging the image to be processed according to the first defogging parameter to obtain a target image.
[0005] In one embodiment, the step of generating a grayscale image and a dark channel image corresponding to the previous frame image further includes: starting a first thread to perform a first downsampling process on the previous frame image to obtain a first downsampling image, and converting the first downsampling image into a grayscale image; and starting a second thread to perform a second downsampling process on the previous frame image to obtain a second downsampling image, and calculating a dark channel image based on the second downsampling image.
[0006] In one embodiment, the image defogging system further includes a cache unit; the method further includes: storing the grayscale image and the dark channel image in the cache unit via the image processing chip.
[0007] In one embodiment, the step of calculating the first dehazing parameter based on the image dehazing algorithm, the grayscale image and the dark channel image includes: reading the grayscale image and the dark channel image from the cache unit; calculating the grayscale mapping value based on the image dehazing algorithm and the grayscale image, and calculating the dark channel mapping value based on the image dehazing algorithm and the dark channel image; wherein the first dehazing parameter includes the grayscale mapping value and the dark channel mapping value.
[0008] In one embodiment, the method further includes: storing the first defogging parameter in the cache unit through the data processor; the step of reading the first defogging parameter through the image processing chip includes: reading the first defogging parameter from the cache unit through the image processing chip.
[0009] In one embodiment, the step of defogging the image to be processed according to the first defogging parameters to obtain the target image includes: calculating the second defogging parameters corresponding to each pixel in the image to be processed according to the first defogging parameters; and defogging the image to be processed according to the second defogging parameters corresponding to each pixel to obtain the target image.
[0010] In one embodiment, the step of calculating the second defogging parameter corresponding to each pixel in the image to be processed based on the first defogging parameter includes: upsampling the first defogging parameter to determine the first defogging parameter corresponding to each pixel in the image to be processed; and searching for the second defogging parameter corresponding to each pixel based on the first defogging parameter corresponding to each pixel.
[0011] In one embodiment, the step of defogging the image to be processed according to the second defogging parameter corresponding to each pixel point to obtain the target image includes: obtaining a fog intensity parameter corresponding to the image to be processed; and defogging the image to be processed based on the fog intensity parameter and the second defogging parameter corresponding to each pixel point to obtain the target image.
[0012] In one implementation, before searching for the second defogging parameter corresponding to each pixel point according to the first defogging parameter corresponding to each pixel point, the method further includes: aligning the image to be processed with the first defogging parameter.
[0013] In a second aspect, an embodiment of the present invention further provides an image defogging system, comprising an image processing chip and a data processor, wherein the data processor is configured with an image defogging algorithm; wherein the image processing chip is used to read a previous frame image corresponding to the image to be processed, and generate a grayscale image and a dark channel image corresponding to the previous frame image; the data processor is used to calculate a first defogging parameter based on the image defogging algorithm, the grayscale image and the dark channel image; the image processing chip is also used to read the first defogging parameter and the image to be processed, and defog the image to be processed according to the first defogging parameter to obtain a target image.
[0014] An image defogging method and system provided by an embodiment of the present invention is applied to an image defogging system including an image processing chip and a data processor. The data processor is configured with an image defogging algorithm. First, the image processing chip reads the previous frame image corresponding to the image to be processed, and generates a grayscale image and a dark channel image corresponding to the previous frame image. Then, the data processor calculates a first defogging parameter based on the image defogging algorithm, the grayscale image and the dark channel image. Finally, the image processing chip reads the first defogging parameter and the image to be processed, and performs defogging processing on the image to be processed according to the first defogging parameter to obtain a target image. The above method proposes a combination of hardware and software to realize image defogging, calculates the first defogging parameter using the image defogging algorithm configured by the data processor, and then uses the image processing chip to give full play to the hardware advantages to perform defogging processing on the image to be processed based on the first defogging parameter, so as to obtain a target image with better defogging effect. The embodiment of the present invention can realize image defogging using less hardware resources, while simplifying the complexity of the image defogging operation process, and achieving a better defogging effect.
[0015] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1A schematic diagram of a flow chart of an image defogging method provided by an embodiment of the present invention;
[0019] Figure 2 An image defogging framework provided by an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of a flow chart of another image defogging method provided by an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of the structure of an image defogging system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] At present, the image defogging solution based on software algorithm has the problem of complex calculation process, while the image defogging solution based on hardware has the problem of high image defogging cost. Based on this, the present invention implements an image defogging method and system, which can not only simplify the complexity of the image defogging calculation process, but also give full play to the computing advantages of hardware resources to achieve better defogging effect.
[0024] To facilitate understanding of this embodiment, first, a method for image defogging disclosed in an embodiment of the present invention is introduced in detail. The method is applied to an image defogging system including an image processing chip and a data processor. The image processing chip can be referred to as the hardware side, and the data processor (CPU, central processing unit) can be referred to as the software side. The data processor is configured with an image defogging algorithm, see Figure 1 The flowchart of an image defogging method shown in FIG. 1 mainly includes the following steps S102 to S106:
[0025] Step S102, read the previous frame image corresponding to the image to be processed through the image processing chip, and generate a grayscale image and a dark channel image corresponding to the previous frame image. Optionally, a video captured in a haze environment can be used as a video to be processed, and each frame image in the video can be used as an image to be processed. Among them, the grayscale image is used to characterize the grayscale information of the previous frame image, and the dark channel image is used to characterize the fog concentration information of the previous frame image. In one embodiment, the hardware side can perform two-way downsampling processing on the previous frame image to obtain a grayscale image and a dark channel image, respectively, thereby reducing the overall data volume read and written by the back-end cache.
[0026] Step S104, a data processor calculates a first defogging parameter based on the image defogging algorithm, the grayscale image, and the dark channel image. The first defogging parameter, i.e., the Map mapping result, may include a grayscale mapping value and a dark channel mapping value. In one embodiment, the software side may use the image defogging algorithm to perform iterative operations on the grayscale image and the dark channel image, respectively, to calculate the grayscale mapping value and the dark channel mapping value.
[0027] Step S106, read the first defogging parameter and the image to be processed through the image processing chip, and perform defogging on the image to be processed according to the first defogging parameter to obtain the target image. In one embodiment, the hardware side can perform two-way upsampling on the grayscale mapping value and the dark channel mapping value to restore the grayscale mapping value and the dark channel mapping value to a size consistent with the size of the image to be processed to ensure image accuracy, and then use the grayscale mapping value and the dark channel mapping value after upsampling to calculate the second defogging parameter (that is, the defogging coefficient), and finally perform defogging on the image to be processed according to the second defogging parameter.
[0028] The above-mentioned image defogging method provided by the embodiment of the present invention proposes a combination of hardware and software to realize image defogging, uses the image defogging algorithm configured by the data processor to calculate the first defogging parameter, and then uses the hardware advantage of the image processing chip to perform defogging on the image to be processed based on the first defogging parameter, so as to obtain a target image with better defogging effect. The embodiment of the present invention can use less hardware resources to realize image defogging, while simplifying the complexity of the image defogging operation process and achieving better defogging effect.
[0029] For the aforementioned step S102, an embodiment of the present invention provides an implementation method for generating a grayscale image and a dark channel image corresponding to a previous frame image, (1) starting a first thread to perform a first downsampling process on the previous frame image to obtain a first downsampling image, and converting the first downsampling image into a grayscale image; (2) starting a second thread to perform a second downsampling process on the previous frame image to obtain a second downsampling image, and calculating a dark channel image based on the second downsampling image. The downsampling process may use window filtering. In one implementation method, a sampling coefficient may be pre-configured, such as filtering with a 4*4 window to obtain a downsampled image, and then the first downsampled image may be converted into a grayscale image by methods such as averaging, maximum and minimum average, weighted averaging, binary image method, etc., and dark channel information may be extracted from the second downsampled image to generate a dark channel image.
[0030] In practical applications, the image dehazing system also includes a cache unit, which can use memory cache. The image processing chip can store the grayscale image and the dark channel image in the cache unit in real time. At the same time, the software side interacts with the cache unit to read the above grayscale image and dark channel image.
[0031] Based on this, an embodiment of the present invention provides an implementation method for calculating the first defogging parameter based on an image defogging algorithm, a grayscale image, and a dark channel image. The grayscale image and the dark channel image can be read from a cache unit, and then the grayscale mapping value is calculated based on the image defogging algorithm and the grayscale image, and the dark channel mapping value is calculated based on the image defogging algorithm and the dark channel image. Among them, the image defogging algorithm can adopt a guided filter algorithm. In one implementation, the software side can use the image defogging algorithm to iterate the grayscale image and the dark channel image respectively, so as to obtain the above-mentioned grayscale mapping value and dark channel mapping value.
[0032] In a specific implementation, the software side may store the first defogging parameter in a cache unit, and optionally, may store the grayscale mapping value and the dark channel mapping value in a fixed position of the memory cache, and wait for the hardware side to read the grayscale mapping value and the dark channel mapping value from the fixed position. The hardware side may read the first defogging parameter from the cache unit when reading the image to be processed.
[0033] For the aforementioned step S106, the embodiment of the present invention provides an implementation method for performing defogging on the image to be processed according to the first defogging parameter to obtain a target image, see the following steps 1 to 2:
[0034] Step 1: Calculate the second defogging parameter corresponding to each pixel in the image to be processed according to the first defogging parameter. In one embodiment, the second defogging parameter corresponding to each pixel can be determined according to the following steps 1.1 to 1.3:
[0035] Step 1.1, upsampling the first defogging parameter to determine the first defogging parameter corresponding to each pixel in the image to be processed. In one embodiment, the upsampling parameter can be set so that the grayscale mapping value and the dark channel mapping value are upsampled according to the upsampling parameter, so that the grayscale mapping value and the dark channel mapping value are restored to the size of the image to be processed.
[0036] Step 1.2, aligning the image to be processed and the first defogging parameter. Considering that there may be misalignment caused by delay in practical applications, the image to be processed and the first defogging parameter are aligned to eliminate the misalignment. Optionally, the image to be processed and the first defogging parameter can be aligned based on pixel analysis.
[0037] Step 1.3, searching for the second defogging parameter corresponding to each pixel point according to the first defogging parameter corresponding to each pixel point. In one embodiment, each pixel point corresponds to a grayscale mapping value and a dark channel mapping value, and the second defogging parameter corresponding to the grayscale mapping value and the dark channel mapping value is searched by a table lookup method. The table lookup method can use a LUT (Look-Up-Table, computer terminology - display lookup table) table lookup.
[0038] Step 2: Defogging the image to be processed according to the second defogging parameter corresponding to each pixel to obtain a target image. In one embodiment, the image to be processed can be defogged according to the following steps 2.1 to 2.2 to obtain a target image:
[0039] Step 2.1, obtaining a fog intensity parameter corresponding to the image to be processed. In one implementation, the fog intensity parameter may be preset.
[0040] Step 2.2, based on the fog intensity parameter and the second defogging parameter corresponding to each pixel, the image to be processed is defogged to obtain a target image. In one embodiment, the image to be processed can be subtracted from the fog intensity parameter to obtain a difference, and then the difference is multiplied by the second defogging parameter to obtain a product, and then the product is summed with the fog intensity parameter to obtain a sum value, so as to obtain the target image.
[0041] To facilitate understanding of the image defogging method provided in the above embodiment, the present invention also provides an application example of the image defogging method, see Figure 2 The image defogging framework shown includes: (1) an image downsampling part: used to obtain a grayscale image and a dark channel image of a previous frame image; (2) an image cache part: used to store a grayscale image and a dark channel image of a previous frame image; (3) a software calculation part: used to calculate a Map mapping result; (4) an image upsampling part: used to restore the Map mapping result to a mapping value of a size corresponding to the original image; (5) a cache alignment part: used to eliminate the misalignment between the image to be processed and the coefficient; (6) a coefficient calculation part: used to perform pipeline processing; (7) a defogging processing part: used to perform a defogging process to obtain a defogged image (i.e., the above-mentioned target image).
[0042] Based on the above Figure 2 , the embodiment of the present invention provides Figure 3 The flowchart of another method for defogging an image is shown in FIG. 1 , and the method mainly includes the following steps S302 to S314:
[0043] Step S302, the hardware side performs two-way downsampling on the previous frame image picture before defogging to obtain grayscale image picture 0 and dark channel image picture 1. The embodiment of the present invention can significantly reduce the overall data volume read and written by the back-end cache by downsampling the previous frame image picture.
[0044] Step S304, the hardware side stores the grayscale image picture0 and the dark channel image picture1 in the memory cache in real time, and the software side reads the grayscale image picture0 and the dark channel image picture1 from the memory cache.
[0045] Step S306, the software side performs parameter operations on the grayscale image picture0 and the dark channel image picture1 to obtain two-way Map mapping results, and stores the Map mapping results in a fixed position of the memory cache, waiting for the hardware side to read the Map mapping results. Among them, the parameter operation mainly includes iterative operations, and the Map mapping results include grayscale mapping values a[i] and dark channel mapping values b[i].
[0046] Step S308: The hardware side reads the grayscale mapping value a[i] and the dark channel mapping value b[i] from the memory cache in the next frame, and performs upsampling processing on the grayscale mapping value a[i] and the dark channel mapping value b[i], respectively, to obtain the grayscale mapping value a[i-1] and the dark channel mapping value b[i-1] corresponding to the next frame image pic[i-1]. By performing upsampling processing on the grayscale mapping value a[i] and the dark channel mapping value b[i], they can be restored to a size consistent with the original image, thereby improving the image defogging accuracy.
[0047] In step S310, the hardware side caches the image to be processed, the grayscale mapping value a[i-1], and the dark channel mapping value b[i-1], and performs alignment processing on the image to be processed, the grayscale mapping value a[i-1], and the dark channel mapping value b[i-1]. The alignment processing can eliminate the misalignment deviation caused by the delay.
[0048] Step S312, the hardware side uses the hardware pipeline operation mode to calculate the defogging coefficient 1 / t(x) of the image to be processed in real time. The defogging coefficient is also the aforementioned second defogging parameter. In one embodiment, 1 / t(x) = gray*a[i-1]+b[i-1], gray represents the grayscale value. Considering that it is a waste of resources to perform calculations in hardware, the defogging coefficient 1 / t(x) is determined by LUT lookup.
[0049] Step S314, the hardware side uses the defogging coefficient to perform defogging on the image to be processed to obtain the target image. In one implementation, the defogging process can be performed according to the following formula:
[0050]
[0051] Among them, J(x) represents the target image, I(x) represents the image to be processed, and A represents the fog intensity parameter.
[0052] To sum up, the hardware-implemented image defogging architecture proposed in the embodiment of the present invention performs defogging on the image to be processed through an image defogging parameter calculation method that combines hardware and software. While realizing complex iterative operations, it can give full play to the advantages of hardware parallel computing, pipeline the defogging of images / videos, and achieve good defogging effects.
[0053] For the image defogging method provided in the above embodiment, the present invention provides an image defogging system, see Figure 4 The structure diagram of an image defogging system is shown, the system comprises: an image processing chip 100 and a data processor 200, and the data processor 200 is configured with an image defogging algorithm.
[0054] The image processing chip 100 is used to read the previous frame image corresponding to the image to be processed, and generate a grayscale image and a dark channel image corresponding to the previous frame image;
[0055] The data processor 200 is used to calculate a first defogging parameter based on an image defogging algorithm, a grayscale image, and a dark channel image;
[0056] The image processing chip 100 is further configured to read the first defogging parameter and the image to be processed, and perform defogging processing on the image to be processed according to the first defogging parameter to obtain a target image.
[0057] The above-mentioned image defogging system provided by the embodiment of the present invention proposes a combination of hardware and software to realize image defogging, uses the image defogging algorithm configured by the data processor to calculate the first defogging parameter, and then uses the hardware advantage of the image processing chip to perform defogging on the image to be processed based on the first defogging parameter, so as to obtain a target image with better defogging effect. The embodiment of the present invention can use less hardware resources to realize image defogging, while simplifying the complexity of the image defogging operation process and achieving better defogging effect.
[0058] In one embodiment, the image processing chip 100 is also used to: start a first thread to perform a first downsampling process on a previous frame image to obtain a first downsampling image, and convert the first downsampling image into a grayscale image; and start a second thread to perform a second downsampling process on the previous frame image to obtain a second downsampling image, and calculate a dark channel image based on the second downsampling image.
[0059] In one embodiment, the image defogging system further includes a cache unit; the image processing chip 100 is further configured to store the grayscale image and the dark channel image in the cache unit.
[0060] In one embodiment, the data processor 200 is further used to: read the grayscale image and the dark channel image from the cache unit; calculate the grayscale mapping value based on the image defogging algorithm and the grayscale image, and calculate the dark channel mapping value based on the image defogging algorithm and the dark channel image; wherein the first defogging parameter includes the grayscale mapping value and the dark channel mapping value.
[0061] In one implementation, the data processor 200 is further used to: store the first defogging parameter in a cache unit; and the image processing chip 100 is further used to: read the first defogging parameter from the cache unit.
[0062] In one embodiment, the image processing chip 100 is further used to: calculate a second defogging parameter corresponding to each pixel in the image to be processed according to the first defogging parameter; and perform defogging on the image to be processed according to the second defogging parameter corresponding to each pixel to obtain a target image.
[0063] In one embodiment, the image processing chip 100 is also used to: upsample the first defogging parameter to determine the first defogging parameter corresponding to each pixel in the image to be processed; and search for the second defogging parameter corresponding to each pixel based on the first defogging parameter corresponding to each pixel.
[0064] In one embodiment, the image processing chip 100 is further used to: obtain a fog intensity parameter corresponding to the image to be processed; and perform defogging processing on the image to be processed to obtain a target image based on the fog intensity parameter and a second defogging parameter corresponding to each pixel.
[0065] In one implementation, the image processing chip 100 is further used to: align the image to be processed with the first defogging parameter.
[0066] The implementation principle and technical effects of the system provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the system embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0067] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned implementation methods.
[0068] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An image defogging method, characterized in that: The method is applied to an image defogging system, the system comprising an image processing chip, a data processor and a cache unit, the data processor being configured with an image defogging algorithm, and the method comprising: The image processing chip reads a previous frame image corresponding to the image to be processed, and generates a grayscale image and a dark channel image corresponding to the previous frame image; Calculating a first defogging parameter by the data processor based on the image defogging algorithm, the grayscale image and the dark channel image; The first defogging parameter and the image to be processed are read by the image processing chip, and the image to be processed is defogged according to the first defogging parameter to obtain a target image; The step of generating a grayscale image and a dark channel image corresponding to the previous frame image further includes: starting a first thread to perform a first downsampling process on the previous frame image to obtain a first downsampling image, and converting the first downsampling image into a grayscale image; and starting a second thread to perform a second downsampling process on the previous frame image to obtain a second downsampling image, and calculating a dark channel image based on the second downsampling image; The step of calculating the first defogging parameter based on the image defogging algorithm, the grayscale image and the dark channel image comprises: reading the grayscale image and the dark channel image from a cache unit; calculating a grayscale mapping value based on the image defogging algorithm and the grayscale image, and calculating a dark channel mapping value based on the image defogging algorithm and the dark channel image; The step of performing defogging processing on the image to be processed according to the first defogging parameters to obtain a target image includes: calculating the second defogging parameters corresponding to each pixel in the image to be processed according to the first defogging parameters; and performing defogging processing on the image to be processed according to the second defogging parameters corresponding to each pixel to obtain a target image.
2. The method according to claim 1, characterized in that The method further includes: storing the grayscale image and the dark channel image in the cache unit through the image processing chip.
3. The method according to claim 1, characterized in that: The first defogging parameter includes a grayscale mapping value and a dark channel mapping value.
4. The method according to claim 1, characterized in that The method further comprises: storing the first defogging parameter in the cache unit by the data processor; The step of reading the first defogging parameter through the image processing chip includes: reading the first defogging parameter from the cache unit through the image processing chip.
5. The method according to claim 1, characterized in that The step of calculating the second defogging parameter corresponding to each pixel in the image to be processed according to the first defogging parameter comprises: Performing upsampling processing on the first defogging parameter to determine the first defogging parameter corresponding to each pixel in the image to be processed; The second defogging parameter corresponding to each pixel point is searched according to the first defogging parameter corresponding to each pixel point.
6. The method according to claim 5, characterized in that The step of performing defogging processing on the image to be processed according to the second defogging parameter corresponding to each pixel point to obtain a target image comprises: Obtaining a fog intensity parameter corresponding to the image to be processed; Based on the fog intensity parameter and the second defogging parameter corresponding to each pixel point, the image to be processed is defogged to obtain a target image.
7. The method according to claim 5, characterized in that Before searching for the second defogging parameter corresponding to each pixel point according to the first defogging parameter corresponding to each pixel point, the method further includes: Aligning the image to be processed and the first defogging parameters.
8. An image defogging system, characterized in that: It includes an image processing chip, a data processor and a cache unit, wherein the data processor is configured with an image defogging algorithm; wherein, The image processing chip is used to read a previous frame image corresponding to the image to be processed, and generate a grayscale image and a dark channel image corresponding to the previous frame image; The data processor is used to calculate a first defogging parameter based on the image defogging algorithm, the grayscale image and the dark channel image; The image processing chip is further used to read the first defogging parameter and the image to be processed, and perform defogging processing on the image to be processed according to the first defogging parameter to obtain a target image; The image processing chip is specifically used to: start a first thread to perform a first downsampling process on the previous frame image to obtain a first downsampling image, and convert the first downsampling image into a grayscale image; and start a second thread to perform a second downsampling process on the previous frame image to obtain a second downsampling image, and calculate a dark channel image based on the second downsampling image; The data processor is specifically used to: read the grayscale image and the dark channel image from the cache unit; calculate the grayscale mapping value based on the image defogging algorithm and the grayscale image, and calculate the dark channel mapping value based on the image defogging algorithm and the dark channel image; The image processing chip is also specifically used to: calculate the second defogging parameter corresponding to each pixel in the image to be processed according to the first defogging parameter; and perform defogging on the image to be processed according to the second defogging parameter corresponding to each pixel to obtain a target image.
Citation Information
Patent Citations
Image defogging method, storage medium and terminal device
CN107403421A
Optimizing and haze removing processing method for images photographed by unmanned aerial vehicles
CN107578386A