A power scene defect image synthesis method based on texture-background decoupling

By performing edge extraction and one-dimensional projection on the background image of the insulator string, correcting the peak sequence, removing false peaks and inserting missed peaks, and combining geometric transformation and gradient domain fusion, the problem of defect texture embedding position deviation in the existing technology is solved, and high-quality synthetic image samples are generated.

CN122887921BActive Publication Date: 2026-11-06HUADIAN ZOUXIAN POWER GENERATION CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611394462.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-06
Estimated Expiration
2046-09-09

AI Technical Summary

Technical Problem

In existing defect image synthesis methods, the presence of spurious peaks and missed detections in the initial peak sequence of edge projection causes the defect texture embedding position to deviate from the real insulator sheet area, destroying the rationality of the synthesized image structure and making it unusable for detection model training.

Method used

By performing edge extraction and principal axis direction correction on the background image of the insulator string, performing one-dimensional edge projection along the direction perpendicular to the principal axis, calculating the spacing deviation of the initial peak sequence, performing pseudo-peak removal and missing peak interpolation, iterating and correcting until stable, determining the boundary and position of the insulator piece, and combining geometric transformation and gradient domain fusion methods to accurately embed the defect texture layer.

Benefits of technology

It achieves accurate embedding of defect texture layers, generating synthetic images with reasonable structure, coordinated texture, and natural lighting, providing high-quality samples for defect detection models and solving the problems of unnatural structure and training usability of synthetic images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887921B_ABST
    Figure CN122887921B_ABST
Patent Text Reader

Abstract

This invention discloses a method for synthesizing power scene defect images based on texture-background decoupling, belonging to the field of defect image processing technology. It aims to solve the technical problem in current insulator string defect image synthesis where the embedding position of the defect texture deviates from the actual insulator sheet area due to spurious peaks and missed detections in the initial peak sequence of edge projection, thus compromising the structural rationality of the synthesized image. The method includes edge extraction and principal axis direction correction of the insulator string background image to obtain a corrected image. This invention incorporates a peak sequence consistency correction mechanism during periodic structure recognition. One-dimensional edge projection is performed on the corrected image along a direction perpendicular to the principal axis to obtain the initial peak sequence. The distance between adjacent peaks is calculated and compared with the average distance of surrounding peaks. Based on the corrected peak sequence, the boundary and individual position of the insulator sheet are determined, ensuring that the embedding position of the defect texture layer accurately falls within the actual insulator sheet area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect image processing technology, and more specifically, to a method for synthesizing defect images of power scenes based on texture-background decoupling. Background Technology

[0002] In the inspection of power transmission lines, insulator strings, as key components supporting conductors and ensuring electrical insulation, directly affect the safety and stability of the power grid. After long-term exposure to mechanical stress, electrical flashover, and harsh environmental corrosion, insulator strings are highly susceptible to spontaneous explosion defects, manifesting as broken, cracked, or completely missing insulator discs. In actual operation, spontaneous explosion defects are sporadic events, making the acquisition of realistic defect images extremely difficult, resulting in a limited sample size that is insufficient for model training. Therefore, expanding the defect sample library through image synthesis technology has become a standard practice in the industry.

[0003] Existing defect image synthesis methods typically first extract a defect texture layer from a small number of real defect images and then embed it into the background image of a normal insulator string. Because insulator strings have a strictly periodic arrangement in their physical structure—multiple insulators are evenly spaced along the main axis—the embedding position of the defect texture must accurately fall within the region of a specific insulator; otherwise, the string structure will be disrupted, leading to image distortion. Currently, some methods attempt to automatically obtain the boundaries of insulator pieces through edge detection and projection analysis to determine the embedding position. However, in actual insulator string images, the insulator surface often has stains or localized reflections, resulting in pseudo-peaks caused by noise or stains in the signal distribution obtained from edge projection. Simultaneously, some real insulator piece edges may be missed due to occlusion or blurring. Directly determining the insulator piece boundaries and individual piece positions based on such peak sequences would cause the defect texture embedding position to deviate from the real insulator piece region, or even be pasted onto the outside of the insulator string or into gaps, compromising the structural rationality of the synthesized image and rendering it unusable for training detection models. Therefore, we propose a power scene defect image synthesis method based on texture-background decoupling. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art, adapt to the needs of reality, and provide a method for synthesizing power scene defect images based on texture-background decoupling. This method aims to solve the technical problem in the current synthesis of insulator string defect images where the defect texture embedding position deviates from the real insulator sheet area due to the presence of pseudo peaks and missed detections in the initial peak sequence of edge projection, thus compromising the rationality of the synthesized image structure.

