Cable insulation thickness detection method and system based on sub-pixel edge enhancement

By synchronously acquiring cable cross-section images with a multi-band LED ring light source and a telecentric lens, and combining adaptive grayscale equalization and gradient direction histogram peak clustering, sub-pixel-level edge localization is achieved. This solves the problems of uneven illumination and cutting burr noise interference in cable insulation thickness detection, and improves detection accuracy and reliability.

CN122199529APending Publication Date: 2026-06-12STATE GRID SHANXI ELECTRIC POWER COMPANY TAIYUAN POWER SUPPLY COMPANY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID SHANXI ELECTRIC POWER COMPANY TAIYUAN POWER SUPPLY COMPANY
Filing Date
2026-05-12
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing technologies for cable insulation thickness testing suffer from problems such as uneven illumination leading to reflection, noise interference from cutting burrs, insufficient pixel-level positioning accuracy, missed detection of weak boundary areas, and inability to close edge breaks. These issues result in large measurement errors and fail to meet the high-precision testing requirements of high-voltage cables.

Method used

Multi-band LED ring light source and telecentric lens are used to synchronously acquire cable cross-section images. Adaptive gray-level equalization and noise suppression, gradient direction histogram peak clustering and neighborhood gray-level profile sampling are combined. Subpixel-level edge localization is achieved through quadratic polynomial fitting. An edge gradient confidence weighted map is constructed for gradient enhancement and missing edge completion. The complete subpixel edge loop is reconstructed and the insulation layer thickness distribution sequence is calculated.

🎯Benefits of technology

It achieves sub-pixel-level precise edge positioning under complex working conditions, improves the accuracy of insulation thickness measurement, reduces the false judgment rate, and ensures the reliability and accuracy of cable quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122199529A_ABST
    Figure CN122199529A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cable detection, and discloses a cable insulation thickness detection method and system based on sub-pixel edge enhancement, which comprises the following steps: collecting a cable cross-section image, performing adaptive gray balance and noise suppression processing on the cable cross-section image to obtain an enhanced gray image, constructing a gradient direction histogram based on the enhanced gray image, extracting pixel-level edge candidate points, constructing a sub-pixel fitting and edge gradient confidence weighting graph, strengthening a weak boundary to complete a broken part to generate a complete edge loop, calculating the insulation thickness along the circumferential direction and calibrating and determining, and effectively improving the insulation thickness detection precision and the adaptability to complex working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cable inspection technology, and in particular to a method and system for detecting cable insulation thickness based on subpixel edge enhancement. Background Technology

[0002] In the power industry, machine vision inspection technology is commonly used for cable insulation thickness testing during cable production quality inspection, engineering acceptance, and operation and maintenance. This technology acquires optical images of the cable cross-section, identifies the boundary between the insulation and shielding layers based on conventional pixel-level edge detection algorithms, and then calculates the insulation thickness parameters to meet the basic testing requirements for cable quality control. This type of inspection method relies on image grayscale features for edge localization, has relatively simple logic, low computational requirements, and is adaptable to most routine testing conditions.

[0003] During cable maintenance and inspection in an underground utility tunnel along a main urban road, a maintenance engineer used a portable machine vision inspection instrument to measure the thickness of a cut cable section. The instrument's reading of the insulation thickness showed a significant discrepancy with the results obtained using a precision vernier caliper in the laboratory, and the results fluctuated considerably with repeated measurements. The root cause of this problem is that conventional pixel-level edge detection algorithms can only locate pixel-level boundaries with abrupt changes in grayscale. When there are burrs on the cut surface, reflections from the insulation layer causing grayscale interference, or small differences in grayscale between the shielding and insulation layers, the algorithm cannot capture the more precise true boundary position, leading to edge positioning errors. This deviation directly impacts the thickness calculation process, making the measurement results insufficient for the high-precision testing requirements of high-voltage cables. Using these results to determine cable insulation performance could lead to incorrectly classifying qualified cables as unqualified, resulting in unnecessary cable replacement costs and material waste, or overlooking cables with potential insulation deficiencies, causing subsequent cable failures due to insufficient insulation strength, affecting the continuity and safety of power supply. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the present invention aims to provide a cable insulation thickness detection method and system based on subpixel edge enhancement. This method achieves subpixel-level edge localization by performing adaptive gray-level equalization processing on the cable cross-section image, gradient direction histogram peak clustering, and quadratic polynomial fitting of neighborhood gray-level profile sampling. An edge gradient confidence weighted map is constructed to perform gradient enhancement on weak boundary regions, reconstructing complete subpixel edge loop pairs. The insulation layer thickness distribution sequence is calculated from multiple measurement points along the circumference of the cable cross-section. This achieves precise subpixel-level edge localization even under complex conditions such as cross-section cutting burrs, gray-level interference from reflective insulation surface, and small gray-level differences between the shielding layer and the insulation layer boundary. This improves the accuracy of insulation thickness measurement, reduces the false positive rate, and ensures the reliability of cable quality inspection.

[0005] A cable insulation thickness detection method based on subpixel edge enhancement includes:

[0006] S1: Acquire the original image of the cable cross section, perform adaptive gray-level equalization and noise suppression on the original image of the cable cross section to obtain an enhanced gray-level image, construct a gradient orientation histogram based on the enhanced gray-level image, perform peak clustering and dynamic dual threshold extraction on the gradient orientation histogram to obtain a pixel-level edge candidate point set;

[0007] S11: Acquires raw images of cable cross-sections by synchronously triggering an industrial camera with a multi-band LED ring light source;

[0008] S12: Perform adaptive grayscale equalization and noise suppression on the original image of the cable cross-section to obtain an enhanced grayscale image;

[0009] S13: Construct a gradient orientation histogram based on the enhanced grayscale image, and perform peak clustering and dynamic dual threshold extraction on the gradient orientation histogram to obtain a pixel-level edge candidate point set;

[0010] S2: Perform neighborhood grayscale profile sampling and quadratic polynomial fitting on the pixel-level edge candidate point set to obtain the sub-pixel edge coordinate sequence; construct an edge gradient confidence weighted graph based on the sub-pixel edge coordinate sequence, wherein the edge gradient confidence weighted graph is a weighted adjacency structure with each point in the sub-pixel edge coordinate sequence as a node and the gradient confidence between nodes as the edge weight.

[0011] S21: Perform neighborhood grayscale profile sampling on each edge candidate point in the pixel-level edge candidate point set;

[0012] S22: Perform quadratic polynomial fitting on the grayscale profile vector of each edge candidate point to obtain the sub-pixel edge coordinate sequence;

[0013] S23: Construct an edge gradient confidence-weighted map based on sub-pixel edge coordinate sequences;

[0014] S3: Based on the edge gradient confidence weighted map, gradient enhancement and missing edge completion are performed on weak boundary regions to obtain complete sub-pixel edge loop pairs; the complete sub-pixel edge loop pairs include conductor insulation boundary loops and insulation shielding boundary loops, and the complete sub-pixel edge loop pairs are stored in the form of loop topology adjacency linked list. Each element in the loop topology adjacency linked list carries the sub-pixel edge coordinates of that point and the gradient confidence score updated after gradient enhancement;

[0015] S31: Identifying weak boundary regions based on edge gradient confidence-weighted maps;

[0016] S32: Perform gradient enhancement on weak boundary regions;

[0017] S33: Perform missing edge completion on the broken regions in the edge gradient confidence weighted map;

[0018] S34: Generate complete sub-pixel edge loop pairs based on the updated edge gradient confidence weighted map;

[0019] S4: Based on the complete sub-pixel edge loop pair, calculate the insulation layer thickness at multiple measurement points along the circumference of the cable cross-section, generate a thickness distribution sequence, and perform compliance judgment and output a standardized test report based on the thickness distribution sequence;

[0020] S41: Calculate the geometric center of the insulating layer based on complete sub-pixel edge loop pairs;

[0021] S42: Calculate the insulation layer thickness along multiple measurement points in the circumferential direction based on the geometric center of the insulation layer and the complete sub-pixel edge loop pair;

[0022] S43: Perform accuracy self-calibration based on thickness distribution sequence;

[0023] S44: Perform compliance assessment and output standardized test reports based on the calibrated thickness distribution sequence;

[0024] A cable insulation thickness detection system based on subpixel edge enhancement is used to implement the aforementioned cable insulation thickness detection method based on subpixel edge enhancement. The system includes:

[0025] Image preprocessing module: used to acquire original images of cable cross sections, perform adaptive grayscale equalization and noise suppression on the original images of cable cross sections to obtain enhanced grayscale images, construct gradient orientation histograms based on the enhanced grayscale images and perform peak clustering and dynamic dual threshold extraction to obtain a set of pixel-level edge candidate points;

[0026] Sub-pixel edge localization module: used to perform neighborhood grayscale profile sampling and quadratic polynomial fitting on the pixel-level edge candidate point set to obtain a sub-pixel edge coordinate sequence, and to construct an edge gradient confidence weighted map based on the sub-pixel edge coordinate sequence;

[0027] Edge loop reconstruction module: used to perform gradient enhancement and missing edge completion on weak boundary regions based on the edge gradient confidence weighted map, to obtain complete sub-pixel edge loop pairs stored in the form of loop topology adjacency linked list;

[0028] Thickness detection output module: used to calculate the insulation layer thickness based on the complete sub-pixel edge loop at multiple measurement points along the circumference of the cable cross section, generate a thickness distribution sequence, and perform compliance judgment and output a standardized test report based on the thickness distribution sequence.

[0029] Compared to existing technologies, the advantages of this invention are as follows: This invention addresses problems in optical inspection of cable insulation thickness, such as uneven illumination causing reflections, noise interference from cutting burrs, insufficient pixel-level positioning accuracy, missed detection of weak boundary areas, inability to close edge breaks, and uncalibrated system deviations, by establishing a complete automated inspection process. Through a synchronous acquisition scheme using a multi-band LED ring light source and a telecentric lens, specular reflection and magnification distortion are eliminated, ensuring stable image quality. Adaptive median filtering and adaptive gamma correction, which dynamically adjust the window based on grayscale variance, enhance the grayscale distinction between the insulation layer, shielding layer, and conductor layer, suppressing salt-and-pepper noise interference. By using gradient direction histogram peak clustering and dynamic dual-threshold extraction based on the cumulative distribution function, edge candidate points are adaptively screened, avoiding the poor adaptability of fixed thresholds. Sub-pixel-level edge positioning is achieved through quadratic polynomial fitting of the neighborhood grayscale profile, reducing the positioning error to within 0.1 pixels and significantly reducing thickness measurement errors. A weighted edge gradient confidence map is constructed to identify weak boundary regions, and gradient enhancement is performed through the zero-crossing points of the second-order derivative. Cubic spline interpolation is used to complete the fracture edges, resulting in fully closed sub-pixel edge loop pairs. Weighted centroid calculation of the insulation layer's geometric center reduces eccentricity errors, and standard gauge block calibration eliminates system biases, enabling accurate calculation of thickness at multiple measurement points and automated compliance determination. This method improves the accuracy, reliability, and automation of cable insulation thickness detection and is suitable for optical length and thickness measurements. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a flowchart of the cable insulation thickness detection method based on sub-pixel edge enhancement in this invention;

[0032] Figure 2 This is a schematic diagram of multi-band LED ring light source illumination in an embodiment of the present invention;

[0033] Figure 3 This is a schematic diagram of gradient direction histogram peak clustering in an embodiment of the present invention;

[0034] Figure 4 This is a schematic diagram of neighborhood grayscale profile sampling in an embodiment of the present invention;

[0035] Figure 5 This is a schematic diagram of the edge gradient confidence weighted map in an embodiment of the present invention;

[0036] Figure 6 This is a schematic diagram of gradient enhancement in the weak boundary region in an embodiment of the present invention;

[0037] Figure 7 This is a schematic diagram illustrating missing edge completion in an embodiment of the present invention;

[0038] Figure 8 This is a schematic diagram of thickness measurement using the ray intersection method in an embodiment of the present invention;

[0039] Figure 9 This is a functional block diagram of the cable insulation thickness detection system based on subpixel edge enhancement in this invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] Example 1

[0042] Please see Figure 1 As shown, this embodiment provides a cable insulation thickness detection method based on sub-pixel edge enhancement, including:

[0043] S1: Acquire the original image of the cable cross section, perform adaptive gray-level equalization and noise suppression on the original image of the cable cross section to obtain an enhanced gray-level image, construct a gradient orientation histogram based on the enhanced gray-level image, perform peak clustering and dynamic dual threshold extraction on the gradient orientation histogram to obtain a pixel-level edge candidate point set;

[0044] Further, step S1 includes:

[0045] S11: Acquires raw images of cable cross-sections by synchronously triggering an industrial camera with a multi-band LED ring light source;

[0046] Further, step S11 includes:

