| CPC G06T 5/73 (2024.01) [G06T 7/90 (2017.01); G06T 2207/10024 (2013.01); G06T 2207/30192 (2013.01)] | 7 Claims |

|
1. A method for image defogging based on a dark channel prior, comprising:
acquiring a dark channel image and a light channel image of a haze weather image according to the haze weather image; wherein acquiring the dark channel image and the light channel image of the haze weather image comprising:
taking a minimum value of pixel points in R, G, and B three channels of an input image to obtain the dark channel image, and taking a minimum value in a neighborhood of the pixel points,
calculating dark channel pixel values of the haze weather image through formula (1);
![]() wherein, c represents a certain channel of R, G, and B three channels, Jc represents pixel values of each channel in a color image, Ω(x) represents a window centered on pixel X, and a size of the window is a size of the neighborhood;
taking a maximum value of the pixel points in the R, G, and B three channels of the input image to obtain the light channel image, and taking a maximum value in the neighborhood of the pixel points;
calculating light channel pixel values of the haze weather image through formula (2),
![]() selecting pixel values in the light channel image and calculating an atmospheric light value A; wherein selecting pixel values in the light channel image and calculating the atmospheric light value A, comprising:
selecting pixel values within a preset range in the light channel pixel values;
averaging the selected pixel points to obtain the atmospheric light value A;
obtaining a transmittance image based on the light channel image and the atmospheric light value A; wherein obtaining the transmittance image based on the light channel image and the atmospheric light value A, comprising:
comparing the calculated light channel pixel values with the calculated atmospheric light value A to obtain a prior value Jdl(x) between the dark channel pixel values and the light channel pixel values, an expression of the prior value Jdl(x) is:
![]() wherein pixels in sky areas or high brightness areas of the haze weather image, at least one color channel has a pixel value close to 255, a prior value 255 of the high brightness areas is obtained, and the dark channel pixel values are Jd(x)→0; the light channel pixel values are Jl(x)→255;
substituting the obtained prior value into a atmospheric scattering model to calculate the transmittance image, the atmospheric scattering model is:
I(x)=J(x)t(x)+A(1−t(x).
wherein, J(x) represents the input image; J(x) represents a clear image; A is the atmospheric light value; t(x) represents the transmittance image;
an obtained transmittance image in dark areas is:
![]() an obtained transmittance image in the high brightness areas is:
![]() introducing a factor ω for optimizing images in t(x), the transmittance image is:
![]() performing threshold processing on the transmittance image;
obtaining a restored image of defogging based on the transmittance image and the atmospheric light value A.
|