Power transmission line image defogging method and device, computer device
By combining a pre-trained diffusion model with an iterative denoising method that corrects for dark channels and color attenuation constraints, the problem of detail loss caused by image dehazing in existing technologies is solved, and a highly efficient dehazing effect that preserves key details of transmission lines is achieved during the dehazing process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-26
Smart Images

Figure CN122289054A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image dehazing technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for dehazing images of power transmission lines. Background Technology
[0002] With the development of image dehazing technology, image dehazing technology based on physical models and image enhancement has emerged. This technology can weaken fog interference in images and improve image clarity through different technical means.
[0003] Physical model-based methods rely on the physical laws of fog imaging to construct a dehazing model and remove fog interference by solving the model. Image enhancement-based methods improve the visual performance of foggy images by enhancing image contrast and sharpening details. Deep learning-based methods utilize the feature learning capabilities of neural networks to train the model to learn the mapping relationship between fog features and fog-free images, thereby achieving image dehazing.
[0004] However, existing technical solutions may result in the loss of image detail while dehazing, affecting image clarity and quality, and cannot guarantee stable removal of fog interference. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for defogging power line images that can stably remove fog interference while preserving key details of the power line, in order to address the aforementioned technical problems.
[0006] In a first aspect, this application provides a method for dehazing transmission line images, including:
[0007] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0008] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0009] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0010] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0011] In one embodiment, based on the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step, constraint correction processing is performed on the current image to be constrained to obtain the iterative output image after constraint correction at the current time step, including:
[0012] Perform dark channel prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint;
[0013] Perform color decay prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the color decay prior constraint;
[0014] The loss gradient of the dark channel prior constraint is multiplied by the dark channel constraint correction weight at the current time step, and the loss gradient of the color attenuation prior constraint is multiplied by the color attenuation constraint correction weight at the current time step. The two weighted loss gradients are then fused to obtain the total gradient. Based on the total gradient, pixel correction is performed on the current image to be constrained to obtain the weighted fused correction image.
[0015] The weighted fusion correction image is sequentially subjected to exposure consistency constraint correction and hue stability constraint correction to obtain the iterative output image after constraint correction at the current time step.
[0016] In one embodiment, a dark channel prior constraint correction is performed on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint, including:
[0017] The current image to be constrained is traversed row by row and column by column using a rectangular sliding window of a preset size. The minimum pixel value of each color channel in each window is extracted to form a dark channel reference image with the same size as the current image to be constrained.
[0018] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the dark channel reference image. Construct a dark channel prior loss function based on the pixel difference. Solve for the gradient of the dark channel prior loss function with respect to the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint.
[0019] In one embodiment, a color attenuation prior constraint correction is performed on the current image to be constrained to obtain the loss gradient corresponding to the color attenuation prior constraint, including:
[0020] Extract the brightness and saturation values of the current image to be constrained;
[0021] Based on the brightness and saturation values, the fog density values of the pixels in the current image to be constrained are calculated to form a color attenuation reference image;
[0022] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the color decay reference image; construct a color decay prior loss function based on the pixel difference, solve the gradient of the color decay prior loss function with respect to the current image to be constrained, and obtain the loss gradient corresponding to the color decay prior constraint.
[0023] In one embodiment, performing exposure consistency constraint correction on the weighted fusion corrected image includes:
[0024] The brightness distribution parameters of the hazy image are extracted as the exposure reference, and the brightness distribution parameters of the weighted fusion correction image are calculated.
[0025] Based on the pixel brightness values of each pixel in the hazy image and the weighted fusion corrected image, calculate the sum of squares of the brightness differences between corresponding pixels, and calculate the average of all sums of squares;
[0026] An exposure consistency loss function is constructed based on the average value. The gradient of the exposure consistency loss function with respect to the weighted fused correction image is calculated. The gradient is then used to perform pixel correction on the weighted fused correction image.
[0027] In one embodiment, performing hue stability constraint correction on the image after exposure consistency constraint correction includes:
[0028] The hazy image and the image after exposure consistency constraint correction were converted to the HSV color space respectively, and their respective H channel hue parameters were extracted.
[0029] Based on the distribution difference between the hue parameters of the two H channels, a hue stability loss function is constructed; the gradient of the hue stability loss function with respect to the image after exposure consistency constraint correction is solved, and pixel correction is performed on the image after exposure consistency constraint correction through the gradient to obtain the iterative output image after constraint correction at the current time step.
[0030] In one embodiment, determining whether image quality degradation has occurred at the current time step based on the quality evaluation index of the iterative output image at the current time step includes:
[0031] Extract the parameters of brightness uniformity, edge sharpness, and texture detail richness of the iterative output image after constraint correction at the current time step;
[0032] The comprehensive quality score is obtained by weighting and summing the various quality evaluation indicators.
[0033] If the overall quality score at the current time step is higher than the preset score threshold, and the overall quality scores at the two consecutive subsequent time steps at the current time step are lower than the overall quality score at the corresponding previous time step, then it is determined that image quality degradation has occurred at the current time step.
[0034] In one embodiment, based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step are adaptively adjusted, including:
[0035] Extract the edge gradient value, pixel gray-level extreme value difference, and number of texture feature points of the iterative output image after constraint correction at the current time step; perform weighted summation of each quality evaluation index to obtain the quality index value of the no-reference image;
[0036] The hazy image and the iterative output image at the current time step are converted to the hue space, and the overlap of the hue distribution between the two is calculated to obtain the hue consistency index value.
[0037] For images obtained under the sole application of dark channel prior constraint correction or color attenuation prior constraint correction, if the no-reference image quality index of the image obtained under the sole application is lower than the preset index value, the weight ratio of the corresponding type of constraint correction is reduced, and the weight ratio of the other type of constraint correction is increased.
[0038] Secondly, this application also provides a dehazing device for transmission line images, comprising:
[0039] The acquisition module is used to acquire foggy images of transmission lines and generate a noise image with the same size and color channel type as the foggy image;
[0040] The denoising module is used to iteratively denoise the noisy image using a pre-trained diffusion model at multiple time steps; among which,
[0041] The denoising module is also used to take the iterative output image of the previous time step as the denoising input image of the current time step for the current time step, perform its own denoising calculation on the denoising input image of the current time step through the pre-trained diffusion model, and output the denoised intermediate image of the current time step; take the denoised intermediate image of the current time step as the current image to be constrained, and perform constraint correction processing on the current image to be constrained based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step to obtain the iterative output image of the current time step after constraint correction;
[0042] The denoising module is also used to determine whether image quality degradation has occurred at the current time step based on the quality evaluation index of the iterative output image at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step are adaptively adjusted to obtain the dark channel constraint correction weight and color attenuation constraint correction weight for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0043] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0044] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0045] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0046] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0047] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0049] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0050] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0051] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0052] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0053] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0054] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0055] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0056] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0057] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0058] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for dehazing transmission line images first acquires a foggy image of the transmission line and generates a noisy image with the same size and color channels. Then, it performs reverse denoising iteratively in multiple time steps using a pre-trained diffusion model. In each time step, the output image of the previous time step is used as the current denoising input. The diffusion model itself calculates a denoised intermediate image, which is then used as the image to be constrained. Constraint correction weights for the current dark channel and color attenuation are used to correct the constraints, resulting in the current iteration output image. Subsequently, the image quality evaluation index is used to determine whether quality degradation has occurred. If no degradation has occurred, it is used as the input for the next denoising step. The prior constraints for the dark channel and color attenuation are integrated into the iterative denoising process of the diffusion model. At the same time, the constraint weights are adaptively and dynamically adjusted in conjunction with the image quality evaluation index. This approach can effectively preserve the key details of the transmission line while ensuring the physical authenticity of the dehazing, avoiding the image quality degradation problem caused by excessive iteration in traditional diffusion denoising processes. The algorithm adaptively adjusts the weights of the dark channel and color attenuation constraints in the next step based on the quality evaluation index, and continues iterating. If degradation occurs, the iteration terminates, and the final dehazed image is output. By judging the image quality degradation status in real time, the iteration process is terminated early, reducing unnecessary time step calculations while ensuring the dehazing effect, thus improving the overall dehazing efficiency. This approach is more suitable for the real-time image processing needs in power transmission line inspection scenarios. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is an application environment diagram of a dehazing method for power transmission line images in one embodiment;
[0061] Figure 2 This is a flowchart illustrating a method for dehazing a transmission line image in one embodiment;
[0062] Figure 3 This is an overall architecture diagram of a method for dehazing transmission line images in one embodiment;
[0063] Figure 4 This is a structural block diagram of a defogging device for a power transmission line image in one embodiment;
[0064] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0066] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0067] The dehazing method for transmission line images provided in this application embodiment can be applied to, for example... Figure 1The application environment shown is as follows. This method can be applied to a system involving only terminal 102, only server 104, or a system containing both terminal 102 and server 104; wherein terminal 102 communicates with server 104 via a network. The data storage system is used to store transmission line inspection images, pre-trained diffusion model parameters, and related configuration data. This data storage system can be integrated into server 104 or deployed in the cloud and other network servers. Specifically, terminal 102 or server 104 completes a dehazing method for transmission line images. The method includes: first, acquiring a foggy image of the transmission line and generating a noisy image with the same size and color channel; then, performing reverse denoising iteratively in multiple time steps using a pre-trained diffusion model; in each time step, using the output image of the previous time step as the current denoising input, the diffusion model itself calculates the denoised intermediate image, which is used as the image to be constrained, and constrained by the current step's dark channel constraint correction weight and color attenuation constraint correction weight to obtain the current step's iterative output image; subsequently, judging whether quality degradation has occurred based on the image quality evaluation index; if no degradation has occurred, it is used as the input for the next denoising step, and the dark channel and color attenuation constraint correction weights for the next step are adaptively adjusted according to the quality evaluation index, and the iteration continues; if degradation occurs, the iteration is terminated, and the final dehazed image is output.
[0068] Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, inspection drones, low-altitude inspection aircraft, IoT inspection equipment, and portable wearable devices. IoT devices can include smart inspection terminals, smart detection equipment, and smart vehicle-mounted inspection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, and smart inspection glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0069] In one exemplary embodiment, such as Figure 2 As shown, a method for dehazing transmission line images is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:
[0070] Step 202: Obtain a foggy image of the transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0071] Among them, the foggy image refers to a power transmission line inspection image that suffers from reduced clarity, lower contrast, and color distortion due to interference from fog, haze, water vapor, etc., in a power transmission line inspection scenario. It includes target information such as transmission conductors, towers, insulators, and background vegetation and terrain. The noisy image refers to a random noise matrix that perfectly matches the pixel size, RGB three-channel / single-channel color channel type of the foggy image, and whose pixel values follow a preset probability distribution. It is used as the initial input for the inverse denoising of the diffusion model.
[0072] For example, a foggy image is acquired during the inspection of a power transmission line, and the pixel resolution parameters, number of color channels, and channel bit depth of the image are extracted. Then, based on the extracted dimensional information, a random noise generation algorithm is used to construct a noise image with the same size and color channel type as the foggy image, ensuring that the noise image and the foggy image can be matched and iteratively denoised in the same dimension in the diffusion model.
[0073] Step 204: Using the pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps;
[0074] The pre-trained diffusion model refers to a diffusion generation model that has completed training and convergence based on massive amounts of fog-free / fog-containing image samples of transmission lines. It possesses image inverse denoising and feature restoration capabilities and is used to perform multi-time-step iterative denoising operations. A time step refers to a discrete iteration node divided during the diffusion model's inverse denoising process. Each time step corresponds to one round of image denoising and constraint correction operations, and multiple time steps are chained together to complete the entire denoising process. Iterative inverse denoising refers to the diffusion model performing denoising optimization and feature restoration on the image round by round according to a preset time-step sequence, gradually removing noise and restoring a clear, fog-free image through multiple iterations.
[0075] Step 206: For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model is used to perform self-denoising calculation on the denoised input image of the current time step, and the denoised intermediate image of the current time step is output. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0076] In this context, the current time step refers to the discrete iterative node in the diffusion model's iterative reverse denoising process that is currently performing denoising and constraint correction operations, distinct from previous completed historical time steps and subsequent future time steps to be executed. The iterative output image of the previous time step refers to the compliant image obtained after diffusion model denoising calculation and multi-constraint correction in the previous iteration node of the current time step, serving as the processing base for the current time step. The denoising input image refers to the image data input into the diffusion model of the current time step for performing basic denoising operations, i.e., the iterative output image of the previous time step.
[0077] Dark channel constraint correction weights refer to adaptively assigned coefficients used to adjust the strength of prior constraint corrections for the dark channel, adapting to the image denoising requirements of the current time step. Color attenuation constraint correction weights refer to adaptively assigned coefficients used to adjust the strength of prior constraint corrections for color attenuation, ensuring that color is not distorted during the denoising process.
[0078] For example, for the current iteration node of the diffusion model's reverse denoising, the output image processed by the previous iteration node is retrieved and used as the input data of the current node to be fed into the pre-trained diffusion model; the diffusion model performs the built-in basic denoising operation to remove residual noise in the image and initially restore the target features of the transmission line, generating the denoised intermediate image of the current time step.
[0079] The denoised intermediate image is designated as the object to be corrected. The dark channel constraint correction weight and color attenuation constraint correction weight adapted to the current time step are retrieved. Based on the two types of prior constraints, the image is subjected to gradient weighted correction and pixel optimization to eliminate the detail blurring and color shift problems caused by basic denoising. Finally, the iterative output image of the current time step is obtained after the entire process is completed, providing compliant input for subsequent iterations.
[0080] Step 208: Based on the quality evaluation index of the iterative output image at the current time step, determine whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, use the iterative output image at the current time step as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, adaptively adjust the dark channel constraint correction weight and color attenuation constraint correction weight for the current time step to obtain the dark channel constraint correction weight and color attenuation constraint correction weight for the next time step, and perform the reverse denoising process for the next time step. If image quality degradation has occurred, end the iterative reverse denoising process and obtain the final iterative output image.
[0081] Among them, the quality evaluation index is used to quantitatively evaluate the dehazing quality of the output image at the current time step, such as the sharpness, contrast, color fidelity, and detail retention. It can use single indicators such as peak signal-to-noise ratio, structural similarity, average gradient magnitude, and information entropy, or the result of multiple indicator fusion, to characterize the quality of the image dehazing effect.
[0082] Specifically, the No-Reference Image Quality Assessment (NR-IQA), also known as blind image quality assessment, can be used. This refers to an objective evaluation index that quantifies and assesses image sharpness, distortion, detail retention, and color fidelity based solely on the intrinsic features of the image being evaluated, such as texture, gradient, color, and natural statistical properties, without requiring an original, clear, and fog-free reference image. It is suitable for the actual situation in power transmission line inspection scenarios where it is impossible to obtain an original fog-free baseline image, and is used to determine whether image quality degradation occurs during iterative defogging.
[0083] Optionally / exemplarily, the iterative output image after constraint correction at the current time step is extracted, and the corresponding quality evaluation index is calculated by a preset quality evaluation algorithm; the index is compared with the image quality evaluation result of the previous time step and the preset degradation threshold to determine whether image quality degradation has occurred in the current iteration.
[0084] If no image quality degradation is detected, it indicates that the current denoising direction is reasonable and there is still room for optimization in the iteration. The iterative output image of the current time step is archived and used as the denoising input image for the next time step. At the same time, based on the numerical feedback of the current quality evaluation index, the existing dark channel constraint correction weights and color attenuation constraint correction weights are dynamically and adaptively adjusted. The correction coefficients are adjusted to adapt to the denoising requirements of the next iteration step, generating dual-constraint correction weights adapted to the next time step, and then starting the reverse denoising iteration process of the next time step.
[0085] If image quality degradation is detected, it means that continuing the iteration will exacerbate image distortion. The reverse denoising operation of all subsequent time steps is immediately terminated, and the best iterative output image generated before the current time step is used as the final dehazing result.
[0086] The aforementioned dehazing method for transmission line images first acquires a foggy image of the transmission line and generates a noisy image with the same size and color channels. Then, a pre-trained diffusion model is used to iteratively perform reverse denoising in multiple time steps. In each time step, the output image of the previous time step is used as the current denoising input. The diffusion model itself calculates a denoised intermediate image, which is then used as the image to be constrained. Constraint correction weights for the dark channel and color attenuation are applied to correct the current step's output image. Subsequently, the image quality evaluation index is used to determine whether quality degradation has occurred. If no degradation has occurred, the image is used as the input for the next denoising step, and the dark channel and color attenuation constraint correction weights are adaptively adjusted according to the quality evaluation index. The iteration continues. If degradation occurs, the iteration terminates, and the final dehazed image is output. By integrating the prior constraints of the dark channel and color attenuation into the iterative denoising process of the diffusion model, and combining the image quality evaluation index to achieve adaptive dynamic adjustment of the constraint weights, the key details of the transmission line can be effectively preserved while ensuring the physical authenticity of the dehazing, avoiding the image quality degradation problem caused by excessive iteration in traditional diffusion denoising processes. By judging the image quality degradation status in real time, the iteration process is terminated in advance. While ensuring the defogging effect, unnecessary time step calculations are reduced, the overall defogging efficiency is improved, and it is more suitable for the real-time image processing needs in the power transmission line inspection scenario.
[0087] In one embodiment, based on the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step, constraint correction processing is performed on the current image to be constrained to obtain the iterative output image after constraint correction at the current time step, including:
[0088] Perform dark channel prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint;
[0089] Perform color decay prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the color decay prior constraint;
[0090] The loss gradient of the dark channel prior constraint is multiplied by the dark channel constraint correction weight at the current time step, and the loss gradient of the color attenuation prior constraint is multiplied by the color attenuation constraint correction weight at the current time step. The two weighted loss gradients are then fused to obtain the total gradient. Based on the total gradient, pixel correction is performed on the current image to be constrained to obtain the weighted fused correction image.
[0091] The weighted fusion correction image is sequentially subjected to exposure consistency constraint correction and hue stability constraint correction to obtain the iterative output image after constraint correction at the current time step.
[0092] Specifically, the loss gradient for the prior constraints of the dark channel is:
[0093]
[0094] in, For the current image gradient, The loss function is the prior constraint for the dark channel. To predict images by minimizing the current model.
[0095] The gradient of the loss due to the prior constraint of color attenuation is:
[0096]
[0097] in, The loss function is the prior constraint for color decay.
[0098] The defogging effects of dark channel priors and color attenuation priors vary significantly when dealing with fine structures around transmission lines or specific backgrounds (such as sky areas).
[0099] To address this, an adaptive weight allocation mechanism is proposed. By performing real-time quality assessment on the generation results of each branch, when the quality of the dehazing result guided by a certain prior is low, its corresponding weight is automatically reduced, thereby avoiding excessive interference of erroneous priors on the diffusion process and achieving dynamic balance among multiple priors.
[0100] For each boot branch Calculate its indicator scores in real time The metrics include the No-Reference Image Quality Assessment (NR-IQA) and the Tone Consistency metric. To eliminate differences in the dimensions of the various indicators, normalization is first performed:
[0101]
[0102] in, To prevent small constants from being divided by zero.
[0103] Subsequently, the branch is calculated using a weighted summation. aggregate score :
[0104]
[0105] in, Indicates different evaluation indicators The corresponding indicator importance weighting coefficients reflect the priority contribution of the no-reference image quality indicator and the tone consistency indicator in evaluating the dehazing effect. As shown in the formula, the aggregate score... It is negatively correlated with image quality; that is, the higher the score, the worse the dehazing effect of the prior in the current power transmission line scenario or the more severe the color difference.
[0106] Use with sensitivity parameters The Softmax function transforms the aggregated score into the final adaptive guided weights. :
[0107]
[0108] When a prior is misled under specific lighting conditions, causing its aggregate score to be affected... During a surge, the negative exponent in the formula will cause the corresponding weight to increase. Rapidly reduce to suppress inferior branches, while when branches The quality is better than the branch At that time, weight It will automatically increase from the initial value of 0.5 and take over, thus ensuring that the diffusion model can be guided in real time and prioritize higher quality prior knowledge.
[0109] The total gradient obtained by fusion is:
[0110]
[0111] in, For the total loss function, The loss function for exposure consistency constraints, They are respectively Adaptive guiding weights.
[0112] The corrected image is:
[0113]
[0114] in, Indicates time step The current image, Indicates a corrected image; and Let represent the mean and variance of the back diffusion distribution predicted by the diffusion model, respectively; This represents random noise that follows a standard Gaussian distribution. The weighting coefficients of the guiding term are used to adjust the degree of influence of prior constraints on the diffusion sampling process; This represents the guided total loss function constructed from various prior information. By applying this loss function to the current image... The gradient is calculated, which can correct the sampling direction during the backdiffusion process, thereby guiding the image to gradually evolve in a direction that satisfies the dehazing prior constraints, thus achieving high-quality image dehazing and enhancement.
[0115] In the above embodiments, image pixel correction is performed by a dual-prior constraint gradient weighted fusion method. This method not only relies on the dark channel prior to ensure thorough dehazing and uses the color attenuation prior to suppress color distortion, but also improves the adaptability of constraint correction by dynamically matching the noise reduction requirements of different time steps through weights. On this basis, the dual constraints of exposure consistency and hue stability are superimposed to further avoid exposure anomalies and tone shifts that occur during the dehazing process. This results in transmission line images that are not only clearer after dehazing, but also maintain natural exposure and stable color, which is more in line with the actual application requirements of inspection images.
[0116] In one embodiment, a dark channel prior constraint correction is performed on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint, including:
[0117] The current image to be constrained is traversed row by row and column by column using a rectangular sliding window of a preset size. The minimum pixel value of each color channel in each window is extracted to form a dark channel reference image with the same size as the current image to be constrained.
[0118] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the dark channel reference image. Construct a dark channel prior loss function based on the pixel difference. Solve for the gradient of the dark channel prior loss function with respect to the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint.
[0119] Specifically, when performing dark channel prior constraint correction and solving the corresponding loss gradient for the current image to be constrained, a rectangular sliding window of a preset size is first used to traverse the entire image row by row and column by column. Within each sliding window, the minimum pixel value of each color channel is extracted, thereby constructing a dark channel reference image with the same pixel size as the current image to be constrained. Then, the difference between corresponding pixels in the current image to be constrained and the dark channel reference image is calculated. Based on this pixel difference, a dark channel prior loss function is constructed, and its corresponding loss function... Defined as:
[0120]
[0121] Finally, the gradient of the loss function with respect to the current image to be constrained is calculated to obtain the loss gradient corresponding to the prior constraints of the dark channel.
[0122] In the above embodiments, a dark channel reference image is constructed by traversing a sliding window, which conforms to the natural image statistical characteristics of the dark channel prior. This can accurately capture the local dark features of the current image to be constrained and adapt to the structural characteristics of targets such as conductors and towers in transmission line images. A loss function is constructed based on the difference between the corresponding pixels and the gradient is solved, so that the loss gradient can accurately reflect the degree of deviation between the current image to be constrained and the dark channel prior. This provides accurate dark channel prior guidance for subsequent gradient weighted fusion and pixel correction, effectively improving the pertinence and effectiveness of dark channel prior constraints for dehazing transmission line images and helping to reduce the brightness drift and contrast reduction caused by fog.
[0123] In one embodiment, a color attenuation prior constraint correction is performed on the current image to be constrained to obtain the loss gradient corresponding to the color attenuation prior constraint, including:
[0124] Extract the brightness and saturation values of the current image to be constrained;
[0125] Based on the brightness and saturation values, the fog density values of the pixels in the current image to be constrained are calculated to form a color attenuation reference image;
[0126] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the color decay reference image; construct a color decay prior loss function based on the pixel difference, solve the gradient of the color decay prior loss function with respect to the current image to be constrained, and obtain the loss gradient corresponding to the color decay prior constraint.
[0127] Specifically, when performing color attenuation prior constraint correction on the current image to be constrained and obtaining the corresponding loss gradient, the brightness and saturation values of each pixel in the current image to be constrained are first extracted. Then, based on these brightness and saturation values, the fog density value corresponding to each pixel is calculated, thereby constructing a color attenuation reference image that matches the size of the current image to be constrained. Subsequently, the difference between the pixels corresponding to the positions in the current image to be constrained and the color attenuation reference image is calculated. Based on this pixel difference, a color attenuation prior loss function is constructed, and its corresponding loss function is... Defined as:
[0128]
[0129] Finally, the gradient of the loss function with respect to the current image to be constrained is calculated to obtain the loss gradient corresponding to the color attenuation prior constraint.
[0130] In the above embodiments, fog concentration is calculated based on the imaging rules of brightness and saturation, and a color attenuation reference image is constructed. This aligns with the physical characteristics of enhanced brightness and reduced saturation in foggy images, accurately matching the non-uniform distribution of fog concentration in the field scene of power transmission lines. A loss function is constructed based on the difference between corresponding pixels, and the gradient is solved. This allows the loss gradient to accurately reflect the degree of deviation between the current image to be constrained and the color attenuation prior, providing accurate color attenuation prior guidance for subsequent gradient weighted fusion. This enables the model to specifically strengthen defogging processing in areas with high fog concentration, effectively improving the visibility of key structures of power transmission lines, while suppressing color distortion problems during the defogging process.
[0131] In one embodiment, performing exposure consistency constraint correction on the weighted fusion corrected image includes:
[0132] The brightness distribution parameters of the hazy image are extracted as the exposure reference, and the brightness distribution parameters of the weighted fusion correction image are calculated.
[0133] Based on the pixel brightness values of each pixel in the hazy image and the weighted fusion corrected image, calculate the sum of squares of the brightness differences between corresponding pixels, and calculate the average of all sums of squares;
[0134] An exposure consistency loss function is constructed based on the average value. The gradient of the exposure consistency loss function with respect to the weighted fused correction image is calculated. The gradient is then used to perform pixel correction on the weighted fused correction image.
[0135] Specifically, the brightness distribution parameters of the original hazy image are first extracted as the exposure benchmark, and the brightness distribution parameters of the weighted fused correction image are calculated simultaneously. Then, based on the brightness values of each corresponding pixel in the hazy image and the weighted fused correction image, the sum of squares of the brightness differences between the two images is calculated, and the average of all sums is taken. An exposure consistency loss function is constructed based on this average. Subsequently, the gradient of this loss function with respect to the weighted fused correction image is calculated. Finally, this gradient is used to perform pixel correction on the weighted fused correction image, completing the exposure consistency constraint correction process. The corresponding loss function is... Defined as:
[0136]
[0137] in, A foggy image of a power transmission line. To correct the image.
[0138] In the above embodiments, the brightness distribution of the original foggy image is used as the exposure benchmark to match the original lighting characteristics of the transmission line image, avoiding the problem of the corrected image being out of sync with the original scene lighting. By constructing a loss function from the sum of the squares and mean of the brightness differences of the corresponding pixels and solving the gradient for pixel correction, the exposure deviation between the corrected image and the benchmark can be accurately quantified and weighted, achieving fine-grained exposure adjustment. This effectively avoids problems such as overall darkening and local overexposure that are prone to occur during the defogging process, ensuring that the transmission line image has natural exposure and uniform brightness after defogging, while fully preserving the brightness details of key structures such as towers and conductors, improving the visual consistency of the defogging image and its adaptability for subsequent hazard identification.
[0139] In one embodiment, performing hue stability constraint correction on the image after exposure consistency constraint correction includes:
[0140] The hazy image and the image after exposure consistency constraint correction were converted to the HSV color space respectively, and their respective H channel hue parameters were extracted.
[0141] Based on the distribution difference between the hue parameters of the two H channels, a hue stability loss function is constructed; the gradient of the hue stability loss function with respect to the image after exposure consistency constraint correction is solved, and pixel correction is performed on the image after exposure consistency constraint correction through the gradient to obtain the iterative output image after constraint correction at the current time step.
[0142] Specifically, when performing hue stability constraint correction on the image after exposure consistency constraint correction, the original hazy image and the image after exposure correction are first uniformly converted to the HSV color space, and the hue parameters of the H channel of the two images are extracted. Two metrics are designed and defined as follows: Metrics Used to measure the cumulative frequency of tones that are underrepresented (i.e. below a threshold) in the current image's reference histogram:
[0143]
[0144] in, and These represent the frequencies in the current image and the reference histogram, respectively. This is a preset threshold.
[0145] The second indicator Used to quantify the difference between the current tonal distribution and the original image:
[0146]
[0147] in, This represents the tonal frequency in the original image.
[0148] Then, based on the distribution difference of the hue parameters of the two H channels, a hue stability loss function is constructed. The gradient of this loss function with respect to the image after exposure consistency constraint correction is solved. Finally, the gradient is used to correct the pixels of the image, and the iterative output image after full-process constraint correction at the current time step is obtained.
[0149] In the above embodiments, the hue parameter is extracted separately through the H channel of the HSV color space, achieving accurate separation and extraction of hue features. This avoids interference from other color channels on hue analysis and aligns with the color distribution characteristics of transmission line images. Using the hue of the original foggy image as a reference, a loss function is constructed based on the hue distribution difference, and pixel correction is performed using gradients. This accurately quantifies and suppresses the hue shift problem that occurs during the defogging process, ensuring that the colors of the defogging transmission line image are natural and the hue remains consistent with the original scene. This avoids affecting the visual recognition of key targets such as towers and conductors due to color distortion, further enhancing the support of the defogging image for subsequent hazard identification tasks.
[0150] In one embodiment, determining whether image quality degradation has occurred at the current time step based on the quality evaluation index of the iterative output image at the current time step includes:
[0151] Extract the parameters of brightness uniformity, edge sharpness, and texture detail richness of the iterative output image after constraint correction at the current time step;
[0152] The comprehensive quality score is obtained by weighting and summing the various quality evaluation indicators.
[0153] If the overall quality score at the current time step is higher than the preset score threshold, and the overall quality scores at the two consecutive subsequent time steps at the current time step are lower than the overall quality score at the corresponding previous time step, then it is determined that image quality degradation has occurred at the current time step.
[0154] Specifically, when determining whether an image has degraded in quality based on the quality evaluation indicators of the iterative output image at the current time step, three core quality evaluation indicator parameters are first extracted: brightness uniformity, edge sharpness, and texture detail richness of the iterative output image after constraint correction at the current time step. Then, the parameters of each indicator are weighted and summed to obtain the comprehensive image quality score at the current time step. Finally, the image quality is determined by a dual judgment based on the scoring threshold and the score change trend of consecutive time steps. If the comprehensive quality score at the current time step is higher than the preset scoring threshold, and the comprehensive quality scores of the two consecutive subsequent time steps are lower than the comprehensive quality scores of the corresponding previous time step, then the image quality at the current time step is determined to have degraded.
[0155] In the above embodiments, three core indicators—brightness uniformity, edge sharpness, and texture detail richness—are selected to align with the quality assessment of dehazed transmission line images. This approach considers both the overall visual effect of the image and key structural details, making the evaluation dimensions more suitable for the actual needs of transmission line inspections. A comprehensive quality score is obtained through weighted summation, which quantitatively integrates the evaluation results of multiple indicators, avoiding the one-sidedness of single-indicator evaluation. Furthermore, a dual judgment is made by combining the scoring threshold with the score decline trend over two consecutive subsequent time steps, rather than relying solely on score fluctuations at a single time step. This effectively avoids misjudgments caused by accidental factors, making the judgment of image quality degradation more accurate and robust. This provides a reliable basis for the subsequent adaptive termination of iterative denoising processes, preventing over-denoising of slightly foggy images and premature termination of high-quality dehazing results, thus ensuring the final quality of dehazed transmission line images.
[0156] In one embodiment, based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step are adaptively adjusted, including:
[0157] Extract the edge gradient value, pixel gray-level extreme value difference, and number of texture feature points of the iterative output image after constraint correction at the current time step; perform weighted summation of each quality evaluation index to obtain the quality index value of the no-reference image;
[0158] The hazy image and the iterative output image at the current time step are converted to the hue space, and the overlap of the hue distribution between the two is calculated to obtain the hue consistency index value.
[0159] For images obtained under the sole application of dark channel prior constraint correction or color attenuation prior constraint correction, if the no-reference image quality index of the image obtained under the sole application is lower than the preset index value, the weight ratio of the corresponding type of constraint correction is reduced, and the weight ratio of the other type of constraint correction is increased.
[0160] Specifically, when adaptively adjusting the weights of dark channel and color attenuation constraint correction based on the quality evaluation index of the iterative output image at the current time step, the edge gradient value, pixel gray-level extreme value difference, and number of texture feature points of the iterative output image after constraint correction at the current time step are first extracted, and the weighted sum of these indices is used to obtain the no-reference image quality index value. Then, the hazy image and the current iterative output image are converted to hue space, and the overlap of their hue distributions is statistically analyzed to obtain the hue consistency index value. Finally, the image under the individual action of dark channel and color attenuation prior constraint correction is evaluated. If the no-reference image quality index value of the image under the individual action of a certain type of constraint is lower than the preset index value, the weight ratio of that type of constraint correction is reduced, while the weight ratio of the other type of constraint correction is increased accordingly, thus completing the adaptive adjustment of the two types of weights.
[0161] Specifically, the dehazing effect of dark channel priors and color attenuation priors fluctuates significantly when dealing with fine structures or specific backgrounds (such as sky areas) around transmission lines. To address this, an adaptive weight allocation mechanism is proposed. By performing real-time quality evaluation on the generation results of each branch, when the quality of the dehazing result guided by a certain prior is low, its corresponding weight is automatically reduced, thereby avoiding excessive interference from erroneous priors on the diffusion process and achieving a dynamic balance among multiple priors.
[0162] For each boot branch Calculate its indicator scores in real time The metrics include the No-Reference Image Quality Assessment (NR-IQA) and the Tone Consistency metric. To eliminate differences in the dimensions of the various indicators, normalization is first performed:
[0163]
[0164] in, To prevent small constants from being divided by zero.
[0165] Subsequently, the branch is calculated using a weighted summation. aggregate score :
[0166]
[0167] in, Indicates different evaluation indicators The corresponding indicator importance weighting coefficients reflect the priority contribution of the no-reference image quality indicator and the tone consistency indicator in evaluating the dehazing effect. As shown in the formula, the aggregate score... It is negatively correlated with image quality; that is, the higher the score, the worse the dehazing effect of the prior in the current power transmission line scenario or the more severe the color difference.
[0168] Use with sensitivity parameters The Softmax function transforms the aggregated score into the final adaptive guided weights. :
[0169]
[0170] When a prior is misled under specific lighting conditions, causing its aggregate score to be affected... During a surge, the negative exponent in the formula will cause the corresponding weight to increase. Rapidly reduce to suppress inferior branches, while when branches The quality is better than the branch At that time, weight It will automatically increase from the initial value of 0.5 and take over, thus ensuring that the diffusion model can be guided in real time and prioritize higher quality prior knowledge.
[0171] Combining the above adaptive allocation mechanism, the total loss function The calculation is as follows:
[0172]
[0173] in, They are subject to adaptive weights Constraint-based prior guidance loss, These are the weights of the corresponding branches. Fixed weights for exposure constraints.
[0174] In one embodiment, such as Figure 3 The figure shows the overall architecture of a dehazing method for transmission line images in a specific embodiment. By utilizing the back-diffusion sampling process of a pre-trained diffusion model in the inference stage, a variety of prior constraints that match the characteristics of fog imaging are introduced to adaptively guide the dehazing process, thereby obtaining transmission line images with clear structure, stable color, and complete details in complex foggy environments.
[0175] In the picture, This indicates a foggy image that needs to be processed. Indicates by The noise image obtained after adding noise during the diffusion process; This represents the denoised image predicted by the pre-trained diffusion model at the current time step; This represents the image updated at the current time step based on both model predictions and prior constraints. This represents the clear image finally recovered after stepwise backdiffusion. The method specifically includes:
[0176] S1: Acquire foggy images of transmission lines. , generation and A noisy image with consistent size and color channel type.
[0177] S2: Initialize the diffusion model and reverse denoising process;
[0178] The diffusion model is used as the basic framework for image dehazing. The diffusion model achieves the reconstruction from a noisy state to a clear image state by progressively injecting Gaussian noise into the image during the forward process and progressively removing the noise during the backward process.
[0179] At the start of the backdiffusion process, the dark channel prior branch loss is applied. With color attenuation prior branch loss The guiding weights are set to equal initial values (i.e., , Exposure consistency constraint Set to have fixed weights Global constraint terms. It is a brightness balance benchmark constructed based on the exposure map extracted from the input image. It aims to prevent the image from being over-darkened or locally overexposed during the dehazing process. As a "bottom line" constraint to maintain the basic physical properties of the generated image, its guiding gradient must remain stable throughout the diffusion process and not fluctuate with the effectiveness of prior knowledge. Therefore, it does not participate in adaptive allocation.
[0180] S3: In each diffusion time step, dark channel prior, color attenuation prior and exposure consistency constraint are introduced;
[0181] Specifically, during the backdiffusion process, the image update at each time step not only depends on the diffusion model's prediction of the current noisy image, but also incorporates a guiding term constructed from various prior information, namely the Dark Channel Prior (DCP), Color Attenuation Prior (CAP), and Exposure Map, to perform gradient correction on the sampling direction. These prior constraints characterize the statistical and illumination properties that a hazy image should satisfy, thereby guiding the reconstruction results during the diffusion sampling process.
[0182] The image update rule for single-step backdiffusion is defined as follows:
[0183] (1)
[0184] in, Indicates time step Noisy images, This represents the updated, denoised intermediate image; and Let represent the mean and variance of the back diffusion distribution predicted by the diffusion model, respectively; This represents random noise that follows a standard Gaussian distribution. The weighting coefficients of the guiding term are used to adjust the degree of influence of prior constraints on the diffusion sampling process; This represents the guided loss function constructed from various prior information. By applying this loss function to the current image... The gradient is calculated, which can correct the sampling direction during the backdiffusion process, thereby guiding the image to gradually evolve in a direction that satisfies the dehazing prior constraints, thus achieving high-quality image dehazing and enhancement.
[0185] Dark Channel Prior (DCP) Constraint: The dark channel prior is a dehazing prior based on the statistical properties of natural images. Its core assumption is that in a hazy natural image, at least one color channel in a local region has a pixel value close to zero. In transmission line images, the conductors, tower structures, and background vegetation all satisfy this statistical property.
[0186] By calculating the difference between the current diffusion prediction image and the prior processing result of the dark channel, and using this difference as a constraint loss, the diffusion process is guided to mitigate the brightness shift and contrast reduction caused by fog. The corresponding loss function is... Defined as:
[0187] (2)
[0188] Predicting images by minimizing the current model With scriptures The differences between the processed dehazed images are used to constrain the generation process of the diffusion model.
[0189] Color attenuation prior constraint: The color attenuation prior is based on the imaging law that brightness increases and saturation decreases in foggy areas. The change in fog concentration is estimated by the difference between brightness and saturation.
[0190] Using color attenuation prior as a second dehazing constraint, the error between the diffusion prediction image and the color attenuation estimation result is constrained, guiding the model to perform stronger dehazing processing in areas with high fog concentration, thereby enhancing the visibility of critical structures of transmission lines. Its corresponding loss function... Defined as:
[0191] (3)
[0192] By minimizing the current model prediction value With scriptures The differences between the processed dehazed images are used to constrain the generation process of the diffusion model.
[0193] Exposure consistency constraint: In the diffusion dehazing process, relying solely on the dehazing prior can easily lead to an overall darker image.
[0194] Further, an exposure consistency constraint is introduced. By comparing the exposure mapping between the input image and the current predicted image, the brightness variation range of the dehazing result is limited, avoiding the darkening problem caused by excessive dehazing. Its corresponding loss function... Defined as:
[0195] (4)
[0196] in, Represents the input image The exposure image extracted from it.
[0197] S4: Dynamically adjust the weights of each prior constraint based on the hue consistency and image quality evaluation results;
[0198] Hue Consistency-Based Constraint Mechanism: To further address the color shift issue that easily occurs during dehazing, this application introduces a hue-based stability constraint. Research has found that in transmission line scenarios, the hue distribution of images before and after dehazing exhibits strong consistency. This application statistically analyzes the difference in hue space distribution between the current dehazing result and the original image, incorporating this difference into the constraint evaluation index. This effectively suppresses unnecessary color drift during dehazing, ensuring the naturalness and consistency of image colors.
[0199] Specifically, two hue-based metrics were designed and defined as follows: Metrics Used to measure the cumulative frequency of tones that are underrepresented (i.e. below a threshold) in the current image's reference histogram:
[0200] (5)
[0201] in, and These represent the frequencies in the current image and the reference histogram, respectively. This is a preset threshold.
[0202] The second indicator Used to quantify the difference between the current tonal distribution and the original image:
[0203] (6)
[0204] in, This represents the tonal frequency in the original image.
[0205] By minimizing This ensures that the dehazed image maintains tonal consistency with the reference image and the original image. These metrics are integrated into an adaptive weighting mechanism to achieve a dehazing effect that preserves the original colors.
[0206] Adaptive Weight Allocation Mechanism: Due to the significant differences in fog distribution across different transmission line scenarios, a single prior is insufficient to maintain optimal performance in all complex scenarios. Specifically, the defogging effects of dark channel and color attenuation priors fluctuate significantly when dealing with fine structures or specific backgrounds (such as the sky) around transmission lines. To address this, an adaptive weight allocation mechanism is proposed. By performing real-time quality assessment on the generation results of each branch, when the defogging result guided by a certain prior is of low quality, its corresponding weight is automatically reduced. This avoids excessive interference from erroneous priors in the diffusion process and achieves a dynamic balance among multiple priors.
[0207] For each boot branch Calculate its indicator scores in real time The metrics include the No-Reference Image Quality Assessment (NR-IQA) metric and the tone consistency metric mentioned above. To eliminate differences in the dimensions of the various indicators, normalization is first performed:
[0208] (7)
[0209] in, To prevent small constants from being divided by zero.
[0210] Subsequently, the branch is calculated using a weighted summation. aggregate score :
[0211] (8)
[0212] in, Indicates different evaluation indicators The corresponding indicator importance weighting coefficients reflect the priority contribution of the no-reference image quality indicator and the tone consistency indicator in evaluating the dehazing effect. As shown in the formula, the aggregate score... It is negatively correlated with image quality; that is, the higher the score, the worse the dehazing effect of the prior in the current power transmission line scenario or the more severe the color difference.
[0213] Use with sensitivity parameters The Softmax function transforms the aggregated score into the final adaptive guided weights. :
[0214] (9)
[0215] This mechanism implements the following dynamic adjustment logic: when a prior is misguided under specific lighting conditions, causing its aggregate score to be affected... During a surge, the negative exponent in the formula will cause the corresponding weight to increase. Rapidly reduce to suppress inferior branches, while when branches The quality is better than the branch At that time, weight It will automatically increase from the initial value of 0.5 and take over, thus ensuring that the diffusion model can be guided in real time and prioritize higher quality prior knowledge.
[0216] Combining the above adaptive allocation mechanism, the total loss function The calculation is as follows:
[0217] (10)
[0218] in, They are subject to adaptive weights Constraint-based prior guidance loss, These are the weights of the corresponding branches. Fixed weights for exposure constraints.
[0219] S5: Adaptively control the number of denoising steps based on changes in image quality;
[0220] To address the significant variations in fog concentration, an adaptive denoising step control mechanism is further proposed. During the backdiffusion process, the system continuously evaluates the no-reference quality index of the current defogging result. When it detects that continued denoising will lead to a deterioration in image quality, the system automatically terminates subsequent diffusion steps and outputs the image from the previous time step as the final result, thereby avoiding overprocessing of lightly foggy images.
[0221] S6: Outputs a high-quality image of the transmission line after defogging, for subsequent hazard identification.
[0222] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0223] Based on the same inventive concept, this application also provides a dehazing apparatus for power transmission line images to implement the aforementioned dehazing method. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations of one or more embodiments of the dehazing apparatus for power transmission line images provided below can be found in the limitations of the dehazing method for power transmission line images described above, and will not be repeated here.
[0224] In one exemplary embodiment, such as Figure 4 As shown, a dehazing device for transmission line images is provided, comprising: an acquisition module 402 and a noise reduction module 404, wherein:
[0225] The acquisition module 402 is used to acquire a foggy image of the transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0226] The denoising module 404 is used to iteratively reverse denoise the noisy image using a pre-trained diffusion model at multiple time steps; wherein,
[0227] The denoising module 404 is also used for the current time step, taking the iterative output image of the previous time step as the denoising input image of the current time step, performing its own denoising calculation on the denoising input image of the current time step through the pre-trained diffusion model, and outputting the denoised intermediate image of the current time step; taking the denoised intermediate image of the current time step as the current image to be constrained, and performing constraint correction processing on the current image to be constrained based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, to obtain the iterative output image of the current time step after constraint correction;
[0228] The denoising module 404 is also used to determine whether image quality degradation occurs at the current time step based on the quality evaluation index of the iterative output image at the current time step; if no image quality degradation occurs, the iterative output image at the current time step is used as the denoising input image for the next time step, and the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step are adaptively adjusted based on the quality evaluation index of the iterative output image at the current time step to obtain the dark channel constraint correction weight and color attenuation constraint correction weight for the next time step, and the reverse denoising process for the next time step is performed; if image quality degradation occurs, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0229] In one embodiment, the denoising module 404 is further configured to perform constraint correction processing on the current image to be constrained based on the dark channel constraint correction weights and color attenuation constraint correction weights based on the current time step, to obtain the iterative output image after constraint correction at the current time step, including:
[0230] Perform dark channel prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint;
[0231] Perform color decay prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the color decay prior constraint;
[0232] The loss gradient of the dark channel prior constraint is multiplied by the dark channel constraint correction weight at the current time step, and the loss gradient of the color attenuation prior constraint is multiplied by the color attenuation constraint correction weight at the current time step. The two weighted loss gradients are then fused to obtain the total gradient. Based on the total gradient, pixel correction is performed on the current image to be constrained to obtain the weighted fused correction image.
[0233] The weighted fusion correction image is sequentially subjected to exposure consistency constraint correction and hue stability constraint correction to obtain the iterative output image after constraint correction at the current time step.
[0234] In one embodiment, the denoising module 404 is further configured to perform dark channel prior constraint correction on the current image to be constrained, and obtain the loss gradient corresponding to the dark channel prior constraint, including:
[0235] The current image to be constrained is traversed row by row and column by column using a rectangular sliding window of a preset size. The minimum pixel value of each color channel in each window is extracted to form a dark channel reference image with the same size as the current image to be constrained.
[0236] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the dark channel reference image. Construct a dark channel prior loss function based on the pixel difference. Solve for the gradient of the dark channel prior loss function with respect to the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint.
[0237] In one embodiment, the denoising module 404 is further configured to perform color attenuation prior constraint correction on the current image to be constrained, and obtain the loss gradient corresponding to the color attenuation prior constraint, including:
[0238] Extract the brightness and saturation values of the current image to be constrained;
[0239] Based on the brightness and saturation values, the fog density values of the pixels in the current image to be constrained are calculated to form a color attenuation reference image;
[0240] Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the color decay reference image; construct a color decay prior loss function based on the pixel difference, solve the gradient of the color decay prior loss function with respect to the current image to be constrained, and obtain the loss gradient corresponding to the color decay prior constraint.
[0241] In one embodiment, the denoising module 404 is further configured to perform exposure consistency constraint correction on the weighted fusion correction image, including:
[0242] The brightness distribution parameters of the hazy image are extracted as the exposure reference, and the brightness distribution parameters of the weighted fusion correction image are calculated.
[0243] Based on the pixel brightness values of each pixel in the hazy image and the weighted fusion corrected image, calculate the sum of squares of the brightness differences between corresponding pixels, and calculate the average of all sums of squares;
[0244] An exposure consistency loss function is constructed based on the average value. The gradient of the exposure consistency loss function with respect to the weighted fused correction image is calculated. The gradient is then used to perform pixel correction on the weighted fused correction image.
[0245] In one embodiment, the denoising module 404 is further configured to perform hue stability constraint correction on the image after exposure consistency constraint correction, including:
[0246] The hazy image and the image after exposure consistency constraint correction were converted to the HSV color space respectively, and their respective H channel hue parameters were extracted.
[0247] Based on the distribution difference between the hue parameters of the two H channels, a hue stability loss function is constructed; the gradient of the hue stability loss function with respect to the image after exposure consistency constraint correction is solved, and pixel correction is performed on the image after exposure consistency constraint correction through the gradient to obtain the iterative output image after constraint correction at the current time step.
[0248] In one embodiment, the denoising module 404 is further configured to determine whether image quality degradation has occurred at the current time step based on the quality evaluation index of the iterative output image at the current time step, including:
[0249] Extract the parameters of brightness uniformity, edge sharpness, and texture detail richness of the iterative output image after constraint correction at the current time step;
[0250] The comprehensive quality score is obtained by weighting and summing the various quality evaluation indicators.
[0251] If the overall quality score at the current time step is higher than the preset score threshold, and the overall quality scores at the two consecutive subsequent time steps at the current time step are lower than the overall quality score at the corresponding previous time step, then it is determined that image quality degradation has occurred at the current time step.
[0252] In one embodiment, the denoising module 404 is further configured to adaptively adjust the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step for the quality evaluation index of the iterative output image based on the current time step, including:
[0253] Extract the edge gradient value, pixel gray-level extreme value difference, and number of texture feature points of the iterative output image after constraint correction at the current time step; perform weighted summation of each quality evaluation index to obtain the quality index value of the no-reference image;
[0254] The hazy image and the iterative output image at the current time step are converted to the hue space, and the overlap of the hue distribution between the two is calculated to obtain the hue consistency index value.
[0255] For images obtained under the sole application of dark channel prior constraint correction or color attenuation prior constraint correction, if the no-reference image quality index of the image obtained under the sole application is lower than the preset index value, the weight ratio of the corresponding type of constraint correction is reduced, and the weight ratio of the other type of constraint correction is increased.
[0256] The modules in the aforementioned defogging device for power transmission line images can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0257] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for dehazing images of power transmission lines. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0258] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0259] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0260] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0261] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0262] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0263] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0264] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0265] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0266] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0267] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0268] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0269] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0270] Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image;
[0271] Using a pre-trained diffusion model, iterative reverse denoising is performed on the noisy image at multiple time steps; whereby...
[0272] For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction.
[0273] Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
[0274] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0275] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0276] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0277] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for dehazing images of power transmission lines, characterized in that, The method includes: Acquire a foggy image of a transmission line and generate a noise image with the same size and color channel type as the foggy image; The noisy image is iteratively denoised using a pre-trained diffusion model at multiple time steps; wherein... For the current time step, the iterative output image of the previous time step is used as the denoised input image of the current time step. The pre-trained diffusion model performs its own denoising calculation on the denoised input image of the current time step, and outputs the denoised intermediate image of the current time step. The denoised intermediate image of the current time step is used as the current image to be constrained. Based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step, the current image to be constrained is constrained and corrected to obtain the iterative output image of the current time step after constraint correction. Based on the quality evaluation index of the iterative output image at the current time step, it is determined whether image quality degradation has occurred at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are adaptively adjusted to obtain the dark channel constraint correction weights and color attenuation constraint correction weights for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
2. The method according to claim 1, characterized in that, The constraint correction weights based on the dark channel constraint correction weights and color attenuation constraint correction weights at the current time step are used to perform constraint correction processing on the current image to be constrained, resulting in the iterative output image after constraint correction at the current time step, including: Perform dark channel prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint; Perform color decay prior constraint correction on the current image to be constrained to obtain the loss gradient corresponding to the color decay prior constraint; The loss gradient of the dark channel prior constraint is multiplied by the dark channel constraint correction weight at the current time step, and the loss gradient of the color attenuation prior constraint is multiplied by the color attenuation constraint correction weight at the current time step. The two weighted loss gradients are then fused to obtain the total gradient. Based on the total gradient, pixel correction is performed on the current image to be constrained to obtain a weighted fused correction image. The weighted fusion correction image is sequentially subjected to exposure consistency constraint correction and hue stability constraint correction to obtain the iterative output image after constraint correction at the current time step.
3. The method according to claim 2, characterized in that, The step of performing dark channel prior constraint correction on the current image to be constrained, and obtaining the loss gradient corresponding to the dark channel prior constraint, includes: The current image to be constrained is traversed row by row and column by column using a rectangular sliding window of a preset size. The minimum pixel value of each color channel in each window is extracted to form a dark channel reference image with the same size as the current image to be constrained. Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the dark channel reference image. Construct a dark channel prior loss function based on the pixel difference. Solve for the gradient of the dark channel prior loss function with respect to the current image to be constrained to obtain the loss gradient corresponding to the dark channel prior constraint.
4. The method according to claim 2, characterized in that, The step of performing color attenuation prior constraint correction on the current image to be constrained, and obtaining the loss gradient corresponding to the color attenuation prior constraint, includes: Extract the brightness and saturation values of the current image to be constrained; Based on the brightness value and the saturation value, the fog density value of the pixels in the current image to be constrained is calculated to form a color attenuation reference image; Calculate the pixel difference between the corresponding pixels in the current image to be constrained and the color attenuation reference image; construct a color attenuation prior loss function based on the pixel difference, solve the gradient of the color attenuation prior loss function with respect to the current image to be constrained, and obtain the loss gradient corresponding to the color attenuation prior constraint.
5. The method according to claim 2, characterized in that, Perform exposure consistency constraint correction on the weighted fused corrected image, including: The brightness distribution parameters of the foggy image are extracted as an exposure reference, and the brightness distribution parameters of the weighted fusion correction image are calculated. Based on the pixel brightness values of each pixel in the foggy image and the weighted fusion corrected image, calculate the sum of squares of the brightness differences between corresponding pixels, and calculate the average of all sums of squares; An exposure consistency loss function is constructed based on the average value. The gradient of the exposure consistency loss function with respect to the weighted fused correction image is calculated. Pixel correction is then performed on the weighted fused correction image using the gradient.
6. The method according to claim 2, characterized in that, Perform hue stability constraint correction on the image after exposure consistency constraint correction, including: The hazy image and the image after exposure consistency constraint correction are respectively converted to the HSV color space, and their respective H channel hue parameters are extracted. Based on the distribution difference between the hue parameters of the two H channels, a hue stability loss function is constructed; the gradient of the hue stability loss function with respect to the image after exposure consistency constraint correction is solved, and pixel correction is performed on the image after exposure consistency constraint correction using the gradient to obtain the iterative output image after constraint correction at the current time step.
7. The method according to claim 1, characterized in that, The quality evaluation index based on the iterative output image at the current time step, used to determine whether image quality degradation has occurred at the current time step, includes: Extract the parameters of brightness uniformity, edge sharpness, and texture detail richness of the iterative output image after constraint correction at the current time step; The comprehensive quality score is obtained by weighting and summing the various quality evaluation indicators. If the overall quality score at the current time step is higher than the preset score threshold, and the overall quality scores at the two consecutive subsequent time steps at the current time step are lower than the overall quality score at the corresponding previous time step, then it is determined that image quality degradation has occurred at the current time step.
8. The method according to claim 1, characterized in that, The quality evaluation index of the iterative output image based on the current time step adaptively adjusts the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step, including: Extract the edge gradient value, pixel gray-level extreme value difference, and number of texture feature points of the iterative output image after constraint correction at the current time step; perform weighted summation of each quality evaluation index to obtain the quality index value of the no-reference image; The hazy image and the iterative output image at the current time step are converted to a hue space, and the overlap of their hue distributions is calculated to obtain a hue consistency index value. For images obtained under the sole application of dark channel prior constraint correction or color attenuation prior constraint correction, if the no-reference image quality index of the image obtained under the sole application is lower than the preset index value, the weight ratio of the corresponding type of constraint correction is reduced, and the weight ratio of the other type of constraint correction is increased.
9. A dehazing device for images of power transmission lines, characterized in that, The device includes: The acquisition module is used to acquire a foggy image of the transmission line and generate a noise image with the same size and color channel type as the foggy image; The denoising module is used to iteratively denoise the noisy image using a pre-trained diffusion model at multiple time steps; wherein, The denoising module is also used to take the iterative output image of the previous time step as the denoising input image of the current time step for the current time step, perform its own denoising calculation on the denoising input image of the current time step through the pre-trained diffusion model, and output the denoised intermediate image of the current time step; take the denoised intermediate image of the current time step as the current image to be constrained, and perform constraint correction processing on the current image to be constrained based on the dark channel constraint correction weight and color attenuation constraint correction weight of the current time step to obtain the iterative output image of the current time step after constraint correction; The denoising module is also used to determine whether image quality degradation has occurred at the current time step based on the quality evaluation index of the iterative output image at the current time step. If no image quality degradation has occurred, the iterative output image at the current time step is used as the denoising input image for the next time step. Based on the quality evaluation index of the iterative output image at the current time step, the dark channel constraint correction weight and color attenuation constraint correction weight at the current time step are adaptively adjusted to obtain the dark channel constraint correction weight and color attenuation constraint correction weight for the next time step, and the reverse denoising process for the next time step is performed. If image quality degradation has occurred, the iterative reverse denoising process ends, and the final iterative output image is obtained.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.