[0047] S111: Set the illumination angle and light intensity parameters of the multi-band LED ring light source to ensure uniform illumination along the cable cross-section normal, eliminating shadow areas caused by unidirectional illumination. The multi-band LED ring light source includes two types of light-emitting units: white light and near-infrared. The white light band provides high-contrast imaging of the overall cable cross-section contour, while the near-infrared band penetrates minor oil or dust interference on the insulation layer surface, enhancing the grayscale distinction at the interface between the insulation and shielding layers. The multi-band LED ring light source is symmetrically arranged along the optical axis of the industrial camera lens, forming a uniformly illuminated ring area. The illumination angle is set to a preset tilt angle with respect to the cable cross-section normal. This tilt angle is determined to prevent specular reflections from the insulation layer surface from directly entering the camera lens; for example, the tilt angle can be set between 15 and 30 degrees. The light intensity parameter is adjusted according to the cable cross-sectional diameter and the reflectivity of the insulation material. For dark insulation materials, the light intensity parameter is increased appropriately, and for light insulation materials, the light intensity parameter is decreased appropriately to ensure that the gray values ​​of each area in the original image of the cable cross-section are within the effective range of the camera's dynamic range, thus avoiding overexposed or underexposed areas.

[0048] See Figure 2 This is a schematic diagram of multi-band LED ring light source illumination provided in an embodiment of this application. Figure 2 As shown, the central circular area represents the cable cross-section. From the inside out, the areas are the conductor area, insulation layer area, and shielding layer area. The outer ring of rectangular blocks represents multi-band LED light source units. White blocks are white light band emitting units, and gray blocks are near-infrared light band emitting units, with the two bands evenly distributed alternately. The radial arrows emanating from each light source unit indicate that the light is evenly directed towards the cable cross-section, and the dashed ring indicates the coverage area of ​​the evenly illuminated region. In cable cross-section inspection, the cut surface of the insulation layer is usually smooth or semi-smooth. Unidirectional illumination easily produces specular reflection, forming localized high-brightness saturated areas, resulting in the loss of grayscale information in these areas and severely affecting the accuracy of subsequent edge detection. The symmetrical arrangement of the ring light source ensures that the light is evenly incident from all directions, and specular reflection from any direction accounts for only a very small proportion of the total incident light, effectively avoiding the formation of concentrated high-brightness areas. Meanwhile, the alternating configuration of white light and near-infrared bands enables the system to obtain additional grayscale contrast information in areas where the grayscale difference between the shielding layer and the insulation layer is small. This is because the reflectivity difference between different materials in the near-infrared band is usually greater than that in the visible light band, thereby enhancing the grayscale differentiation of the boundary area and providing a high-quality imaging foundation for high-precision edge detection in subsequent steps.

[0049] S112: The industrial camera completes single-frame exposure acquisition under the synchronization of the light source trigger signal, obtaining the original image of the cable cross-section, including the conductor region, insulation layer region, and shielding layer region. The synchronized triggering refers to the fact that the lighting time of the multi-band LED ring light source and the exposure start time of the industrial camera are controlled by the same hardware trigger signal, ensuring that the light source maintains stable output during camera exposure and avoiding inconsistent imaging brightness due to ambient light fluctuations or light source flicker. An area array industrial camera is selected, with a sensor resolution of no less than 5 million pixels and a pixel size of no more than 3.5 micrometers, ensuring that the physical size corresponding to each pixel within the cable cross-section imaging field of view meets the requirements of sub-millimeter level detection accuracy. The industrial camera lens is a telecentric lens. The imaging characteristic of a telecentric lens is that the object-side principal ray is parallel to the optical axis, and the imaging magnification is consistent at different object distances, avoiding magnification distortion caused by different distances between different areas of the cable cross-section and the lens, and ensuring that the geometric proportions of each area in the original image of the cable cross-section are consistent with the actual object.

[0050] S113: Distortion correction is performed on the original cable cross-section image. Based on camera calibration parameters, geometric deformation introduced by lens distortion is eliminated to obtain the corrected original cable cross-section image. The camera calibration parameters include a camera intrinsic parameter matrix and a distortion coefficient vector. The camera intrinsic parameter matrix describes the mapping relationship between the camera sensor coordinate system and the image pixel coordinate system, and the distortion coefficient vector describes the degree of radial and tangential distortion of the lens. The camera calibration parameters are pre-obtained using a checkerboard calibration method. During the deployment phase of the detection system, a standard checkerboard calibration board is used to acquire calibration images at multiple positions and angles within the field of view of the industrial camera. The camera intrinsic parameter matrix and distortion coefficient vector are solved using the Zhang Zhengyou calibration method. The distortion correction process is as follows: the distortion offset of each pixel in the original cable cross-section image is calculated based on the distortion coefficient vector. The coordinates of each pixel are subtracted from the corresponding distortion offset to obtain the corrected coordinates. The grayscale value at the corrected coordinates is sampled in the original image using bilinear interpolation to generate the corrected original cable cross-section image. The original cable cross-section image mentioned in subsequent steps refers to the corrected original cable cross-section image.

[0051] Specifically, the S11 uses a multi-band LED ring light source and an industrial camera to synchronously trigger the acquisition of raw images of the cable cross-section. This design addresses the challenges of complex lighting conditions and unstable image quality in cable cross-section inspection. After cutting, the insulation surface of the cable cross-section is typically smooth or semi-smooth, making it highly susceptible to specular reflection under unidirectional illumination. This creates high-brightness reflective areas whose grayscale values ​​approach saturation, resulting in the loss of boundary information between the reflective areas and surrounding regions, severely impacting the accuracy of subsequent edge detection. The symmetrical arrangement of the ring light source ensures uniform light incidence on the cable cross-section from all directions. Specular reflections from any direction account for only a small portion of the total incident light, preventing the formation of concentrated bright areas in the image. Furthermore, the introduction of the near-infrared band provides additional grayscale contrast information in areas where the grayscale difference between the shielding and insulation layers is small, as the reflectivity difference between different materials in the near-infrared band is typically greater than that in the visible light band. The use of telecentric lenses eliminates the impact of magnification distortion on measurement accuracy. For optical measurement of cable insulation thickness, magnification distortion can cause inconsistent pixel equivalent coefficients at different radial positions in the image, resulting in systematic deviations in the insulation thickness values ​​measured at different azimuth angles on the same cable cross-section.

[0052] S12: Perform adaptive grayscale equalization and noise suppression on the original image of the cable cross-section to obtain an enhanced grayscale image;

[0053] Further, step S12 includes:

[0054] S121: Calculate the global grayscale mean and grayscale variance of the original cable cross-section image. Determine the window size for adaptive median filtering based on the comparison between the grayscale variance and a preset variance threshold. The larger the grayscale variance, the larger the window size. Perform adaptive median filtering on the original cable cross-section image to obtain the filtered image. The global grayscale mean is the arithmetic mean of the grayscale values ​​of all pixels in the original cable cross-section image, and the grayscale variance is the variance of the grayscale values ​​of all pixels relative to the global grayscale mean. The preset variance threshold is determined as follows: Under standard lighting conditions, acquire a cable cross-section image without cutting burrs, calculate the grayscale variance of this image as the baseline variance, and multiply the baseline variance by a preset variance amplification factor to obtain the variance threshold. For example, the variance amplification factor can be set to 1.5. The window size determination rule for adaptive median filtering is as follows: if the gray-level variance is less than the variance threshold, the window size is set to 3 x 3 pixels; if the gray-level variance is greater than or equal to the variance threshold but less than twice the variance threshold, the window size is set to 5 x 5 pixels; if the gray-level variance is greater than or equal to twice the variance threshold, the window size is set to 7 x 7 pixels. The adaptive median filtering process is as follows: For each pixel in the original image of the cable cross-section, the gray values ​​of all pixels are counted within a window centered on that pixel. The median of the gray values ​​within the window is calculated. If the absolute value of the difference between the gray value of the pixel and the median gray value within the window exceeds a preset impulse noise threshold, the gray value of the pixel is replaced with the median gray value within the window. Otherwise, the original gray value remains unchanged. The impulse noise threshold is determined as follows: In a burr-free cable cross-section image acquired under standard illumination, a region with uniform insulation material is selected, and the gray standard deviation of this region is calculated as the reference noise standard deviation. Three times the reference noise standard is regarded as the impulse noise threshold. This threshold aims to effectively identify isolated noise points with significant jumps in gray values ​​compared to their neighbors, while preserving true edge information.

[0055] S122: Calculate the gray-level histogram for the filtered image, and determine the gamma correction coefficient based on the peak distribution of the gray-level histogram. The gray-level histogram is the statistical distribution of the number of pixels corresponding to each gray level from 0 to 255 in the filtered image. The peak distribution is analyzed by identifying the gray level with the most pixels in the gray-level histogram and recording this gray level as the main peak gray level. Specifically, if the main peak gray level is greater than or equal to a preset high gray-level boundary value, the filtered image is determined to be overall too bright, and the gamma correction coefficient is set to a value greater than 1; if the main peak gray level is less than a preset low gray-level boundary value, the filtered image is determined to be overall too dark, and the gamma correction coefficient is set to a value less than 1; if the main peak gray level is between the low gray-level boundary value and the high gray-level boundary value, the gamma correction coefficient is set to 1, and no correction is performed. The high and low grayscale boundary values ​​are determined based on the equal division of the grayscale dynamic range. For example, the high grayscale boundary value can be set to 180, and the low grayscale boundary value can be set to 75. The specific value of the gamma correction coefficient is determined as follows: the main peak grayscale level is normalized to the range of 0 to 1, and the ratio of the natural logarithm of the normalized grayscale value in the target to the natural logarithm of the normalized value is taken as the gamma correction coefficient. The normalized grayscale value in the target is 0.5, corresponding to grayscale level 128. For example, if the main peak grayscale level is 200, and the normalized value is 200 divided by 255, which is approximately 0.784, then the gamma correction coefficient is equal to the natural logarithm 0.5 divided by the natural logarithm 0.784, which is approximately 2.85.

[0056] S123: Perform gamma correction on the filtered image based on the gamma correction coefficient to expand the grayscale distinction between the insulating layer and the conductor layer, as well as between the insulating layer and the shielding layer, to obtain an enhanced grayscale image. The calculation process of gamma correction is as follows: normalize the grayscale value of each pixel in the filtered image to the range of 0 to 1 to obtain a normalized grayscale value; take the normalized grayscale value as a power of the gamma correction coefficient to obtain the corrected normalized grayscale value; then multiply the corrected normalized grayscale value by 255 to map it back to the grayscale range of 0 to 255 to obtain the grayscale value of that pixel in the enhanced grayscale image. When the gamma correction factor is greater than 1, the gray value of pixels with higher original gray values ​​decreases more after correction, which compresses high gray value areas and stretches medium and low gray value areas, thus amplifying the gray value difference between the insulating layer and the shielding layer, which originally had similar gray values. When the gamma correction factor is less than 1, the gray value of pixels with lower original gray values ​​increases more after correction, which stretches low gray value areas, thus amplifying the gray value difference between the originally dark conductor area and the insulating layer.

[0057] Specifically, the adaptive grayscale equalization and noise suppression in S12 are designed to address two main interference factors: burrs and reflections from cable cross-section cutting. During the cable cross-section cutting process, the shearing action between the cutting tool and the insulation material generates randomly distributed burrs and debris on the cut surface. These burrs and debris appear as isolated high- or low-grayscale pixels in the image, i.e., salt-and-pepper noise. Adaptive median filtering dynamically adjusts the window size based on the grayscale variance to adapt to cable cross-sections with different cutting qualities. When the cutting burrs are severe, the grayscale variance increases, and the window size increases accordingly to cover a larger noise area. When the cut surface is relatively smooth, the grayscale variance is small, and the window size decreases to avoid edge blurring caused by excessive smoothing. Gamma correction addresses the issues of reflections on the insulation surface and small grayscale differences between the shielding layer and the insulation layer. It redistributes the grayscale dynamic range through nonlinear grayscale transformation, expanding the grayscale values ​​of the insulation and shielding layers, which were originally concentrated in a narrow grayscale range, to a wider range, providing a larger grayscale gradient for subsequent edge detection. Without the adaptive grayscale equalization and noise suppression in S12, the salt-and-pepper noise in the original image of the cable cross-section will generate a large number of false gradient extrema in the subsequent gradient calculation in S13, which will be incorrectly identified as edge candidate points. At the same time, the low grayscale difference between the insulation layer and the shielding layer will cause the gradient magnitude at the real edge to be lower than the detection threshold and thus be missed, seriously affecting the quality of the pixel-level edge candidate point set.

[0058] S13: Construct a gradient orientation histogram based on the enhanced grayscale image, and perform peak clustering and dynamic dual threshold extraction on the gradient orientation histogram to obtain a pixel-level edge candidate point set;

[0059] Further, step S13 includes:

[0060] S131: Calculate the first-order grayscale gradient components along the horizontal and vertical directions for the enhanced grayscale image. Based on the grayscale gradient components in both directions, calculate the gradient magnitude and gradient direction angle for each pixel. Statistically analyze the gradient direction angles of all pixels at preset angular intervals to construct a gradient direction histogram. The first-order grayscale gradient components are calculated using the Sobel operator. The Sobel operator uses a 3x3 convolution kernel to perform convolution operations on the enhanced grayscale image in both the horizontal and vertical directions, obtaining the horizontal and vertical gradient components for each pixel. The gradient magnitude of each pixel is equal to the square root of the sum of the squares of the horizontal and vertical gradient components. The gradient direction angle of each pixel is equal to the arctangent of the ratio of the vertical to the horizontal gradient components, ranging from 0 to 360 degrees. The gradient orientation histogram is constructed as follows: the angular range from 0 degrees to 360 degrees is divided into several angular intervals according to a preset angular interval. The number of pixels in the enhanced grayscale image whose gradient magnitude is greater than a preset minimum gradient magnitude falls into each angular interval is counted, forming a gradient orientation histogram with the angular interval as the horizontal axis and the number of pixels as the vertical axis. The preset angular interval is determined based on a balance between directional resolution and statistical stability. For example, the angular interval can be set to 5 degrees, then the gradient orientation histogram contains 72 angular intervals. The preset minimum gradient magnitude is used to filter pixels in uniform regions with extremely smooth grayscale changes, avoiding interference from the peak distribution of the gradient orientation histogram caused by the random orientation angles of a large number of low-gradient pixels. For example, the minimum gradient magnitude can be set to the 10th percentile value of the gradient magnitude of all pixels in the enhanced grayscale image.

[0061] S132: Perform peak clustering on the gradient direction histogram, clustering the continuous high-frequency distribution intervals in the gradient direction histogram into several gradient direction main peaks, with each gradient direction main peak corresponding to a main edge direction in the cable cross section;

[0062] Further, step S132 includes:

[0063] S1321: Scan the gradient direction histogram, identify all local maxima, and group local maxima with adjacent angle intervals not exceeding a preset angle merging threshold into the same gradient direction main peak. A local maximum is defined as an angle interval in the gradient direction histogram where the number of pixels in that angle interval is greater than the number of pixels in its two adjacent angle intervals. The preset angle merging threshold is determined based on the curvature variation range of the cable cross-section edge. For circular cross-section cables, the edge direction changes continuously along the circumference, and the gradient direction angle difference between adjacent regions is small. For example, the angle merging threshold can be set to 15 degrees.

[0064] See Figure 3 This is a schematic diagram of gradient direction histogram peak clustering provided in an embodiment of this application. For example... Figure 3 As shown, the horizontal axis represents the gradient direction angle, and the vertical axis represents the number of pixels, i.e., frequency. The gray bar chart represents the statistical distribution of the number of pixels with a gradient magnitude greater than the minimum gradient magnitude within each angle interval. The dashed rectangle in the figure encloses two effective gradient direction main peak cluster regions, corresponding to the main edge directions of the conductor insulation boundary and insulation shield boundary in the cable cross-section, respectively. Local maxima points and the angle merging threshold span between adjacent local maxima points are marked in both main peak regions. The figure also marks a noise main peak region where the cumulative frequency value is lower than the effective peak value threshold (horizontal dashed line). This region corresponds to non-structural noise edges such as cutting burrs or scratches, and is removed after processing. The bottom bracket indicates the final retained effective gradient direction main peak. In cable cross-section inspection, cables of different models and cross-section conditions have different gray-scale gradient distribution characteristics, and traditional fixed-threshold edge detection methods cannot adapt to these differences. By performing peak clustering on the gradient direction histogram, the system can automatically identify the main edge directions in the current cable cross-section and remove noisy edge directions. Based on the frequency distribution of the effective main peak, the dual threshold parameters are dynamically calculated, so that the threshold parameters of edge detection are adaptively adjusted with the actual gradient distribution of the image, avoiding the problem of over- or under-edge detection caused by a fixed threshold.

[0065] S1322: Calculate the cumulative frequency value corresponding to the main peak of each gradient direction. Mark the main peaks of the gradient direction with a cumulative frequency value lower than the preset effective peak threshold as noise main peaks and remove them, retaining the effective gradient direction main peaks. The cumulative frequency value is the sum of the number of pixels in all angle intervals belonging to the same gradient direction main peak. The preset effective peak threshold is determined based on the statistical distribution of the cumulative frequency values ​​of all gradient direction main peaks. The mean of the cumulative frequency values ​​of all gradient direction main peaks is multiplied by a preset effective coefficient as the effective peak threshold. Typically, the effective coefficient is set between 0.2 and 0.5. Its optimal value is obtained by testing and optimizing a sample image library of cables covering different materials and noise levels. A coefficient value that can maximize the distinction between the statistical characteristics of structural edges (such as circular boundaries) and unstructured noise (such as random scratches) is selected, thereby ensuring that interference is filtered out while retaining the effective edge information constituting the cable outline to the maximum extent. The gradient direction main peak with a cumulative frequency value lower than the effective threshold usually corresponds to non-structural noise edges such as cutting burrs and scratches. In the gradient direction histogram, it appears as a scattered, low-amplitude random peak, which has a significant statistical difference from the concentrated high-amplitude main peak corresponding to the real edge of the cable cross section.

[0066] S133: Calculate dynamic dual thresholds based on the effective gradient direction main peak. Specifically, take the cumulative distribution function of gradient magnitudes in the enhanced grayscale image, and use the gradient magnitude corresponding to the cumulative distribution function reaching a preset high percentile as the high threshold. Multiply the high threshold by a preset threshold ratio coefficient to obtain the low threshold. The cumulative distribution function is calculated as follows: sort the gradient magnitudes of all pixels in the enhanced grayscale image with gradient magnitudes greater than the minimum gradient magnitude in ascending order, and calculate the cumulative percentage corresponding to each gradient magnitude, that is, the proportion of pixels with a gradient magnitude less than or equal to that gradient magnitude to the total number of pixels. The preset high percentile is determined based on the proportion of the cumulative frequency value of the main peak in the effective gradient direction to the total number of effective pixels. The larger the proportion, the higher the proportion of edge pixels, and the higher percentile is reduced accordingly to include more edge candidate points. For example, the preset high percentile can be set between the 85th and 95th percentiles. The specific value within the range is determined according to the proportion of the cumulative frequency value of the main peak in the effective gradient direction in the current image. When the proportion is less than 8%, the 95th percentile is taken; when the proportion is between 8% and 12%, the 90th percentile is taken; and when the proportion is greater than 12%, the 85th percentile is taken. The preset threshold ratio coefficient is determined as follows: under standard lighting conditions, a cross-sectional image of a cable without cutting burrs is acquired, and the average gradient amplitude of the conductor insulation boundary loop is extracted as the strong edge gradient feature value, and the average gradient amplitude of the insulation shield boundary loop is extracted as the weak edge gradient feature value. The ratio of the weak edge gradient feature value to the strong edge gradient feature value is calculated as the threshold ratio coefficient. For example, when the strong edge gradient feature value is 120 and the weak edge gradient feature value is 48, the threshold ratio coefficient is set to 0.4.

[0067] S134: All pixels in the enhanced grayscale image are filtered based on a high threshold and a low threshold. Pixels with a gradient magnitude greater than or equal to the high threshold are directly marked as strong edge points. Pixels with a gradient magnitude between the low and high thresholds and spatially adjacent to strong edge points are marked as weak edge points. Strong and weak edge points are merged to obtain a pixel-level edge candidate point set. The criterion for spatial adjacentity is whether the weak edge point is contained within an 8-neighborhood centered on the strong edge point. If it is, the weak edge point is considered spatially adjacent. The data structure of the pixel-level edge candidate point set is in list form. Each element in the list stores the integer pixel row coordinates, integer pixel column coordinates, gradient magnitude, gradient direction angle, and edge intensity label of the edge candidate point. The edge intensity label can be either a strong edge point or a weak edge point.

[0068] Specifically, the peak clustering and dynamic dual-threshold extraction mechanism based on gradient orientation histograms in step S13 is designed to address the issue of different threshold parameters required for edge detection of cables with different models and cross-sectional conditions. Traditional edge detection methods use fixed dual-threshold parameters. When cable models change, leading to changes in cross-sectional size and material, the fixed thresholds cannot adapt to the new gray-level gradient distribution, easily resulting in over- or under-detection of edges. Gradient orientation histograms provide global statistical information on edge directions and gradient magnitude distribution in cable cross-section images. Peak clustering of the gradient orientation histogram can automatically identify the main edge directions in the cable cross-section and eliminate noisy edge directions. Dynamic threshold calculation based on the cumulative distribution function allows the threshold parameters to adaptively adjust with the actual gradient distribution of the image. The pixel-level edge candidate point set output in step S13 provides a coarse localization basis for the sub-pixel edge localization in the subsequent step S2. Without the dynamic dual-threshold extraction in S13, using a fixed threshold may result in a large number of noisy pixels being mixed into the pixel-level edge candidate point set or real edge pixels being missed, directly affecting the accuracy and reliability of sub-pixel fitting in S2. The enhanced grayscale image in step S12 provides the input image with enhanced grayscale contrast for gradient calculation in step S13. The two steps form a synergistic relationship: S12 eliminates noise and enhances contrast in the grayscale domain, while S13 uses the enhanced grayscale information to extract edge candidate points in the gradient domain. If only gradient extraction in S13 is performed without grayscale enhancement in S12, the slight grayscale difference between the shielding layer and the insulation layer will still be below the detection threshold after gradient calculation, resulting in the loss of edge candidate points in this area. If only grayscale enhancement in S12 is performed without dynamic threshold adaptation in S13, although the grayscale contrast of the enhanced image is improved, the fixed threshold still cannot adapt to the gradient distribution differences of different cable cross-sections.

[0069] S2: Perform neighborhood grayscale profile sampling and quadratic polynomial fitting on the pixel-level edge candidate point set to obtain the sub-pixel edge coordinate sequence; construct an edge gradient confidence weighted graph based on the sub-pixel edge coordinate sequence, wherein the edge gradient confidence weighted graph is a weighted adjacency structure with each point in the sub-pixel edge coordinate sequence as a node and the gradient confidence between nodes as the edge weight.

[0070] Further, step S2 includes:

[0071] S21: Perform neighborhood grayscale profile sampling on each edge candidate point in the pixel-level edge candidate point set;

[0072] Further, step S21 includes:

[0073] S211: For each edge candidate point in the pixel-level edge candidate point set, determine the normal sampling direction based on the gradient direction angle calculated in step S131. Take a preset number of sampling points on both sides of the edge candidate point along the normal sampling direction. The normal sampling direction is the direction pointed to by the gradient direction angle of the edge candidate point, i.e., the direction of the most drastic grayscale change, and this direction is perpendicular to the edge tangent direction at the edge candidate point. The preset number is determined to ensure that the grayscale profile can completely cover the transition zone from high grayscale to low grayscale areas on both sides of the edge. For example, the preset number can be set to 3, that is, take 3 sampling points on each side of the normal sampling direction of the edge candidate point, plus the edge candidate point itself, for a total of 7 sampling points. The spacing between adjacent sampling points is 1 pixel.

[0074] See Figure 4 This is a schematic diagram of neighborhood grayscale profile sampling provided in an embodiment of this application. As shown in the figure, the background grid represents the image pixel grid, the concentric circles at the center are marked as edge candidate points, and the hollow circles evenly distributed on both sides along the normal sampling direction are grayscale profile sampling points, a total of 7 sampling points numbered sequentially. In the figure, the direction of the dashed line represents the edge tangent direction, and the direction of the solid arrow represents the normal sampling direction, i.e., the gradient direction, and the two are perpendicular to each other. The spacing between adjacent sampling points is marked as 1 pixel. In the sub-pixel edge localization process of cable cross-section, pixel-level edge detection is limited by pixel discretization. The real edge position is located at continuous coordinates between adjacent pixels, and relying solely on integer pixel coordinates will produce a maximum localization error of 0.5 pixels. By densely sampling on both sides of the edge candidate point along the gradient direction, a grayscale profile vector that completely covers the grayscale transition zone from high to low can be obtained. This profile vector provides sufficient data support for subsequent quadratic polynomial fitting. The selection of the normal sampling direction ensures that the sampling path is along the direction of the most drastic gray-level change, capturing edge transition information to the maximum extent. This allows the extreme position of the gray-level gradient obtained by fitting to accurately reflect the sub-pixel coordinates of the real edge, improving the positioning accuracy from the pixel level to the sub-pixel level.

[0075] S212: For each sampling point, its grayscale value is calculated in the enhanced grayscale image using bilinear interpolation. The grayscale values ​​of the candidate edge point and the sampling points on both sides are arranged according to their distance along the normal sampling direction to form a grayscale profile vector for that candidate edge point. The bilinear interpolation refers to the weighted average of the grayscale values ​​at the four integer pixel coordinates surrounding the sampling point when the coordinates of the sampling point are non-integer pixel coordinates, based on the distance weights in the horizontal and vertical directions, to obtain the interpolated grayscale value at that sampling point. The grayscale profile vector is a one-dimensional vector with a length equal to the total number of sampling points. The elements in the vector are arranged in order from one side to the other along the normal sampling direction, and the value of each element is the grayscale value of the corresponding sampling point.