[0005] To solve the above technical problems, the present invention provides the following technical solution: a method for synthesizing defect images of power scenes based on texture-background decoupling, comprising edge extraction and principal axis direction correction of the background image of an insulator string to obtain a corrected image; One-dimensional edge projection is performed on the corrected image along the direction perpendicular to the principal axis. The edge pixels are accumulated along the projection direction to obtain a one-dimensional edge intensity distribution curve. The local maxima in the one-dimensional edge intensity distribution curve whose amplitude exceeds the peak screening threshold are used as the initial peak sequence. Calculate the spacing between adjacent peaks in the initial peak sequence. Based on the deviation between the spacing and the average spacing of the surrounding peaks, perform at least one of pseudo-peak removal and missed peak interpolation on the initial peak sequence. Iterate the correction until the spacing sequence is stable to obtain the corrected peak sequence. Determine the boundary and single-piece position of the insulator piece according to the corrected peak sequence. Use the insulator piece region corresponding to the single-piece position as the embedding position. Obtain the defect texture layer, embed the defect texture layer into the embedding position, and obtain the synthesized image.

[0006] Preferably, the peak screening threshold is the global mean of the smoothed edge intensity distribution curve; The initial peak sequence is obtained by taking local maxima whose amplitude exceeds the peak screening threshold as local maxima, including: smoothing the one-dimensional edge intensity distribution curve, detecting local maxima on the smoothed curve, and arranging the local maxima whose amplitude exceeds the global mean in order of position.

[0007] Preferably, performing at least one of pseudo-peak removal and missed peak interpolation on the initial peak sequence includes: calculating the first peak... The deviation between a spacing and the average value of the corresponding surrounding spacing, wherein the deviation is the spacing minus the average value of the surrounding spacing; When the deviation is less than the negative deviation threshold, the target peak is discarded as a pseudo peak. When the deviation is greater than the deviation threshold, missed peaks are interpolated between adjacent peaks of the target. The deviation threshold is the standard deviation of the distance between adjacent peaks in the initial peak sequence.

[0008] Preferably, the average surrounding spacing is obtained using a desired spacing calculation model based on perspective deformation compensation. The expression for the desired spacing calculation model is as follows: ; in, For the first The average surrounding spacing of each spacing location. This is the reference projection spacing near the insulator string. For perspective deformation gradient coefficients, For the first The center coordinates corresponding to each spacing; The reference projection spacing and perspective deformation gradient coefficient are obtained by linear least squares fitting of the spacing between adjacent peaks in the initial peak sequence with the corresponding center coordinates.

[0009] Preferably, missed peaks are interpolated between adjacent peaks of the target. Based on the average surrounding spacing, peaks are interpolated at equal intervals within the interval between adjacent peaks of the target until the spacing between the interpolated adjacent peaks is less than or equal to the sum of the average surrounding spacing and the deviation threshold. The number of interpolated peaks is determined by calculating the average number of complete surrounding spacing values ​​that can be accommodated within the spacing between adjacent peaks of the target and rounding down. Iterative correction is performed until the spacing sequence is stable. By repeatedly performing pseudo-peak removal and missed peak insertion, the deviation of all adjacent spacings in the initial peak sequence is less than the deviation threshold. The peak sequence at this point is then used as the corrected peak sequence.

[0010] Preferably, obtaining the defect texture layer and embedding the defect texture layer into the embedding position includes: extracting the broken edge contour by performing edge detection on a real insulator self-explosion defect image, and separating to obtain the defect texture layer; Extract the outer contour of the target insulator sheet region and the outer contour of the defect texture layer. Combine the edge contours of adjacent insulator sheets and perform geometric transformation to align the defect texture layer so that the outer contour of the defect texture layer is consistent with the contour and perspective angle of the target insulator sheet.

[0011] Preferably, the geometric transformation alignment of the defect texture layer includes: solving the translation, scaling, and rotation parameters of the defect texture layer by minimizing the distance between corresponding contour points; and transforming the defect texture layer using the translation, scaling, and rotation parameters while keeping its internal damage characteristics unchanged.

[0012] Preferably, embedding the defect texture layer into the embedding location to obtain a synthetic image includes: using a gradient domain fusion method to mix the gradient field of the defect texture layer with the gradient field of the insulator string background image, keeping the gradient of the insulator string background image unchanged at the boundary of the embedding region; and performing brightness and color correction on the embedded defect texture layer according to the illumination and texture features of adjacent insulator sheets to obtain a synthetic image.

[0013] Preferably, the embedded defect texture layer undergoes brightness and color correction, using a brightness correction formula: ; in, These are the corrected pixel values ​​for the defective texture. For the original defect texture in coordinates The pixel grayscale value at that location; The grayscale average of the defect texture layer; The grayscale standard deviation of the defect texture layer; This represents the average grayscale value of the background area of ​​adjacent insulator discs. This represents the standard deviation of grayscale in the background area of ​​adjacent insulator discs.

