CN-121981908-A - Infrared image parallel defogging method based on GPU
Abstract
The invention relates to an infrared image parallel defogging method based on a Graphic Processing Unit (GPU), which comprises the steps of S1, constructing a dark channel foggy image by taking an infrared image as an input, estimating scene transmittance to obtain a GPU transmittance image, S2, conducting guide filtering optimization on the GPU transmittance image by taking the infrared image as a guide image, outputting a GPU refined transmittance image, S3, obtaining a preliminary defogging image by the GPU refined transmittance image through an atmospheric scattering model, S4, adjusting a limiting contrast parameter according to the estimated scene transmittance, enhancing the preliminary defogging image by utilizing a limiting contrast self-adaptive histogram equalization method to obtain an infrared enhanced image, S5, designing a kernel function by using GPU parallel language, and executing the processing process of the steps S1-S4. The invention can meet the real-time requirement of infrared video processing and can improve the resolution and the visible distance of infrared images.
Inventors
- YANG HAO
- YANG XIAORAN
- WANG DONGXUE
- LIU YI
- Jian Zhijing
- PING DUO
Assignees
- 北京航天控制仪器研究所
Dates
- Publication Date
- 20260505
- Application Date
- 20251231
Claims (8)
- 1. The infrared image parallel defogging method based on the GPU is characterized by comprising the following steps of: S1, constructing a dark channel foggy image by taking an infrared image as an input, and estimating scene transmissivity to obtain a GPU transmissivity image; S2, taking the infrared image as a guide image, conducting guide filtering optimization on the GPU transmittance image, and outputting a GPU refined transmittance image; s3, the GPU refines the transmissivity image and obtains a preliminary defogging image through an atmospheric scattering model; S4, adjusting a limiting contrast parameter according to the estimated scene transmissivity, and enhancing the preliminary defogging image by using a limiting contrast self-adaptive histogram equalization method to obtain an infrared enhanced image; S5, using GPU parallel language to design kernel functions, and executing the processing procedures of the steps S1-S4.
- 2. The method for parallel defogging of an infrared image based on a GPU according to claim 1, wherein the method for obtaining the transmittance image of the GPU is as follows: establishing a CPU-to-GPU transmission channel, and transmitting the infrared original image from the CPU to the GPU; the gray scale channel of the GPU infrared original image is For any point x in the GPU infrared original image, local neighborhood taking x as center Taking the minimum gray value of all pixel points to construct dark channel foggy image : Wherein, the In the form of a dark channel foggy image, Is a local neighborhood Gray values of pixels in the pixel array; Obtaining the maximum gray value of all pixel points of the GPU infrared original image as a global atmosphere light component A, and calculating scene transmissivity through an atmosphere scattering model to obtain a GPU transmissivity image : In order to remove the parameters of the mist limiting, Representing pixel coordinates in the image.
- 3. The method for parallel defogging of an infrared image based on a GPU according to claim 2, wherein the method for optimization of guided filtering is as follows: an infrared image is used as a guiding image I, and a local window is formed Internally-derived boot image I and GPU transmittance image Mean of (2) 、 ; Transmission image by guiding image I and GPU Mean value 、 Calculating a coefficient a k : Wherein I i is the guiding image I in the local window Points within, P i is the GPU transmittance image In a local window The point in the inner side of the frame, Is a decimal set to prevent the divisor from being 0; By means of the mean value 、 And coefficient a k , coefficient b k : Calculating GPU refinement transmissivity image according to coefficient a k 、b k : 。
- 4. A method for parallel defogging of an infrared image based on a GPU according to claim 3, wherein the method for obtaining the preliminary defogging image is as follows: In order to preliminarily defogging the image, Is the GPU infrared original image.
- 5. The method for parallel defogging of an infrared image based on a GPU according to claim 4, wherein the method for obtaining the infrared enhanced image is as follows: Calculating a local histogram, dividing the preliminary defogging image into a plurality of window tiles, and calculating a histogram for each window tile: ; Wherein the method comprises the steps of For pixel gray level 256, the above Representing the traversing pixel, counting +1 when the pixel value of a certain gray level appears once; setting limiting contrast , Clipping the histogram for enhancing the coefficients, the number of pixels being at most Exceeding cutting: , The pixels cut out from the histogram cannot be lost, all gray scales need to be distributed evenly, and the number of the pixels cut out is calculated firstly: , Superscript + indicates that only remains A number greater than 0, the remaining amount R is equally allocated to all gray levels: , calculating a cumulative integral function of the redistributed local histogram: , Normalization and mapping to gray scale range to obtain local equalization map : Wherein the method comprises the steps of The minimum value of pixels in the window is given, and N is the number of pixels in the window; For local equalization map And performing bilinear interpolation to obtain an infrared enhancement chart.
- 6. The method for parallel defogging of an infrared image based on a GPU according to claim 1 or 5, wherein the limiting contrast parameter is adjusted according to the estimated scene transmissivity, specifically: The area limiting contrast parameter with the transmissivity higher than 0.5 has a value of 1.0-2.0; The area with transmittance lower than 0.5 limits the contrast parameter to 0.0-1.0.
- 7. The GPU-based infrared image parallel defogging method of claim 1, wherein the design kernel functions comprise a dark channel kernel function, a transmittance kernel function, a guided filter kernel function, a defogging kernel function, and an adaptive histogram equalization kernel function; The input of the dark channel kernel function is GPU infrared original image, and the output is dark channel foggy image; the input of the transmissivity kernel function is a dark channel foggy image, the scene transmissivity is calculated through an atmospheric scattering model, and the GPU transmissivity image is output; The input of the guide filtering kernel function is a GPU transmittance image and a GPU infrared original image, the guide filtering optimization is carried out on the GPU transmittance image based on the GPU infrared original image, and the GPU refined transmittance image is output; The input of the defogging kernel function is GPU refinement transmissivity image, and the preliminary defogging image is output by using an atmospheric scattering model; the input of the self-adaptive histogram equalization kernel function is a preliminary defogging image and a GPU transmissivity image, a histogram is calculated for the preliminary defogging image, the limiting contrast of the self-adaptive histogram equalization kernel function is set according to the transmissivity, the histogram is cut, the cut histogram is normalized and mapped to a gray scale range, and then the infrared enhancement map is obtained through interpolation.
- 8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1-7 when executing the computer program.
Description
Infrared image parallel defogging method based on GPU Technical Field The invention belongs to the technical field of infrared image defogging, and relates to an infrared image parallel defogging method based on a Graphic Processing Unit (GPU). Background The image defogging technology aims at recovering clear and high-contrast original scenes from degraded images shielded by haze and fog, and has important values in the fields of security monitoring, remote sensing, unmanned aerial vehicle aerial photography and the like. The infrared image defogging algorithm is mainly used for improving the definition and contrast of an infrared camera, so that the infrared image influenced by temperature, haze, smoke dust and the like is clearer. The traditional infrared defogging algorithm is generally based on an atmospheric scattering physical model, and the problems of low brightness and low resolution of images after defogging can be caused by synchronously reducing the overall brightness while reducing the foggy noise. In addition, the algorithm generally performs traversal operation on the image, has poor real-time performance, and cannot be used for video real-time processing. Disclosure of Invention The invention solves the technical problems of overcoming the defects of the prior art, and provides the infrared image parallel defogging method based on the GPU, which aims to not only meet the real-time requirement of infrared video processing, but also improve the resolution and the visible distance of the infrared image. The technical problem is solved by the method for parallel defogging of the infrared images based on the GPU, which comprises the following steps: S1, constructing a dark channel foggy image by taking an infrared image as an input, and estimating scene transmissivity to obtain a GPU transmissivity image; S2, taking the infrared image as a guide image, conducting guide filtering optimization on the GPU transmittance image, and outputting a GPU refined transmittance image; s3, the GPU refines the transmissivity image and obtains a preliminary defogging image through an atmospheric scattering model; S4, adjusting a limiting contrast parameter according to the estimated scene transmissivity, and enhancing the preliminary defogging image by using a limiting contrast self-adaptive histogram equalization method to obtain an infrared enhanced image; S5, using GPU parallel language to design kernel functions, and executing the processing procedures of the steps S1-S4. Further, the method for obtaining the GPU transmittance image comprises the following steps: establishing a CPU-to-GPU transmission channel, and transmitting the infrared original image from the CPU to the GPU; the gray scale channel of the GPU infrared original image is For any point x in the GPU infrared original image, local neighborhood taking x as centerTaking the minimum gray value of all pixel points to construct dark channel foggy image: Wherein, the In the form of a dark channel foggy image,Is a local neighborhoodGray values of pixels in the pixel array; Obtaining the maximum gray value of all pixel points of the GPU infrared original image as a global atmosphere light component A, and calculating scene transmissivity through an atmosphere scattering model to obtain a GPU transmissivity image : In order to remove the parameters of the mist limiting,Representing pixel coordinates in the image. Further, the guided filtering optimization method comprises the following steps: an infrared image is used as a guiding image I, and a local window is formed Internally-derived boot image I and GPU transmittance imageMean of (2)、; Transmission image by guiding image I and GPUMean value、Calculating a coefficient a k: Wherein I i is the guiding image I in the local window Points within, P i is the GPU transmittance imageIn a local windowThe point in the inner side of the frame,Is a decimal set to prevent the divisor from being 0; By means of the mean value 、And coefficient a k, coefficient b k: Calculating GPU refinement transmissivity image according to coefficient a k、bk: 。 Further, the method for obtaining the preliminary defogging image comprises the following steps: In order to preliminarily defogging the image, Is the GPU infrared original image. Further, the method for obtaining the infrared enhanced image comprises the following steps: Calculating a local histogram, dividing the preliminary defogging image into a plurality of window tiles, and calculating a histogram for each window tile: ; Wherein the method comprises the steps of For pixel gray level 256, the aboveRepresenting the traversing pixel, counting +1 when the pixel value of a certain gray level appears once; setting limiting contrast ,Clipping the histogram for enhancing the coefficients, the number of pixels being at mostExceeding cutting: , The pixels cut out from the histogram cannot be lost, all gray scales need to be distributed evenly, and the number of the pixels cut