[0076] S22: Perform quadratic polynomial fitting on the grayscale profile vector of each edge candidate point to obtain the sub-pixel edge coordinate sequence;

[0077] Further, step S22 includes:

[0078] S221: Using the relative distance along the normal sampling direction as the independent variable and the gray value of each sampling point in the gray-scale profile vector as the dependent variable, a quadratic polynomial is fitted using the least squares method to obtain the coefficients of the quadratic polynomial. The relative distance is taken as the origin of the edge candidate point, with one side along the normal sampling direction as the positive direction and the other side as the negative direction. The relative distance of each sampling point is taken as an integer value in pixels. The form of the quadratic polynomial is that the gray value is equal to the quadratic coefficient multiplied by the square of the relative distance, plus the linear coefficient multiplied by the relative distance, plus the constant coefficient. The solution process of the least squares method is as follows: Construct a Vandermonde matrix with the relative distance of each sampling point as the row. Use the inverse matrix of the product of the transpose of the Vandermonde matrix and the Vandermonde matrix, and then multiply it by the product of the transpose of the Vandermonde matrix and the gray-scale profile vector to obtain the coefficients of the quadratic polynomial. The coefficients of the quadratic polynomial include the quadratic coefficient, the linear coefficient, and the constant coefficient.

[0079] S222: Take the first derivative of the quadratic polynomial and set it to zero to obtain the sub-pixel offset corresponding to the grayscale gradient extremum. The first derivative of the quadratic polynomial is equal to twice the coefficient of the quadratic term multiplied by the relative distance plus the coefficient of the first term. Setting the first derivative to zero, the sub-pixel offset is equal to the negative coefficient of the first term divided by twice the coefficient of the quadratic term. This sub-pixel offset represents the offset distance of the true edge position relative to the integer pixel coordinates of the edge candidate point in the normal sampling direction, and its absolute value is usually less than 0.5 pixels. If the absolute value of the sub-pixel offset is greater than or equal to 1 pixel, it indicates that the pixel-level positioning deviation of the edge candidate point is too large or the grayscale profile of the point does not meet the edge transition characteristics. The edge candidate point is then removed from the pixel-level edge candidate point set and does not participate in subsequent processing. For example, suppose that a candidate edge point is fitted with a quadratic polynomial and the coefficient of the quadratic term is -15.2, the coefficient of the linear term is 4.6, and the coefficient of the constant term is 180.3. Then the subpixel offset is equal to -4.6 divided by twice -15.2, which equals 0.151 pixels. This means that the real edge position is offset by 0.151 pixels in the positive direction of the normal sampling direction.

[0080] S223: Add the component of the sub-pixel offset along the normal sampling direction to the integer pixel coordinates of the edge candidate point to obtain the sub-pixel edge coordinates corresponding to the edge candidate point; sort the sub-pixel edge coordinates of all edge candidate points in the pixel-level edge candidate point set according to the angle along the circumference of the cable cross-section to generate a sub-pixel edge coordinate sequence. The component of the sub-pixel offset along the normal sampling direction is decomposed into a horizontal component and a vertical component. The horizontal component is equal to the sub-pixel offset multiplied by the cosine of the gradient direction angle, and the vertical component is equal to the sub-pixel offset multiplied by the sine of the gradient direction angle. The row coordinate of the sub-pixel edge coordinate is equal to the integer pixel row coordinate of the edge candidate point plus the vertical component, and the column coordinate is equal to the integer pixel column coordinate of the edge candidate point plus the horizontal component. The circumferential angle is calculated as follows: taking the geometric center of the original cable cross-section image as the origin of polar coordinates, calculate the polar angle of each sub-pixel edge coordinate relative to the origin of polar coordinates. The geometric center of the original cable cross-section image is the coordinate point corresponding to half of the number of rows and half of the number of columns of the image. The subpixel edge coordinate sequence is in list form. The elements in the list are arranged in ascending order of circumferential angle. Each element stores the row and column coordinates of the subpixel edge point, the gradient magnitude, the gradient direction angle, and the circumferential angle.

[0081] S23: Construct an edge gradient confidence-weighted map based on sub-pixel edge coordinate sequences;

[0082] Further, step S23 includes:

[0083] S231: For each sub-pixel edge point in the sub-pixel edge coordinate sequence, calculate the fitting curvature based on the absolute value of the second derivative of its corresponding quadratic polynomial at the extreme value of the gray-level gradient. The larger the fitting curvature, the more drastic the gray-level change at that edge. Simultaneously, calculate the sum of squared residuals of the fitting quadratic polynomial corresponding to that sub-pixel edge point. The smaller the sum of squared residuals, the higher the fitting accuracy. The second derivative is the second derivative of the quadratic polynomial, equal to twice the coefficient of the quadratic term, and the absolute value of the second derivative is the fitting curvature. The calculation process of the sum of squared residuals is as follows: sum the squares of the differences between the actual gray-level value of each sampling point in the gray-level profile vector and the predicted gray-level value of the quadratic polynomial at the relative distance of that sampling point.

[0084] S232: The gradient confidence score for each sub-pixel edge point is obtained by weighting the fitted curvature with the reciprocal of the sum of squared residuals. Specifically, the formula for calculating the gradient confidence score is as follows:

[0085] ;

[0086] in, For the first Gradient confidence scores of sub-pixel edge points For the first The coefficients of the quadratic term in the quadratic polynomial corresponding to each sub-pixel edge point This represents the maximum absolute value of the second derivative of all sub-pixel edge points in the sub-pixel edge coordinate sequence. For the first Sum of squared residuals at sub-pixel edge points This represents the minimum sum of squared residuals of all sub-pixel edge points in the sub-pixel edge coordinate sequence. This is the curvature weighting coefficient. The residual weight coefficients are the curvature weight coefficient and the residual weight coefficient, respectively, and their sum equals 1. The physical meaning of this formula is as follows: the fitted curvature, normalized by the ratio to the maximum fitted curvature, represents the ranking of the intensity of grayscale change at the sub-pixel edge point relative to all edge points. A larger fitted curvature indicates a more pronounced grayscale jump, making it more likely to be a true edge rather than a gradual transition region. The residual sum of squares, normalized by the reciprocal of the ratio to the minimum residual sum of squares, represents the ranking of the quadratic polynomial fitting accuracy of the sub-pixel edge point relative to all edge points. A smaller residual sum of squares indicates that the grayscale profile better matches the parabolic transition characteristics of an ideal edge, and the higher the reliability of the fitting result. The curvature weight coefficient and the residual weight coefficient are determined based on the following: in scenarios where the boundary between the shielding layer and the insulating layer is blurred, fitting accuracy reflects the reliability of edge positioning more effectively than the intensity of grayscale change. Therefore, the residual weight coefficient should be slightly larger than the curvature weight coefficient. For example, the curvature weight coefficient can be set to 0.4, and the residual weight coefficient can be set to 0.6. For example, suppose the quadratic coefficient of a subpixel edge point is -15.2, then the absolute value of the second derivative is 30.4. If the absolute value of the largest second derivative in the subpixel edge coordinate sequence is 52.0, the sum of squares of the residuals at that point is 8.5, and the sum of squares of the smallest residuals is 2.1, then the gradient confidence score is equal to 0.4 multiplied by 30.4 divided by 52.0 plus 0.6 multiplied by 2.1 divided by 8.5, which equals 0.4 multiplied by 0.585 plus 0.6 multiplied by 0.247, which equals 0.234 plus 0.148, which equals 0.382.

[0087] See Figure 5 This is a schematic diagram of the edge gradient confidence weighted map provided in an embodiment of this application. For example... Figure 5As shown, nodes arranged along the circumferential angle represent sub-pixel edge points. Solid nodes represent high-confidence edge points, and hollow nodes represent low-confidence edge points, i.e., weak nodes. Each node is labeled with its gradient confidence score C. The lines connecting adjacent nodes represent weighted edges, with line thickness reflecting the edge weight. Thick lines represent high-confidence edges, and thin lines represent low-confidence edges. Each edge is labeled with its weight, calculated as the harmonic average of the gradient confidence scores of the two endpoints. The area enclosed by the dashed rectangle in the figure is marked as a weak boundary region, where the gradient confidence scores of nodes are significantly lower than those of nodes on either side. In cable cross-section inspection, the grayscale difference between the shielding layer and the insulation layer is usually small. Edge points in this region have low fitting curvature and large residual sum of squares, resulting in low gradient confidence scores. The edge gradient confidence weighted map organizes discrete sub-pixel edge points into a weighted graph structure, allowing each edge point to carry topological relationships and confidence quantification information with its neighboring edge points. Using the harmonic mean instead of the arithmetic mean as the edge weights significantly reduces the edge weight when one of the two adjacent nodes has a low confidence level. This allows for the rapid location of weak boundary regions by traversing low-weight edges, providing accurate region location data for subsequent gradient enhancement operations.

[0088] S233: Using each sub-pixel edge point in the sub-pixel edge coordinate sequence as a node, for two adjacent nodes in the circumferential angle sorting, the harmonic mean of the gradient confidence scores of the two nodes is used as the weight of the edge connecting the two nodes; for two non-adjacent nodes in the circumferential angle sorting but whose spatial Euclidean distance is less than a preset adjacency distance threshold, the harmonic mean of the gradient confidence scores is also calculated as the weight of the edge; all nodes and weighted edges constitute an edge gradient confidence weighted graph. The harmonic mean is calculated as follows: the harmonic mean of the gradient confidence scores of two nodes is equal to twice the product of the two gradient confidence scores divided by the sum of the two gradient confidence scores. The harmonic mean is chosen instead of the arithmetic mean as the edge weight because the harmonic mean is more sensitive to the smaller of the two values. When one of the two adjacent nodes has a low gradient confidence score, the harmonic mean will be significantly lower than the arithmetic mean, thus making the edge containing the low-confidence node easier to detect in subsequent weak boundary recognition. The preset adjacency distance threshold is determined based on the typical spatial distance between adjacent edge points in the cable cross-section image. For example, the adjacency distance threshold can be set to 5 pixels.

[0089] S234: The data structure of the edge gradient confidence weighted graph includes a node attribute table and an edge weight adjacency table. The node attribute table stores the sub-pixel edge coordinates, gradient direction angle, gradient confidence score, and boundary category label of each node. The edge weight adjacency table stores the start and end node indices and the weight of each edge. The boundary category label includes two categories: conductor insulation boundary and insulation shielding boundary. The classification is assigned based on the distance between the radial position of the sub-pixel edge point in the enhanced grayscale image and the geometric center of the cable cross-section. Specifically, the classification method is as follows: calculate the Euclidean distance from all sub-pixel edge points in the sub-pixel edge coordinate sequence to the geometric center of the original cable cross-section image; perform cluster analysis on all Euclidean distances; and use the Otsu's method to divide all Euclidean distances into two groups: the group with smaller Euclidean distances corresponds to conductor insulation boundaries, and the group with larger Euclidean distances corresponds to insulation shielding boundaries. The execution process of the Otsu's method is as follows: Iterate through all possible segmentation thresholds. For each threshold, group sub-pixel edge points with an Euclidean distance less than the threshold into one group, and group sub-pixel edge points with an Euclidean distance greater than or equal to the threshold into another group. Calculate the inter-class variance between the two groups, and select the threshold that maximizes the inter-class variance as the final classification threshold. The node attribute table is a two-dimensional table, with each row corresponding to a node. Column fields include node index, row coordinates of sub-pixel edge coordinates, column coordinates of sub-pixel edge coordinates, gradient direction angle, gradient confidence score, and the label of the boundary category. The edge weight adjacency table is a list, with each element containing the starting node index, ending node index, and edge weight.

[0090] Specifically, S2 improves edge localization accuracy from pixel-level to sub-pixel-level by using neighborhood grayscale profile sampling and quadratic polynomial fitting. It also assigns a quantitative evaluation of confidence to each sub-pixel edge point by constructing an edge gradient confidence weighted map. The localization accuracy of pixel-level edge detection is limited by pixel discretization; the true edge position lies at a continuous coordinate between adjacent pixels, but pixel-level detection can only locate it to the nearest integer pixel coordinate, resulting in a maximum localization error of 0.5 pixels. In cable insulation thickness detection, when the pixel equivalent coefficient of the imaging system is 0.02 mm per pixel, a localization error of 0.5 pixels corresponds to a thickness measurement error of 0.01 mm. Sub-pixel localization can reduce the localization error to within 0.1 pixels, corresponding to a thickness measurement error of 0.002 mm, significantly improving measurement accuracy. The physical basis of quadratic polynomial fitting lies in the fact that the gray-level transition profile at the ideal edge approximates the result of convolution between a step function and a Gaussian kernel. The first derivative of this convolution result approximates a Gaussian function, and the local extrema of the Gaussian function can be accurately approximated by a quadratic polynomial. Therefore, the extrema of the first-order gray-level gradient can be precisely located through the extrema of the quadratic polynomial. The construction of the edge gradient confidence weighted map organizes discrete sub-pixel edge points into a weighted graph structure, making each edge point no longer an isolated coordinate point, but structured data carrying topological relationships and confidence information with adjacent edge points. This graph structure provides direct input data and topological basis for weak boundary identification and missing edge completion in step S3. Weak boundary regions can be located by traversing the low-weight edges in the edge weight adjacency list, and gaps can be found by checking node connectivity. Without the construction of the edge gradient confidence weighted map, step S3 would be unable to distinguish between strong and weak edge regions, and would only perform indiscriminate processing on all sub-pixel edge points, leading to unnecessary computational overhead and potential over-enhancing noise in strong edge regions during gradient enhancement operations.