[0014] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the aforementioned method for synthesizing power scene defect images based on texture-background decoupling.

[0015] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention incorporates a peak sequence consistency correction mechanism during the periodic structure identification process to accurately determine the boundaries and individual positions of insulator pieces. An initial peak sequence is obtained by performing a one-dimensional edge projection on the corrected image along a direction perpendicular to the principal axis. The spacing between adjacent peaks is calculated and compared with the average spacing of surrounding peaks. False peak removal and / or missed peak interpolation are performed on the initial peak sequence, iteratively correcting until the spacing sequence stabilizes, resulting in the corrected peak sequence. Based on the corrected peak sequence, the boundaries and individual positions of the insulator pieces are determined, ensuring that the embedding position of the defect texture layer accurately falls within the actual insulator piece area. This solves the problem in current insulator string defect image synthesis where false peaks and missed detections in the initial peak sequence of edge projection cause the defect texture embedding position to deviate from the actual insulator piece area, compromising the structural rationality of the synthesized image.

[0016] 2. Based on the determined boundaries and individual positions of the insulator pieces, this invention uses the insulator piece region corresponding to the individual piece position as the embedding position, extracts the outer contour of the target insulator piece region and the outer contour of the defect texture layer, and combines the edge contours of adjacent insulator pieces. By minimizing the distance between corresponding contour points, the translation, scaling, and rotation parameters of the defect texture layer are solved, so that the outer contour of the defect texture layer is consistent with the contour and perspective angle of the target insulator piece, while maintaining its internal damage characteristics. This solves the problem that the outer contour of the defect texture layer is not coordinated with the shape of the target insulator piece after the embedding position of the defect texture layer is accurate, resulting in an unnatural local structure of the synthesized image.

[0017] 3. After completing the geometric transformation alignment, this invention also employs a gradient domain fusion method to maintain the gradient of the insulator string background image at the boundary of the embedding region. The gradient field of the defect texture layer is mixed with the gradient field of the insulator string background image, so that the internal details of the defect texture are smoothly integrated into the background, eliminating grayscale jumps caused by gradient abrupt changes. Furthermore, based on the illumination and texture characteristics of adjacent insulator sheets, the brightness and color of the embedded defect texture layer are corrected, mapping the overall grayscale distribution of the defect texture to a consistent level with the background region. This generates a synthetic image with reasonable structure, harmonious texture, and natural illumination, providing high-quality samples for defect detection model training. This solves the problem that differences in gradient characteristics and illumination conditions between the defect texture layer and the background cause stitching marks in the synthetic image, affecting the training usability. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the overall method of the present invention; Figure 2 This is a detailed flowchart of the peak sequence consistency correction of the present invention; Figure 3 This is a detailed flowchart of the geometric transformation alignment and gradient domain fusion process of the present invention; Figure 4 This is a flowchart of the brightness and color correction and annotation output refinement process of the present invention. Detailed Implementation

[0019] Example: Figures 1 to 4 As shown, the present invention relates to a method for synthesizing power scene defect images based on texture-background decoupling, comprising: S100. Obtain the background image of the insulator string and the actual image of the insulator spontaneously bursting defect; perform edge extraction and principal axis direction correction on the background image of the insulator string to obtain the corrected image; separate the defect texture layer from the actual image of the insulator spontaneously bursting defect, and scale and rotate the defect texture layer so that the size and direction of the defect texture layer are consistent with the approximate size and direction of the insulator piece in the background image.

[0020] In one embodiment, obtaining the corrected image includes: performing edge detection on the background image of the insulator string to extract the edge contours of the insulator string; using a line detection algorithm to determine the principal axis direction of the edge contours; and rotating the background image of the insulator string according to the principal axis direction to make the principal axis direction horizontal or vertical, thus obtaining the corrected image. In this embodiment, high-contrast edge contours are extracted by edge detection operators (such as Canny or Sobel), and the overall orientation (principal axis direction) of the insulator string is fitted using Hough transform or least squares method. This can correct tilted insulator strings to a standard horizontal or vertical state. Subsequent edge projection only needs to accumulate edge pixels row by row or column by column along the horizontal or vertical direction, without needing to perform interpolation or coordinate transformation for any tilt direction, simplifying the computational complexity of subsequent one-dimensional edge projection and improving the signal-to-noise ratio of the projection signal.

