To address the poor performance of most defogging algorithms on images with large areas of sky, an improved dark channel a priori defogging method is proposed. First, segment the sky area according to the image gradient information, and based on the sky area segmentation, combine the high brightness and smoothness of the atmospheric light reference pixels to set the discriminant formula and reasonably estimate atmospheric light values. Second, a piecewise linear function is used to dynamically modify the adjustable parameters in response to the value of the dark channel to solve the local shadow caused by excessive defogging. Then, the transmittance estimated by the bright channel model and improved dark channel a priori model are fused and guided filtering is used for edge optimization. Finally, the defogging image is obtained by combining brightness compensation and contrast stretching using the atmospheric scattering model. The experimental results show that the improved method effectively reduces image distortion, improves image contrast and details, and has advantages in preserving the visual authenticity of the sky area.