[0091] S3: Based on the edge gradient confidence weighted map, gradient enhancement and missing edge completion are performed on weak boundary regions to obtain complete sub-pixel edge loop pairs; the complete sub-pixel edge loop pairs include conductor insulation boundary loops and insulation shielding boundary loops, and the complete sub-pixel edge loop pairs are stored in the form of loop topology adjacency linked list. Each element in the loop topology adjacency linked list carries the sub-pixel edge coordinates of that point and the gradient confidence score updated after gradient enhancement;

[0092] Further, step S3 includes:

[0093] S31: Identifying weak boundary regions based on edge gradient confidence-weighted maps;

[0094] Further, step S31 includes:

[0095] S311: Traverse the edge weight adjacency list of the edge gradient confidence weighted graph, calculate the weight of each edge, and mark edges with weights lower than a preset weak boundary weight threshold as weak boundary edges. The preset weak boundary weight threshold is determined based on the statistical distribution of the weights of all edges in the edge gradient confidence weighted graph. The 25th percentile value of all edge weights is taken as the weak boundary weight threshold. For example, if the 25th percentile value after sorting all edge weights is 0.18, then the weak boundary weight threshold is set to 0.18. The 25th percentile is selected as the threshold because in a typical cable cross-section image, the edge points in the boundary region between the shielding layer and the insulation layer account for about one-quarter to one-third of the total number of edge points. The edge gradient confidence scores in this region are generally low, and the corresponding edge weights are concentrated in the low weight range.

[0096] S312: In the edge gradient confidence weighted graph, connected regions are expanded using weak boundary edges as seeds. Nodes connected to weak boundary edges whose endpoint gradient confidence scores are lower than a preset weak node threshold are grouped into the same weak boundary region, resulting in a set of weak boundary regions. Each weak boundary region in the set contains several consecutive weak nodes and weak boundary edges. The preset weak node threshold is determined by multiplying the median gradient confidence score of all nodes in the node attribute table by a preset weakening coefficient. The weakening coefficient is determined by: acquiring cable cross-section images under standard lighting conditions, statistically analyzing the ratio of the gradient confidence score of low-confidence nodes in the insulation shield boundary region due to small grayscale differences to the median gradient confidence score of all nodes, and taking the mean of this ratio as the weakening coefficient. For example, the weakening coefficient can be set to 0.5 to 0.7. The process of connected component expansion is as follows: Select any weak boundary edge that has not yet been assigned to any weak boundary region as a seed edge. Add the two endpoints of this seed edge to the current weak boundary region. Then, check other nodes connected to these two endpoints through the edge weight adjacency list. If the weight of the connecting edge is lower than the weak boundary weight threshold and the gradient confidence score of the node is lower than the weak node threshold, add the node and its corresponding connecting edge to the current weak boundary region. Repeat the above expansion process until expansion can no longer continue, forming a weak boundary region. Repeat the above process for all weak boundary edges that have not yet been assigned to a weak boundary region until all weak boundary edges have been processed. The data structure of the weak boundary region set is in list form, with each element containing a list of node indices and a list of weak boundary edge indices for a weak boundary region.

[0097] S313: For each weak boundary region in the set of weak boundary regions, record its starting angle and ending angle in the sub-pixel edge coordinate sequence, as well as the boundary category label of each node in the weak boundary region. The starting angle is the circumferential angle of the node with the smallest circumferential angle in the weak boundary region, and the ending angle is the circumferential angle of the node with the largest circumferential angle in the weak boundary region.

[0098] S32: Perform gradient enhancement on weak boundary regions;

[0099] Further, step S32 includes:

[0100] S321: For each weak boundary region in the set of weak boundary regions, extract the gray-level profile vector of each weak node within the weak boundary region along the normal sampling direction in the enhanced gray-level image. Perform a second-order differential operation on the gray-level profile vector to obtain a second-order gray-level gradient profile. The normal sampling direction is the direction pointed to by the gradient direction angle calculated in step S131 for the weak node. The extraction method of the gray-level profile vector is the same as in steps S211 and S212, but the number of sampling points is increased to twice the original preset number, that is, 6 sampling points are taken on each side of the weak node, plus the weak node itself, for a total of 13 sampling points, in order to expand the sampling range to cover the gray-level gradient region. The reason for expanding the sampling range is that the gray-level transition band of the weak boundary region is usually wider than that of the strong boundary region, and more sampling points are needed to capture the complete gray-level change trend. The second-order differential operation is performed as follows: For the gray values ​​of three adjacent sampling points in the gray-level profile vector, calculate the second-order difference value of the middle sampling point, which is equal to the gray value of the next sampling point minus twice the gray value of the middle sampling point plus the gray value of the previous sampling point. The second-order gray-level gradient profile of the weak node is calculated in sequence. The second-order gray-level gradient profile is a one-dimensional vector, and the vector length is equal to the total number of sampling points minus 2.

[0101] S322: The second-order gray-level gradient profiles of all weak nodes within the same weak boundary region are weighted and superimposed along the circumferential direction. The weight is the proportion of the original gradient confidence score of the weak node to the sum of the gradient confidence scores of all weak nodes within the weak boundary region, resulting in the cumulative gradient enhancement profile of the weak boundary region. The physical meaning of weighted superposition is to fuse the gray-level transition information of multiple weak nodes within the weak boundary region. Weak nodes with higher gradient confidence scores contribute more to the fusion result because their gray-level profiles are more likely to reflect the true boundary transition characteristics rather than noise interference. The prerequisite for weighted superposition is that the lengths of the second-order gray-level gradient profiles of all weak nodes within the same weak boundary region are consistent. This condition is guaranteed by the uniformly increased number of sampling points in step S321. The cumulative gradient enhancement profile is a one-dimensional vector with the same length as the second-order gray-level gradient profile of each weak node.

[0102] See Figure 6This is a schematic diagram of gradient enhancement in a weak boundary region provided in this application embodiment. As shown in the figure, the left side displays the second-order gray-level gradient profile curves of multiple weak nodes within the weak boundary region. Each curve is marked with a zero-crossing point, and the confidence weight level is indicated below each weak node. The arrow in the middle indicates a weighted superposition operation. The right side shows the cumulative gradient enhancement profile obtained after superposition, where the signal amplitude at the zero-crossing point is significantly enhanced compared to the profile of a single weak node. The lower part of the figure shows the edge position correction process. Hollow dots represent the original sub-pixel edge coordinates, and solid dots represent the enhanced sub-pixel edge coordinates. The arrow between them indicates the correction amount determined by the zero-crossing point location. The dashed line connects the zero-crossing point of the cumulative gradient enhancement profile with the enhanced edge coordinates. In areas where the gray-level difference between the shielding layer and the insulation layer boundary is small in the cable cross-section, the extreme point of the first-order gray-level gradient of a single weak node cannot accurately reflect the true boundary position. However, the zero-crossing point of the second-order derivative can achieve precise positioning at the inflection point of the gray-level change rate. By weighted superposition of the second-order gray-level gradient profiles of multiple adjacent weak nodes, the zero-crossing points caused by the real boundary are in the same position in each profile, and their signals are enhanced. Meanwhile, the false zero-crossing points caused by random noise are suppressed due to their dispersed positions, thus achieving reliable edge position correction in the weak boundary region.

[0103] S323: Locate the zero-crossing point in the cumulative gradient enhancement profile. The sub-pixel offset corresponding to the zero-crossing point is the edge position correction amount after gradient enhancement. Correct the sub-pixel edge coordinates of each weak node in the weak boundary region according to the edge position correction amount to obtain the enhanced sub-pixel edge coordinates. The zero-crossing point refers to the position in the cumulative gradient enhancement profile where the value changes from positive to negative or from negative to positive. The precise position of the zero-crossing point is determined by linear interpolation: take two adjacent sampling points on both sides of the zero-crossing point, and perform linear interpolation with the second-order gray-level gradient value of the two sampling points as the dependent variable and the relative distance as the independent variable. The relative distance where the second-order gray-level gradient value is equal to zero is the precise position of the zero-crossing point. If there are multiple zero-crossing points in the cumulative gradient enhancement profile, select the zero-crossing point closest to the original sub-pixel offset as the edge position correction amount. The edge position correction amount represents the offset correction value of the true edge position in the weak boundary region relative to the original sub-pixel edge coordinates in the normal sampling direction. The enhanced subpixel edge coordinates are calculated as follows: the original subpixel edge coordinates of each weak node are added to the horizontal and vertical components of the edge position correction along the normal sampling direction. The component decomposition method is the same as in step S223.

[0104] S324: Recalculate the grayscale profile vector based on the enhanced subpixel edge coordinates and perform quadratic polynomial fitting. Recalculate the gradient confidence score according to the methods in steps S231 and S232, and update the node attribute table of the edge gradient confidence weighted map with the recalculated gradient confidence score. Specifically, using the enhanced subpixel edge coordinates as the new center position, sampling points are taken on both sides according to the original preset number in step S211. Grayscale values ​​are calculated through bilinear interpolation to form a new grayscale profile vector. Quadratic polynomial fitting is performed on the new grayscale profile vector according to steps S221 to S222 to obtain new quadratic polynomial coefficients. Based on the new quadratic polynomial coefficients, the new fitting curvature and residual sum of squares are calculated according to step S231. The new gradient confidence score is calculated according to the formula in step S232. The subpixel edge coordinates of the weak node in the node attribute table are updated to the enhanced subpixel edge coordinates, and the gradient confidence score is updated to the recalculated gradient confidence score. At the same time, update the weights of all edges associated with the weak node in the edge weight adjacency table, and recalculate the edge weights according to the harmonic average calculation method in step S233.

[0105] Specifically, the gradient enhancement operation in S32 is designed to address the edge positioning ambiguity caused by the small grayscale difference between the shielding layer and the insulation layer. In the cable cross-section, the shielding layer is usually made of semi-conductive material, and its grayscale value is close to that of the insulation layer. The grayscale transition bandwidth between the two is wide and the gradient value is low, making it difficult for the extreme points of the first-order grayscale gradient to accurately reflect the true boundary position. The second-order differential operation detects the rate of change of grayscale. Even if the first-order gradient value is low, as long as there is an inflection point in the rate of change of grayscale, the second-order differential value will still cross zero at the inflection point. Therefore, the zero-crossing point of the second-order differential can more accurately locate the edge position in weak boundary regions with low grayscale gradient values. The weighted superposition of second-order gray-level gradient profiles of multiple weak nodes has a signal enhancement effect in the spatial direction. The second-order gray-level gradient profile of a single weak node may have multiple false zero-crossings due to random noise. However, after superimposing the profiles of multiple adjacent weak nodes, the positions of the zero-crossings caused by the real boundary in each profile are basically consistent. After superposition, the signal amplitude is enhanced. Meanwhile, the positions of the false zero-crossings caused by random noise in each profile are randomly distributed. After superposition, their amplitude is suppressed by averaging.

[0106] S33: Perform missing edge completion on the broken regions in the edge gradient confidence weighted map;

[0107] Further, step S33 includes:

[0108] S331: Based on their respective boundary category labels, the nodes in the edge gradient confidence weighted graph are divided into a conductor insulation boundary node subset and an insulation shield boundary node subset. The angular intervals between adjacent nodes in each of the two subsets are checked according to circumferential angle sorting. If the angular interval exceeds a preset maximum allowable angular interval threshold, the interval is marked as a break gap. The preset maximum allowable angular interval threshold is determined by multiplying the median of the angular intervals of all adjacent nodes in the same subset by a preset break judgment multiple. The break judgment multiple is determined by: acquiring cable cross-section images containing typical defects such as cutting burrs and local reflections under standard lighting conditions; calculating the ratio of the angular interval at the actual break gap to the angular interval of the digits in the same subset; and taking the minimum value of all actual break gap ratios, rounded down as the break judgment multiple. This ensures that all actual break gaps can be detected and that normal continuous areas are not misjudged. For example, the break judgment multiple can be set to 2 to 4. The reason for the break gap is that the edge within this angle range was not detected as a pixel-level edge candidate point in step S1 due to factors such as cutting burrs blocking the edge or severe local reflection, or was rejected in step S22 because the grayscale profile does not meet the edge transition characteristics.