[0021] In one embodiment, aligning the size and orientation of the defect texture layer with the approximate size and orientation of the insulator disc in the background image includes: performing edge detection on a real insulator spontaneous explosion defect image to extract the broken edge contour of the spontaneous explosion region; determining the defect region range based on the broken edge contour, separating the defect region from the real insulator spontaneous explosion defect image to obtain the defect texture layer; and scaling and rotating the defect texture layer to align its size and orientation with the approximate size and orientation of the insulator disc in the background image. In this embodiment, edge detection is used to delineate the boundary of the spontaneous explosion notch or crack, and image masking technology is used to non-destructively extract the defect region, achieving decoupling of the texture from the background. Subsequent scaling and rotation operations ensure that the defect texture matches the single insulator disc in the target background on a geometric scale.

[0022] S200. Perform one-dimensional edge projection on the corrected image along the direction perpendicular to the principal axis, and accumulate the edge pixels along the projection direction to obtain a one-dimensional edge intensity distribution curve; take the peaks in the one-dimensional edge intensity distribution curve as the initial peak sequence; calculate the spacing between adjacent peaks in the initial peak sequence, and based on the deviation between the spacing and the average spacing of the surrounding peaks, perform pseudo-peak removal and / or missed peak interpolation on the initial peak sequence, iteratively correct until the spacing sequence is stable, and obtain the corrected peak sequence; In one embodiment, using the peaks in the edge intensity distribution curve as the initial peak sequence includes: One-dimensional edge projection is performed on the corrected image along the direction perpendicular to the principal axis, and the edge pixels of each column or each row are accumulated to obtain a one-dimensional edge intensity distribution curve. Smooth the one-dimensional edge intensity distribution curve (e.g., Gaussian filtering or mean filtering). Local maxima are detected on the smoothed curve. Local maxima whose amplitude exceeds the peak screening threshold are taken as peaks and arranged in order of position to obtain the initial peak sequence.

[0023] It should be noted that the peak filtering threshold is set to the global mean of the smoothed edge intensity distribution curve. The rationale for this is that noise spikes in the smoothed edge intensity distribution curve originate from random factors such as image noise, surface stains, or localized reflections. Their accumulation along the projection direction is dispersed and unstable, resulting in amplitudes lower than the global mean. In contrast, the actual insulator edge corresponds to the physical boundary between insulator pieces. When projected along a direction perpendicular to the principal axis, the gradient responses of edge pixels accumulate in a concentrated manner, forming peaks with amplitudes higher than the global mean. Therefore, using the global mean as the peak filtering threshold can distinguish the peaks corresponding to the actual insulator edge from noise spikes, avoiding misdetection of noise as peaks while preserving the actual edge peaks.

[0024] For example, suppose a background image of an insulator string is projected onto a one-dimensional edge and smoothed to obtain a one-dimensional edge intensity distribution curve. This curve has 100 sampling points, and the global mean of the summed amplitudes at each point is 35, which is the peak selection threshold. Local maxima with amplitudes exceeding 35 are considered peaks. For example, if local maxima appear sequentially at points 12, 33, 54, 75, and 96, with amplitudes of 58, 62, 10, 60, and 55 respectively, then these five local maxima all exceed the peak selection threshold of 35 and are arranged in order to form the initial peak sequence. The local maximum with an amplitude of 10 is less than 35 and is not considered a peak. This demonstrates that using the global mean as the peak selection threshold effectively eliminates noise spikes.

[0025] In one embodiment, performing pseudo-peak removal and / or missed peak interpolation on the initial peak sequence includes: Let the first The spacing between adjacent wave crests is The average surrounding spacing is Calculate the deviation .

[0026] It should be noted that, normally, insulator discs are arranged at equal intervals along the principal axis, therefore the spacing between adjacent wave crests should be approximately the same. Less than And the deviation exceeds This indicates that near the actual edge of the insulator disc where a single peak should appear, an extra false peak caused by noise, dirt, or reflection has appeared, resulting in two peaks at that location. The distance between these two peaks is smaller than the normal distance between the edges of adjacent insulator discs, leading to an unbalanced spacing. Greater than And the deviation exceeds This indicates that the actual edge of the insulator sheet was missed at that location, causing the spacing between two adjacent actual edges to be merged into a larger spacing, resulting in an excessively large spacing. Therefore, by comparing the deviation of the actual spacing with the average spacing of the surrounding area, these two types of errors can be identified and corrected.

[0027] The specific judgment criteria are as follows: When satisfied (i.e., the spacing is less than the average spacing of the surrounding areas) Deviation threshold When the difference is found, the target peak is discarded as a pseudo-peak. When satisfied (i.e., the spacing is greater than the average spacing of the surrounding areas) Deviation threshold When the sum of the values ​​is 0, the missing peaks are interpolated between adjacent peaks of the target.

