A visual detection method for defects of a porcelain insulator of a transformer substation
By employing image registration and feature extraction techniques, the problem of unstable defect location caused by attitude disturbance in the inspection of porcelain insulators in substations was solved, enabling accurate identification and boundary representation of porcelain insulator defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGXI GANPING ELECTRIC PORCELAIN ELECTRIC APPLIANCE MFG CO LTD
- Filing Date
- 2026-04-16
- Publication Date
- 2026-06-23
Smart Images

Figure CN122265256A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and in particular to a visual inspection method for defects in porcelain insulators in substations. Background Technology
[0002] Existing technologies focus on pixel intensity, spatial structure, texture distribution, and edge contours for identification, classification, and evaluation. While these technologies can meet the general requirements for judging target states, in the case of substation porcelain insulators, actual operating scenarios often involve factors such as video jitter, viewing angle fluctuations, background interference, metal reflections, dirt adhesion, and local occlusion. Simply relying on conventional image information analysis can easily lead to a lack of stable correspondence between the same structure in different frames. This results in the location representation of the same defect shifting across different images, making subsequent interpretation prone to issues such as blurred boundaries, distorted shapes, or dispersed abnormal areas. For example, if there is a slight crack at the edge of the porcelain skirt, and there is a small displacement between the preceding and following images, the crack location may be covered by bright background spots or outline ghosting, ultimately appearing only as general texture undulations, making it difficult to directly form a clear criterion. Therefore, improvements are needed. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a visual inspection method for defects in porcelain insulators in substations.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a visual inspection method for defects in porcelain insulators in substations, comprising the following steps:
[0005] Extract adjacent sequence image frames from the video stream, set the first sequence image as the reference image, calculate and establish the porcelain skirt spatial pixel offset field, and perform spatial coordinate translation mapping calculation on the corresponding subsequent sequence image frames based on the values of the porcelain skirt spatial pixel offset field to generate a registered and aligned porcelain skirt image sequence.
[0006] Obtain the set of pixel intensity values corresponding to the same spatial coordinates in each frame of the registered and aligned porcelain skirt image sequence, establish a reconstructed and enhanced porcelain insulator feature array, extract the pixels inside the reconstructed and enhanced porcelain insulator feature array and perform morphological opening operation, filter to obtain white level value and black level value, and generate the binary defect morphology features of the porcelain insulator.
[0007] Extract the set of outermost continuous non-zero pixels corresponding to the edge pixel coordinates in the binary defect morphology features of the porcelain insulator, generate the connecting boundary trajectory between the iron cap and the steel foot, extract the angle between the tangent direction of each pixel point inside the connecting boundary trajectory between the iron cap and the steel foot and the horizontal reference coordinate axis, and generate a one-dimensional boundary turning geometric signal.
[0008] Extract a preset standard geometric signal sequence, establish a two-dimensional distance matrix corresponding to the one-dimensional boundary turning geometric signal and the standard geometric signal sequence, calculate the cumulative distance matrix of elastic deformation, extract the shuttle path sequence with the minimum total value from the starting point to the ending point inside the cumulative distance matrix of elastic deformation, and filter to obtain the abnormal fracture coordinates of the umbrella skirt peak.
[0009] Preferably, the step of obtaining the registration and alignment of the ceramic skirt image sequence is as follows:
[0010] The adjacent sequence of image frames is extracted from the video stream. The first sequence of image frames is fixed as the reference image base. The corresponding pixel blocks inside the reference image base are divided according to the uniform pixel size. The same position block reading is performed on the subsequent sequence of image frames. The center coordinates, gray scale distribution and edge response values of the pixel blocks of the subsequent sequence of image frames are recorded block by block. The change of the center coordinates of the corresponding pixel blocks inside the reference image base is compared block by block to obtain the set of spatial offset difference values.
[0011] Based on the set of spatial offset difference values, according to the original arrangement order of pixel blocks within the subsequent sequence image frames, each spatial offset difference value is backfilled to the spatial coordinate position of the corresponding pixel block. The continuity of offset changes between adjacent pixel blocks is checked, abnormal offset items that exceed the range of adjacent offset changes are removed, continuous offset items are retained and merged position by position to form the ceramic skirt spatial pixel offset field.
[0012] Based on the spatial pixel offset field of the porcelain skirt, the horizontal and vertical translation amounts corresponding to each spatial coordinate position are read item by item. The pixels inside the subsequent sequence image frames are written into the target coordinate positions after translation mapping. For the missing coordinates that have not been written by pixels after translation mapping, the intensity values of the surrounding neighboring pixels are extracted. The weights are allocated according to the distance ratio from the missing coordinates to each neighboring pixel. The intensity values of the neighboring pixels are weighted and summed. The pixel values of the missing coordinates are filled in one by one to generate the registered and aligned porcelain skirt image sequence.
[0013] Preferably, the step of obtaining the reconstructed and enhanced ceramic insulator feature array is as follows:
[0014] Based on the registered and aligned ceramic skirt image sequence, the pixel intensity value of each spatial coordinate position is read frame by frame. The pixel intensity values corresponding to each frame are collected according to the spatial coordinate position to form a set of pixel intensity values corresponding to the same spatial coordinate. The pixel intensity values of each item in the set of pixel intensity values corresponding to the same spatial coordinate are accumulated one by one, and each item is divided by the corresponding number of items to obtain the average pixel intensity value of each spatial coordinate position. All average pixel intensity values are backfilled according to the original spatial coordinate arrangement order to form a reconstructed and enhanced ceramic insulator feature array.
[0015] Preferably, the step of obtaining the binary defect morphology features of the porcelain insulator is as follows:
[0016] Extract the internal pixels of the reconstructed and enhanced porcelain insulator feature array one by one, scan the pixel intensity distribution around each pixel within a fixed neighborhood range, first eliminate the protruding area formed by the expansion of the neighborhood boundary, then fill in the local depression position of the retained area inside the neighborhood, record the processed pixel intensity value corresponding to all spatial coordinate positions, and align the pixels point by point according to the original coordinate order of the reconstructed and enhanced porcelain insulator feature array to form a morphological opening operation output array.
[0017] The pixel intensity values at each spatial coordinate position within the morphological opening operation output array are extracted one by one. The original pixel intensity values at the corresponding spatial coordinate positions within the reconstructed and enhanced ceramic insulator feature array are retrieved one by one. The numerical difference at each spatial coordinate position is calculated. The correspondence between the numerical difference and the preset judgment threshold is compared point by point. Spatial coordinate positions with numerical differences exceeding the preset judgment threshold are assigned white level values, and the remaining spatial coordinate positions are assigned black level values. The output is performed according to the original arrangement order of all spatial coordinate positions to obtain the binary defect morphology features of the ceramic insulator.
[0018] Preferably, the step of obtaining the boundary trajectory connecting the iron cap and the steel foot is as follows:
[0019] Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator row by row, and record the outermost white level pixel coordinates of each row. Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator column by column, and record the outermost white level pixel coordinates of each column. Connect all the outermost white level pixel coordinates according to the eight-neighborhood connection relationship, remove isolated white level pixel coordinates with broken neighborhoods, and retain the continuously arranged non-zero pixel coordinates to form the outermost continuous non-zero pixel set.
[0020] The first non-zero pixel in the outermost set of consecutive non-zero pixels is selected as the starting pixel. According to the continuous connection order of the outermost set of consecutive non-zero pixels, the coordinate interval length between the current non-zero pixel and the previous non-zero pixel is calculated point by point. The coordinate interval lengths of each segment are accumulated to the position of the current non-zero pixel. The cumulative path length value corresponding to each non-zero pixel is recorded as the edge arc length parameter. The correspondence between pixel coordinates and edge arc length parameters is output according to the connection order of non-zero pixels to generate the connecting boundary trajectory of the iron cap and steel foot.
[0021] Preferably, the step of obtaining the one-dimensional boundary turning geometry signal is as follows:
[0022] The forward and backward coordinate differences of adjacent pixels within the boundary trajectory connecting the iron cap and steel foot are extracted point by point. The tangent extension direction of the current pixel is determined according to the forward and backward coordinate differences. The angle between the tangent direction and the horizontal reference coordinate axis is calculated point by point. The edge arc length parameters recorded within the boundary trajectory connecting the iron cap and steel foot are retrieved point by point. The edge arc length parameters are written to the horizontal coordinate position and the angle value is written to the vertical coordinate position. All coordinate mappings are completed in the increasing order of the edge arc length parameters to obtain the one-dimensional boundary turning geometric signal.
[0023] Preferably, the step of obtaining the cumulative distance matrix of elastic deformation is as follows:
[0024] Based on the one-dimensional boundary turning geometry signal and the standard geometry signal sequence, the included angle value of each arc length parameter position is read point by point according to the sampling order of the one-dimensional boundary turning geometry signal, and the included angle value of each standard position is read point by point according to the sampling order of the standard geometry signal sequence. The included angle value of each arc length parameter position is paired with the included angle value of each standard position item by item, and the absolute value of the difference between the paired values is calculated item by item. The data is written into the matrix unit according to the sampling order of the one-dimensional boundary turning geometry signal as the row order and the sampling order of the standard geometry signal sequence as the column order to form a two-dimensional distance matrix.
[0025] Starting from the initial unit of the two-dimensional distance matrix, each matrix unit is scanned row by row and column by column. The cumulative values of the matrix units to the left, above, and above the current matrix unit are extracted respectively. The minimum value among the cumulative values of the left, above, and above the current matrix units is selected and added to the distance value of the current matrix unit. This process is repeated to fill all matrix units in sequence to form the elastic deformation cumulative distance matrix.
[0026] Preferably, the step of obtaining the coordinates of the abnormal fracture of the umbrella skirt peak is as follows:
[0027] Starting from the endpoint of the cumulative distance matrix of elastic deformation, backtracking node by node in the direction of minimum cumulative value to the starting point, and recording the row and column positions of all traversed nodes, a minimum shuttle path sequence is obtained. Following the node arrangement order of the minimum shuttle path sequence, the path values of the preceding and following nodes are extracted node by node. The change in path values of adjacent nodes is calculated node by node, and the magnitude of the change in path values of adjacent nodes along the path sequence is calculated node by node, yielding the path value derivative of each node. The relationship between the path value derivative and a preset judgment threshold is compared node by node, and the node positions where the path value derivative is greater than the preset judgment threshold are screened out. Then, the start and end range of the arc length parameter corresponding to the one-dimensional boundary turning geometric signal is checked back according to the node position to obtain the abnormal fracture coordinates of the umbrella skirt peak.
[0028] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0029] In this invention, a spatial pixel offset field for the ceramic insulator is first established based on the spatial offset relationship between adjacent image frames. Then, a registered and aligned image sequence of the ceramic insulator is obtained by spatial coordinate translation mapping. This compresses the interference caused by posture disturbances, image jitter, and local misalignment during video acquisition on subsequent interpretation. The subsequent aggregation and mean reconstruction of pixel intensity at the same spatial coordinates not only strengthens stable structural information but also suppresses random fluctuations, instantaneous reflections, and local noise, thereby enabling a clearer expression of the ceramic insulator's body outline and defect differences on a unified coordinate basis. On this basis, the reconstruction results are further compared by opening operations, and white and black level values are screened according to numerical differences. This distinguishes irregular and fragmented disturbances from the true defect morphology, transforming the defect area from grayscale variations into a clearly defined morphology. The feature is further extracted by extracting the outermost continuous non-zero pixel set, accumulating the edge arc length parameter along the continuous boundary, and mapping the tangent direction change into a one-dimensional boundary turning geometric signal. This is equivalent to transforming the complex two-dimensional boundary morphology into a geometric change process that can be compared sequentially. This not only enhances the continuous expression of the boundary trajectory connecting the iron cap and the steel foot, but also makes it easier to show subtle fractures, peak anomalies, and local gaps at the signal level. Finally, the minimum shuttle path sequence is extracted by the cumulative distance relationship between the standard geometric signal sequence and the current geometric signal, and the coordinates of the umbrella skirt peak anomaly fracture are screened by combining the path numerical derivative. This makes the defect judgment no longer stop at whether there is an anomaly, but further obtain the interval where the anomaly is located and the degree of boundary turning mismatch. This is more targeted for the identification of surface fractures, defects and edge anomalies of porcelain insulators in substations. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the steps of the present invention;
[0031] Figure 2 A comparison of one-dimensional boundary turning geometry signal extraction and standard signal;
[0032] Figure 3 A diagram showing the SAD matching energy field and anomaly removal analysis based on a numerical set of spatial offset differences;
[0033] Figure 4 This is a diagram illustrating the backtracking and precise locking analysis of the coordinates of the abnormal fracture at the peak of the umbrella skirt. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0035] Please see Figure 1-4This invention provides a technical solution: a visual inspection method for defects in porcelain insulators in substations, comprising the following steps:
[0036] Extract adjacent sequence image frames from the video stream, set the first sequence image as the reference image, calculate and establish the porcelain skirt spatial pixel offset field, and perform spatial coordinate translation mapping calculation on the corresponding subsequent sequence image frames based on the values of the porcelain skirt spatial pixel offset field to generate a registered and aligned porcelain skirt image sequence.
[0037] Obtain the set of pixel intensity values corresponding to the same spatial coordinates in each frame of the registered and aligned porcelain skirt image sequence, establish a reconstructed and enhanced porcelain insulator feature array, extract the pixels inside the reconstructed and enhanced porcelain insulator feature array and perform morphological opening operation, filter to obtain white level value and black level value, and generate the binary defect morphology features of porcelain insulator.
[0038] Extract the set of outermost continuous non-zero pixels corresponding to the edge pixel coordinates in the binary defect morphology features of the porcelain insulator, generate the boundary trajectory connecting the iron cap and the steel foot, extract the angle between the tangent direction of each pixel inside the boundary trajectory connecting the iron cap and the steel foot and the horizontal reference coordinate axis, and generate a one-dimensional boundary turning geometric signal.
[0039] Extract the preset standard geometric signal sequence, establish a two-dimensional distance matrix corresponding to the one-dimensional boundary turning geometric signal and the standard geometric signal sequence, calculate the cumulative distance matrix of elastic deformation, extract the shuttle path sequence with the minimum total value from the starting point to the ending point inside the cumulative distance matrix of elastic deformation, and filter to obtain the coordinates of the abnormal fracture of the umbrella skirt peak.
[0040] The steps for obtaining the registration and alignment of the porcelain skirt image sequence are as follows:
[0041] The adjacent sequence of image frames is extracted from the video stream. The first sequence of image frames is fixed as the reference image base. The corresponding pixel blocks inside the reference image base are divided according to the uniform pixel size. The same position block reading is performed on the subsequent sequence of image frames. The center coordinates, gray scale distribution and edge response values of the pixel blocks of the subsequent sequence of image frames are recorded block by block. The change of the center coordinates of the corresponding pixel blocks inside the reference image base is compared block by block to obtain the set of spatial offset difference values.
[0042] Based on the set of spatial offset difference values, according to the original arrangement order of pixel blocks within the subsequent sequence image frames, each spatial offset difference value is backfilled to the spatial coordinate position of the corresponding pixel block. The continuity of offset changes between adjacent pixel blocks is checked, abnormal offset items that exceed the range of adjacent offset changes are removed, continuous offset items are retained and merged position by position to form the ceramic skirt spatial pixel offset field.
[0043] Based on the spatial pixel offset field of the porcelain skirt, the horizontal and vertical translation amounts corresponding to each spatial coordinate position are read item by item. The pixels inside the subsequent sequence image frames are written into the target coordinate positions after translation mapping. For the missing coordinates that are not written by pixels after translation mapping, the intensity values of the surrounding neighboring pixels are extracted. The weights are allocated according to the distance ratio from the missing coordinates to each neighboring pixel, and the intensity values of the neighboring pixels are weighted and summed. The pixel values of the missing coordinates are filled in one by one to generate the registered and aligned porcelain skirt image sequence.
[0044] Specifically, based on adjacent sequence image frames extracted from the video stream, the pixel blocks within subsequent sequence image frames are matched with a reference image. The process involves first setting a uniform size for the pixel blocks, such as 32×32 pixels. Then, for each pixel block in the subsequent sequence image frames, a 64×64 pixel search window is set centered on its corresponding position in the reference image. Within this search window, the best match is found by calculating the grayscale value difference between the pixel blocks in the subsequent frames and each candidate pixel block in the reference image. The difference is calculated using an absolute difference summation method, that is, calculating the absolute value of the grayscale value difference between corresponding pixels in two pixel blocks one by one, and then summing all the differences. The smaller the value, the more similar the grayscale distribution of the two pixel blocks, and the higher the matching degree. To increase the accuracy of the matching, the edge response value of each pixel block is calculated before matching, specifically using a 3×3 Sobel operator. The gradient magnitude of each pixel within a block is calculated, and then the average gradient magnitude of the entire block is obtained. An edge response threshold is set, which is based on the average edge response value distribution of all pixel blocks in the reference image. For example, the 25th percentile of the average response value distribution of all blocks is taken as the threshold. In a specific example, if the calculated average edge response values of all blocks are sorted from smallest to largest, and the value at the 25th percentile is 18.5, then the threshold is set to 18.5. Only pixel blocks with an average edge response value exceeding 18.5 are used for subsequent matching calculations. For each pixel block that passes the screening, the position with the smallest absolute difference found in the search window is its best matching position. The displacement difference between the center coordinates of this pixel block and the center coordinates of the best matching block in the reference image is the change in the center coordinates of this block. The changes in the center coordinates of all valid pixel blocks are recorded to form a set of spatial offset difference values.
[0045] Based on the set of spatial offset difference values, each recorded spatial offset difference value in the set, i.e., a two-dimensional vector containing horizontal and vertical offsets, is backfilled to the center position of the pixel block in the corresponding subsequent sequence image frame, forming a sparse offset field. Next, the continuity of offset changes between adjacent pixel blocks is checked. For each pixel block with an offset vector, its eight neighboring pixel blocks that also have offset vectors are examined. The median of the offset vectors of these neighboring pixel blocks in the horizontal and vertical components is calculated, forming a neighborhood median offset vector. Then, the current pixel block is calculated... The Euclidean distance between the offset vector of a pixel and the median offset vector of its neighborhood is used to determine if the distance exceeds a preset anomaly threshold. If this distance exceeds a preset anomaly threshold, the offset vector of the current pixel block is considered an anomaly and removed. The anomaly threshold is set by first calculating the distances between the offset vectors of all neighboring pixels and the median offset vector, forming a distance set. Then, the median absolute deviation (MAD) of this distance set is calculated. The final threshold is set as the magnitude of the median offset vector plus a multiple (e.g., 3 times) of the MAD value. For example, if the offset vector of a pixel block is (20, 25) and its median vector is (5, 6), then the magnitude of the median vector is approximately 7.8, and the MAD of the distance set between its neighbors and the median vector is 1.5. Therefore, the threshold is 7.8 + 3 * 1.5 = 12.3. The distance between the offset vector of the current block and the median vector is... Since 24.2 is greater than 12.3, the (20, 25) vector is removed. After removing all abnormal offsets, the remaining continuous offsets are merged position by position. For those pixel blocks that were removed or whose offset vectors were not originally calculated, the inverse distance weighted interpolation method is used to fill in their offset vectors. Specifically, the four nearest positions with valid offset vectors are found, and the four vectors are weighted according to the inverse square of the distance as the weight to calculate the interpolation vector of the current position. This operation is performed on all positions that need interpolation to form the pixel offset field of the ceramic skirt space.
[0046] Based on the pixel offset field of the porcelain skirt space, a registration-aligned image is generated for each frame in the subsequent image sequence. First, a blank target image with the same size as the original image frame is created. Then, each pixel in the subsequent image sequence is traversed, and its coordinates are read. The pixel intensity value at that location is calculated, and the corresponding lateral translation is retrieved from the pixel offset field in the ceramic skirt space. and longitudinal translation The mapped coordinates of the pixel in the target image are calculated as follows: Since the calculated mapped coordinates are usually floating-point numbers, they are rounded down to the nearest integer and used as the target coordinates. The intensity values of the original pixels are then written to the corresponding integer coordinates in the target image. This process is called forward mapping. After this is completed, there will be a large number of empty coordinates in the target image that have not been written to by any pixels. Next, pixel values are filled into these empty coordinates. For each empty coordinate in the target image, the pixels in the surrounding 5×5 neighborhood are examined, and all non-empty neighboring pixels are found. For each found non-empty neighboring pixel, the Euclidean distance from its coordinates to the current empty coordinate is calculated. And assign a weight based on that distance. The formula for calculating the weight is: The decimal 0.0001 is added to prevent division by zero when the distance is 0. Then, the intensity values of all non-empty neighbor pixels are multiplied by their corresponding weights, summed, and then divided by the sum of all weights to obtain the weighted average pixel intensity value of the empty coordinates. The calculation formula is as follows: in, This is the final pixel value that was added. It is the total number of non-empty pixels in the neighborhood. It is the first The intensity value of each non-empty neighboring pixel. The corresponding weights are used to fill in the missing coordinates with pixel values one by one, thus completing the registration and alignment of one frame of the image. This process is repeated for all subsequent image frames in the sequence to finally generate a registered and aligned ceramic skirt image sequence.
[0047] The steps for obtaining the feature array of the reconstructed and enhanced ceramic insulator are as follows:
[0048] Based on the registered and aligned ceramic insulator image sequence, the pixel intensity value of each spatial coordinate position is read frame by frame. The pixel intensity values corresponding to each frame are collected according to the spatial coordinate position to form a set of pixel intensity values corresponding to the same spatial coordinate. The pixel intensity values of each item in the set of pixel intensity values corresponding to the same spatial coordinate are accumulated one by one, and each item is divided by the corresponding number of items to obtain the average pixel intensity value of each spatial coordinate position. All average pixel intensity values are backfilled according to the original spatial coordinate arrangement order to form a reconstructed and enhanced ceramic insulator feature array.
[0049] Specifically, based on the registration and alignment of the porcelain skirt image sequence, each spatial coordinate in the image sequence is assigned... A temporary set of pixel intensity values is established. Specifically, the operation involves iterating through each frame of the registered and aligned porcelain skirt image sequence, from the first frame to the last frame, and reading the coordinates in each frame. The 8-bit grayscale pixel intensity value at the location is added to the coordinate system. After traversing all image frames, this numerical set contains the brightness variation information of the spatial location throughout the entire time series. Next, this numerical set undergoes preprocessing to remove extreme outliers. This preprocessing first calculates the median and median absolute deviation (MAD) of the numerical set. Then, any value exceeding the range of "median ± 3 × MAD" is marked as an outlier and removed from the set. For example, if the pixel intensity set for a certain coordinate is [120, 122, 121, 185, 119], with a median of 121 and MAD of 1, the effective range is [118, 124], and the value 185 will be removed. After removing outliers, all remaining pixel intensity values in the numerical set are summed and then divided by the number of remaining values to calculate the mean pixel intensity at that spatial coordinate location. This process is repeated for each spatial coordinate in the image. Repeat the process, averaging all calculated pixel intensities according to their original values. The spatial coordinates are backfilled into a new two-dimensional array of the same size as the original image, forming a reconstructed and enhanced ceramic insulator feature array.
[0050] The steps for obtaining the binary defect morphology features of porcelain insulators are as follows:
[0051] Extract the internal pixels of the reconstructed and enhanced porcelain insulator feature array one by one, scan the pixel intensity distribution around each pixel within a fixed neighborhood range, first eliminate the protruding area formed by the expansion of the neighborhood boundary, then fill in the local depression position of the retained area inside the neighborhood, record the processed pixel intensity value corresponding to all spatial coordinate positions, and align them point by point according to the original coordinate order of the reconstructed and enhanced porcelain insulator feature array to form a morphological opening operation output array.
[0052] The pixel intensity values at each spatial coordinate position within the morphological opening operation output array are extracted one by one. The original pixel intensity values at the corresponding spatial coordinate positions within the reconstructed and enhanced ceramic insulator feature array are retrieved one by one. The numerical difference at each spatial coordinate position is calculated. The correspondence between the numerical difference and the preset judgment threshold is compared point by point. Spatial coordinate positions with numerical differences exceeding the preset judgment threshold are assigned white level values, and the remaining spatial coordinate positions are assigned black level values. The output is performed according to the original arrangement order of all spatial coordinate positions to obtain the binary defect morphology features of the ceramic insulator.
[0053] Specifically, the internal pixels of the reconstructed and enhanced ceramic insulator feature array are extracted one by one. A morphological opening operation is then performed on this array. This operation consists of two consecutive steps: first, an erosion operation, followed by a dilation operation. A unified structuring element is used, which is set as a circular disk-shaped structure with a radius of 3 pixels. The size of this element is chosen to be larger than the fine texture noise commonly present on the insulator surface (usually less than 3 pixels), but smaller than the typical initial defect size (usually greater than 5 pixels). During the erosion stage, for each pixel in the array, its pixel value is replaced with the minimum value of all pixels in its 3×3 neighborhood. This process causes the edges of brighter areas in the image to shrink inward, effectively eliminating pixels smaller than the minimum value in the structuring element. Isolated bright spots or thin bright lines in the constituent elements are usually image noise rather than real defects. After the erosion operation is completed, an intermediate result array is obtained. Then, a dilation operation is performed on this intermediate result array. For each pixel in the intermediate result array, its pixel value is replaced with the maximum value of all pixel values in its 3×3 neighborhood. This process causes the boundaries of the bright areas retained after erosion to expand outward, thereby filling in any tiny holes or breaks that may exist inside these bright areas. At the same time, it restores the main object outline that has been slightly reduced due to the erosion operation, but does not restore the noise points that were completely eliminated before. The array obtained after the dilation operation is completed is recorded as the final processed pixel intensity values and aligned according to the original coordinate order to form a morphological opening operation output array.
[0054] The pixel intensity values at each spatial coordinate position within the output array of the morphological opening operation are extracted one by one and compared with the original pixel intensity values of the reconstructed and enhanced ceramic insulator feature array. The numerical difference at each spatial coordinate position is calculated. Specifically, for each coordinate in the image... Difference The calculation method is as follows ,in It is a reconstructed and enhanced ceramic insulator feature array in Pixel intensity at that location It is a morphological opening operation output array in The pixel intensity at that location, due to the properties of the opening operation, is this difference. Since the differences are always non-negative, a preset threshold needs to be set to binarize these differences. This threshold is set using an adaptive method. First, all differences are calculated. The global average value of the constructed difference image and standard deviation Then, the preset judgment threshold will be set. Set as , where the coefficient This is a sensitivity adjustment parameter, empirically set to 2.0. This value was determined through testing on a sample image set containing known microcracks and stains. The goal is to minimize false detections caused by background texture while ensuring that over 95% of true defects are detected. For example, if the calculated mean value of the difference images is 15 and the standard deviation is 5, then the threshold... for Finally, iterate through each coordinate of the image again. Compare their differences The relationship with the threshold 25, if Then, the corresponding position in the output image will be assigned a white level value (e.g., 255). If the value is black level (e.g., 0), the binarized results of all coordinates are output in the original order to obtain the binarized defect morphology features of the porcelain insulator.
[0055] The steps to obtain the boundary trajectory connecting the iron cap and the steel foot are as follows:
[0056] Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator line by line, and record the outermost white level pixel coordinates of each line. Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator column by column, and record the outermost white level pixel coordinates of each column. Connect all the outermost white level pixel coordinates according to the eight-neighborhood connection relationship, remove isolated white level pixel coordinates with broken neighborhoods, and retain the continuously arranged non-zero pixel coordinates to form the outermost continuous non-zero pixel set.
[0057] The starting pixel is selected as the first non-zero pixel in the outermost set of consecutive non-zero pixels. The coordinate interval length between the current non-zero pixel and the previous non-zero pixel is calculated point by point according to the continuous connection order of the outermost set of consecutive non-zero pixels. The coordinate interval lengths of each segment are accumulated to the position of the current non-zero pixel. The cumulative path length value corresponding to each non-zero pixel is recorded as the edge arc length parameter. The correspondence between pixel coordinates and edge arc length parameters is output according to the connection order of non-zero pixels to generate the connected boundary trajectory of the iron cap and steel foot.
[0058] Specifically, based on the binarized defect morphology characteristics of porcelain insulators, connected component analysis is first performed on the binarized image to mark all independent white-level pixel regions. The total number of pixels in each region is calculated, and an area threshold is set, for example, 20 pixels. This threshold is based on statistical analysis of the noise spot size in normal insulator images. Typically, isolated regions formed by random noise have fewer than 20 pixels, while the actual defect area is much larger. Connected components with a total number of pixels less than 20 are considered noise and removed from the image, i.e., their pixel values are changed from white to black. Among all the retained connected components, the one with the largest total number of pixels is selected as the main target region. Then, a contour tracking algorithm, such as the Moore-Neighbor algorithm, is used. To extract the outermost boundary of the target region, the specific operation is as follows: starting from the leftmost white-level pixel in the top row of the target region, set it as the starting point and the current point, and add it to an empty pixel set. Then, with the current point as the center, start from the next position of the previous boundary point and check its eight neighboring pixels in a clockwise direction until the first white-level pixel is found. This newly discovered white-level pixel is the next boundary point, which is added to the set and updated as the new current point. Repeat this eight-neighbor search process until you return to the starting point. At this time, all pixel coordinates in the set are arranged in the order of addition, forming a closed boundary contour. This contour is the retained continuous arrangement of non-zero pixel coordinates, forming the outermost continuous non-zero pixel set.
[0059] Select the first non-zero pixel from the outermost set of consecutive non-zero pixels, sorted according to the "row first, column second" rule. This means selecting the pixel with the smallest row coordinate value among all boundary points. If multiple pixels have the same row coordinate value, select the pixel with the smallest column coordinate value and designate it as the starting pixel. and initialize its corresponding edge arc length parameter. The initial value is 0. Then, following the continuous connection order determined by the contour tracking algorithm, each pixel in the set is traversed sequentially. For each current non-zero pixel Calculate its relationship with the previous non-zero pixel in the sequence. The coordinate interval between them, which is calculated using Euclidean distance, is given by the formula: in, It is a point With point The length of the interval between them These are the coordinates of the current point. These are the coordinates of the previous point. Since it's an eight-neighbor connection, The value can only be 1 (horizontal or vertical movement) or... (Diagonal movement) calculate the length of each coordinate segment. By summing them up sequentially, we can obtain the current point. Corresponding cumulative path length value The calculation method is as follows Record each non-zero pixel. coordinates and its corresponding cumulative path length value After traversing all boundary points, output the data in the order of connection of non-zero pixels. The sequence constitutes the boundary trajectory connecting the iron cap and the steel foot.
[0060] The steps for obtaining the one-dimensional boundary turning geometry signal are as follows:
[0061] The forward and backward coordinate differences of adjacent pixels within the boundary trajectory connecting the iron cap and steel foot are extracted point by point. The tangent extension direction of the current pixel is determined according to the forward and backward coordinate differences. The angle between the tangent direction and the horizontal reference coordinate axis is calculated point by point. The edge arc length parameters recorded within the boundary trajectory connecting the iron cap and steel foot are retrieved point by point. The edge arc length parameters are written to the horizontal coordinate position and the angle value is written to the vertical coordinate position. All coordinate mappings are completed in the increasing order of the edge arc length parameters to obtain the one-dimensional boundary turning geometric signal.
[0062] Specifically, based on the boundary trajectory connecting the iron cap and the steel foot, the internal pixels are extracted point by point to calculate the tangent direction. To improve the stability of the tangent direction estimation and suppress pixel-level noise, directly adjacent points are not used; instead, a local window is employed for calculation. Specifically, for each pixel in the boundary trajectory... Select its forward-oriented position in the trajectory sequence Points and backward Points The half width of the window Based on experience, a value of 5 is set. This value is the result of a trade-off between smoothing noise and preserving boundary details, which is suitable for typical insulator image resolutions. It can effectively smooth out pixel staircase effect, making points Time The vector as a point The approximation of the tangent direction at a given point is that the components of the tangent vector are... Then calculate the angle between the tangent vector and the horizontal reference coordinate axis (positive X-axis direction). The calculation is performed using the two-parameter arctangent function, and the formula is as follows: in, It is a point The angle between the tangents at that point It is the forward first The coordinates of the points It is backwards The coordinates of the points Function return vector The angle with the positive X-axis, with a range of values. For the beginning and end of the trajectory where a complete window cannot be formed For each point, without performing calculations, the included angle is successfully calculated for each point. point The corresponding edge arc length parameter is retrieved from the boundary trajectory connecting the iron cap and the steel foot. ,Will As the x-axis, As the vertical axis, a two-dimensional data point is formed. All these data points are sorted according to the edge arc length parameter. Arranged in ascending order, the one-dimensional boundary turning geometry signal is obtained.
[0063] The steps for obtaining the cumulative distance matrix of elastic deformation are as follows:
[0064] Based on the one-dimensional boundary turning geometry signal and the standard geometry signal sequence, the included angle value of each arc length parameter position is read point by point according to the sampling order of the one-dimensional boundary turning geometry signal, and the included angle value of each standard position is read point by point according to the sampling order of the standard geometry signal sequence. The included angle value of each arc length parameter position is paired with the included angle value of each standard position item by item, and the absolute value of the difference between the paired values is calculated item by item. The data is written into the matrix unit according to the sampling order of the one-dimensional boundary turning geometry signal as the row order and the sampling order of the standard geometry signal sequence as the column order to form a two-dimensional distance matrix.
[0065] Starting from the initial cell of the two-dimensional distance matrix, scan each matrix cell row by row and column by column. Extract the cumulative values of the matrix cells to the left, above, and to the top left of the current matrix cell. Select the minimum value among the cumulative values of the left, above, and top left matrix cells and add it to the distance value of the current matrix cell. Fill all matrix cells in sequence to form the elastic deformation cumulative distance matrix.
[0066] Specifically, based on the one-dimensional boundary turning geometric signal and the standard geometric signal sequence, the standard geometric signal sequence needs to be constructed first. This sequence is generated by acquiring at least 50 sample images from different defect-free porcelain insulators, performing all the aforementioned steps on each sample image to generate its own one-dimensional boundary turning geometric signal, and then aligning these 50 signals using the Dynamic Time Warping (DTW) algorithm. Using an arbitrarily selected signal as a reference, the remaining signals are nonlinearly scaled in the arc length dimension to match the peak and trough positions of the reference signal. After alignment, the average of the included angle values of all 50 signals is calculated at each corresponding sampling point, thereby generating a standard geometric signal sequence representing the boundary morphology of an ideal, defect-free insulator. Next, let the one-dimensional boundary turning geometric signal be a sequence... ,in For the first The included angle values at each sampling point, the standard geometric signal sequence is: ,in For the first Create a standard position with included angle values. Two-dimensional distance matrix The first in the matrix Line number Column cells The value is calculated and The absolute value of the difference between them is obtained, and the specific calculation formula is as follows: in, Indicates the signal to be measured. The point and the standard signal Local distance between points It is a one-dimensional boundary turning geometry signal in the first... The included angle value of each sampling point It is the standard geometric signal sequence in the 1st The included angle value of each sampling point The value range is 1 to , The value range is 1 to , and These are the lengths of the one-dimensional boundary turning geometric signal and the standard geometric signal sequence, respectively. By filling in each item using this method, a two-dimensional distance matrix is formed.
[0067] Starting from the initial element of the two-dimensional distance matrix Begin by calculating and filling a row and column by row, with the same value. Cumulative distance matrix of elastic deformation of size Each element of the matrix It represents the starting point To the current point The minimum cumulative distance is calculated following the principle of dynamic programming. First, the initial elements of the matrix are initialized, letting... For the first row of the matrix (when (At that time), its cumulative distance can only be obtained by accumulating from the left-hand unit, that is Similarly, for the first column of the matrix (when...) (At that time), its cumulative distance can only be obtained by adding the distances from the units above it, that is... For all other internal elements in the matrix (in and Its value is determined by the local distance of the current cell. The formula for calculating this recursive relationship is: (The formula is incomplete and requires further context.) in, This is the currently calculated cumulative distance. It is the local distance at the corresponding position obtained from the two-dimensional distance matrix. , and These are the cumulative distance values already calculated for the upper, left, and upper-left cells of the current cell. These values are calculated and filled into all matrix cells sequentially from top to bottom and from left to right, finally reaching the endpoint cell of the matrix. The obtained value is the dynamic time-normalized distance between the two sequences. After filling, an elastic deformation cumulative distance matrix is formed.
[0068] The steps to obtain the coordinates of the abnormal break at the peak of the umbrella skirt are as follows:
[0069] Starting from the endpoint of the cumulative distance matrix of elastic deformation, backtracking node by node in the direction of minimum cumulative value to the starting point, recording the row and column positions of all traversed nodes, a minimum shuttle path sequence is obtained. The path values of the preceding and following nodes are extracted according to the node arrangement order of the minimum shuttle path sequence. The change in path values of adjacent nodes is calculated for each node, and the magnitude of the change in path values of adjacent nodes along the path sequence is calculated for each node, obtaining the path value derivative of each node. The relationship between the path value derivative and a preset judgment threshold is compared node by node, and the node positions where the path value derivative is greater than the preset judgment threshold are screened out. Then, the start and end range of the arc length parameter corresponding to the one-dimensional boundary turning geometric signal is checked back according to the node position to obtain the coordinates of the abnormal fracture of the umbrella skirt peak.
[0070] Specifically, from the endpoint of the cumulative distance matrix of elastic deformation To begin, backtrack backwards to find the optimal path at the current node. Check its left side , upper side and the upper left side The cumulative values of the three candidate predecessor nodes are used to select the node with the smallest value as the previous node in the path, and the row and column positions of the current node are recorded. Repeat this process until you backtrack to the starting point. The recorded row and column positions of all nodes constitute the minimum shuttle path sequence. Then, for each node on this path, its path numerical derivative is calculated. Here, the path numerical value refers to the two-dimensional distance matrix. The numerical value at the corresponding node position in the path, the derivative of the path value at the th node. Path nodes The following is an approximate calculation using the central difference method: ,in It is the first The path numerical derivative of each node. and These are the first on the path The and the first Each node in the two-dimensional distance matrix The corresponding values are then used to filter out nodes with abnormal derivative values by setting a preset threshold. This threshold is calculated by taking the mean of the set of derivatives of the path values of all nodes on the path. and standard deviation To determine the threshold Set as For example, if the mean of all derivatives is calculated to be 0.8 and the standard deviation is 0.5, then the threshold is... , path numerical derivative Nodes with a value greater than 2.3 are marked as abnormal. Finally, based on the row number of the marked abnormal node in the minimum shuttle path sequence, the one-dimensional boundary turning geometry signal is retrieved. The row number corresponds to an arc length parameter sampling point index in the signal. The range of arc length parameters corresponding to this index and the five sampling point indices before and after it is extracted and used as the coordinates of the abnormal fracture of the umbrella skirt peak.
[0071] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A visual inspection method for defects in porcelain insulators in substations, characterized in that, Includes the following steps: Extract adjacent sequence image frames from the video stream, set the first sequence image as the reference image, calculate and establish the porcelain skirt spatial pixel offset field, and perform spatial coordinate translation mapping calculation on the corresponding subsequent sequence image frames based on the values of the porcelain skirt spatial pixel offset field to generate a registered and aligned porcelain skirt image sequence. Obtain the set of pixel intensity values corresponding to the same spatial coordinates in each frame of the registered and aligned porcelain skirt image sequence, establish a reconstructed and enhanced porcelain insulator feature array, extract the pixels inside the reconstructed and enhanced porcelain insulator feature array and perform morphological opening operation, filter to obtain white level value and black level value, and generate the binary defect morphology features of the porcelain insulator. Extract the set of outermost continuous non-zero pixels corresponding to the edge pixel coordinates in the binary defect morphology features of the porcelain insulator, generate the connecting boundary trajectory between the iron cap and the steel foot, extract the angle between the tangent direction of each pixel point inside the connecting boundary trajectory between the iron cap and the steel foot and the horizontal reference coordinate axis, and generate a one-dimensional boundary turning geometric signal. Extract a preset standard geometric signal sequence, establish a two-dimensional distance matrix corresponding to the one-dimensional boundary turning geometric signal and the standard geometric signal sequence, calculate the cumulative distance matrix of elastic deformation, extract the shuttle path sequence with the minimum total value from the starting point to the ending point inside the cumulative distance matrix of elastic deformation, and filter to obtain the abnormal fracture coordinates of the umbrella skirt peak.
2. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the registration and alignment of the ceramic skirt image sequence are as follows: The adjacent sequence of image frames is extracted from the video stream. The first sequence of image frames is fixed as the reference image base. The corresponding pixel blocks inside the reference image base are divided according to the uniform pixel size. The same position block reading is performed on the subsequent sequence of image frames. The center coordinates, gray scale distribution and edge response values of the pixel blocks of the subsequent sequence of image frames are recorded block by block. The change of the center coordinates of the corresponding pixel blocks inside the reference image base is compared block by block to obtain the set of spatial offset difference values. Based on the set of spatial offset difference values, according to the original arrangement order of pixel blocks within the subsequent sequence image frames, each spatial offset difference value is backfilled to the spatial coordinate position of the corresponding pixel block. The continuity of offset changes between adjacent pixel blocks is checked, abnormal offset items that exceed the range of adjacent offset changes are removed, continuous offset items are retained and merged position by position to form the ceramic skirt spatial pixel offset field. Based on the spatial pixel offset field of the porcelain skirt, the horizontal and vertical translation amounts corresponding to each spatial coordinate position are read item by item. The pixels inside the subsequent sequence image frames are written into the target coordinate positions after translation mapping. For the missing coordinates that have not been written by pixels after translation mapping, the intensity values of the surrounding neighboring pixels are extracted. The weights are allocated according to the distance ratio from the missing coordinates to each neighboring pixel. The intensity values of the neighboring pixels are weighted and summed. The pixel values of the missing coordinates are filled in one by one to generate the registered and aligned porcelain skirt image sequence.
3. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the reconstructed and enhanced ceramic insulator feature array are as follows: Based on the registered and aligned ceramic skirt image sequence, the pixel intensity value of each spatial coordinate position is read frame by frame. The pixel intensity values corresponding to each frame are collected according to the spatial coordinate position to form a set of pixel intensity values corresponding to the same spatial coordinate. The pixel intensity values of each item in the set of pixel intensity values corresponding to the same spatial coordinate are accumulated one by one, and each item is divided by the corresponding number of items to obtain the average pixel intensity value of each spatial coordinate position. All average pixel intensity values are backfilled according to the original spatial coordinate arrangement order to form a reconstructed and enhanced ceramic insulator feature array.
4. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the binary defect morphology features of the porcelain insulator are as follows: Extract the internal pixels of the reconstructed and enhanced porcelain insulator feature array one by one, scan the pixel intensity distribution around each pixel within a fixed neighborhood range, first eliminate the protruding area formed by the expansion of the neighborhood boundary, then fill in the local depression position of the retained area inside the neighborhood, record the processed pixel intensity value corresponding to all spatial coordinate positions, and align the pixels point by point according to the original coordinate order of the reconstructed and enhanced porcelain insulator feature array to form a morphological opening operation output array. The pixel intensity values at each spatial coordinate position within the morphological opening operation output array are extracted one by one. The original pixel intensity values at the corresponding spatial coordinate positions within the reconstructed and enhanced ceramic insulator feature array are retrieved one by one. The numerical difference at each spatial coordinate position is calculated. The correspondence between the numerical difference and the preset judgment threshold is compared point by point. Spatial coordinate positions with numerical differences exceeding the preset judgment threshold are assigned white level values, and the remaining spatial coordinate positions are assigned black level values. The output is performed according to the original arrangement order of all spatial coordinate positions to obtain the binary defect morphology features of the ceramic insulator.
5. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the boundary trajectory connecting the iron cap and the steel foot are as follows: Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator row by row, and record the outermost white level pixel coordinates of each row. Scan all white level pixel coordinates inside the binary defect morphology features of the porcelain insulator column by column, and record the outermost white level pixel coordinates of each column. Connect all the outermost white level pixel coordinates according to the eight-neighborhood connection relationship, remove isolated white level pixel coordinates with broken neighborhoods, and retain the continuously arranged non-zero pixel coordinates to form the outermost continuous non-zero pixel set. The first non-zero pixel in the outermost set of consecutive non-zero pixels is selected as the starting pixel. According to the continuous connection order of the outermost set of consecutive non-zero pixels, the coordinate interval length between the current non-zero pixel and the previous non-zero pixel is calculated point by point. The coordinate interval lengths of each segment are accumulated to the position of the current non-zero pixel. The cumulative path length value corresponding to each non-zero pixel is recorded as the edge arc length parameter. The correspondence between pixel coordinates and edge arc length parameters is output according to the connection order of non-zero pixels to generate the connecting boundary trajectory of the iron cap and steel foot.
6. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the one-dimensional boundary turning geometry signal are as follows: The forward and backward coordinate differences of adjacent pixels within the boundary trajectory connecting the iron cap and steel foot are extracted point by point. The tangent extension direction of the current pixel is determined according to the forward and backward coordinate differences. The angle between the tangent direction and the horizontal reference coordinate axis is calculated point by point. The edge arc length parameters recorded within the boundary trajectory connecting the iron cap and steel foot are retrieved point by point. The edge arc length parameters are written to the horizontal coordinate position and the angle value is written to the vertical coordinate position. All coordinate mappings are completed in the increasing order of the edge arc length parameters to obtain the one-dimensional boundary turning geometric signal.
7. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the cumulative distance matrix of elastic deformation are as follows: Based on the one-dimensional boundary turning geometry signal and the standard geometry signal sequence, the included angle value of each arc length parameter position is read point by point according to the sampling order of the one-dimensional boundary turning geometry signal, and the included angle value of each standard position is read point by point according to the sampling order of the standard geometry signal sequence. The included angle value of each arc length parameter position is paired with the included angle value of each standard position item by item, and the absolute value of the difference between the paired values is calculated item by item. The data is written into the matrix unit according to the sampling order of the one-dimensional boundary turning geometry signal as the row order and the sampling order of the standard geometry signal sequence as the column order to form a two-dimensional distance matrix. Starting from the initial unit of the two-dimensional distance matrix, each matrix unit is scanned row by row and column by column. The cumulative values of the matrix units to the left, above, and above the current matrix unit are extracted respectively. The minimum value among the cumulative values of the left, above, and above the current matrix units is selected and added to the distance value of the current matrix unit. This process is repeated to fill all matrix units in sequence to form the elastic deformation cumulative distance matrix.
8. The visual inspection method for defects in porcelain insulators in substations according to claim 1, characterized in that, The steps for obtaining the coordinates of the abnormal breakage at the peak of the umbrella skirt are as follows: Starting from the endpoint of the cumulative distance matrix of elastic deformation, backtracking node by node in the direction of minimum cumulative value to the starting point, and recording the row and column positions of all traversed nodes, a minimum shuttle path sequence is obtained. Following the node arrangement order of the minimum shuttle path sequence, the path values of the preceding and following nodes are extracted node by node. The change in path values of adjacent nodes is calculated node by node, and the magnitude of the change in path values of adjacent nodes along the path sequence is calculated node by node, yielding the path value derivative of each node. The relationship between the path value derivative and a preset judgment threshold is compared node by node, and the node positions where the path value derivative is greater than the preset judgment threshold are screened out. Then, the start and end range of the arc length parameter corresponding to the one-dimensional boundary turning geometric signal is checked back according to the node position to obtain the abnormal fracture coordinates of the umbrella skirt peak.