[0109] S332: For each fracture gap, several adjacent nodes at both ends of the fracture gap are taken as control points. Cubic spline interpolation is performed using the sub-pixel edge coordinates of the control points as constraints. Within the angular range of the fracture gap, the sub-pixel edge coordinates of the completed edge points are generated according to a preset interpolation angle step size. The number of the several adjacent nodes is 3 nodes at each end of the fracture gap, for a total of 6 control points. Cubic spline interpolation uses the circumferential angle of the control points as the independent variable and the row and column coordinates of the sub-pixel edge coordinates of the control points as dependent variables, respectively, to construct two cubic spline functions. Within the angular range of the fracture gap, the corresponding row and column coordinates are calculated according to the preset interpolation angle step size to generate the sub-pixel edge coordinates of the completed edge points. The preset interpolation angle step size is consistent with the angle interval used in step S131 to construct the gradient direction histogram, ensuring that the density of the completed edge points is comparable to the density of the original edge points.

[0110] See Figure 7 This is a schematic diagram of missing edge completion provided in an embodiment of this application. For example... Figure 7As shown, solid square nodes connected by solid lines represent existing sub-pixel edge points and their connections. The broken area in the middle is marked as a fracture gap, with three control points at each end of the fracture gap for constraining interpolation calculations. The dashed curve represents the completion interpolation curve generated by cubic spline interpolation, with hollow square nodes on the curve representing completion edge points. The arc-shaped bidirectional arrow at the bottom of the figure indicates the angular span of the fracture gap. In cable cross-section inspection, fracture gaps are usually caused by cutting burrs obscuring the edges or severe local reflections, resulting in edges within that angular range not being detected or removed in previous steps. If a fracture gap exists in the edge loop, rays at certain measurement azimuth angles cannot intersect with the edge loop, leading to missing insulation thickness values ​​at that azimuth angle and preventing the generation of a complete thickness distribution sequence. Cubic spline interpolation uses the sub-pixel edge coordinates of the three control points at each end of the fracture gap as geometric constraints to ensure the coordinate continuity and curvature continuity between the completed area and the existing edges at the connection point. This ensures a smooth transition of the completed edge loop at the fracture gap, avoiding geometric abrupt changes that could affect thickness measurement accuracy.

[0111] S333: For each completed edge point, perform grayscale profile sampling and quadratic polynomial fitting in the enhanced grayscale image according to the methods in steps S211 to S222, and calculate its gradient confidence score. If the gradient confidence score of the completed edge point is lower than the preset effective completion threshold, the average gradient confidence score of the control points at both ends of the fracture gap is used instead. The preset effective completion threshold is determined based on half of the weak boundary weight threshold. For example, if the weak boundary weight threshold is 0.18, the effective completion threshold is set to 0.09. A gradient confidence score of the completed edge point lower than the effective completion threshold indicates that there is indeed no obvious grayscale change at this location in the enhanced grayscale image. Its subpixel edge coordinates mainly rely on geometric inference from cubic spline interpolation rather than image grayscale information. In this case, the average gradient confidence score of the control points at both ends of the fracture gap is used as the gradient confidence score of the completed edge point to reflect that its positioning accuracy is lower than that of edge points supported by image grayscale information, but higher than that of completely missing points. When performing grayscale profile sampling, the gradient direction angle of the completed edge points is obtained by linear interpolation of the gradient direction angle of the control points at both ends of the fracture gap.

[0112] S334: Add the completed edge points as new nodes to the edge gradient confidence weighted graph. Establish weighted edges between the new nodes and their adjacent nodes according to the method in step S233. Update the node attribute table and edge weight adjacency table of the edge gradient confidence weighted graph. The boundary category label of the new node in the node attribute table is the same as the boundary category label of the control points at both ends of the fracture gap.

[0113] S34: Generate complete sub-pixel edge loop pairs based on the updated edge gradient confidence weighted map;

[0114] Further, step S34 includes:

[0115] S341: In the updated edge gradient confidence weighted graph, the conductor insulation boundary node subset and the insulation shielding boundary node subset are sorted according to the circumferential angle to form closed node chains. The spatial distance between the first and last nodes is verified to be less than a preset closed distance threshold. If not, the gap between the first and last nodes is filled in according to the method in step S332. The closed node chain refers to a closed loop formed by arranging the nodes according to the circumferential angle from smallest to largest, with the last node connecting back to the first node. The preset closure distance threshold is determined by multiplying the average spatial distance between adjacent nodes in the same node subset by a preset closure tolerance multiple. The closure tolerance multiple is determined by: acquiring multiple sets of cable cross-section images under standard lighting conditions, calculating the ratio of the spatial distance between the first and last nodes of the conductor insulation boundary node subset and the insulation shield boundary node subset in each set of images to the average spatial distance between adjacent nodes in the same node subset, and taking the maximum value among all ratios and rounding it up as the closure tolerance multiple, so as to ensure that the gap between the first and last nodes can be determined as a reasonable gap that can be filled under normal acquisition conditions. For example, the closure tolerance multiple can be set to 1.5 to 3.

[0116] S342: The closed node chain formed by the subset of conductor insulation boundary nodes is denoted as the conductor insulation boundary loop, and the closed node chain formed by the subset of insulation shield boundary nodes is denoted as the insulation shield boundary loop. The conductor insulation boundary loop and the insulation shield boundary loop together constitute a complete sub-pixel edge loop pair.

[0117] S343: Complete subpixel edge loop pairs are stored in the form of a loop topology adjacency list. Each element in the loop topology adjacency list contains the subpixel edge coordinates, gradient confidence score, and an index pointer to the next node. Conductor insulation boundary loops and insulation shielding boundary loops each correspond to a closed loop topology adjacency list. The data structure of the loop topology adjacency list is a singly linked circular list, where the index pointer of the last element points to the first element, forming a closed loop. Each element's fields include: node index number, subpixel edge coordinate row coordinates, subpixel edge coordinate column coordinates, gradient confidence score, and next node index number. The difference between the loop topology adjacency list and the edge gradient confidence weighted graph in step S2 is that the edge gradient confidence weighted graph is a weighted undirected graph structure that includes both circumferential and spatial adjacency relationships, making it suitable for global analysis operations such as weak boundary identification and fracture gap detection; the loop topology adjacency list is a unidirectional circular linked list structure that only retains the circumferential sequential adjacency relationship, making it suitable for efficient traversal operations in the subsequent step S4, such as calculating ray intersection points and measuring thickness along the circumferential direction.

[0118] Specifically, step S3 transforms the edge gradient confidence weighted map output in step S2 into two complete closed edge loops by enhancing the gradient in weak boundary regions and completing missing edges in broken regions. This is a necessary prerequisite for accurate insulation thickness calculation. In cable insulation thickness detection, thickness calculation requires drawing rays outward from the geometric center of the insulation layer, intersecting with both the conductor insulation boundary and the insulation shield boundary, and obtaining the intersection points. The distance between the intersection points is the insulation thickness at that azimuth angle. If there are gaps in the edge loops, rays at some measurement azimuth angles cannot intersect with the edge loops, resulting in missing thickness values ​​at those azimuth angles and preventing the generation of a complete thickness distribution sequence. If the edge positioning of weak boundary regions is biased and not corrected, the accuracy of the thickness value at the measurement azimuth angle of that region will be lower than that of other regions, reducing the overall accuracy consistency of the thickness distribution sequence. The gradient enhancement in step S3 utilizes the topological structure and confidence information of the edge gradient confidence weighted map in step S2, quickly locating weak boundary regions through low-weight edges, avoiding indiscriminate gradient enhancement processing of all edge points. The missing edge completion utilizes the geometric constraints and grayscale information of existing edge points at both ends of the break gap, and maintains the continuity of edge curvature in the completed region through cubic spline interpolation. Complete sub-pixel edge loop pairs are output in the form of a loop topological adjacency linked list. The unidirectional circular linked list structure allows step S4 to traverse along one direction from any position in the list when calculating ray intersections, until returning to the starting position. During traversal, it is only necessary to determine whether the current line segment intersects with the ray, resulting in higher computational efficiency than traversal operations on undirected graph structures.

[0119] S4: Based on complete sub-pixel edge loop pairs, calculate the insulation layer thickness at multiple measurement points along the circumference of the cable cross-section, generate a thickness distribution sequence, and perform compliance judgment and output a standardized test report based on the thickness distribution sequence;

[0120] Further, step S4 includes:

[0121] S41: Calculate the geometric center of the insulating layer based on complete sub-pixel edge loop pairs;

[0122] Further, step S41 includes:

[0123] S411: Traverse the loop topology adjacency list of the conductor insulation boundary loop, extract the sub-pixel edge coordinates of all nodes, and calculate the weighted centroid coordinates using the gradient confidence score as the weight to obtain the weighted centroid of the conductor insulation boundary. The weighted centroid coordinates are calculated as follows: the row coordinate of the weighted centroid of the conductor insulation boundary is equal to the sum of the products of the row coordinates of the sub-pixel edge coordinates of all nodes multiplied by their corresponding gradient confidence scores, divided by the sum of the gradient confidence scores of all nodes; the column coordinates of the weighted centroid of the conductor insulation boundary are calculated in the same way, except that the row coordinates are replaced with column coordinates. The reason for using the gradient confidence score as the weight instead of equal weight to calculate the centroid is that nodes with higher gradient confidence scores have higher positioning accuracy of their sub-pixel edge coordinates and should receive a greater weight contribution in the centroid calculation, so that the calculated centroid coordinates are biased towards the edge points with high precision positioning, reducing the interference of low precision edge points, especially the completed edge points, on the centroid calculation.

[0124] S412: Traverse the loop topology adjacency list of the insulation shield boundary loop and calculate the weighted centroid of the insulation shield boundary in the same way.

[0125] S413: The arithmetic mean of the weighted centroids of the conductor insulation boundary and the insulation shield boundary is taken as the geometric center of the insulation layer. The arithmetic mean is calculated as follows: the row coordinate of the geometric center of the insulation layer is equal to the sum of the row coordinates of the weighted centroids of the conductor insulation boundary and the insulation shield boundary, divided by 2. The column coordinates of the geometric center of the insulation layer are calculated in the same way. The arithmetic mean of the weighted centroids of the two boundary loops is used as the geometric center of the insulation layer, instead of using the centroid of a single boundary loop or the geometric center of the original cable cross-section image, because the geometric center of the insulation layer should be located at a geometrically symmetrical position between the conductor insulation boundary and the insulation shield boundary. The arithmetic mean of the weighted centroids of the two boundary loops can better reflect the true geometric center position of the insulation layer. Especially in the case of cable cross-section eccentricity, this calculation method can reduce the impact of eccentricity error on subsequent thickness measurements.

[0126] S42: Calculate the insulation layer thickness along multiple measurement points in the circumferential direction based on the geometric center of the insulation layer and the complete sub-pixel edge loop pair;

[0127] Further, step S42 includes:

[0128] S421: Using the geometric center of the insulation layer as the origin of the polar coordinates, the circumference is divided into K measurement azimuth angles according to a preset circumferential angle step. The preset circumferential angle step is determined based on the minimum number of measurement points and measurement uniformity requirements specified in the cable testing standard. For example, the circumferential angle step can be set to 1 degree, corresponding to K equal to 360 measurement azimuth angles. The starting angle of the K measurement azimuth angles is 0 degrees, and the ending angle is 359 degrees. The angle difference between adjacent measurement azimuth angles is equal to the preset circumferential angle step.

[0129] S422: For each measured azimuth angle, draw a ray outward from the geometric center of the insulation layer and calculate the coordinates of the intersection point of the ray and the conductor insulation boundary loop. Specifically, traverse the line segments formed by adjacent nodes in the loop topology adjacency list of the conductor insulation boundary loop, and obtain the intersection point coordinates by solving the simultaneous equations of the parameterized line and the ray. If there are multiple intersection points, take the intersection point closest to the geometric center of the insulation layer and denote it as the conductor insulation intersection point. The process of solving the simultaneous equations of the parameterized line is as follows: the ray starts from the geometric center of the insulation layer, the direction angle is the current measured azimuth angle, and the point on the ray can be represented as the coordinates of the geometric center of the insulation layer plus the parameter multiplied by the cosine and sine components of the direction angle, where the parameter is greater than 0; the point on the line segment formed by two adjacent nodes in the conductor insulation boundary loop can be represented as the coordinates of the starting node plus the proportional parameter multiplied by the difference between the coordinates of the ending node and the coordinates of the starting node, where the proportional parameter ranges from 0 to 1. By making the row and column coordinates of the ray parameterized equation and the line segment parameterized equation equal, a system of two linear equations in two variables is obtained, containing the ray parameter and the line segment scale parameter. Solving this system of equations yields the ray parameter and the line segment scale parameter. If the ray parameter is greater than 0 and the line segment scale parameter is between 0 and 1, then the intersection point is valid, and the coordinates of the intersection point are the coordinate values ​​of the ray parameterized equation at the ray parameter. Traverse all line segments of the conductor insulation boundary loop, collect all valid intersection points, and take the valid intersection point with the smallest ray parameter as the conductor insulation intersection point. The intersection point with the smallest ray parameter corresponds to the intersection point closest to the geometric center of the insulation layer.