[0028] Among them, the deviation threshold The value is the standard deviation of the distance between adjacent peaks in the initial peak sequence. The standard deviation reflects the fluctuation range of the normal insulator edge spacing. When the deviation exceeds one standard deviation, it indicates that the spacing has deviated from the normal fluctuation range and belongs to the abnormality caused by false peaks or missed detection.

[0029] It should be noted that for the "and / or" case, there are three execution modes: when only the spacing is too small in the sequence, only spurious peak removal is performed; when only the spacing is too large, only missed peak insertion is performed; when both of the above cases exist in the sequence, removal and insertion operations are performed simultaneously. This can filter out spurious peaks caused by local reflections or contamination, and repair missed detections caused by occlusion, thereby improving the purity of the sequence.

[0030] For example, an insulator string has 10 insulators, and normally it should produce 10 wave peaks with close spacing between adjacent ones.

[0031] Due to surface reflection at a certain point, an extra pseudo-peak appears next to the real edge, resulting in a smaller spacing at that point. Meanwhile, in another area, due to partial occlusion, the true edge peaks were not detected, resulting in an excessively large spacing.

[0032] These two types of errors can occur simultaneously at different positions within the same sequence. Therefore, when performing a single round of correction on the sequence, it is necessary to simultaneously remove spurious peaks and insert missed peaks in order to completely repair the sequence.

[0033] Furthermore, the spacing is the coordinate difference between two adjacent peaks in the initial peak sequence on the one-dimensional edge intensity distribution curve; the average value of the surrounding spacing The desired spacing is obtained using a perspective deformation compensation-based calculation model. The desired spacing calculation model is as follows: ; in, For the first The average surrounding spacing (expected spacing) of a spacing position, that is, the normal adjacent peak spacing that should exist at that position after taking perspective distortion into account, in pixels; The reference projection spacing is the distance between the near ends of the insulator string. It represents the projection spacing between adjacent peaks when there is no perspective deformation at the near ends of the insulator string (i.e., near the origin of the coordinate system). It is the intercept obtained by performing linear least squares fitting between the spacing between adjacent peaks in the initial peak sequence and the corresponding center coordinates. The unit is pixels. The perspective distortion gradient coefficient reflects the rate at which the projection spacing changes along the principal axis with the coordinate position. When, it indicates that the spacing gradually increases along the principal axis direction, when When, it indicates that the spacing gradually decreases, when When there is no perspective distortion and the spacing remains constant, the slope is obtained by linear least squares fitting of the spacing between adjacent peaks in the initial peak sequence with the corresponding center coordinates; it is a dimensionless parameter. For the first The center coordinates corresponding to each spacing are taken from the average of the horizontal (or vertical, depending on the principal axis direction) coordinates of the two adjacent peaks that constitute that spacing in the initial peak sequence, and the unit is pixels.

[0034] For example: Suppose that an image of an insulator string has perspective distortion due to the shooting angle. The fitted data of adjacent spacing and corresponding center coordinates in the initial wave crest sequence are: center coordinates 20, 40, 60, 80, 100, and corresponding spacings 22, 24, 26, 28, 30.

[0035] The reference projection spacing was obtained by linear least squares fitting. The perspective deformation gradient coefficient is 20. It is 0.1.

[0036] The expected spacing of each interval is calculated according to the model as follows: when the center coordinate is 20, the expected spacing is 20 + 0.1 × 20 = 22; when the center coordinate is 40, the expected spacing is 20 + 0.1 × 40 = 24. Similarly, the deviation between the actual spacing and the expected spacing is calculated. If the deviation exceeds the deviation threshold, it is judged as a false peak or a missed detection, reflecting the trend of linear change in spacing with position, and avoiding misjudging normal gradual changes as abnormal.

[0037] By using the expected spacing calculation model, the interference of perspective deformation on spacing consistency assessment is eliminated, making the determination of false peaks and missed peaks more accurate. In one embodiment, interpolation of missed peaks between adjacent peaks of the target includes: based on the average surrounding spacing. Interpolate peaks at equal intervals within the interval between adjacent peaks of the target until the spacing between the interpolated adjacent peaks is less than or equal to the average spacing of the surrounding peaks. Deviation threshold The sum of . The number of interpolations is determined as follows: Let the spacing between adjacent peaks of the target be . Calculate the average value of the complete surrounding spacing that can be accommodated within this interval. The number of peaks is rounded down to the nearest integer as the number of interpolated peaks. When the distance between two peaks is detected to be too large, the average distance between the surrounding peaks is used as the number of interpolated peaks. Using a reference step size, new peak coordinates are uniformly inserted within the blank intervals. Through this interpolation, the boundary information of insulator discs that were completely lost due to occlusion or local blurring can be recovered, ensuring the continuity and integrity of the final sequence.

