A computer vision-based switchgear wiring defect detection method
By extracting the high-frequency distribution matrix and radial gradient intensity parameters in the frequency domain during wiring detection of distribution cabinets, and combining them with the geometric measurement parameters of concentric circles, the lack of multi-scale frequency information and multi-directional structural relationships in existing technologies has been solved, enabling precise identification and accurate judgment of broken strand defects and missing gasket defects.
Patent Information
- Application Number
- CN202610588857.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-10
AI Technical Summary
Existing computer vision technology lacks the ability to jointly model multi-scale frequency information and multi-directional structural relationships in the wiring inspection of power distribution cabinets. This makes it difficult to separate subtle broken strand phenomena, and it is easy to misjudge or ignore local anomalies in complex backgrounds. In particular, textures are misidentified as defects when there are changes in lighting or surface reflections.
By extracting the high-frequency distribution matrix of the terminal crimping point pixel matrix in the frequency domain, a strand abrupt change feature quantity is generated. Combined with the radial gradient intensity parameter and the concentric circle geometric measurement parameter, multi-angle correlation judgment is performed to establish the ring layer benchmark interval, calculate the gasket fracture evaluation parameter, and realize the hierarchical identification of strand breakage defects and gasket omission defects.
It enhances the distinguishability of fine structures in the wiring area, improves the stability and anti-interference ability of the test results, improves the identification accuracy in complex environments, and enables precise judgment of broken strand defects and missing gasket defects.
Smart Images