[0130] See Figure 9 This is a schematic diagram of thickness measurement using the ray intersection method provided in an embodiment of this application. For example... Figure 8As shown, the central cross mark indicates the geometric center of the insulation layer. The inner dashed ring represents the conductor insulation boundary loop, and the outer dashed ring represents the insulation shield boundary loop. The light gray area between them represents the insulation layer region. The solid arrow extending outward from the geometric center of the insulation layer represents the ray of the current measurement azimuth. The intersection of the ray with the inner boundary loop is the conductor insulation intersection point, and the intersection with the outer boundary loop is the insulation shield intersection point. The double-arrow dimension line between the two intersection points indicates the insulation layer thickness. Multiple light-colored dashed rays in the figure indicate multiple measurement azimuths evenly distributed circumferentially. In cable insulation thickness inspection, the geometric center of the insulation layer is the arithmetic mean of the weighted centroids of the conductor insulation boundary and insulation shield boundary loops, rather than the geometric center of the image. This is because in actual cable production, the conductor may be eccentric relative to the outer contour of the insulation layer. Using the mean of the centroids of the two boundary loops as the origin of the polar coordinates can more accurately reflect the true geometric symmetry position of the insulation layer and reduce the impact of eccentricity error on thickness measurement. The ray intersection method calculates the distance between the intersection points of the inner and outer boundaries by using a uniform method of drawing rays from the center outward at all measurement azimuth angles. This ensures that the thickness values ​​at each azimuth angle have a consistent physical definition and comparability, ultimately generating a thickness distribution sequence covering the entire circumference.

[0131] S423: Calculate the coordinates of the intersection point between the ray and the insulating shield boundary loop using the same method. If multiple intersection points exist, take the intersection point farthest from the geometric center of the insulating layer and denote it as the insulating shield intersection point. The reason for taking the intersection point farthest from the geometric center of the insulating layer, rather than the closest intersection point, is that the insulating shield boundary is the outer boundary of the insulating layer. After the ray passes outward from the geometric center of the insulating layer, it first intersects with the conductor insulating boundary (inner boundary), and then passes through the insulating layer and intersects with the insulating shield boundary (outer boundary). The farthest intersection point corresponds to the position of the outer boundary of the insulating layer.

[0132] S424: Calculate the Euclidean distance between the conductor insulation intersection and the insulation shield intersection. Multiply this Euclidean distance by a pixel equivalent coefficient to obtain the physical thickness of the insulation layer at the measured azimuth angle. The pixel equivalent coefficient is obtained through standard gauge block calibration. The formula for calculating the Euclidean distance is:

[0133] ;

[0134] in, For the first The Euclidean distance between the conductor insulation intersection point and the insulation shield intersection point at each azimuth angle is measured. and These are the row and column coordinates of the conductor insulation intersection point, respectively. and These are the row and column coordinates of the insulation-shield intersection, respectively. The physical meaning of this formula is: in the image pixel coordinate system, the straight-line distance between the conductor insulation intersection and the insulation shield intersection represents the pixel width of the insulation layer in the image at the measurement azimuth angle. The pixel equivalent coefficient is the physical length corresponding to each pixel in physical space, in millimeters per pixel, obtained through standard gauge block calibration. The standard gauge block calibration process is as follows: a standard gauge block with known physical dimensions is placed within the field of view of an industrial camera; an image of the standard gauge block is acquired under the same imaging conditions as cable cross-section inspection; the number of pixels corresponding to the feature dimensions of the standard gauge block is measured in the standard gauge block image; and the pixel equivalent coefficient is obtained by dividing the nominal physical dimension of the standard gauge block by the corresponding number of pixels. The physical thickness value of the insulation layer is equal to the Euclidean distance multiplied by the pixel equivalent coefficient. For example, assuming the coordinates of the conductor insulation intersection point at a measured azimuth angle are row coordinate 450.23 and column coordinate 612.87, and the coordinates of the insulation shield intersection point are row coordinate 425.56 and column coordinate 598.15, then the Euclidean distance is equal to the square root of the sum of the squares of the row coordinate difference (450.23 minus 425.56, equal to 24.67) and the column coordinate difference (612.87 minus 598.15, equal to 14.72), which is equal to the square root of 608.81 plus 216.68, equal to 825.49, approximately 28.73 pixels. If the pixel equivalent coefficient is 0.018 mm per pixel, then the physical thickness of the insulation layer is equal to 28.73 multiplied by 0.018, approximately 0.517 mm.

[0135] S425: Arrange the physical thickness values ​​of the insulation layer at K measured azimuth angles in angular order to generate a thickness distribution sequence. The data structure of the thickness distribution sequence is a one-dimensional array with a length of K. The k-th element in the array stores the physical thickness value of the insulation layer at the k-th measured azimuth angle, and the value of k ranges from 1 to K.

[0136] S43: Perform accuracy self-calibration based on thickness distribution sequence;

[0137] Further, step S43 includes:

[0138] S431: Acquire a standard gauge block image under the same imaging conditions. Perform full-process processing steps S1 to S3 on the standard gauge block image to obtain the measured thickness value of the standard gauge block. Calculate the deviation between the measured thickness value and the nominal thickness value of the standard gauge block. The same imaging conditions refer to the illumination angle, light intensity parameters, exposure time, and gain parameters of the multi-band LED ring light source being consistent with the settings used when acquiring the original image of the cable cross-section. The standard gauge block is a precision ring gauge or stepped gauge block with a traceability certificate from the National Institute of Metrology, and its nominal thickness uncertainty is no greater than 0.001 mm. The measured thickness value of the standard gauge block is the physical thickness value calculated at a preset measurement azimuth angle after performing full-process processing on the standard gauge block image. The deviation value is equal to the measured thickness value of the standard gauge block minus its nominal thickness value.

[0139] S432: Calculate the system compensation coefficient based on the deviation value. Multiply the physical thickness value of each insulating layer in the thickness distribution sequence by the system compensation coefficient to obtain the calibrated thickness distribution sequence. The formula for calculating the system compensation coefficient is:

[0140] ;

[0141] in, For system compensation coefficients, This refers to the nominal thickness value of the standard gauge block. The measured thickness value of the standard gauge block is given. The physical meaning of this formula is: the system compensation coefficient is the ratio of the nominal thickness value of the standard gauge block to the measured thickness value. When the measured thickness value is greater than the nominal thickness value, the system compensation coefficient is less than 1, resulting in a reduction correction for the values ​​in the thickness distribution sequence; when the measured thickness value is less than the nominal thickness value, the system compensation coefficient is greater than 1, resulting in a magnification correction for the values ​​in the thickness distribution sequence. Each element in the calibrated thickness distribution sequence is equal to the corresponding element in the thickness distribution sequence multiplied by the system compensation coefficient. The data structure of the calibrated thickness distribution sequence is the same as that of the thickness distribution sequence, which is a one-dimensional array with a length of K. For example, if the nominal thickness value of the standard gauge block is 2.000 mm and the measured thickness value is 2.008 mm, then the system compensation coefficient is equal to 2.000 divided by 2.008, approximately equal to 0.99602. If the physical thickness of the insulation layer at a certain azimuth angle in the thickness distribution sequence is 0.517 mm, then the calibrated value is equal to 0.517 multiplied by 0.99602, which is approximately 0.5149 mm.

[0142] S44: Perform compliance assessment and output standardized test reports based on the calibrated thickness distribution sequence;

[0143] Further, step S44 includes:

[0144] S441: Retrieve the standard value and permissible deviation range of the insulation thickness for the corresponding cable model from the built-in cable testing standard database. The data in the cable testing standard database comes from national and power industry standards specifying the insulation thickness for each cable model. The database's data structure is a key-value pair format, where the key is the cable model code, and the value is the standard value and permissible deviation range of the insulation thickness for that model. The standard value of the insulation thickness is the nominal thickness of the cable insulation layer for that model, and the permissible deviation range is the minimum and maximum permissible value of the insulation layer thickness for that model. The model of the cable under test is entered by the operator on the testing system interface or automatically obtained by scanning the QR code on the cable nameplate.

[0145] S442: Calculate the minimum, maximum, average, and standard deviation of the calibrated thickness distribution sequence. Compare the minimum value with the standard insulation thickness value minus the lower limit of the allowable deviation range, and compare the average value with the standard insulation thickness value. The minimum value is the smallest value among K elements in the calibrated thickness distribution sequence, the maximum value is the largest value among K elements, the average value is the arithmetic mean of the K elements, and the standard deviation is the root mean square deviation of the K elements relative to the average value. The lower limit of the allowable deviation range is the difference between the standard insulation thickness value and the minimum allowable value.

[0146] S443: If the minimum value is greater than or equal to the standard value of insulation thickness minus the lower limit of the allowable deviation range, and the average value is greater than or equal to the standard value of insulation thickness, then it is judged as qualified; otherwise, it is judged as unqualified. This judgment logic conforms to the dual assessment requirements for insulation thickness in the power industry cable testing standards: The first assessment requires that the insulation thickness at all measured azimuth angles must not be lower than the minimum allowable value, which is achieved by comparing the minimum value with the standard value of insulation thickness minus the lower limit of the allowable deviation range; the second assessment requires that the average value of the insulation thickness at all measured azimuth angles must not be lower than the nominal thickness, which is achieved by comparing the average value with the standard value of insulation thickness.

[0147] S444: The system automatically generates and outputs a standardized test report by summarizing the calibrated thickness distribution sequence, compliance judgment results, physical insulation thickness values ​​at each measurement azimuth, inspection time, and cable model information. The standardized test report is in PDF format and includes: report number, inspection date and time, cable model and specifications, testing equipment number and calibration date, standard insulation thickness value and allowable deviation range, minimum, maximum, average, and standard deviation of the calibrated thickness distribution sequence, compliance judgment results, and a visualization of the cable cross-section edge inspection results. The visualization image displays the conductor insulation boundary loop and insulation shielding boundary loop superimposed on an enhanced grayscale image. The physical insulation thickness values ​​at different measurement azimuths are displayed in polar coordinate distribution, with qualified measurement azimuths marked in the first color and unqualified measurement azimuths marked in the second color.

[0148] Specifically, in S4, multi-point insulation thickness calculation and compliance judgment based on complete sub-pixel edge loops is a key step in translating the accuracy advantage of sub-pixel edge detection into improved insulation thickness measurement accuracy. The geometric center of the insulation layer is used as the arithmetic mean of the weighted centroids of two boundary loops, rather than a simple image geometric center. This is because, in actual cable production and laying, the conductor may be eccentric relative to the outer contour of the insulation layer. If the image geometric center is used as the origin of polar coordinates, the intersection point of the ray in the eccentric direction with the boundary loop will deviate from the true normal direction of the insulation layer, resulting in a measured thickness value that is too large or too small. Compared to the shortest distance method, the ray intersection method provides a consistent measurement definition across all measurement azimuth angles, giving the thickness values ​​at each azimuth angle in the thickness distribution sequence a unified physical meaning and comparability. Accuracy self-calibration eliminates the overall system deviation through full-process processing of standard gauge blocks, including comprehensive errors introduced by factors such as pixel equivalent coefficient calibration error, systematic offset of sub-pixel fitting, and chromatic aberration of the optical imaging system. The compliance determination directly references industry standard parameters from the cable testing standard database, avoiding the subjectivity and inefficiency of manual table lookup. It automatically compares the thickness distribution sequence output by the algorithm with the numerical requirements of industry standards, ultimately achieving traceability and standardization of the test results through a standardized test report. Step S4 relies on the completeness and accuracy of the sub-pixel edge loop pairs output in step S3. If the quality of the weak boundary gradient enhancement and missing edge completion in step S3 is poor, the intersection position of the ray and the edge loop in step S4 will deviate, directly affecting the accuracy of the physical thickness value of the insulation layer. Steps S1 to S4 constitute a complete detection and processing chain. Step S1 provides a high-quality enhanced grayscale image and a preliminary set of pixel-level edge candidate points. Step S2 improves the pixel-level localization to the sub-pixel level and constructs a graph structure with confidence. Step S3 uses the graph structure to perform weak boundary enhancement and break repair to generate a closed loop. Step S4 uses the closed loop to perform accurate thickness calculation and standard comparison. The four steps are progressive and interlocking. The output of each step is a necessary input for the next step. The absence of any step will cause subsequent steps to fail or significantly reduce accuracy.