[0038] For example: Suppose the distance between adjacent peaks of the target is 42 pixels, the average surrounding distance is approximately 20 pixels, and the deviation threshold is... Let's take 7. Calculate the interpolation amount as 42 divided by 20 and rounded down, resulting in 2. Therefore, interpolate two peaks at equal intervals within this 42-pixel interval, dividing the interval into three segments, each approximately 14 pixels. After interpolation, check if the spacing between each adjacent element is less than or equal to the sum of the average spacing of the surrounding elements and the deviation threshold (20 + 7 = 27). If 14 ≤ 27, the condition is met, and interpolation is complete. If the spacing still exceeds 27 after interpolation, continue interpolation until the condition is met.

[0039] In one embodiment, the iterative correction until the spacing sequence stabilizes includes: repeatedly performing spurious peak removal and missed peak interpolation operations until the deviation of all adjacent spacings is less than a deviation threshold. If the number of iterations reaches the preset maximum number of iterations, whichever comes first, the peak sequence at that point will be used as the corrected peak sequence. The preset maximum number of iterations is set to twice the number of peaks in the initial peak sequence. The rationale for this setting is that the initial peak sequence has a limited number of peaks, and each iteration removes at least one spurious peak or inserts one missed peak. Even if the insertion operation increases the number of peaks, the total number of peaks in the corrected peak sequence will not exceed twice the number of initial peaks. Therefore, the number of iterations will not exceed twice the number of initial peaks, ensuring that the iteration process will inevitably terminate. When the deviation of all adjacent spacings is less than the deviation threshold... When the time reaches a certain threshold, it indicates that there are no more spurious peaks or abnormal spacing caused by missed detections in the sequence, and the peak sequence has reached a stable state; if there is still a small deviation slightly greater than the preset maximum number of iterations, it indicates that the sequence has reached a stable state. The current peak sequence can still be used as the corrected peak sequence.

[0040] For example: Suppose that after the first round of correction, some adjacent peak sequences still have a spacing deviation greater than [missing information]. For example, the 5th spacing deviation is 9, which is greater than... Continue with the second round of correction: recalculate the average value and deviation of the surrounding spacings based on the current sequence, and perform interpolation for the 5th spacing. After interpolation, the deviation of all adjacent spacings is less than 7, the iteration stops, and the corrected peak sequence is output. Since each iteration processes at least one abnormal spacing, and the number of peaks is limited, the iteration process will inevitably terminate.

[0041] S300. Based on the corrected peak sequence, determine the boundary and individual piece position of the insulator sheet; determine the corresponding insulator sheet region based on the individual piece position, and use this region as the embedding position; extract the outer contour of the target insulator sheet region and the outer contour of the defect texture layer, and combine them with the edge contours of adjacent insulator sheets to perform geometric transformation and alignment on the defect texture layer, so that the outer contour of the defect texture layer is consistent with the contour and perspective angle of the target insulator sheet, while keeping its internal damage characteristics unchanged; use the gradient domain fusion method to embed the aligned defect texture layer into the embedding position.

[0042] In one embodiment, determining the boundary and individual piece position of an insulator sheet includes: based on the corrected peak sequence, defining the region between adjacent peaks as an insulator sheet, with the peak position corresponding to the edge boundary line between insulator sheets, and the individual piece position being the midpoint coordinates between adjacent peaks. In this way, the boundary and center position of each insulator sheet can be determined, providing a positioning reference for subsequent defect texture embedding.

[0043] In one embodiment, geometric transformation alignment of the defect texture layer includes: using the insulator sheet region corresponding to the determined single-piece position as the embedding position; extracting the outer contour of the target insulator sheet region and the outer contour of the defect texture layer, combining the edge contours of adjacent insulator sheets, and solving the translation, scaling, and rotation parameters of the defect texture layer by minimizing the distance between corresponding contour points, so that the outer contour of the defect texture layer is consistent with the contour and perspective angle of the target insulator sheet, while keeping its internal damage characteristics unchanged.

[0044] In one embodiment, the gradient domain fusion method includes: during the fusion process, keeping the gradient of the insulator string background image at the boundary of the embedding region unchanged, and mixing the gradient field of the defect texture layer with the gradient field of the insulator string background image; the gradient domain fusion smoothly integrates the internal details of the defect texture into the background image by solving the Poisson equation, while maintaining the original macroscopic structure of the background.

[0045] S400: Based on the illumination and texture characteristics of adjacent insulator pieces, perform brightness and color correction on the embedded defect texture layer; based on the final embedded position of the defect texture layer, automatically generate target detection bounding boxes, and output the synthesized image and corresponding annotation files.