Figure CN122368016A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method for detecting wiring defects in power distribution cabinets based on computer vision. Background Technology
[0002] Computer vision technology takes image and video information as its core, and through the acquisition, expression, analysis and understanding of pixel data, it can automatically identify and quantify the structural features, spatial relationships and state changes of target objects.
[0003] Current methods typically rely on direct feature extraction at the pixel level and simple spatial structure judgment in actual operation, lacking the ability to jointly model multi-scale frequency information and multi-directional structural relationships. When dealing with wiring scenarios in distribution cabinets, judgments are often made solely based on grayscale changes or edge contours, making it difficult to separate subtle broken strands from complex backgrounds. Furthermore, in areas with regular geometric structures such as screws and washers, common processing methods focus on analysis of a single direction or local area, lacking a quantitative expression of the overall consistency of the ring structure. This leads to local anomalies being ignored or misjudged; for example, in the presence of changes in lighting or surface reflection, a single gradient judgment can easily misidentify normal textures as defects. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a computer vision-based method for detecting wiring defects in power distribution cabinets.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting wiring defects in power distribution cabinets based on computer vision, comprising the following steps: Based on the terminal crimping point pixel matrix extracted from the power distribution cabinet wiring terminals, a high-frequency distribution matrix in the frequency domain is established. The pixel texture energy value and texture energy variance in the high-frequency distribution matrix in the frequency domain are extracted to generate scattered strand mutation feature quantity. Based on the scattered strand mutation characteristic quantity, the strand breakage defect is determined, and the center coordinate of the screw head in the assembly area is extracted. The gray-scale gradient value set in the outer ring interval of the screw head is read, the radial gradient intensity parameter is established, the coordinates of each gradient peak and the corresponding number of peaks in the radial gradient intensity parameter are located, and the valley pixel distribution quantity is generated. Based on the distribution of the trough pixels and the peak values of each gradient in the radial gradient intensity parameter, the index of the spring washer is obtained. The pixel set of the outer ring boundary of the flat washer in the assembly area is read. Combined with the index of the spring washer, the geometric metric parameters of the concentric circle are established. Based on the concentric circle geometric measurement parameters, the reference range for the number of annular layers is set, the gasket fracture evaluation parameters are calculated, and the gasket fracture evaluation parameters are compared with the assembly threshold to generate the gasket missing defect status quantity.
[0006] Preferably, the step of obtaining the scattered strand mutation feature quantity is as follows: Extract the pixel matrix of terminal crimping points from the terminal wiring terminals of the distribution cabinet. Read the corresponding brightness value according to the row and column coordinates of each pixel position in the terminal crimping point pixel matrix. Map the brightness value point by point according to the original arrangement order of the row and column coordinates. Write a unique corresponding gray value to each pixel position to form a gray matrix. Layered organization is performed around the gray values of each pixel position in the gray matrix. The low-frequency component values of the central region of the gray matrix at different scales are recorded, and the high-frequency sub-band feature values at different directional positions are recorded. The low-frequency component values and multi-directional high-frequency sub-band feature values are combined point by point according to the same pixel position to form the first mixed component. Based on the first mixed component, the high-frequency response values in different directions are summarized according to each pixel position, the frequency distribution state of each pixel position is sorted out to form a frequency domain high-frequency distribution matrix, the pixel texture energy value corresponding to each pixel position in the frequency domain high-frequency distribution matrix is extracted, the texture energy variance corresponding to each pixel position is calculated, and the pixel texture energy value and texture energy variance are calculated item by item to obtain the scattered mutation feature quantity.
[0007] Preferably, the step of obtaining the radial gradient intensity parameter is as follows: The positional correspondence of the loose strand mutation feature quantity in the terminal crimping point pixel matrix is read, the distribution state of the loose strand mutation feature quantity in the continuous pixel interval is statistically analyzed, it is determined whether the loose strand mutation feature quantity falls into the interval corresponding to the broken strand defect, the broken strand defect judgment result is output, the circular edge of the screw head in the assembly area is locked according to the broken strand defect judgment result, the row coordinates and column coordinates of the geometric center of the circular edge are extracted, the outer ring interval is set around the center coordinate of the screw head, and the gray level change amplitude of each pixel position in the outer ring interval is read point by point to form the gray level gradient value set of the screw head center; The screw head center coordinates, which are recorded in the gray-scale gradient values of the screw head center, are called. Radiation paths are established from the screw head center coordinates to the outer ring boundary according to different angle directions. The gray-scale gradient values corresponding to each pixel position on each radiation path are extracted in sequence. The gray-scale gradient values are arranged in order of distance from the pixel position to the screw head center coordinates. The projection results on each radiation path are summarized. The gradient change strength and position distribution corresponding to each angle direction are statistically analyzed to form the radial gradient intensity parameter.
[0008] Preferably, the step of obtaining the valley pixel distribution is as follows: Based on the radial gradient intensity parameter, the gradient change curves corresponding to each angle direction are retrieved one by one. The gradient peak coordinates corresponding to the prominent value in each gradient change curve are located. The number of peaks in each gradient change curve is counted. Intervals are divided according to the coordinates of adjacent gradient peaks. The pixel point corresponding to the minimum value position in each interval is extracted. The distribution of each minimum position under different angle directions is recorded to form the valley pixel distribution.
[0009] Preferably, the step of obtaining the index value of the spring washer is as follows: Based on the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter, the valley position values in the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter are matched one by one according to the same radiation direction. The difference between each valley position value and the adjacent gradient peak value is calculated. The distribution order of all differences in each radiation direction is counted. The corresponding ratio of the difference to the gradient peak value in each radiation direction is extracted to obtain the difference ratio of each radiation direction. According to each radiation direction, the continuous and uninterrupted pixel segments in the assembly area are retrieved one by one. The number of connected pixels in the corresponding pixel segment of each radiation direction is counted. The difference ratio of each radiation direction and the number of connected pixels in the same radiation direction are matched item by item. The influence order of the degree of difference change on the connectivity range under each radiation direction is recorded. The comprehensive characterization value of each radiation direction is extracted to form the index of spring washer.
[0010] Preferably, the steps for obtaining the geometric measurement parameters of the concentric circles are as follows: The pixel set of the outermost annular boundary of the flat washer located at the outermost contour position of the flat washer within the assembly area is read. The boundary pixel coordinates of the pixel set of the outermost annular boundary of the flat washer are arranged in angular order. The distance values from each boundary pixel coordinate to the center coordinate of the screw head are extracted. The distance values are merged with the corresponding directional characterization values in the spring washer index item by item. The boundary fit state, radius fluctuation state, and annular closure state at each angular position are statistically analyzed to form concentric circle geometric measurement parameters.
[0011] Preferably, the steps for obtaining the gasket fracture assessment parameters are as follows: Read the number of gradient peaks corresponding to each angle position in the concentric circle geometric measurement parameters, set the ring layer reference interval according to the distribution of the number of gradient peaks at each angle position, check the number of gradient peaks at each angle position against the ring layer reference interval, screen out the angle positions that do not fall into the ring layer reference interval, record the distance between gradient peaks corresponding to each angle position that does not fall into the ring layer reference interval, and form the parameter corresponding to the deviation angle peak distance. The number of all deviation angle positions in the parameters corresponding to the deviation angle peak distance is counted, the peak number deviation corresponding to each deviation angle position is extracted, the gradient peak distance corresponding to each deviation angle position is extracted, and the gasket fracture evaluation parameters are calculated.
[0012] Preferably, the step of obtaining the quantity of the defective condition of the missing gasket is as follows: Read the assembly threshold, compare the size of the gasket fracture assessment parameter with the assembly threshold, extract the difference value between the gasket fracture assessment parameter and the assembly threshold, classify the abnormality mark according to the positive and negative state and amplitude state corresponding to the difference value, output the corresponding defect judgment result according to the abnormality mark, and generate the gasket missing installation defect state quantity.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, frequency domain decomposition of the terminal crimping point pixel matrix is performed to extract high-frequency distribution features. The pixel texture energy value and texture energy variance are coupled to calculate a strand breakage feature quantity, enabling the subtle structural disturbances within the wiring area to be presented numerically, enhancing the distinguishability of the broken strand state at the pixel level. Simultaneously, a radial gradient intensity parameter is constructed by combining the screw head center coordinates. By organizing the projection changes of the grayscale gradient on multi-angle paths, local structural changes are transformed from single-point judgment to multi-directional correlation judgment. Furthermore, by jointly extracting the number of gradient peaks and the distribution of trough pixels, the discontinuities and periodic changes of the internal structure of the assembly area are synchronously expressed. Finally, the distribution of trough pixels and the gradient peak values are correlated and calculated, and combined with the number of connected pixels to form a spring-like structure. The spring washer index allows for a comprehensive characterization of structural defects from both geometric distribution and connectivity perspectives. Building upon this, a pixel set representing the outer ring boundary of the flat washer is introduced and fused with the aforementioned index to establish concentric circle geometric measurement parameters. This enables a unified quantitative expression of the circular consistency and boundary stability of the assembled structure. Finally, by comparing the number of ring layers with the number of gradient peaks and constructing washer fracture evaluation parameters, the degree of structural deviation can be transformed into a continuous evaluation quantity that corresponds to the assembly threshold. This allows for graded identification and precise judgment of broken strand defects and missing washer defects. The entire process establishes a continuous mapping between pixel features, structural features, and geometric relationships, resulting in stronger stability and anti-interference capabilities in the detection results, and improved identification accuracy in complex assembly environments. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 A three-dimensional thermogram of radial gradient intensity parameters; Figure 3 This is a diagram of the characteristic distribution matrix of the two-dimensional discrete wavelet transform. Figure 4 This is a feature map for geometric measurement and edge recognition of concentric circles. Detailed Implementation
[0015] 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.
[0016] Please see Figure 1-4 This invention provides a technical solution: a method for detecting wiring defects in power distribution cabinets based on computer vision, comprising the following steps: Based on the terminal crimping point pixel matrix extracted from the power distribution cabinet wiring terminals, a high-frequency distribution matrix in the frequency domain is established. The pixel texture energy value and texture energy variance in the high-frequency distribution matrix in the frequency domain are extracted to generate scattered abrupt change feature quantity. Based on the characteristics of the scattered strand mutation, the broken strand defect is determined, and the center coordinate of the screw head in the assembly area is extracted. The gray-level gradient value set in the outer ring interval of the screw head is read, the radial gradient intensity parameter is established, the coordinates of each gradient peak and the corresponding number of peaks in the radial gradient intensity parameter are located, and the valley pixel distribution is generated. Based on the distribution of trough pixels and the peak values of various gradients within the radial gradient intensity parameters, the index of the spring washer is obtained. The pixel set of the outer ring boundary of the flat washer in the assembly area is read. Combined with the index of the spring washer, the geometric metric parameters of the concentric circle are established. Based on the concentric circle geometric measurement parameters, the reference range of the number of ring layers is set, the gasket fracture evaluation parameters are calculated, and the gasket fracture evaluation parameters are compared with the assembly threshold to generate the gasket missing defect status quantity.
[0017] The steps for obtaining the characteristic quantities of scattered strand mutations are as follows: Extract the pixel matrix of terminal crimping points from the terminal wiring terminals of the distribution cabinet. Read the corresponding brightness value according to the row and column coordinates of each pixel position in the terminal crimping point pixel matrix. Map the brightness value point by point according to the original arrangement order of the row and column coordinates. Write a unique corresponding gray value to each pixel position to form a gray matrix. Layered organization is performed around the gray values of each pixel position in the gray matrix. The low-frequency component values of the central region of the gray matrix at different scales are recorded, and the high-frequency sub-band feature values at different directional positions are recorded. The low-frequency component values and multi-directional high-frequency sub-band feature values are combined point by point according to the same pixel position to form the first mixed component. Based on the first mixed component, the high-frequency response values in different directions are summarized according to each pixel position, the frequency distribution state of each pixel position is sorted out, and a frequency domain high-frequency distribution matrix is formed. The pixel texture energy values corresponding to each pixel position in the frequency domain high-frequency distribution matrix are extracted, the texture energy variance corresponding to each pixel position is calculated, and the pixel texture energy values and texture energy variances are calculated item by item to obtain the scattered mutation feature quantity.
[0018] Specifically, the pixel matrix of terminal crimping points is extracted from the wiring terminals of the distribution cabinet. Color images are acquired using a camera installed in front of the distribution cabinet. The cropping window size is set according to the mapping ratio between the physical size of the wiring terminals and the camera's field of view. A 256x256 pixel image block is cropped from the center point of the terminal as the terminal crimping point pixel matrix. This matrix contains 65,536 pixels. The corresponding brightness value is read according to the row and column coordinates of each pixel position in the terminal crimping point pixel matrix. The row and column coordinates range from 1 to 256. For each pixel position, the corresponding red, green, and blue channel brightness values are read, with each channel brightness value ranging from 0 to 255. The brightness values are mapped point by point according to the original arrangement order of the row and column coordinates. A fixed color conversion weight is used to apply color conversion weights to the brightness values of the three channels. The weighted summation is performed by multiplying the red brightness value by 0.299, the green brightness value by 0.587, and the blue brightness value by 0.114. These three products are then added together to obtain the overall brightness value. For example, if the red, green, and blue brightness values at a pixel location are 100, 150, and 200 respectively, the weighted calculation result is 100 multiplied by 0.299, 150 multiplied by 0.587, and 200 multiplied by 0.114, resulting in an overall brightness value of 140.85. This result is rounded down to 140 as the final grayscale value. The grayscale values of each row and column are arranged in a two-dimensional array according to their original spatial relative positions. A unique corresponding grayscale value is written to each pixel location. This weighted calculation and assignment process is repeated until all pixel locations in the 256x256 pixel matrix are covered, forming a two-dimensional data set, which yields the grayscale matrix.
[0019] The grayscale values of each pixel in the previously obtained grayscale matrix are processed hierarchically. A two-dimensional discrete wavelet transform is used to perform spatial frequency decomposition on the 256x256 grayscale matrix. The wavelet decomposition is set to two layers, using the Haar wavelet basis function as the transform foundation. In the first layer decomposition, each row of the grayscale matrix undergoes one-dimensional low-pass filtering and one-dimensional high-pass filtering, followed by intermittent downsampling. The same filtering and downsampling operations are then performed on the column directions, generating a 128x128 first-layer approximate component and first-layer horizontal, vertical, and diagonal detail components. The first-layer approximate component is further decomposed into a second layer, generating a 64x64 second-layer low-frequency approximate component and second-layer high-frequency detail components in three directions. The low-frequency component values of the central region of the grayscale matrix at different scales are recorded, and the core region corresponding to the pressure point in the second-layer low-frequency approximate component is extracted. The heart data block records the high-frequency sub-band feature values at different directional positions. It extracts all six high-frequency detail component values in the horizontal, vertical, and diagonal directions of the first and second layers. These components of different sizes are uniformly enlarged to the original 256x256 resolution size through bilinear interpolation, so that the row and column coordinates of each feature map are completely aligned with the original grayscale matrix. For example, for a pixel position with coordinates of 10 rows and 10 columns, it reads the corresponding resampled low-frequency component value and the six high-frequency detail component values of different scales and directions. The low-frequency component value and the multi-directional high-frequency sub-band feature value are combined point by point according to the same pixel position. These seven values are concatenated into a one-dimensional value sequence as the local frequency feature description of the pixel position. The feature concatenation operation is repeated for all 65536 pixel positions in the matrix to construct the feature data matrix and form the first mixed component.
[0020] Based on the first mixed component obtained earlier, for each of the 256x256 pixel positions, read its corresponding one-dimensional numerical sequence of length 7, separate the values of 6 high-frequency detail components, and summarize the high-frequency response values in different directions according to each pixel position. Calculate the absolute value of each of these 6 high-frequency detail component values and then sum them. For example, if the 6 high-frequency values of a certain pixel position are -5, 10, -2, 8, -4, and 3, then the sum of its absolute values is 5 + 10 + 2 + 8 + 4 + 3 = 32. This sum is used as the comprehensive high-frequency responsivity of that pixel position. Organize the frequency distribution of each pixel position, and rearrange the comprehensive high-frequency responsivity of all pixel positions into a 256x256 two-dimensional matrix according to the original row and column coordinates to form a frequency domain high-frequency distribution matrix. Extract the pixel texture energy values corresponding to each pixel position in the frequency domain high-frequency distribution matrix. Set a 5x5 local sliding window centered on each pixel position. This window contains 25 adjacent pixels. The average value of the squared high-frequency responsivity values of the 5 pixels is taken as the pixel texture energy value of the center pixel. For example, if the sum of the squares of the responsivity values of 25 pixels is 2500, the average value is 100. The texture energy variance corresponding to each pixel position is calculated. Within the same 5x5 local sliding window, the sum of the squares of the differences between the comprehensive high-frequency responsivity values of these 25 pixels and their average values is calculated. The sum of the squares is then divided by 24 to obtain the local sample variance as the texture energy variance. The pixel texture energy value and texture energy variance are calculated item by item. Based on the statistical results of the distribution of historical scattered defect sample characteristics, a fixed energy weight coefficient of 0.6 and a variance weight coefficient of 0.4 are set. The 100 pixel texture energy value obtained above is multiplied by 0.6 to get 60. The obtained local sample variance is multiplied by 0.4. The product of the two is added together as the final feature value of the pixel position. The same weighting operation is performed on all pixel positions. All final feature values are organized according to a matrix structure to obtain the scattered mutation feature quantity.
[0021] The steps for obtaining the radial gradient intensity parameters are as follows: Read the position correspondence of the scattered strand mutation feature quantity in the pixel matrix of the terminal crimping point, count the distribution state of the scattered strand mutation feature quantity in the continuous pixel interval, determine whether the scattered strand mutation feature quantity falls into the interval corresponding to the strand breakage defect, output the strand breakage defect judgment result, lock the circular edge of the screw head in the assembly area according to the strand breakage defect judgment result, extract the row coordinates and column coordinates of the geometric center of the circular edge, set the outer ring interval around the center coordinate of the screw head, read the gray level change amplitude of each pixel position in the outer ring interval point by point, and form the gray level gradient value set of the screw head center; The screw head center coordinates are collected and recorded using the grayscale gradient values at the center of the screw head. Radiation paths are established from the center coordinates of the screw head to the boundary of the outer ring interval according to different angle directions. The grayscale gradient values corresponding to each pixel position on each radiation path are extracted in sequence. The grayscale gradient values are arranged in order of distance from the pixel position to the center coordinates of the screw head. The projection results on each radiation path are summarized, and the gradient change strength and position distribution corresponding to each angle direction are statistically analyzed to form the radial gradient intensity parameter.
[0022] Specifically, the positional correspondence of the previously obtained stray strand mutation feature quantity in the terminal crimping point pixel matrix is read. All pixels in the terminal crimping point pixel matrix are traversed. Based on the statistical results of the feature data of historical defect-free normal terminal samples, a feature quantity judgment threshold is set. The average value of the historical sample feature data is extracted as 45, and the standard deviation is 12. The average value plus twice the standard deviation is calculated to obtain a feature quantity judgment threshold of 69. The stray strand mutation feature quantity at each pixel position is compared with this threshold, and abnormal pixels with a feature quantity greater than 69 are selected. An 8-neighborhood connected component labeling algorithm is used to count the continuous pixel intervals formed by these abnormal pixels. The number of pixels in each continuous pixel interval is calculated as the connected area. A connected area judgment benchmark of 15 pixels is set. It is determined whether the connected area of each continuous pixel interval is greater than 15. The feature quantity corresponding to the continuous pixel interval greater than this benchmark value is judged to fall into the interval corresponding to the stray strand defect. The stray strand defect judgment result is output, and the assembly area where the defect occurs is located according to the stray strand defect judgment result. The circular edge of the screw head within the domain is detected using the Hough circle transform algorithm based on the grayscale matrix data. The search range of the circle radius for the Hough transform is set to 20 to 40 pixels. The circle corresponding to the highest peak position in the accumulator is extracted as the edge of the screw head. The row and column coordinates of the geometric center of this circular edge are obtained. For example, the extracted row coordinates are 120 and the column coordinates are 135. An outer annular interval with an inner diameter of 45 pixels and an outer diameter of 65 pixels is set around the center coordinates of the screw head. The Sobel operator is applied to each pixel position in the original grayscale matrix to calculate the horizontal and vertical gradient magnitudes respectively. The square root of the sum of the squares of the horizontal and vertical gradient magnitudes is obtained to get the comprehensive grayscale change magnitude of each pixel position. All coordinate positions within the outer annular interval are traversed, and the grayscale change magnitude of each pixel position in the outer annular interval is read point by point. These extracted coordinates and corresponding magnitudes are combined into a data set to form the grayscale gradient value set of the screw head center.
[0023] The screw head center coordinates, recorded in the previously obtained set of grayscale gradient values, are used as the starting point. Starting from row coordinate 120 and column coordinate 135, the angle range is set to 0 to 359 degrees, with a step value of 1 degree between adjacent angles, generating a total of 360 angular directions. Radial paths are established from the screw head center coordinates to the outer ring boundary according to these 360 different angular directions. The Bressenham line generation algorithm is used to calculate the specific pixel coordinates that each radial path passes through on the discrete pixel grid. Since the outer ring interval is set to an inner diameter of 45 pixels to an outer diameter of 65 pixels, the grayscale gradient values corresponding to each pixel position falling within this inner to outer diameter range on each radial path are extracted sequentially. For a single radial path, the square of the difference between the row coordinate of each extracted pixel position and the row coordinate of the screw head center is calculated, plus the difference between the column coordinate and the center column coordinate. The square root of the sum is used to obtain the Euclidean distance from the pixel location to the center coordinate. These gray-level gradient values are arranged in ascending order of Euclidean distance from 45 to 65, thus converting the originally two-dimensional scattered gray-level gradients into a one-dimensional distance sequence. The projection results on all 360 radiation paths are summarized, and the one-dimensional distance sequence corresponding to each radiation path is used as a row of a matrix to construct a two-dimensional feature matrix with 360 rows and 21 columns. The row number represents the angular direction from 0 degrees to 359 degrees, and the column number represents the distance position from the inner diameter to the outer diameter. The two-dimensional feature matrix is traversed to count the gradient change strength and position distribution corresponding to each angular direction. The distance coordinates corresponding to the maximum value of the gradient value in each angular direction and the specific value of the maximum gradient are recorded. The statistical results with directional angle, distance coordinates and corresponding gray-level gradient magnitude are packaged and integrated to form the radial gradient intensity parameter.
[0024] The steps to obtain the valley pixel distribution are as follows: Based on the radial gradient intensity parameter, the gradient change curves corresponding to each angle direction are retrieved one by one. The gradient peak coordinates corresponding to the prominent value in each gradient change curve are located. The number of peaks in each gradient change curve is counted. The intervals are divided according to the coordinates of adjacent gradient peaks. The pixel points corresponding to the minimum value position in each interval are extracted. The distribution of each minimum position under different angle directions is recorded to form the valley pixel distribution.
[0025] Specifically, based on the radial gradient intensity parameters obtained earlier, a data structure consisting of 360 angular directions is retrieved. Gradient change curves composed of one-dimensional distance sequences corresponding to each angular direction are retrieved item by item. For any gradient change curve with a length of 21 data points, a sliding window of size 3 data points is used for local maximum search. When the gradient value at the center of the sliding window is simultaneously greater than its two adjacent values, the center position is marked as a candidate point. Gradient amplitude data of multiple batches of intact washers in the corresponding region are collected, and the historical average gradient amplitude is calculated to be 35 and the historical standard deviation to be 8. The average value plus one standard deviation is used to calculate the peak value benchmark of 43. The gradient values of each candidate point are compared with this benchmark value of 43, and candidate points with values greater than 43 are retained. The distance coordinates corresponding to the prominent values of the retained values in each gradient change curve are used as the gradient coordinates. The peak coordinates are calculated and recorded. The number of peaks that meet the conditions in each gradient change curve is counted and recorded. For example, if two gradient peak coordinates with a distance of 50 and a distance of 60 are detected at a certain angle, the number of peaks at that angle is 2. The intervals are divided according to the adjacent gradient peak coordinates arranged from smallest to largest at the same angle. Taking the above example, the range between 50 and 60 is taken as a data interval. The pixel corresponding to the position of the minimum gradient value in each divided interval is extracted. All data points in the interval are scanned to find the minimum value and the corresponding distance coordinate is recorded. For example, if the minimum value is found at a distance of 55, the point is taken as the trough position. The number of each angle direction is associated with the corresponding trough distance coordinate and the gradient value at the trough. The distribution of each minimum position in different angle directions is recorded. The coordinate summary information of all trough intervals is generated to form the trough pixel distribution.
[0026] The steps for obtaining the spring washer specifications are as follows: Based on the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter, the valley position values in the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter are matched one by one according to the same radiation direction. The difference between each valley position value and the adjacent gradient peak value is calculated. The distribution order of all differences in each radiation direction is counted. The corresponding ratio of the difference to the gradient peak value in each radiation direction is extracted to obtain the difference ratio of each radiation direction. According to each radiation direction, the continuous and uninterrupted pixel segments in the assembly area are retrieved one by one. The number of connected pixels in the corresponding pixel segment of each radiation direction is counted. The difference ratio of each radiation direction and the number of connected pixels in the same radiation direction are matched item by item. The influence order of the degree of difference change on the connectivity range under each radiation direction is recorded. The comprehensive characterization value of each radiation direction is extracted to form the index of spring washer.
[0027] Specifically, based on the previously obtained valley pixel distribution and the gradient peak values within the radial gradient intensity parameters, for each radiation direction within the range of 0 to 359 degrees, the corresponding data set is retrieved. For each radiation direction, the valley position values in the valley pixel distribution and the gradient peak values within the radial gradient intensity parameters are matched one by one. For example, in the 45-degree radiation direction, a gradient peak value of 48, relatively close to the center, is read. The adjacent valley position is found, and the gradient value corresponding to this valley position is read as 12. The difference between each valley position value and its adjacent gradient peak value is calculated. This difference is obtained by subtracting the gradient value of the valley position from the adjacent gradient peak value; for example, subtracting 12 from 48 yields a difference of 36. If within the same radiation direction... If there are multiple trough and peak pairs, the differences between them are calculated sequentially. Following the distance coordinate order from the center outwards, the distribution order of all differences in each radiation direction is statistically analyzed. The corresponding ratio of the difference to the gradient peak value in each radiation direction is extracted by dividing the calculated difference by the corresponding gradient peak value. For example, dividing the difference 36 by the gradient peak 48 yields a ratio of 0.75. If there are multiple ratios in the same direction, all ratios in that direction are traversed, and the ratio with the largest value is extracted as the unique representative data for that angle direction. In this way, the difference calculation and ratio extraction are performed for each of the 360 radiation directions. The maximum ratio corresponding to each direction is saved in a one-dimensional array in the order from 0 degrees to 359 degrees to obtain the difference ratio of each radiation direction.
[0028] Using the previously obtained difference ratios for each radiation direction, the grayscale matrix and screw head center coordinates within the previously locked assembly area are read. The Otsu method is used to binarize the local area of the grayscale matrix, assigning a value of 1 to the grayscale portion of the metal washer entity and a value of 0 to the background portion. For each radiation direction from 0 to 359 degrees, consecutive, uninterrupted pixel segments with a pixel value of 1 in the binarized result within the assembly area are retrieved one by one. The number of connected pixels in the corresponding pixel segment for each radiation direction is counted. For example, if a continuous segment of pixels with a value of 1 is detected on the radiation path at 45 degrees, it is calculated that this segment contains 14 pixels. The previously obtained difference ratios for each radiation direction are matched item by item with the number of connected pixels in the same radiation direction. For example, the difference ratio for the 45-degree direction is 0.75, and its corresponding number of connected pixels is 14. The difference ratios for each radiation direction are recorded. The order of influence of value change on connectivity range was determined by collecting data from historical defect-free assembly samples. The contribution of the ratio to the gasket condition assessment was calculated to be 0.6, and the contribution of the connectivity length was 0.4. These two values were set as fixed weight coefficients. The comprehensive characteristic values of each radiation direction were extracted. The difference ratio of each direction was multiplied by 100 for amplification, and then multiplied by a weight coefficient of 0.6. At the same time, the number of connected pixels was multiplied by a weight coefficient of 0.4. The products of the two were added together. For example, multiplying the ratio 0.75 by 100 gives 75, 75 by 0.6 gives 45, and multiplying the number of connected pixels 14 by 0.4 gives 5.6. Adding 45 and 5.6 gives 50.6. 50.6 is used as the representative value of this 45-degree direction. The same weighted summation calculation is performed for all 360 angular directions. These values are combined in angular order to form the index of the spring washer.
[0029] The steps for obtaining the geometric measurement parameters of concentric circles are as follows: The pixel set of the outermost annular boundary of the flat washer located at the outermost contour position of the flat washer within the assembly area is read. The boundary pixel coordinates of the pixel set of the outermost annular boundary of the flat washer are arranged in angular order. The distance values from each boundary pixel coordinate to the center coordinate of the screw head are extracted. The distance values are merged with the corresponding directional characterization values in the spring washer index item by item. The boundary fit state, radius fluctuation state, and annular closure state at each angular position are statistically analyzed to form concentric circle geometric measurement parameters.
[0030] Specifically, the assembly area image is read, and the image is processed using the Canney edge detection operator. Based on historical experience, a high threshold of 150 and a low threshold of 50 are set to identify all edge contours in the image. The contour that is farthest from the center coordinates of the screw head and is closed is selected as the outer edge boundary of the flat washer. The pixel set of the outer ring boundary of the flat washer located at the outermost contour of the flat washer in the assembly area is read. The boundary pixel coordinates of the outer ring boundary pixel set of the flat washer are arranged in angular order from 0 degrees to 359 degrees. The Euclidean distance from each boundary pixel coordinate to the row and column coordinates of the screw head center is calculated. The distance value from each boundary pixel coordinate to the screw head center coordinate is extracted. For example, the distance value of the boundary pixel in the 90-degree direction from the center is 72 pixels. The distance value is then merged with the corresponding direction characterization value in the previously obtained spring washer index item by item. For example, the distance in the 90-degree direction is 72, and the corresponding comprehensive representation value is 52. 72 and 52 are bound into a data pair. The boundary fitting state at each angle position is statistically analyzed. The absolute value of the difference between the distance values of adjacent angles is calculated. The fitting judgment threshold is set to 2 pixels. If the absolute value of the difference is less than or equal to 2, the fitting state is marked as smooth. The radius fluctuation state is statistically analyzed. The average value of the distance values in 360 directions is calculated. The fluctuation amount is obtained by subtracting the average value from the distance value in each direction. The ring closure state is statistically analyzed. The distance values in the 0-degree direction and the 359-degree direction are read. The absolute value of the difference between the two is calculated. The closure judgment standard is set to the difference being less than 3 pixels. If it is met, it is marked as completely closed. The angle number, distance value, representation value, fitting state, fluctuation amount, and closure state in 360 directions are combined into a multi-dimensional matrix structure to form concentric circle geometric measurement parameters.
[0031] The steps for obtaining gasket fracture assessment parameters are as follows: Read the number of gradient peaks corresponding to each angle position in the geometric measurement parameters of the concentric circle, set the reference interval for the number of ring layers according to the distribution of the number of gradient peaks at each angle position, check the number of gradient peaks at each angle position against the reference interval for the number of ring layers, screen out the angle positions that do not fall into the reference interval for the number of ring layers, record the distance between the gradient peaks corresponding to each angle position that does not fall into the reference interval for the number of ring layers, and form the parameter corresponding to the deviation angle peak distance. The number of all deviation angle positions in the parameters corresponding to the deviation angle peak distance is counted. The peak number deviation corresponding to each deviation angle position is extracted. The gradient peak distance corresponding to each deviation angle position is extracted. The gasket fracture evaluation parameters are calculated using the following formula: in, For parameters to assess gasket fracture, Let represent the total number of deviation angle positions in the parameters corresponding to the deviation angle peak distance, and u represent the index of the u-th deviation angle position in the parameters corresponding to the deviation angle peak distance. Peak number deviation weighting factor, This is used to adjust the contribution of the peak number deviation corresponding to the u-th deviation angle position to the gasket fracture evaluation parameters. This represents the peak number deviation corresponding to the u-th deviation angle position. The calculation formula is: , This represents the number of actual gradient peaks corresponding to the u-th deviation angle position. The boundary value of the reference interval for the number of annular layers is the one that is closest to the actual number of gradient peaks corresponding to the u-th deviation angle position. Let be the distance between the gradient peaks corresponding to the i-th deviation angle position of u. This represents the average distance between gradient peaks corresponding to the angular positions falling within the baseline interval of the annular layer number. The calculation formula is: , Let r be the total number of angular positions falling within the reference interval of the annular layer number, and r be the angular position number falling within the reference interval of the annular layer number. This represents the distance between gradient peaks corresponding to the angle position of the r-th element falling within the reference interval of the annular layer. The standard deviation of the distance between gradient peaks corresponding to the angle positions falling within the baseline interval of the annular layer number. The calculation formula is: , This is a stable quantity in the denominator.
[0032] Specifically, the number of gradient peaks at each angle position in the previously obtained concentric circle geometric measurement parameters is read, and the peak values in 360 directions from 0 degrees to 359 degrees are extracted. A reference interval for the number of annular layers is set according to the distribution of gradient peaks at each angle position. Data from 100 consecutive normally assembled spring washers are extracted, and the number of gradient peaks in each angle direction of these normal samples is counted. The sum of the peak values for all samples at corresponding angles is divided by 100 to obtain an average peak value of 2. The lower limit is set to this average peak value minus 0, and the upper limit is set to the average peak value plus 1, resulting in a reference interval of 2 to 3 for the number of annular layers. The number of gradient peaks at each angle position is checked against the reference interval for the number of annular layers. For example, if the number of gradient peaks in a 90-degree direction is 1, the value of 1 is compared with the reference interval 2 to 3. It is found that 1 is not within this interval. Further comparison is then performed. If the number of gradient peaks in the 180-degree direction is 4, it is also not within this interval. These angle positions that do not fall into the reference interval of the ring layer number are screened out. Traverse 360 angle directions and summarize all abnormal angle direction numbers such as 90 degrees and 180 degrees. Record the distance between gradient peaks corresponding to each angle position that does not fall into the reference interval of the ring layer number. For these screened abnormal angle positions, call the distance coordinate recorded in the concentric circle geometric measurement parameters and calculate the distance difference between two adjacent gradient peaks at the same angle as the distance between gradient peaks. When there is only one gradient peak, extract the distance from the peak to the outer inner diameter of the screw head center as the alternative distance. For example, in the 90-degree direction, there is only one peak with a distance coordinate of 55, and the inner diameter is 45, so its distance is 10. Integrate the numbers of abnormal angle positions with the corresponding distance values to form the deviation angle peak distance corresponding parameters.
[0033] In the calculation formula for gasket fracture assessment parameters, an exponential function is introduced to nonlinearly amplify the fracture or deformation characteristics during the gasket assembly process. The severity of gasket defects is comprehensively assessed by combining the degree of peak deviation and peak distance divergence. This makes minute deformation anomalies stand out in the assessment parameters, thereby improving the sensitivity of gasket fracture detection. Furthermore, by introducing the mean and standard deviation to standardize the distance deviation, the influence of differences in physical dimensions of gaskets of different specifications is eliminated. This represents the total number of deviation angle positions in the parameters corresponding to the deviation angle peak distance. For example, when inspecting the terminal gaskets of a power distribution cabinet, if the peak counts of 15 angle positions are found to be abnormal in the data list, then this number is obtained by iterating and accumulating the statistics. .
[0034] The peak deviation weighting factor is used to adjust the contribution of the peak deviation at the u-th deviation angle position to the gasket fracture assessment parameters. Data from 50 gasket samples with known fracture defects and 50 normal samples generated over three consecutive months were collected. The recall and false alarm rates of the detection parameters under different weighting coefficients were tested using the controlled variable method. The weight was set between 0.5 and 1.5 and adjusted in increments of 0.1. The detection accuracy data after each adjustment was recorded. Comparison showed that the overall assessment accuracy was highest when the weight was 0.8; therefore, it was fixed as a constant. ; The peak number deviation corresponding to the u-th deviation angle position is calculated using the following formula: This parameter is obtained by calculating the absolute value of the difference between the actual number of gradient peaks and the boundary value of the reference interval for the number of ring layers. This parameter is specifically used to measure the degree of absence or abnormal overlap of the reflective metal ring of the gasket at the current angle. The larger the value, the more severe the breakage or overlapping deformation at that location. The extracted actual peak value and boundary value are substituted into this absolute value subtraction formula for numerical calculation. For example, if the actual number of peaks detected at a certain location is 1, and the nearest boundary value of the reference interval is 2, the absolute difference between the two is calculated. The specific value is 1; The actual number of gradient peaks corresponding to the u-th deviation angle position is obtained by extracting the peak statistics under the corresponding angle number from the concentric circle geometric metric parameters. This value objectively reflects the physical number of the metallic ring-shaped reflective bands presented in this local area. By retrieving the previously saved concentric circle geometric metric parameter attribute matrix and reading the number of peaks recorded at the coordinate position according to the original angle coordinates corresponding to the sequence number, the image features are transformed into calculable discrete values. For example, the specific actual number of gradient peaks at the 1st deviation angle position is extracted through matrix indexing. ; To find the boundary value of the annular layer reference interval that is closest to the actual gradient peak number corresponding to the u-th deviation angle position, read the previously set annular layer reference interval values, such as 2 to 3. Calculate the Euclidean distance between the actual peak number and the upper and lower limits of this interval, and extract the boundary value with the smaller distance as the calculation benchmark. When the calculated values of the upper and lower limits are completely equal, to ensure the conservatism of the evaluation, the lower limit value is selected as the boundary value by default. For example, if the actual peak number is 1, the distance difference with the lower limit 2 is 1, and the distance difference with the upper limit 3 is 2. After comparison, the lower limit value with the closer distance is extracted. ; This is the distance between gradient peaks corresponding to the u-th deviation angle position. It is obtained by extracting the distance data corresponding to the u-th position from the dataset of parameters corresponding to the deviation angle peak distance. It reflects the physical spacing of the reflective bands in the spatial distribution within the abnormal area. This parameter originates from the calculation of the spatial difference of the gradient coordinates at the edge of the grayscale matrix and is mainly used to measure the change in pixel spatial span caused by gasket breakage or warping. The unit is uniformly set to pixels. For example, the value of the distance between gradient peaks at the 1st deviation angle position is... ; The average distance between gradient peaks corresponding to angle positions falling within the reference range of the ring layer is obtained by summing the distance values of all normal angle positions and dividing by the total number of normal positions. This represents the average physical distance baseline of the currently detected gasket in its normal shape. The summation of the values is achieved by setting a loop accumulator to traverse all normal position distances. The unit is consistent with the original distance value, which is pixels. For example, the total distance of all normal areas is 3450, and the number of normal positions is 345. The average value is calculated by dividing the two by 10. The total number of angular positions falling within the reference range of the annular layer is calculated by subtracting the previously obtained total number of deviation angular positions from the total number of 360 circumferential directions. The calculation shows that this value reflects the size of the intact area on the circumference of the tested gasket that has not undergone deformation or breakage. A simple subtraction operation is used to count the total number of normal data points, which serves as the denominator in the subsequent calculations of the average and standard deviation formulas. For example, if the circumference is divided into 360 directions and the total number of deviations is 15, then the total number falling within the reference range is obtained through subtraction. ; Let be the distance between gradient peaks corresponding to the r-th angular position falling within the reference interval of the ring layer. The distance between adjacent peaks corresponding to normal positions is extracted from the concentric circle geometric metric parameter matrix. The extraction rule is exactly the same as the method for extracting distances at abnormal positions, except that the parameter's application is limited to normal coordinate points conforming to the layer distribution interval. This data is used to establish a spatial spacing baseline reference for the entire washer under normal morphology, and its dimension is also pixels. For example, the distance value extracted to the first normal position is... ; To determine the standard deviation of the distance between gradient peaks corresponding to angle positions falling within the baseline interval of the annular layer, the squares of the differences between the distances at each normal position and the overall average are summed, then divided by the total number of normal positions, and the square root is taken. This value reflects the dispersion of the spacing fluctuation within the normal region. The unit is consistent with the distance average, both being pixels. For example, by iterating through each normal distance, subtracting the mean, squaring, summing, and taking the square root, the standard deviation is obtained. ; This is a stable denominator used to prevent overflow errors when dividing by zero occur, especially when the distance value fluctuates very little or not at all. ; Calculations based on parameters: when At that time, bring in ; ; Substitute ; Calculate the distance deviation term: ; Calculate the exponent term: ; Calculation results of individual indexes: ; Following the steps above, the remaining 14 deviation angle positions are calculated cyclically in sequence. For example, the exponents obtained by actual detection and formula calculation for the remaining positions are 1.2, 1.5, 1.3, 1.1, 1.4, 1.6, 1.2, 1.3, 1.5, 1.4, 1.2, 1.1, 1.3, and 1.2, respectively. The sum of the calculation results for all 15 deviation angle positions is: 1+1.2+1.5+1.3+1.1+1.4+1.6+1.2+1.3+1.5+1.4+1.2+1.1+1.3+1.2=19.3; Substitute Perform averaging: .
[0035] The result indicates that the current gasket has a slight tendency to break or be missing. Since the value is small and close to 1, it reflects that the peak distance deviation from the angular position is not serious. This value can be further compared with the assembly threshold to output the final defect status judgment result.
[0036] The steps for obtaining the defect status of a gasket that is missing are as follows: Read the assembly threshold, compare the gasket fracture assessment parameter with the assembly threshold, extract the difference between the gasket fracture assessment parameter and the assembly threshold, classify the abnormality according to the positive and negative state and amplitude state corresponding to the difference value, output the corresponding defect judgment result according to the abnormality mark, and generate the gasket missing defect state quantity.
[0037] Specifically, the pre-set assembly threshold is read, and the gasket fracture assessment parameters for the corresponding gasket locations in the previous 1000 normal distribution cabinet assembly records are statistically analyzed. The maximum value of these 1000 parameter values is extracted, and 0.5 is added to this maximum value as the baseline fault tolerance margin. The assembly threshold is calculated to be 1.5. The previously obtained gasket fracture assessment parameters are compared with the assembly threshold. For example, if the gasket fracture assessment parameter calculated earlier is 1.2867, it is compared with 1.5 to extract the difference between the gasket fracture assessment parameter and the assembly threshold. This difference is obtained by subtracting the assembly threshold from the gasket fracture assessment parameter. For example, subtracting 1.5 from 1.2867 yields a difference of -0.2133. Anomalies are classified based on the positive / negative state and amplitude of the difference. The system uses a marking mechanism. When the difference value is less than 0, it is marked as normal assembly. When the difference value is greater than or equal to 0 and less than 1, it is marked as a minor missing part or breakage defect. When the difference value is greater than or equal to 1, it is marked as a severe missing part defect. For example, for the aforementioned difference value of -0.2133, since it is in a negative state less than 0, it is classified and assigned an abnormal mark of normal assembly. Based on the abnormal mark, the corresponding defect judgment result is output. When marked as a severe missing part defect, the system outputs a result of immediately stopping the machine and issuing an audible and visual alarm. When marked as normal assembly, the system outputs a signal to allow the machine to proceed to the next process. The defect judgment result is associated with the coordinate position of the corresponding gasket in the image and the power distribution cabinet number and packaged together. All inspection marks and judgment action data sets are summarized to generate a gasket missing part defect status quantity.
[0038] 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 method for detecting wiring defects in power distribution cabinets based on computer vision, characterized in that, Includes the following steps: Based on the terminal crimping point pixel matrix extracted from the power distribution cabinet wiring terminals, a high-frequency distribution matrix in the frequency domain is established. The pixel texture energy value and texture energy variance in the high-frequency distribution matrix in the frequency domain are extracted to generate scattered strand mutation feature quantity. Based on the scattered strand mutation characteristic quantity, the strand breakage defect is determined, and the center coordinate of the screw head in the assembly area is extracted. The gray-scale gradient value set in the outer ring interval of the screw head is read, the radial gradient intensity parameter is established, the coordinates of each gradient peak and the corresponding number of peaks in the radial gradient intensity parameter are located, and the valley pixel distribution quantity is generated. Based on the distribution of the trough pixels and the peak values of each gradient in the radial gradient intensity parameter, the index of the spring washer is obtained. The pixel set of the outer ring boundary of the flat washer in the assembly area is read. Combined with the index of the spring washer, the geometric metric parameters of the concentric circle are established. Based on the concentric circle geometric measurement parameters, the reference range for the number of annular layers is set, the gasket fracture evaluation parameters are calculated, and the gasket fracture evaluation parameters are compared with the assembly threshold to generate the gasket missing defect status quantity.
2. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the scattered strand mutation feature quantity are as follows: Extract the pixel matrix of terminal crimping points from the terminal wiring terminals of the distribution cabinet. Read the corresponding brightness value according to the row and column coordinates of each pixel position in the terminal crimping point pixel matrix. Map the brightness value point by point according to the original arrangement order of the row and column coordinates. Write a unique corresponding gray value to each pixel position to form a gray matrix. Layered organization is performed around the gray values of each pixel position in the gray matrix. The low-frequency component values of the central region of the gray matrix at different scales are recorded, and the high-frequency sub-band feature values at different directional positions are recorded. The low-frequency component values and multi-directional high-frequency sub-band feature values are combined point by point according to the same pixel position to form the first mixed component. Based on the first mixed component, the high-frequency response values in different directions are summarized according to each pixel position, the frequency distribution state of each pixel position is sorted out to form a frequency domain high-frequency distribution matrix, the pixel texture energy value corresponding to each pixel position in the frequency domain high-frequency distribution matrix is extracted, the texture energy variance corresponding to each pixel position is calculated, and the pixel texture energy value and texture energy variance are calculated item by item to obtain the scattered mutation feature quantity.
3. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the radial gradient intensity parameter are as follows: The positional correspondence of the loose strand mutation feature quantity in the terminal crimping point pixel matrix is read, the distribution state of the loose strand mutation feature quantity in the continuous pixel interval is statistically analyzed, it is determined whether the loose strand mutation feature quantity falls into the interval corresponding to the broken strand defect, the broken strand defect judgment result is output, the circular edge of the screw head in the assembly area is locked according to the broken strand defect judgment result, the row coordinates and column coordinates of the geometric center of the circular edge are extracted, the outer ring interval is set around the center coordinate of the screw head, and the gray level change amplitude of each pixel position in the outer ring interval is read point by point to form the gray level gradient value set of the screw head center; The screw head center coordinates, which are recorded in the gray-scale gradient values of the screw head center, are called. Radiation paths are established from the screw head center coordinates to the outer ring boundary according to different angle directions. The gray-scale gradient values corresponding to each pixel position on each radiation path are extracted in sequence. The gray-scale gradient values are arranged in order of distance from the pixel position to the screw head center coordinates. The projection results on each radiation path are summarized. The gradient change strength and position distribution corresponding to each angle direction are statistically analyzed to form the radial gradient intensity parameter.
4. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the valley pixel distribution are as follows: Based on the radial gradient intensity parameter, the gradient change curves corresponding to each angle direction are retrieved one by one. The gradient peak coordinates corresponding to the prominent value in each gradient change curve are located. The number of peaks in each gradient change curve is counted. Intervals are divided according to the coordinates of adjacent gradient peaks. The pixel point corresponding to the minimum value position in each interval is extracted. The distribution of each minimum position under different angle directions is recorded to form the valley pixel distribution.
5. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the spring washer specifications are as follows: Based on the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter, the valley position values in the valley pixel distribution and the gradient peak values of each item in the radial gradient intensity parameter are matched one by one according to the same radiation direction. The difference between each valley position value and the adjacent gradient peak value is calculated. The distribution order of all differences in each radiation direction is counted. The corresponding ratio of the difference to the gradient peak value in each radiation direction is extracted to obtain the difference ratio of each radiation direction. According to each radiation direction, the continuous and uninterrupted pixel segments in the assembly area are retrieved one by one. The number of connected pixels in the corresponding pixel segment of each radiation direction is counted. The difference ratio of each radiation direction and the number of connected pixels in the same radiation direction are matched item by item. The influence order of the degree of difference change on the connectivity range under each radiation direction is recorded. The comprehensive characterization value of each radiation direction is extracted to form the index of spring washer.
6. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the geometric measurement parameters of the concentric circles are as follows: The pixel set of the outermost annular boundary of the flat washer located at the outermost contour position of the flat washer within the assembly area is read. The boundary pixel coordinates of the pixel set of the outermost annular boundary of the flat washer are arranged in angular order. The distance values from each boundary pixel coordinate to the center coordinate of the screw head are extracted. The distance values are merged with the corresponding directional characterization values in the spring washer index item by item. The boundary fit state, radius fluctuation state, and annular closure state at each angular position are statistically analyzed to form concentric circle geometric measurement parameters.
7. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the gasket fracture assessment parameters are as follows: Read the number of gradient peaks corresponding to each angle position in the concentric circle geometric measurement parameters, set the ring layer reference interval according to the distribution of the number of gradient peaks at each angle position, check the number of gradient peaks at each angle position against the ring layer reference interval, screen out the angle positions that do not fall into the ring layer reference interval, record the distance between gradient peaks corresponding to each angle position that does not fall into the ring layer reference interval, and form the parameter corresponding to the deviation angle peak distance. The number of all deviation angle positions in the parameters corresponding to the deviation angle peak distance is counted, the peak number deviation corresponding to each deviation angle position is extracted, the gradient peak distance corresponding to each deviation angle position is extracted, and the gasket fracture evaluation parameters are calculated.
8. The method for detecting wiring defects in power distribution cabinets based on computer vision according to claim 1, characterized in that, The steps for obtaining the defect status of the missing gasket are as follows: Read the assembly threshold, compare the size of the gasket fracture assessment parameter with the assembly threshold, extract the difference value between the gasket fracture assessment parameter and the assembly threshold, classify the abnormality mark according to the positive and negative state and amplitude state corresponding to the difference value, output the corresponding defect judgment result according to the abnormality mark, and generate the gasket missing installation defect state quantity.