CN-122023191-A - Image defogging method based on atmospheric scattering model and color correction
Abstract
The invention relates to the technical field of digital image processing and discloses an image defogging method based on an atmospheric scattering model and color correction, which comprises the following steps of S1, performing color correction on a foggy image with color bias; S2, calculating an atmospheric light value of the foggy image, S3, calculating a transmittance value of the foggy image, S4, recovering the defogging image by adopting an atmospheric scattering model according to the atmospheric light value and the transmittance value, and S5, obtaining the defogging image with the self-adaptive brightness enhanced and the self-adaptive contrast enhanced. The invention can recover the color of the defogging image naturally, improve the phenomena of color cast, incomplete defogging, loss of detail information and darkness of the whole image, and the recovered defogging image is more in line with the human eye perception, and has the advantages of simple realization process, low time complexity and better defogging efficiency.
Inventors
- CHEN TINGTING
- Cai Jiacan
- ZHAO JINGJING
- ZOU JUN
- SONG JUN
Assignees
- 贵州航天南海科技有限责任公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251217
Claims (10)
- 1. An image defogging method based on an atmospheric scattering model and color correction, comprising the steps of: s1, carrying out color correction on a foggy image with color bias; s2, calculating an atmospheric light value of the foggy image; S3, calculating a transmissivity value of the foggy image; S4, recovering a defogging image by adopting an atmospheric scattering model according to the atmospheric light value and the transmittance value; S5, obtaining defogging images after self-adaptive brightness enhancement and self-adaptive contrast enhancement.
- 2. The image defogging method based on an atmospheric scattering model and color correction according to claim 1, wherein the step S1 comprises the steps of: S11, calculating the foggy image with color shift in the Lab space Color component, Color components and luminance components; s12, calculating the corrected foggy image with color shift in the Lab space Color component Color components; s13, correcting according to Lab space Color component Color component, calculating foggy image after color shift correction 。
- 3. The image defogging method based on the atmospheric scattering model and the color correction according to claim 2, wherein the step S12 comprises the steps of: s121, calculating for correction Correction coefficient of color component : , wherein, For colour components Is used for the correction of the correction coefficient of (c), For colour components From the luminance component Weighted average of the weights: , wherein, 、 The size of the image is represented and, For colour components Is a pixel value of a corresponding pixel point of the image, For the luminance component i.e. the luminance value of the corresponding pixel, Is a weighted average; S122, calculating for correction Correction coefficient of color component : , wherein, For colour components Is used for the correction of the correction coefficient of (c), For colour components According to the luminance component of (a) Weighted average of the weights: , wherein, 、 The size of the image is represented and, For colour components Is a pixel value of a corresponding pixel point of the image, For the luminance component i.e. the luminance value of the corresponding pixel, Is a weighted average; s123, calculating corrected color components And : , wherein, Representing corrected The color component of the color component is, Representing corrected The color component of the color component is, For colour components Is used for the correction of the correction coefficient of (c), For colour components Is used for the correction of the correction coefficient of (c), And Representing the color component before correction, =0.9 =0.6 Is a constant coefficient, For colour components Is used for the mean absolute deviation of (c), For colour components Mean absolute deviation of (c).
- 4. The method for defogging an image based on an atmospheric scattering model and color correction as recited in claim 2, wherein the method comprises The color components are from green to red, The color components are color components from blue to yellow.
- 5. An atmospheric scattering model and color correction based image defogging method as claimed in claim 3 wherein the color component The mean absolute deviation of (2) is: , wherein, For colour components Is used for the mean absolute deviation of (c), 、 The size of the image is represented and, For colour components Is a pixel value of a corresponding pixel point of the image, Representing color components Is the average value of (2); color component The mean absolute deviation of (2) is: , wherein, For colour components Is used for the mean absolute deviation of (c), 、 The size of the image is represented and, For colour components Is a pixel value of a corresponding pixel point of the image, Representing color components Is a mean value of (c).
- 6. The image defogging method based on the atmospheric scattering model and the color correction according to claim 1, wherein the step S2 comprises the steps of: s21, calculating a dark channel diagram with improved fog images; s22, an improved dark channel diagram after guide filtering treatment; s23, calculating an area where the atmospheric light value is located by adopting a quadtree segmentation algorithm according to the improved dark channel diagram.
- 7. The image defogging method based on the atmospheric scattering model and the color correction according to claim 1, wherein the step S21 comprises the steps of: s211, utilizing SLIC super-pixel algorithm to carry out fog image Super pixel blocks obtained by super pixel segmentation are carried out: , wherein, For the number of super-pixel blocks, 、 The size of the image is represented and, To be dark channel window size: , wherein, For the dark channel window size, 、 The size of the image is represented and, Is an adjusting parameter, and the value is 0.02; s212, firstly, obtaining the value of the dark channel in each super pixel block Then replace all values of this sub-block with its 5 th percentile to obtain an improved dark channel map : , wherein, For dark channel values within each super pixel block, Index for color channels.
- 8. The image defogging method based on the atmospheric scattering model and the color correction according to claim 1, wherein the step S22 comprises the steps of: S221, setting a guided filtered input image and a guided image, wherein the input image is an improved dark channel diagram The guide image is a foggy image after color shift correction Gray scale image of (a) : , wherein, In order to guide the image, 、 、 The foggy image is respectively dotted on the three channels of red, green and blue Pixel values of (2); S222, for each position in the image Calculating a local window centered at the position Statistics within, including mean of the guide image Sum of variances Mean value of input image Covariance of guide image and input image Wherein the mean value of the guide image The method comprises the following steps: In which, in the process, In order to guide the image, Variance of guide image The method comprises the following steps: , mean value of input image The method comprises the following steps: , Covariance of guide image and input image The method comprises the following steps: ; S223, for each partial window Calculating linear transformation coefficients Bias term , wherein, Linear transform coefficients The method comprises the following steps: In which, in the process, For regularization parameters, the value is 0.15, Bias term The method comprises the following steps: ; s224, averaging the linear coefficients and the bias terms of all windows covering the same pixel to obtain an average linear coefficient And average bias term ; S225, calculating an improved dark channel diagram after the guide filtering process: , In the formula, For an improved dark channel map after the guided filtering process, As the average of the coefficients of linearity, As an average of the bias terms, Foggy image corrected for color shift Is a gray scale image of (a).
- 9. The image defogging method based on the atmospheric scattering model and the color correction according to claim 1, wherein the step S3 comprises the steps of: s31, calculating a foggy image Luminance value, chrominance value, and saturation value, wherein, Foggy image Luminance value of (2) The method comprises the following steps: In which, in the process, As a foggy image At the pixel point The brightness value at which the brightness value is to be obtained, 、 、 The foggy image is respectively dotted on the three channels of red, green and blue Pixel values of (2) Foggy image Is of the chromaticity value of (2) The method comprises the following steps: In which, in the process, As a foggy image At the pixel point The chromaticity value at which the color value is to be obtained, 、 、 The foggy image is respectively dotted on the three channels of red, green and blue Is used for the display of the display panel, 、 、 Respectively, hazy images Red, green and blue channel pixel averages of (c), Foggy image Saturation value of (2) The method comprises the following steps: In which, in the process, As a foggy image At the pixel point The saturation value at which the saturation value is to be calculated, 、 、 The foggy image is respectively dotted on the three channels of red, green and blue Is used for the display of the display panel, As a foggy image Global averages of the red, green and blue channels of (c), Foggy image Global average of red, green, blue channels of (c) The method comprises the following steps: ,; S32, fitting the foggy image by using an exponential decay model Relation between luminance, chromaticity, saturation and haze concentration 、 And Then calculate the mist concentration value , wherein, Foggy image Relation between brightness and haze concentration The method comprises the following steps: In which, in the process, As a foggy image Is a relationship between the brightness and the haze concentration, As a foggy image At the pixel point The brightness value at which the brightness value is to be obtained, =1.2 Is an exponential decay model parameter, Foggy image Relationship between chromaticity and haze concentration The method comprises the following steps: In which, in the process, As a foggy image The relationship between the chromaticity of (c) and the haze concentration, As a foggy image At the pixel point The chromaticity value at which the color value is to be obtained, =1.5 Is an exponential decay model parameter, Foggy image Relation between saturation and mist concentration of (c) The method comprises the following steps: In which, in the process, As a foggy image Is a relationship between the saturation and the mist concentration, As a foggy image At the pixel point The saturation value at which the saturation value is to be calculated, =2.0 Is an exponential decay model parameter, Mist concentration value The method comprises the following steps: ; S33, calculating a foggy image Transmittance values of (2) : In which, in the process, As a foggy image Is used for the transmission value of (a), As a foggy image Is used for the concentration of fog in the air, The atmospheric scattering coefficient is 0.95%.
- 10. The image defogging method based on the atmospheric scattering model and the color correction according to claim 1, wherein the step S5 comprises the steps of: S51, firstly, obtaining a brightness image of the defogging image, and then processing the brightness image by utilizing logarithmic transformation to realize self-adaptive adjustment of the brightness dynamic range, wherein, Defogging image Is a luminance image of (2) The method comprises the following steps: In which, in the process, 、 、 The defogging image is respectively dotted on three channels of red, green and blue Is used for the display of the display panel, Adaptive luminance enhanced luminance image The method comprises the following steps: In which, in the process, In order to remove the luminance image of the foggy image, Constant, parameter =3; S52, enhancing the self-adaptive brightness on different scales to obtain a brightness image Carrying out Gaussian kernel function convolution operation of different scales to obtain a blurred image : In which, in the process, Is the first Gaussian convolution kernel of individual scale: In which, in the process, Is the scale factor of the gaussian function, Is a normalization factor, and the normalization factor The following is satisfied: , The Laplace response at each scale is then calculated : In which, in the process, The Laplace operator adopts four fields of discrete forms, specifically: , recalculating adaptive gamma correction parameters The expression is as follows: , In the formula, Is the first The maximum value of the absolute value of the laplace response on the individual scale, Is a detail protection factor and , In order to blur the image is blurred, For the laplace response at each scale, Then calculate contrast enhanced images on different scales : , Wherein, the For contrast enhancement images on different scales, To enhance the adaptive luminance for luminance images, For the purpose of the adaptive gamma correction parameters, Finally, the image is enhanced with different scales Takes the average Laplace response value of (a) as a weight to obtain a defogging image after final self-adaptive contrast enhancement : , , , In the formula, 、 Representing the size of the image.
Description
Image defogging method based on atmospheric scattering model and color correction Technical Field The invention relates to the technical field of digital image processing. Background The defogging images obtained by the existing defogging method still have the phenomena of color cast, incomplete defogging, missing detail information, overall darkness of the images and the like. The Chinese patent publication No. CN114757850A discloses an image defogging method for eliminating halation effect, which comprises the steps of firstly obtaining an input image, determining an atmospheric light value corresponding to the input image, wherein the atmospheric light value is a matrix with the same size as the input image, then fusing a dark channel transmittance map and a bright channel transmittance map according to a preset proportion to determine an image transmittance map corresponding to the input image, and finally bringing the atmospheric light value and the image transmittance map into an atmospheric scattering model to obtain an output defogged image. Although the halation effect of the image shot in the haze environment can be eliminated, the obtained defogging image still has the phenomena of color cast, incomplete defogging, loss of detail information, overall darkness of the image and the like. Disclosure of Invention The invention aims to provide an image defogging method based on an atmospheric scattering model and color correction, which can effectively improve the color cast phenomenon, incomplete defogging, detail information deletion and overall darkness phenomenon of a foggy image after defogging. In order to solve the technical problems, the invention provides an image defogging method based on an atmospheric scattering model and color correction, which comprises the following steps: s1, carrying out color correction on a foggy image with color bias; s2, calculating an atmospheric light value of the foggy image; S3, calculating a transmissivity value of the foggy image; S4, recovering a defogging image by adopting an atmospheric scattering model according to the atmospheric light value and the transmittance value; S5, obtaining defogging images after self-adaptive brightness enhancement and self-adaptive contrast enhancement. The step S1 includes the steps of: S11, calculating the foggy image with color shift in the Lab space Color component,Color components and luminance components; s12, calculating the corrected foggy image with color shift in the Lab space Color componentColor components; s13, correcting according to Lab space Color componentColor component, calculating foggy image after color shift correction。 The step S12 includes the steps of: s121, calculating for correction Correction coefficient of color component: , wherein,For colour componentsIs used for the correction of the correction coefficient of (c),For colour componentsFrom the luminance componentWeighted average of the weights: , wherein, 、The size of the image is represented and,For colour componentsIs a pixel value of a corresponding pixel point of the image,For the luminance component i.e. the luminance value of the corresponding pixel,Is a weighted average; S122, calculating for correction Correction coefficient of color component: , wherein,For colour componentsIs used for the correction of the correction coefficient of (c),For colour componentsAccording to the luminance component of (a)Weighted average of the weights: , wherein, 、The size of the image is represented and,For colour componentsIs a pixel value of a corresponding pixel point of the image,For the luminance component i.e. the luminance value of the corresponding pixel,Is a weighted average; s123, calculating corrected color components And: , wherein,Representing correctedThe color component of the color component is,Representing correctedThe color component of the color component is,For colour componentsIs used for the correction of the correction coefficient of (c),For colour componentsIs used for the correction of the correction coefficient of (c),AndRepresenting the color component before correction,=0.9=0.6 Is a constant coefficient,For colour componentsIs used for the mean absolute deviation of (c),For colour componentsMean absolute deviation of (c). The saidThe color components are from green to red,The color components are color components from blue to yellow. The color componentThe mean absolute deviation of (2) is: , wherein, For colour componentsIs used for the mean absolute deviation of (c),、The size of the image is represented and,For colour componentsIs a pixel value of a corresponding pixel point of the image,Representing color componentsIs the average value of (2); color component The mean absolute deviation of (2) is: , wherein, For colour componentsIs used for the mean absolute deviation of (c),、The size of the image is represented and,For colour componentsIs a pixel value of a corresponding pixel point of the image,Representing color component