[0046] In one embodiment, brightness and color correction of the embedded defect texture layer includes: calculating the average grayscale value of adjacent insulator pieces. and standard deviation and the grayscale mean of the defect texture layer. and standard deviation The brightness of the defect texture layer is corrected using a brightness correction formula, which is as follows: ; in, The corrected defect texture pixel values ​​are used to replace the original defect texture pixel values, so that the brightness of the defect area is consistent with the background. It is dimensionless. For the original defect texture in coordinates The pixel grayscale value at that location is dimensionless. The grayscale mean of the defect texture layer is obtained by taking the arithmetic mean of the grayscale values ​​of all pixels in the defect texture layer, reflecting the overall brightness level of the defect texture. The standard deviation of grayscale in the defect texture layer is obtained by calculating the standard deviation of grayscale values ​​of all pixels in the defect texture layer. It reflects the degree of grayscale variation within the defect texture, i.e., contrast, and is dimensionless. The average grayscale value of the background area of ​​adjacent insulator pieces is obtained by taking the arithmetic mean of the grayscale values ​​of all pixels in the normal insulator piece area adjacent to the embedding position, reflecting the overall brightness level of the target background. The grayscale standard deviation of the background region of adjacent insulator pieces is obtained by calculating the standard deviation of the grayscale values ​​of all pixels in the normal insulator piece region adjacent to the embedding position. It reflects the contrast of the target background and is dimensionless.

[0047] when or When the value is 0, the corresponding proportional term is set to 1 to avoid division by zero. Among these, This indicates that the defect texture layer is a flat area. Setting it to 1 means that no contrast scaling is performed, and only the overall brightness shift is retained. This indicates that the background area is a flat area. Setting it to 1 means that the texture information of the defective texture itself is preserved, and the texture is not compressed into a solid color.

[0048] For color images, the brightness correction formula described above is applied to the R, G, and B channels respectively. This is because a color image consists of three channels: R, G, and B. Each channel can be considered an independent grayscale image with different grayscale means and standard deviations. The brightness correction formula is designed based on the grayscale statistics of a single channel. After mapping the mean and standard deviation for each channel, the grayscale distribution of the defect texture layer across the three channels is consistent with the background area of ​​the adjacent insulator sheet. This achieves both overall brightness correction and color correction through simultaneous matching of the means and standard deviations of the three channels, avoiding color shift caused by only processing the overall brightness. For grayscale images, the brightness correction formula can be applied directly.

[0049] For example: Assume the average grayscale value of the background area of ​​adjacent insulator sheets is 150, and the standard deviation is 30; the average grayscale value of the defect texture layer is 100, and the standard deviation is 20. For a pixel in the defect texture layer, the original grayscale value is 120. The first global statistical mapping calculation is: 150 + (30 / 20) × (120 - 100) = 180. Therefore, the corrected grayscale value of this pixel is 180. For color images, the above calculation is performed on the R, G, and B channels respectively, so that the grayscale distribution of the three channels is consistent with the background area, achieving synchronous correction of brightness and color. Local gradient difference compensation is completed by the gradient domain fusion step: During the fusion process, the gradient of the insulator string background image at the boundary of the embedding region is kept unchanged, and the gradient field of the defect texture layer is mixed with the gradient field of the insulator string background image, so that the internal details of the defect texture are smoothly integrated into the background, eliminating the gray-level jump caused by gradient abrupt change.

[0050] In one embodiment, outputting the synthesized image and the corresponding annotation file includes: based on the final embedding position of the defect texture layer, the system automatically calculates the pixel coordinate range of the defect texture in the background image, generates the corresponding target detection annotation box, and outputs the synthesized image and annotation file to expand the training sample library of the insulator defect detection model.

[0051] Example 2: An electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the program, it implements the aforementioned method for synthesizing power scene defect images based on texture-background decoupling.

[0052] The embodiments disclosed in this invention are preferred embodiments, but are not limited thereto. Those skilled in the art can easily understand the spirit of this invention based on the above embodiments and make different extensions and variations, but as long as they do not depart from the spirit of this invention, they are all within the protection scope of this invention.

Claims