[0149] For example, the following is a complete workflow example. The cable under inspection is a YJV22 type high-voltage cross-linked polyethylene insulated steel tape armored power cable, with a rated voltage level of 8.7 kV to 15 kV, a nominal insulation thickness of 4.5 mm, and a minimum allowable thickness of 4.5 mm minus 0.1 multiplied by 4.5 mm, which equals 4.05 mm. A 5-megapixel area array industrial camera with a telecentric lens is selected, with an imaging field of view of 30 mm x 24 mm, corresponding to a pixel equivalent factor of approximately 0.006 mm per pixel. The multi-band LED ring light source is set with a tilt angle of 20 degrees, the white light band intensity is set to 70% of the rated intensity, and the near-infrared light band intensity is set to 50% of the rated intensity. After acquiring the original image of the cable cross-section, an enhanced grayscale image is obtained through distortion correction, adaptive median filtering, and gamma correction. The gradient magnitude and gradient direction angle of the enhanced grayscale image were calculated, a gradient direction histogram was constructed, and peak clustering was performed to identify two effective gradient direction peaks, corresponding to the main edge directions of the conductor insulation boundary and the insulation shielding boundary, respectively. Based on the cumulative distribution function, a high threshold of 127 and a low threshold of 51 were calculated, resulting in a pixel-level edge candidate point set containing 1862 edge candidate points. Neighborhood grayscale profile sampling and quadratic polynomial fitting were performed on the pixel-level edge candidate point set, and 23 edge candidate points were removed because the absolute value of the sub-pixel offset was greater than 1 pixel, finally generating a sub-pixel edge coordinate sequence containing 1839 sub-pixel edge points. An edge gradient confidence weighted map was constructed, and the 1839 nodes were divided into a conductor insulation boundary node subset of 934 and an insulation shielding boundary node subset of 905 using the maximum inter-class variance method. Three weak boundary regions were identified, containing a total of 187 weak nodes. After gradient enhancement, the gradient confidence scores of these 187 weak nodes were improved by an average of 42%. One fracture gap with an angle span of 8 degrees was detected in the conductor insulation boundary node subset, and 16 edge points were completed. After generating a complete sub-pixel edge loop pair, the thickness distribution sequence was calculated by setting 360 measurement azimuth angles in 1-degree increments, with the geometric center of the insulation layer as the origin of the polar coordinates. After calibration with standard gauge blocks, the minimum value of the calibrated thickness distribution sequence was 4.12 mm, the maximum value was 4.89 mm, the average value was 4.53 mm, and the standard deviation was 0.15 mm. The minimum value of 4.12 mm is greater than the minimum allowable thickness of 4.05 mm, and the average value of 4.53 mm is greater than the nominal thickness of 4.5 mm, so it is judged as qualified, and a standardized test report is automatically generated and output.

[0150] Example 2

[0151] This embodiment, based on Embodiment 1, provides a cable insulation thickness detection system based on sub-pixel edge enhancement, such as... Figure 9 As shown, it includes:

[0152] Image preprocessing module: used to acquire original images of cable cross sections, perform adaptive grayscale equalization and noise suppression on the original images of cable cross sections to obtain enhanced grayscale images, construct gradient orientation histograms based on the enhanced grayscale images and perform peak clustering and dynamic dual threshold extraction to obtain a set of pixel-level edge candidate points;

[0153] Sub-pixel edge localization module: used to perform neighborhood grayscale profile sampling and quadratic polynomial fitting on the pixel-level edge candidate point set to obtain a sub-pixel edge coordinate sequence, and to construct an edge gradient confidence weighted map based on the sub-pixel edge coordinate sequence;

[0154] Edge loop reconstruction module: used to perform gradient enhancement and missing edge completion on weak boundary regions based on the edge gradient confidence weighted map, to obtain complete sub-pixel edge loop pairs stored in the form of loop topology adjacency linked list;

[0155] Thickness detection output module: used to calculate the insulation layer thickness based on the complete sub-pixel edge loop at multiple measurement points along the circumference of the cable cross section, generate a thickness distribution sequence, and perform compliance judgment and output a standardized test report based on the thickness distribution sequence.

Claims

1. A cable insulation thickness detection method based on sub-pixel edge enhancement, characterized in that, The method includes: Acquire an original image of the cable cross-section, perform adaptive grayscale equalization and noise suppression on the original image of the cable cross-section to obtain an enhanced grayscale image, construct a gradient orientation histogram based on the enhanced grayscale image, and perform peak clustering and dynamic dual threshold extraction on the gradient orientation histogram to obtain a pixel-level edge candidate point set; Neighborhood grayscale profile sampling and quadratic polynomial fitting are performed on the pixel-level edge candidate point set to obtain a sub-pixel edge coordinate sequence; an edge gradient confidence weighted map is constructed based on the sub-pixel edge coordinate sequence, which is a weighted adjacency structure with each point in the sub-pixel edge coordinate sequence as a node and the gradient confidence between nodes as the edge weight. Based on the edge gradient confidence weighted map, gradient enhancement and missing edge completion are performed on weak boundary regions to obtain complete sub-pixel edge loop pairs. Each complete sub-pixel edge loop pair includes a conductor insulation boundary loop and an insulation shield boundary loop. The complete sub-pixel edge loop pairs are stored in the form of a loop topology adjacency list. Each element in the loop topology adjacency list carries the sub-pixel edge coordinates of that point and the gradient confidence score updated after gradient enhancement. Based on the complete sub-pixel edge loop pair, the insulation layer thickness is calculated at multiple measurement points along the circumference of the cable cross-section, generating a thickness distribution sequence. Compliance judgment and standardized test report output are then performed based on the thickness distribution sequence.

2. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The adaptive grayscale equalization and noise suppression method includes: The global grayscale mean and grayscale variance are calculated for the original image of the cable cross-section. The window size of the adaptive median filter is determined based on the comparison result of the grayscale variance and the preset variance threshold. The adaptive median filter is then applied to the original image of the cable cross-section to obtain the filtered image. Calculate the gray-level histogram for the filtered image, and determine the gamma correction coefficient based on the peak distribution of the gray-level histogram; Gamma correction is performed on the filtered image based on the gamma correction coefficients to obtain the enhanced grayscale image.

3. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The peak clustering method includes: Scan the gradient direction histogram, identify all local maxima, and group local maxima with adjacent angular intervals not exceeding a preset angle merging threshold into the same gradient direction main peak. Calculate the cumulative frequency value corresponding to the main peak in each gradient direction, mark the main peak in the gradient direction with a cumulative frequency value lower than the preset effective threshold as a noise main peak and remove it, and retain the effective main peak in the gradient direction.

4. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The dynamic dual-threshold extraction method includes: Take the cumulative distribution function of the gradient magnitude in the enhanced grayscale image, take the gradient magnitude corresponding to the cumulative distribution function reaching the preset high percentile as the high threshold, and multiply the high threshold by the preset threshold ratio coefficient to obtain the low threshold. Pixels with gradient magnitudes greater than or equal to the high threshold are marked as strong edge points, and pixels with gradient magnitudes between the low threshold and the high threshold and spatially adjacent to the strong edge points are marked as weak edge points. The strong edge points and the weak edge points are merged to obtain the pixel-level edge candidate point set.

5. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The method for neighborhood grayscale profile sampling and quadratic polynomial fitting includes: For each edge candidate point in the pixel-level edge candidate point set, the normal sampling direction is determined according to the gradient direction angle of the edge candidate point. A preset number of sampling points are taken on both sides of the edge candidate point along the normal sampling direction. The gray value of each sampling point is calculated by bilinear interpolation to form the gray-level profile vector of the edge candidate point. Using the relative distance along the normal sampling direction as the independent variable and the gray value of each sampling point in the gray-scale profile vector as the dependent variable, a quadratic polynomial is fitted using the least squares method. The first derivative of the quadratic polynomial is calculated and set to zero to obtain the sub-pixel offset. The sub-pixel edge coordinates are obtained by adding the component of the sub-pixel offset along the normal sampling direction to the integer pixel coordinates of the edge candidate point. The sub-pixel edge coordinates of all edge candidate points are then sorted according to the angle along the circumference of the cable cross section to generate the sub-pixel edge coordinate sequence.

6. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The data structure of the edge gradient confidence weighted graph includes a node attribute table and an edge weight adjacency table. The node attribute table stores the sub-pixel edge coordinates, gradient direction angle, gradient confidence score, and boundary category label of each node. The edge weight adjacency table stores the start and end node indexes of each edge and the weight of that edge. The boundary category label includes two categories: conductor insulation boundary and insulation shielding boundary.

7. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The method for performing gradient enhancement on weak boundary regions includes: Traverse the edge weight adjacency list of the edge gradient confidence weighted graph, mark the edges with weights lower than the preset weak boundary weight threshold as weak boundary edges, and use the weak boundary edges as seeds to expand the connected regions to obtain a set of weak boundary regions. For each weak boundary region in the set of weak boundary regions, extract the gray-level profile vector of each weak node and perform second-order differential operation to obtain the second-order gray-level gradient profile. The second-order gray-level gradient profiles of all weak nodes are weighted and superimposed to obtain the cumulative gradient enhancement profile. In the cumulative gradient enhancement profile, the zero-crossing position is located as the edge position correction amount. The sub-pixel edge coordinates of each weak node are corrected according to the edge position correction amount to obtain the enhanced sub-pixel edge coordinates.

8. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The method for completing missing edges includes: The nodes are divided into a conductor insulation boundary node subset and an insulation shield boundary node subset according to their boundary category labels. The angular interval between adjacent nodes is checked according to the circumferential angle. If the angular interval exceeds the preset maximum allowable angular interval threshold, it is marked as a break gap. For each fracture gap, take the two adjacent nodes as control points and perform cubic spline interpolation to generate sub-pixel edge coordinates of the completed edge points; The completed edge points are added as new nodes to the edge gradient confidence weighted graph, and the node attribute table and edge weight adjacency table are updated.

9. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The loop topology adjacency list is a unidirectional circular linked list. Each element in the loop topology adjacency list contains the sub-pixel edge coordinates of the node, the gradient confidence score, and an index pointer pointing to the next node. The conductor insulation boundary loop and the insulation shielding boundary loop each correspond to a closed loop topology adjacency list.

10. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The method for calculating the insulation layer thickness at multiple measuring points circumferentially along the cable cross-section includes: Traverse the loop topology adjacency list of the conductor insulation boundary loop and the insulation shield boundary loop, calculate the weighted centroid coordinates with the gradient confidence score as the weight, and take the arithmetic mean of the two weighted centroid coordinates as the geometric center of the insulation layer. With the geometric center of the insulation layer as the origin of the polar coordinates, the circumferential angle is divided into K measurement azimuth angles according to the preset circumferential angle step size. A ray is drawn for each measurement azimuth angle, and the intersection point of the ray with the conductor insulation boundary loop and the insulation shielding intersection point with the insulation shielding boundary loop are calculated respectively. The Euclidean distance between the conductor insulation intersection and the insulation shield intersection is calculated and multiplied by the pixel equivalent coefficient to obtain the physical thickness value of the insulation layer. The physical thickness values ​​of the insulation layer at K measured azimuth angles are arranged in angular order to generate the thickness distribution sequence.

11. The cable insulation thickness detection method based on sub-pixel edge enhancement according to claim 1, characterized in that, The methods for determining compliance include: Under the same imaging conditions, standard gauge block images are acquired and processed throughout the entire process to obtain the measured thickness value of the standard gauge block. The system compensation coefficient is calculated based on the deviation between the measured thickness value and the nominal thickness value of the standard gauge block. The physical thickness value of each insulating layer in the thickness distribution sequence is multiplied by the system compensation coefficient to obtain the calibrated thickness distribution sequence. The standard value of insulation thickness and the allowable deviation range are retrieved from the cable testing standard database. If the minimum value of the calibrated thickness distribution sequence is greater than or equal to the standard value of insulation thickness minus the lower limit of the allowable deviation range and the average value is greater than or equal to the standard value of insulation thickness, it is judged as qualified; otherwise, it is judged as unqualified.

12. A cable insulation thickness detection system based on subpixel edge enhancement, used to implement the cable insulation thickness detection method based on subpixel edge enhancement as described in any one of claims 1 to 11, characterized in that, The system includes: Image preprocessing module: used to acquire original images of cable cross sections, perform adaptive grayscale equalization and noise suppression on the original images of cable cross sections to obtain enhanced grayscale images, construct gradient orientation histograms based on the enhanced grayscale images and perform peak clustering and dynamic dual threshold extraction to obtain a set of pixel-level edge candidate points; Sub-pixel edge localization module: used to perform neighborhood grayscale profile sampling and quadratic polynomial fitting on the pixel-level edge candidate point set to obtain a sub-pixel edge coordinate sequence, and to construct an edge gradient confidence weighted map based on the sub-pixel edge coordinate sequence; Edge loop reconstruction module: used to perform gradient enhancement and missing edge completion on weak boundary regions based on the edge gradient confidence weighted map, to obtain complete sub-pixel edge loop pairs stored in the form of loop topology adjacency linked list; Thickness detection output module: used to calculate the insulation layer thickness based on the complete sub-pixel edge loop at multiple measurement points along the circumference of the cable cross section, generate a thickness distribution sequence, and perform compliance judgment and output a standardized test report based on the thickness distribution sequence.