1. A method for synthesizing defect images of power scenes based on texture-background decoupling, characterized in that, This includes edge extraction and principal axis direction correction of the background image of the insulator string to obtain the corrected image; One-dimensional edge projection is performed on the corrected image along the direction perpendicular to the principal axis. The edge pixels are accumulated along the projection direction to obtain a one-dimensional edge intensity distribution curve. The local maxima in the one-dimensional edge intensity distribution curve whose amplitude exceeds the peak screening threshold are used as the initial peak sequence. Calculate the spacing between adjacent peaks in the initial peak sequence. Based on the deviation between the spacing and the average spacing of the surrounding peaks, perform at least one of pseudo-peak removal and missed peak interpolation on the initial peak sequence. Iterate the correction until the spacing sequence is stable to obtain the corrected peak sequence. The boundaries and individual positions of the insulator discs are determined based on the corrected peak sequence, and the insulator disc regions corresponding to the individual disc positions are used as the embedding positions. Perform at least one of pseudo-peak removal and missed peak interpolation on the initial peak sequence, including: calculating the first peak. The deviation between a spacing and the average value of the corresponding surrounding spacing, wherein the deviation is the spacing minus the average value of the surrounding spacing; When the deviation is less than the negative deviation threshold, the target peak is discarded as a pseudo peak. When the deviation is greater than the deviation threshold, missed peaks are interpolated between adjacent peaks of the target. The deviation threshold is the standard deviation of the spacing between adjacent peaks in the initial peak sequence; The average surrounding spacing was obtained using a desired spacing calculation model based on perspective deformation compensation. The expression for the desired spacing calculation model is as follows: ; in, For the first The average surrounding spacing of each spacing location. This is the reference projection spacing near the insulator string. For perspective deformation gradient coefficients, For the first The center coordinates corresponding to each spacing; The reference projection spacing and perspective deformation gradient coefficient are obtained by linear least squares fitting of the spacing between adjacent peaks in the initial peak sequence with the corresponding center coordinates. A defective texture layer is obtained, and a gradient domain fusion method is used to embed the defective texture layer into the embedding position to obtain a synthesized image.

2. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 1, characterized in that, The peak filtering threshold is the global mean of the smoothed edge intensity distribution curve; The initial peak sequence is obtained by taking local maxima whose amplitude exceeds the peak screening threshold as local maxima, including: smoothing the one-dimensional edge intensity distribution curve, detecting local maxima on the smoothed curve, and arranging the local maxima whose amplitude exceeds the global mean in order of position.

3. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 1, characterized in that, Missed peaks are interpolated between adjacent peaks of the target. Based on the average surrounding spacing, peaks are interpolated at equal intervals within the interval between adjacent peaks of the target until the spacing between the interpolated adjacent peaks is less than or equal to the sum of the average surrounding spacing and the deviation threshold. The number of interpolated peaks is determined by calculating the average number of complete surrounding spacing values ​​that can be accommodated within the spacing between adjacent peaks of the target and rounding down. Iterative correction is performed until the spacing sequence is stable. By repeatedly performing pseudo-peak removal and missed peak insertion, the deviation of all adjacent spacings in the initial peak sequence is less than the deviation threshold. The peak sequence at this point is then used as the corrected peak sequence.

4. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 1, characterized in that, Obtaining the defect texture layer and embedding it into the embedding location includes: extracting the broken edge contour by performing edge detection on a real insulator self-explosion defect image, and separating it to obtain the defect texture layer; Extract the outer contour of the target insulator sheet region and the outer contour of the defect texture layer. Combine the edge contours of adjacent insulator sheets and perform geometric transformation to align the defect texture layer so that the outer contour of the defect texture layer is consistent with the contour and perspective angle of the target insulator sheet.

5. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 4, characterized in that, Geometric transformation alignment of the defect texture layer includes: solving for the translation, scaling, and rotation parameters of the defect texture layer by minimizing the distance between corresponding contour points; and transforming the defect texture layer using the translation, scaling, and rotation parameters while keeping its internal damage characteristics unchanged.

6. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 1, characterized in that, The defect texture layer is embedded into the embedding location to obtain a synthetic image, including: using a gradient domain fusion method to mix the gradient field of the defect texture layer with the gradient field of the insulator string background image, keeping the gradient of the insulator string background image unchanged at the boundary of the embedding region; and performing brightness and color correction on the embedded defect texture layer according to the illumination and texture features of adjacent insulator pieces to obtain a synthetic image.

7. The method for synthesizing power scene defect images based on texture-background decoupling according to claim 6, characterized in that, The embedded defect texture layer is subjected to brightness and color correction. The brightness correction formula is as follows: ; in, These are the corrected pixel values ​​for the defective texture. For the original defect texture in coordinates The pixel grayscale value at that location; The grayscale average of the defect texture layer; The grayscale standard deviation of the defect texture layer; This represents the average grayscale value of the background area of ​​adjacent insulator discs. This represents the standard deviation of grayscale in the background area of ​​adjacent insulator discs.

8. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement a method for synthesizing power scene defect images based on texture-background decoupling as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Phase deflection technology photoelectric imaging quality evaluation method

    CN111928798A

  • A composite insulator defect detection method based on image analysis

    CN119762467A