A method for analyzing cable cross-section images
By constructing a cable cross-section geometric template library and reconstructing the energy functional from the gradient field, the structural integrity and long-term adaptability issues of cable cross-section contour extraction were resolved, achieving high accuracy and low complexity detection in complex environments.
Patent Information
- Application Number
- CN202611297863.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to guarantee the structural integrity and long-term adaptability of cable cross-section contour extraction in complex industrial environments. Traditional edge detection methods are dependent on local pixel gradients and global illumination uniformity, leading to contour breaks, false responses, and insufficient continuity.
A cross-sectional geometry template library is constructed. The energy functional is reconstructed and iteratively solved by gradient field. Only the normal component is updated and unstructured perturbations are suppressed. The maximum modulus path is tracked by vector gradient field, and curvature smoothing constraints are applied to generate a globally coherent cable cross-sectional profile. Stability detection is achieved by using the adaptively evolving geometry template library.
It significantly improves the accuracy and robustness of edge extraction under complex industrial imaging conditions, reduces computational complexity, ensures stable operation on resource-constrained vision controllers, achieves long-term detection stability, and adapts to illumination drift and sudden changes in imaging conditions.
Smart Images

Figure CN123118510A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial image analysis and cable manufacturing quality inspection technology, and in particular to a method for analyzing cable cross-section images. Background Technology
[0002] In the current field of industrial image analysis and cable manufacturing quality inspection, the automatic extraction and recognition of cable cross-sectional contours is a crucial foundation for achieving quality monitoring in the production process. Most mainstream methods for obtaining cross-sectional contours employ pixel-level edge detection methods, including traditional multi-scale gradient response techniques such as the Sobel operator and Canny edge detection. These methods identify the interfaces of cable materials by determining thresholds based on local grayscale changes and edge signal-to-noise ratios. In recent years, some technical solutions have attempted to incorporate deep learning segmentation models and image grouping clustering to further enhance the robustness and adaptability of contour detection, improve the ability to analyze cable images in unstructured and complex backgrounds, and drive the intelligent development of industrial visual inspection.
[0003] Existing technologies are mostly applied in static experimental environments or under relatively ideal imaging conditions. For example, cable cross-section images are placed under uniform lighting and low-interference backgrounds, and edge operators or pixel-based segmentation methods are used to identify the boundaries of each layer. In actual industrial production environments, cable cross-section images are often affected by complex background interference, dynamic lighting changes, and uneven reflections from material surfaces, leading to a decrease in local signal-to-noise ratio and blurred edge grayscale transitions. In such cases, traditional edge detection methods suffer from problems such as contour breaks, false responses, and insufficient continuity. According to publicly available information, although some studies have utilized multi-scale enhancement and other improvement schemes, they still cannot fundamentally escape the dependence on local pixel gradients and global lighting uniformity, nor can they guarantee the structural integrity and long-term adaptability of the extracted contours. Summary of the Invention
[0004] This application provides a cable cross-section image analysis method, which aims to solve the problem mentioned in the background art of difficulty in ensuring the structural integrity and long-term adaptability of cable cross-section contour extraction.
[0005] This application provides a cable cross-section image analysis method, specifically including:
[0006] S1: Obtain the original image data of the cable cross-section and build a cross-section geometry template library based on the cable manufacturing process;
[0007] S2: Use the original image data of the cable cross-section as the initial field input, and use the cross-section geometry template library to construct the gradient field to reconstruct the energy functional;
[0008] S3: Iteratively solve the energy functional of the gradient field reconstruction, updating only the normal component of the gradient field in each iteration and simultaneously suppressing gradient perturbations in non-structurally permissible directions until convergence generates a vector gradient field.
[0009] S4: Based on the dispersion region of the vector gradient field, locate the real physical boundary position, and by tracing the path of the maximum modulus in the vector gradient field and applying curvature smoothing constraints, synthesize a globally coherent cable cross-section profile curve that does not depend on single-point threshold determination, and complete the analysis of the cable cross-section image.
[0010] S5: Calculate the overall matching confidence based on the global continuous cable cross-section profile curve and the geometric template library of each cross-section, and determine whether the overall matching confidence is lower than the preset dynamic calibration threshold. If the determination result is yes, trigger the online prior calibration mechanism; otherwise, keep the cross-section geometric template library unchanged.
[0011] S6: In response to the triggered online prior calibration mechanism, extract stable boundary segment data, update the cross-sectional geometry template library using the stable boundary segment data, and generate an adaptively evolved cross-sectional geometry template library;
[0012] S7: Convert the global coherent cable cross-section profile curve into structured cross-section analysis data, and combine it with the adaptively evolved cross-section geometry template library to output the final inspection results for cable manufacturing quality control.
[0013] The cable cross-section image analysis method provided in this application has the following advantages:
[0014] This solution utilizes prior geometric knowledge inherent in cable manufacturing processes, such as concentric circle topology, insulation thickness tolerance, and smooth sheathing, to construct a parameterized template library. Combined with historical sample optical response characteristics, it forms joint constraints. Using structural consistency as a regularization term, an energy functional is designed to drive the input image gradient field to evolve in a direction conforming to the prior pattern. This effectively suppresses noise disturbances in unstructured directions, recovering a complete, closed, and geometrically reasonable cross-sectional contour. This significantly improves the accuracy and robustness of edge extraction under complex industrial imaging conditions, overcoming the shortcomings of traditional methods that are overly sensitive to local intensity changes. Simultaneously, by focusing computation on updating the gradient field normal component and evolving the vector field, computational complexity and memory usage are greatly reduced. This ensures stable operation on resource-constrained embedded vision controllers and meets the millisecond-level response requirements of production lines. Furthermore, when there is ambient light drift or sudden changes in imaging conditions, a small-sample incremental learning process is automatically triggered, achieving lightweight adaptive evolution of prior knowledge. This maintains long-term detection stability without retraining or manual intervention, effectively overcoming the performance degradation of static prior models caused by environmental time-varying conditions. Attached Figure Description
[0015] Figure 1This is the main flowchart of a cable cross-section image analysis method.
[0016] Figure 2 This is a sub-flowchart of a cable cross-section image analysis method.
[0017] Figure 3 This is another sub-flowchart of a cable cross-section image analysis method. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0020] like Figure 1 As shown, this application provides a method for analyzing cable cross-section images, specifically including:
[0021] S1: Obtain the original image data of the cable cross-section and build a cross-section geometry template library based on the cable manufacturing process.
[0022] S2: Use the original image data of the cable cross-section as the initial field input, and use the cross-section geometry template library to construct the gradient field to reconstruct the energy functional.
[0023] S3: Iteratively solve the energy functional of the gradient field reconstruction. In each iteration, only the normal component of the gradient field is updated and gradient perturbations in non-structure-allowed directions are suppressed simultaneously until convergence is achieved to generate a vector gradient field.
[0024] S4: Based on the dispersion region of the vector gradient field, locate the real physical boundary position, and by tracing the path of the maximum modulus in the vector gradient field and applying curvature smoothing constraints, synthesize a globally coherent cable cross-section profile curve that does not depend on single-point threshold determination, and complete the analysis of the cable cross-section image.
[0025] S5: Calculate the overall matching confidence level based on the global continuous cable cross-section profile curve and the geometric template library of each cross-section, and determine whether the overall matching confidence level is lower than the preset dynamic calibration threshold. If the determination result is yes, trigger the online prior calibration mechanism; otherwise, keep the cross-section geometric template library unchanged.
[0026] S6: In response to the triggered online prior calibration mechanism, extract stable boundary segment data, update the cross-sectional geometry template library using the stable boundary segment data, and generate an adaptively evolved cross-sectional geometry template library.
[0027] S7: Convert the global coherent cable cross-section profile curve into structured cross-section analysis data, and combine it with the adaptively evolved cross-section geometry template library to output the final inspection results for cable manufacturing quality control.
[0028] Step S1: Obtain the original image data of the cable cross-section and construct a cross-section geometric template library based on the cable manufacturing process. Specifically, this includes:
[0029] S1.1: Perform standardized preprocessing on the raw cable cross-section image data collected in the industrial field to eliminate uneven lighting and sensor noise interference, and generate standard cable cross-section image data with uniform grayscale resolution, which serves as the input benchmark for subsequent physical constraint modeling.
[0030] It receives raw image data of cable cross-sections collected in the industrial field. This data includes low-frequency brightness components caused by fluctuations in ambient light and high-frequency random interference introduced by sensor thermal noise.
[0031] Homomorphic filtering-based illumination equalization is performed on the original image data to map the image to the logarithmic domain to separate the illumination component and the reflection component, thereby suppressing the influence of low-frequency illumination unevenness on the grayscale distribution.
[0032] A Gaussian low-pass filter is used to smooth the illumination component in the logarithmic domain, preserving the high-frequency reflection component that reflects the texture of the cable material and eliminating gradient field distortion caused by macroscopic shadows.
[0033] By using exponential transformation to restore the logarithmic domain image to the spatial domain, an intermediate image with uniform illumination is generated, ensuring that subsequent gradient calculations are not affected by global brightness differences.
[0034] The nonlocal mean denoising method is applied to the intermediate image, and a weighted average kernel is constructed using the self-similarity redundancy information in the image, which suppresses high-frequency shot noise while preserving edge sharpness.
[0035] By calculating the Euclidean distance between pixel blocks as a similarity weight, neighboring pixels are weighted and aggregated, which significantly reduces the probability of false edge response caused by sensor noise.
[0036] Histogram specification is performed on the denoised image to map the grayscale distribution to a preset standard normal distribution range, thus unifying the dynamic range of images from different batches.
[0037] By enhancing the grayscale step features of low-contrast regions through linear stretching, standard cable cross-section image data with uniform grayscale resolution is generated.
[0038] Through the above standardized preprocessing operations, the original non-uniform noise image is transformed into benchmark data with consistent illumination, noise suppression, and standardized dynamic range, achieving the expected technical effect of eliminating illumination non-uniformity and sensor noise interference, and providing a high signal-to-noise ratio input for subsequent physical constraint modeling.
[0039] For example, for 16-bit original cable cross-section image data with a resolution of 1024x1024, a Gaussian filter with homomorphic filtering is set with a standard deviation of 50 and a cutoff frequency of 0.05, effectively separating the illumination component. In nonlocal mean denoising, the search window size is set to 21x21, the similarity window size to 7x7, and the filter parameter h is set to 10, resulting in an improvement in signal-to-noise ratio of approximately 15dB. The histogram specifies the target distribution with a mean of 128 and a standard deviation of 40, linearly mapping the image grayscale values to the [0, 255] interval. After processing, the illumination non-uniformity coefficient of the image decreases from 0.35 to 0.05, the edge signal-to-noise ratio is significantly improved, and the generated standard image data fully meets the consistency requirements of the geometric topology parameter extraction for the input benchmark in step S1.2.
[0040] S1.2: Based on the standard cable cross-section image data, geometric topology parameter extraction processing is performed using the concentric circle distribution pattern of conductor layers, the tolerance range of insulation layer thickness, and the smooth continuity characteristics of sheath boundaries in the cable manufacturing process, to generate a structured geometric topology constraint set containing multi-layer concentric circle radius thresholds and interface curvature constraints.
[0041] The system receives standardized preprocessed standard cable cross-section image data as input for geometric topology parameter extraction. Hough circle transform is performed on the image data to identify the concentric circle structure of the conductor and insulation layers, extracting the center coordinates and preliminary radius estimates of each interface. Based on cable manufacturing process specifications, a lower limit for the conductor layer radius and an upper limit for the sheath outer diameter are set, constructing a radial search window to eliminate abnormal edge points deviating from the concentric circle distribution pattern. The standard deviation of the interface radius of each layer is calculated, and combined with the insulation layer thickness tolerance range, a multi-layer concentric circle radius threshold set is generated to constrain the radial boundary of subsequent gradient field evolution. Curvature calculation is performed on the extracted contour point set, and the least squares method is used to fit local arcs to evaluate the smoothness and continuity of the sheath boundary. A curvature change rate threshold is set to filter out boundary segments that meet the smoothness and continuity characteristics, forming interface curvature constraints. The radius threshold set and curvature constraints are integrated to construct a structured geometric topology constraint set. Through the above processing method, the standard image data of the previous step is transformed into a set of structured geometric topological constraints containing multi-layer concentric circle radius thresholds and interface curvature constraints, realizing digital modeling of the cable cross-section geometry and providing an accurate spatial topological reference for the subsequent correlation mapping of optical response feature vectors.
[0042] For example, a Hough circle transform is performed on a standard cable cross-section image with a resolution of 1024x1024 pixels. The accumulator threshold is set to 80, and the minimum center-to-center distance is 50 pixels. Three main concentric circle structures are detected, with a center coordinate deviation of less than 2 pixels. Based on manufacturing specifications, the conductor layer radius is set to [50, 55] pixels, the insulation layer thickness tolerance is ±2 pixels, and the sheath outer diameter range is [90, 95] pixels. The calculated conductor layer radius is 52.3 pixels with a standard deviation of 0.8 pixels, generating a radius threshold set {51.5, 53.1}. Curvature calculation is performed on the sheath boundary point set, with a curvature change rate threshold set to 0.05, filtering out smooth, continuous boundary segments accounting for more than 95%. The final output includes a structured geometric topological constraint set containing radius thresholds and curvature constraints, ensuring that subsequent gradient field reconstruction is performed in the correct geometric space, significantly improving the completeness and accuracy of contour recognition.
[0043] S1.3: Perform statistical feature analysis on the grayscale jump pattern data generated by historical qualified cable samples under standard imaging conditions, extract the typical gradient amplitude range, direction consistency threshold and cross-layer attenuation coefficient at each layer interface, and generate an initial optical response feature vector set characterizing the optical properties of the material boundary.
[0044] Obtain a dataset of historical qualified cable cross-section standard images calibrated by geometric topology constraints, and use it as the input source for optical response feature statistics.
[0045] For each standard image in the dataset, radial profile sampling is performed in polar coordinates based on the concentric circle radius threshold and interface curvature constraint generated in S1.2 to extract the gray-level distribution sequence along the radial direction.
[0046] The radial gradient magnitude is calculated by applying a first-order difference operator to the gray-scale distribution sequence, identifying local maxima at the interfaces of each material layer, and defining the locations of key physical boundaries such as conductor-insulation and insulation-sheath.
[0047] For each identified interface neighborhood, the mean and standard deviation of the gradient magnitude are calculated to construct a typical gradient magnitude range parameter that characterizes the interface sharpness and contrast stability.
[0048] The directional dispersion of the gradient vector within the neighborhood of the calculation interface is determined by fitting the von Mises distribution to determine the directional consistency threshold, thereby quantifying the degree of clustering of the boundary normal vector.
[0049] Extending outwards along a preset pixel distance in the radial direction, the attenuation slope of the gradient magnitude as a function of spatial distance is calculated, generating a cross-layer attenuation coefficient that characterizes the transition properties of the material.
[0050] The comprehensive optical response eigenvector of the k-th layer interface is calculated using the following formula. :
[0051]
[0052] in, The average gradient magnitude. The standard deviation of the gradient magnitude. The directional consistency coefficient. This is the cross-layer attenuation coefficient.
[0053] By iterating through all historical qualified samples, robust statistical aggregation is performed on the above four-dimensional parameters, and outliers are removed to generate an initial set of optical response feature vectors.
[0054] By using statistical feature analysis, the original grayscale image data is transformed into a set of structured feature vectors that characterize the optical properties of material boundaries, realizing the mapping from pixel-level information to physical property descriptions, and providing an accurate optical prior benchmark for subsequent gradient field reconstruction.
[0055] S1.4: Based on the structured geometric topology constraint set and the initial optical response feature vector set, perform association mapping fusion processing, bind the geometric topology parameters as index keys with the corresponding optical response feature vectors, and generate a geometric-optical joint feature mapping table with physical meaning association.
[0056] Read the multi-layer concentric circle radius threshold and interface curvature constraint data from the structured geometric topology constraint set, parse them into geometric key-value pairs with hierarchical indexing relationship, and establish the spatial position reference of each physical interface of the cable section.
[0057] Extract the typical gradient magnitude range, direction consistency threshold, and cross-layer attenuation coefficient of the corresponding layer from the initial optical response feature vector set, map the above optical parameters into optical attribute values that correspond one-to-one with geometric key value pairs, and establish the semantic association between physical boundaries and image grayscale jumps.
[0058] A geometry-optics joint mapping matrix is constructed, with geometric topology parameters as the primary index key and optical response feature vectors as the association values. A two-way binding operation is performed through a hash mapping method to ensure that the corresponding optical statistical features can be uniquely retrieved at any geometric level.
[0059] Consistency checks are performed on the relationships in the mapping matrix. Mutual information entropy is used to evaluate the coupling strength between geometric position deviation and optical gradient fluctuation. Low-correlation noise pairs are eliminated, and the expression weight of effective physical boundary features is enhanced.
[0060] A geometric-optical joint feature map with physical meaning is generated, which fully records the spatial topology from the conductor layer to the sheath layer and its ideal gradient distribution pattern under standard imaging conditions.
[0061] By using the correlation mapping fusion processing method, the structured geometric constraints and optical statistical features of the previous step are transformed into joint feature mapping table data with spatiotemporal consistency, so as to achieve accurate alignment between the physical structure of the cable cross section and the visual features of the image, and provide a high-confidence structural prior basis for subsequent gradient field reconstruction.
[0062] S1.5: Perform serialization encapsulation and parameterization processing on the geometry-optics joint feature mapping table to integrate and form a cross-sectional geometry template library containing complete geometric topology and optical response feature vectors.
[0063] The system receives the geometry-optics joint feature mapping table generated in S1.4, which contains a discrete set of structured geometric topological constraints and a set of initial optical response feature vectors. Serialization encoding is performed on the geometric topological parameters in the mapping table, converting multi-layer concentric circle radius thresholds, interface curvature constraints, and sheath boundary continuity conditions into fixed-length binary data streams, establishing the physical structure index key for the template library. For the initial optical response feature vector set, normalization and quantization compression are performed, mapping typical gradient magnitude ranges, direction consistency thresholds, and cross-layer attenuation coefficients to standard floating-point arrays, eliminating dimensional differences and reducing storage redundancy. A bidirectional hash mapping relationship is established between the geometric index key and the optical feature array, ensuring that the corresponding optical prior distribution can be quickly retrieved through geometric constraints during subsequent gradient field reconstruction. Version control identifiers and timestamp fields are introduced to encapsulate each set of mapping data, forming traceable independent template objects to support incremental update operations in the online prior calibration mechanism. All independent template objects are integrated into a unified data structure to construct a cross-sectional geometry template library containing complete geometric topological structures and optical response feature vectors.
[0064] By serializing and parameterizing the discrete mapping table from the previous step, a structured and rapidly searchable cross-sectional geometry template library is transformed, enabling efficient storage and real-time retrieval of structural prior data and providing accurate physical constraint benchmarks for subsequent gradient field reconstruction.
[0065] For example, a geometric-optical joint feature mapping table containing five cable specifications is processed. The geometric topology parameter serialization encoding uses a 16-bit unsigned integer to represent the radius threshold with a precision of 0.1 mm; the optical response feature vector is quantized as a 32-bit floating-point array, containing 128 dimensions of features including the mean gradient magnitude, standard deviation, and orientation histogram. An indexing mechanism based on SHA-256 hash values is established to ensure a retrieval time complexity of O(1). The encapsulated template library occupies less than 5MB of memory, and the latency for a single template read is less than 1ms. Verification on an embedded vision controller shows that the template library can support real-time gradient field reconstruction calculations at 30 frames per second, and the template matching accuracy remains above 98% even under illumination intensity fluctuations of ±20%, significantly improving the robustness of contour extraction.
[0066] Step S2: The original image data of the cable cross-section is used as the initial field input, and the gradient field is reconstructed using the cross-section geometry template library to reconstruct the energy functional. Specifically, this includes:
[0067] S2.1: Obtain the original image data of the cable cross section, and use the isotropic differential operator to perform pixel-by-pixel gray-level jump calculation on the original image data of the cable cross section to generate an initial vector gradient field containing amplitude and direction information, which serves as the reference input object for subsequent field evolution.
[0068] The original cable cross-section image data, after standardization and preprocessing in step S1, is acquired and used as the initial scalar field input to the gradient calculation module. Isotropic differential operators are used to perform pixel-by-pixel convolution on the image matrix, calculating the first-order partial derivatives of grayscale in the horizontal and vertical directions to capture the spatial rate of change of local pixel intensity. Based on the calculated horizontal and vertical partial derivative components, a two-dimensional vector gradient field is constructed, where each pixel corresponds to a gradient vector containing both magnitude and orientation angle. The gradient magnitude at any pixel (x, y) is calculated using the following formula. :
[0069]
[0070] in, Represents the grayscale intensity function of an image. and These are the partial derivatives of the grayscale values in the x and y directions, respectively. The gradient direction angle is also calculated. This is used to characterize the direction of the edge normal, and the formula is as follows:
[0071]
[0072] The generated initial vector gradient field is normalized to eliminate the inconsistency in magnitude of amplitude caused by differences in the absolute value of illumination intensity, ensuring the magnitude balance of data terms in the subsequent energy functional construction. The normalized gradient magnitude is mapped to the [0,1] interval to preserve the continuity of directional information, forming initial vector gradient field data containing complete amplitude and directional information.
[0073] By performing pixel-by-pixel partial derivative calculation and vector synthesis on the standardized image using isotropic differential operators, the scalar image data from the previous step is transformed into an initial vector gradient field containing information on the magnitude of the spatial rate of change and the direction of the edge normals. This achieves the expected technical effect of providing a physically meaningful reference input object for the subsequent reconstruction of the energy functional of the gradient field.
[0074] For example, for a 1024×1024 pixel grayscale image of a cable cross-section, a 3×3 Sobel operator is used as an isotropic differential approximation template to calculate the convolution results in the horizontal and vertical directions. The image grayscale range is set to 0-255, and the horizontal partial derivative of a certain conductor layer boundary pixel is calculated to be 45.2, and the vertical partial derivative to be 38.6. Substituting these values into the magnitude formula yields a gradient magnitude of 59.4, and substituting them into the direction formula yields a gradient angle of 0.71 radians. The same operation is performed on all pixels in the image to generate a 1024×1024×2-dimensional initial vector gradient field matrix. L2 norm normalization is performed on this matrix, mapping the maximum gradient magnitude to 1.0, and scaling the remaining pixels proportionally. The final output initial vector gradient field accurately reflects the radial gradient distribution characteristics of the cable's concentric circular structure, eliminating spurious high-amplitude responses caused by background noise, and providing high-precision directional reference data for generating the soft-constraint topology mask matrix in step S2.2.
[0075] S2.2: Read the geometric topology data from the cross-sectional geometric template library, and perform parameterized mapping processing on the geometric topology data based on the concentric circle distribution rule of the conductor layer and the smooth continuity constraint of the sheath boundary to generate a soft-constraint topology mask matrix for limiting the evolution space of the gradient field.
[0076] Read the set of structured geometric topological constraints from the cross-sectional geometric template library, and extract the conductor layer concentric circle radius threshold, insulation layer thickness tolerance zone, and sheath boundary curvature constraint parameters.
[0077] Based on the polar coordinate symmetry of the cable cross section, a polar coordinate mapping grid with the image center as the origin is constructed to convert the pixel position in the Cartesian coordinate system into radial distance and angular components.
[0078] Using the concentric circle distribution rule, the Euclidean distance from each pixel to the image center is calculated and compared with the multi-layer radius threshold in the template library to generate a radial position membership matrix.
[0079] To address the smooth continuity constraint of the sheath boundary, a Gaussian kernel function is applied to spatially smooth the radial position membership matrix, suppressing radial jumps caused by local noise.
[0080] By combining the insulation layer thickness tolerance zone, the allowable region weight of gradient field evolution is set. High weight values are assigned within the tolerance zone, and low weight values or zero values are assigned outside the tolerance zone, thus forming a spatially weighted mask.
[0081] The radial position membership matrix is multiplied element-wise with the spatial weighted mask to generate an initial soft-constraint topological mask matrix, which characterizes the strength of the physical structure constraint on the gradient field at each point in space.
[0082] The initial soft-constraint topological mask matrix is normalized to ensure that its numerical range is between 0 and 1, in order to meet the numerical stability requirements in the subsequent energy functional solution process.
[0083] By using the above-mentioned parametric mapping and weighted fusion processing method, discrete geometric topological constraints are transformed into continuous spatial weight distribution data, generating a soft constraint topological mask matrix for limiting the gradient field evolution space, thus achieving the expected technical effect of embedding the prior physical structure of the cable into the image analysis process.
[0084] For example, for a 512x512 resolution cable cross-section image, the conductor layer radius threshold is set to 50±2 pixels, and the insulation layer outer diameter threshold is set to 100±3 pixels. A polar coordinate grid is constructed, and the radial distance of each pixel is calculated. When the radial distance of a pixel is in the range of 48 to 52 pixels, the radial membership degree is set to 1.0; it linearly decreases to 0.8 in the range of 52 to 55 pixels. A Gaussian kernel with a standard deviation of 1.5 is applied for smoothing. A weight of 0.9 is assigned within the insulation layer tolerance band, and 0.1 is assigned outside. After normalization, a 512x512 soft-constraint topology mask matrix is generated. This matrix effectively suppresses gradient perturbations in unstructured regions, ensuring that the subsequent gradient field evolution strictly follows the concentric circle structure of the cable, significantly improving the integrity of the contour extraction.
[0085] S2.3: Call the associated optical response feature vector in the cross-sectional geometry template library, and perform spatial distribution matching quantization operation on the optical response feature vector according to the statistical law of gray-level jump mode of historical qualified samples to generate a target gradient distribution reference field that represents the ideal gradient distribution mode.
[0086] The optical response feature vector associated with the cross-sectional geometry template library is called to extract the mean gradient magnitude, standard deviation of orientation consistency, and cross-layer attenuation coefficient at each interface, which are used as statistical benchmark parameters for constructing the target field.
[0087] Based on the concentric circle topology of the cable, an ideal geometric trajectory grid corresponding to the boundaries of the conductor layer, insulation layer and sheath layer is generated in the image coordinate system, providing spatial positioning anchor points for gradient distribution.
[0088] Along the normal direction of the ideal geometric trajectory, the mean gradient magnitude in the optical response eigenvector is spatially smoothed by using the Gaussian kernel function to construct a continuous theoretical gradient magnitude distribution map.
[0089] By combining the standard deviation of directional consistency, anisotropic weighting is applied to the theoretical gradient magnitude distribution map to enhance the gradient response of the main direction that conforms to historical statistical patterns and suppress random noise in non-structurally permissible directions.
[0090] By introducing a cross-layer attenuation coefficient, exponential attenuation modulation is applied to the gradient intensity transition region between adjacent layers to simulate the light intensity gradient characteristics at the interface of real materials, thus eliminating the pseudo-edge effect caused by step abrupt changes.
[0091] The desired gradient vector of any pixel in the target gradient distribution reference field is calculated using the following formula:
[0092]
[0093] in, This is the theoretical gradient magnitude obtained based on radius r interpolation. As a weighting factor for directional consistency, For cross-layer attenuation function, The boundary normal unit vector.
[0094] Through the aforementioned spatial distribution matching metric operation, the discrete optical response feature vector is transformed into a continuous target gradient distribution reference field across the entire field, realizing the mapping from statistical prior to pixel-level gradient constraints, and providing an accurate ideal reference benchmark for subsequent energy functional minimization.
[0095] For example, for a 20mm diameter power cable cross-section, the average gradient amplitude at the conductor-insulation interface is extracted to be 45 gray levels / pixel, with a standard deviation of 0.1 radians for directional consistency. A point is sampled every 1 degree along a 10mm radius circular trajectory, and the amplitude is interpolated using a Gaussian kernel. An interlayer attenuation coefficient of 0.8 is set, and the gradient within a 5-pixel range outside the insulation layer is subjected to exponential attenuation modulation. The calculated target gradient field shows that the magnitude of the desired gradient vector at the conductor edge is stable between 42 and 48, with a strictly radial distribution, effectively eliminating background noise interference and significantly improving the signal-to-noise ratio of the contour extraction.
[0096] S2.4: Integrate the initial vector gradient field, the soft-constrained topological mask matrix, and the target gradient distribution reference field. Based on the variational method principle, construct a composite function expression containing data fidelity terms and structural prior regularization terms. Generate a gradient field reconstruction energy functional with structural prior regularization terms. Its minimization objective is defined as driving the current image gradient field to approximate the target gradient distribution reference field within the range of the soft-constrained topological mask matrix.
[0097] Read the initial vector gradient field data generated in S2.1 and use it as the basic input for the data fidelity term in the energy functional construction to ensure that the reconstruction process is faithful to the gray-level transition information of the original image.
[0098] The soft-constraint topology mask matrix generated by S2.2 is called, and the matrix is mapped to a spatial weight function to define the legal geometric region of gradient field evolution and suppress the gradient response of non-cable structure regions.
[0099] Introducing the target gradient distribution reference field generated by S2.3, we extract the gradient magnitude and direction distribution characteristics that characterize the ideal boundary, and use them as the optimization target benchmark for the structural prior regularization term.
[0100] Based on the principle of variational methods, a composite energy functional containing data fidelity terms and structural prior regularization terms is constructed. Its mathematical expression is defined as:
[0101]
[0102] in, For the vector gradient field to be reconstructed, For the initial vector gradient field, As the reference field for the target gradient distribution, For soft-constraint topological mask matrix, For balance coefficient, Define the domain for the image.
[0103] The Euler-Lagrange equations are derived for the energy functional, transforming the problem of minimizing the energy functional into solving the corresponding set of partial differential equations, and establishing the iterative rules for updating the gradient field.
[0104] By using the above processing method, the initial gradient field, geometric constraints, and optical priors are integrated into a unified mathematical optimization model, generating a gradient field energy functional with structural priors as regularization terms, realizing the transformation from discrete pixel response to continuous physical boundary field, and providing a clear convergence target for subsequent implicit iterative solutions.
[0105] Step S3: Iteratively solve the energy functional of the gradient field reconstruction, updating only the normal component of the gradient field in each iteration while simultaneously suppressing gradient perturbations in non-structure-allowed directions, until convergence to generate a vector gradient field. Specifically, this includes:
[0106] S3.1: Calculate the initial scalar gradient field based on the original image data of the cable cross section, and define the normal projection operator according to the geometric topology in the cross section geometric template library. Perform directional decomposition processing on the initial scalar gradient field to separate the normal gradient component and tangential interference component that meet the constraints of the concentric circle distribution of the cable and the smooth continuity of the sheath boundary, and obtain the normal gradient field component data to be optimized.
[0107] The system reads the standardized preprocessed raw image data of the cable cross-section and inputs it as a scalar field into the differential operator module. The Sobel or Scharr operator is used to perform convolution operations on the image pixel matrix, calculating the first-order partial derivatives of grayscale in the horizontal and vertical directions to generate initial gradient magnitude and initial gradient direction maps. Based on the pre-defined concentric circle topology in the cross-section geometry template library, a polar coordinate system is established with the image geometric center as the origin, and a radial normal projection operator is defined. This operator maps the gradient vector in the Cartesian coordinate system to the polar coordinate basis, extracting gradient components that diverge or converge along the radial direction. The projection values of the initial gradient vector and the radial unit vector of each pixel are calculated through dot product operations, separating the normal gradient component that conforms to the physical characteristics of the conductor layer and insulation layer interface. Simultaneously, the tangential gradient component perpendicular to the radial direction is extracted; this component mainly corresponds to material texture noise or unstructured lighting artifacts. A Gaussian smoothing filter is applied to perform spatial domain noise reduction on the normal gradient component, suppressing high-frequency random noise interference and retaining low-frequency structural information reflecting the true physical boundary. A threshold truncation operation is performed on the denoised normal gradient components to remove invalid gradient responses with amplitudes lower than the background noise baseline, resulting in sparsed normal gradient field component data to be optimized. Through normal projection decomposition and noise suppression, the initial vector gradient field from the previous step is transformed into normal gradient component data that conforms to the concentric circle distribution constraints of the cable, achieving the expected technical effects of effectively removing non-structural directional interference and enhancing key boundary features.
[0108] S3.2: Construct a structural prior regularization function using the optical response feature vector generated from historical qualified samples, and substitute the normal gradient component data as input variables into the gradient field to reconstruct the energy functional. Perform energy value quantization calculation to evaluate the degree of distribution deviation between the current normal gradient field component data and the standard gray-scale jump mode, and obtain the energy functional value including topological constraint error.
[0109] Receive the normal gradient field component data to be optimized from the output of S3.1 and use it as the spatial distribution basis variable for energy functional calculation.
[0110] By calling the optical response feature vector bound in the cross-sectional geometry template library, the mean and standard deviation parameters of typical gradient magnitudes at each interface are extracted, and a Gaussian structure prior regularization function is constructed.
[0111] Substitute the normal gradient field component data pixel by pixel into the structural prior regularization function to calculate the penalty weight for the current gradient magnitude deviating from the statistical regularity of historical qualified samples.
[0112] Based on the principle of variational method, a composite energy functional including topological constraint error is constructed by integrating data fidelity terms and structural prior regularization terms.
[0113] Perform the discretized numerical integration operation of the energy functional on all pixels in the image domain, and accumulate the local energy contribution value of each point.
[0114] By performing energy quantization calculations, the normal gradient field data from the previous step is transformed into an energy functional value that includes topological constraint errors. This enables an accurate assessment of the deviation between the current gradient field and the standard gray-scale jump mode distribution, providing a clear convergence guide for subsequent iterative optimization.
[0115] S3.3: A lightweight implicit iterative solution method is executed for the energy function value. In each iteration cycle, only the magnitude of the normal gradient field component data is updated by gradient descent. At the same time, an unstructured allowable direction suppression filter is applied to remove noise disturbances introduced by the tangential interference component, so as to gradually minimize the energy function value and enhance the directional consistency of the gradient field, and obtain the intermediate state vector gradient field data in the convergence process.
[0116] The energy generalized function value containing topological constraint error and the normal gradient field component data to be optimized are received from the output of S3.2 and used as the initial state variables for implicit iterative solution.
[0117] A lightweight iterative update operator based on the Euler-Lagrange discretization scheme is constructed to transform the energy minimization problem in the continuous domain into a process of solving a system of difference equations on a pixel grid.
[0118] For each pixel in the normal gradient field, calculate the partial derivative of the energy functional with respect to the magnitude of the normal gradient at that point, and form a local gradient descent direction vector.
[0119] An unstructured allowable direction suppression filter is introduced, which is based on the soft-constrained topological mask matrix generated by S2.2 to identify and mark pixel regions where tangential interference components dominate.
[0120] During the iterative update process, a strong attenuation coefficient is applied to the tangential gradient component of the marked region, forcing its amplitude to approach zero, thereby eliminating the non-physical edge response caused by noise.
[0121] The system synchronously monitors the directional consistency index of the updated vector gradient field in the local neighborhood. If the angle between the gradient directions of adjacent pixels exceeds a preset threshold, an anisotropic diffusion smoothing operation is triggered.
[0122] By using the above-mentioned lightweight implicit iterative solution method, the energy functional value of the previous step is transformed into intermediate state vector gradient field data in the convergence process, which significantly enhances the consistency of gradient field direction and effectively suppresses noise disturbance.
[0123] S3.4: Monitor the magnitude change rate and directional divergence index of the intermediate state vector gradient field data, and determine whether they meet the preset convergence threshold conditions. If they do not meet the threshold conditions, the step size parameters of the implicit iterative solution method are adjusted and a new round of iteration is executed. If the threshold conditions are met, the iteration process is terminated to obtain the final state vector gradient field data with stable spatial modulation characteristics.
[0124] Receive the intermediate state vector gradient field data output by S3.3, extract the gradient magnitude and orientation angular components of each pixel, and construct the field state matrix for the current iteration period.
[0125] The relative rate of change of the gradient field modulus between two adjacent iterations is calculated, and the L2 norm is used to measure the amplitude of energy fluctuations in the entire field, thus quantifying the stability index of the field evolution.
[0126] Perform divergence operations on the vector gradient field to calculate the degree of divergence of the gradient vector at each pixel, and generate a directional divergence distribution map to characterize local topological consistency.
[0127] The root mean square error of the divergence values across the entire field is statistically analyzed and used as a quantitative criterion for directional convergence to assess whether the gradient field tends to have a smooth and continuous structured distribution.
[0128] The relative rate of change of modulus and the root mean square error of divergence are logically compared with the preset amplitude convergence threshold and directional convergence threshold, respectively.
[0129] If any indicator exceeds the corresponding threshold, it is determined that the current field state has not converged. The implicit iteration step size parameter is dynamically reduced according to the deviation ratio to suppress oscillations and return to S3.3 to execute a new round of updates.
[0130] If both indicators are below the threshold, the gradient field evolution is determined to have reached a steady state, the iteration process is terminated, and the current field data is locked as the final state vector gradient field.
[0131] By using a multi-dimensional convergence index monitoring and adaptive step size feedback mechanism, intermediate state iterative data is transformed into final state vector gradient field data with stable spatial modulation characteristics, thereby ensuring field stability before high-precision contour extraction.
[0132] For example, the amplitude convergence threshold is set to 0.001, and the direction convergence threshold is set to 0.05. In the 50th iteration, the calculated relative rate of change of the magnitude is 0.0008, and the root mean square error of the divergence is 0.032, both below the thresholds, indicating convergence. If the rate of change is 0.002 in the 49th iteration, the step size is automatically adjusted from 0.1 to 0.05, and iterations continue until the conditions are met, significantly improving the directional consistency of the gradient field.
[0133] S3.5: Perform dispersion region localization analysis and maximum modulus path tracing preprocessing on the final state vector gradient field data to verify whether it exhibits continuous closed loop topological features, so as to confirm that the final state vector gradient field data has eliminated the fracture defects caused by traditional edge detection, and output a vector gradient field with directional continuity and intensity spatial modulation characteristics for subsequent contour synthesis.
[0134] Receive the final state vector gradient field data with stable spatial modulation characteristics output by S3.4. This data contains the gradient magnitude and direction information of each pixel in the image domain.
[0135] The divergence operator is performed on the final state vector gradient field to calculate the degree of divergence of the gradient vector at each pixel, generating a zero-divergence distribution map that characterizes the topological discontinuity.
[0136] In the dispersion distribution map, the region of numerical minimum value is located and mapped to a set of candidate physical boundary locations, thereby identifying continuous edge zones formed by structural priors.
[0137] Based on the candidate physical boundary location set, the pixel with the largest gradient magnitude in the local neighborhood is extracted as the path tracing seed point to construct an initial high-confidence boundary node network.
[0138] Starting from the seed point, maximum modulus path tracing is performed along the gradient field vector direction, connecting adjacent nodes to form a preliminary closed contour trajectory, ensuring the continuity of the path in geometric topology.
[0139] Curvature smoothing constraints are applied to the initial closed contour trajectory to eliminate high-frequency jitter caused by discrete sampling, and to verify whether the trajectory exhibits a closed loop characteristic that conforms to the concentric circle structure of the cable.
[0140] By using discrete region localization and maximum modulus path tracing, the vector gradient field from the previous step is transformed into verified vector gradient field data with directional continuity and intensity spatial modulation characteristics, thus achieving the expected technical effect of eliminating contour breakage defects caused by traditional edge detection.
[0141] For example, for a final-state vector gradient field with a resolution of 1024x1024, the divergence is calculated using the central difference method, with a divergence threshold of 0.05, and 360 high-confidence seed points are selected. A path is traced along the gradient direction with a step size of 1 pixel and an angular deviation tolerance of 5 degrees to generate a closed trajectory. After curvature smoothing, the trajectory closure error is less than 0.1 pixels, with no breakpoints, significantly improving contour integrity.
[0142] like Figure 2As shown, step S4 involves locating the actual physical boundary position based on the dispersion region of the vector gradient field, and synthesizing a globally coherent cable cross-section profile curve that does not rely on single-point threshold determination by tracing the path of the maximum modulus in the vector gradient field and applying curvature smoothing constraints, thereby completing the analysis of the cable cross-section image. Specifically, this includes:
[0143] S4.1: Perform a divergence operator on the vector gradient field to calculate the gradient divergence of each pixel and generate a divergence distribution map, thereby mapping the topological discontinuity region of the gradient field to a set of candidate physical boundary locations.
[0144] Receive the final state vector gradient field data with directional continuity and intensity spatial modulation characteristics output from step S3. This data contains the gradient magnitude and direction information of each pixel in the image.
[0145] Construct a discrete two-dimensional divergence operator and calculate the rate of change of the gradient components in the horizontal and vertical directions for each pixel in the vector gradient field.
[0146] The central difference method is used to estimate the partial derivatives of the lateral components of the gradient field to obtain the gradient divergence contribution value in the horizontal direction.
[0147] The central difference method is used to estimate the partial derivatives of the longitudinal components of the gradient field to obtain the gradient divergence contribution value in the vertical direction.
[0148] The scalar divergence value of the current pixel is obtained by algebraically summing the gradient divergence contributions in the horizontal and vertical directions.
[0149] Traverse all pixels in the image to generate a dispersion distribution map with the same size as the original image. The highlighted areas in the map correspond to the source or sink points of the gradient field, i.e., the potential physical boundary locations.
[0150] Non-maximum suppression is performed on the dispersion distribution map to retain local extreme points to refine the boundary positioning accuracy and form a set of candidate physical boundary locations.
[0151] By using the dispersion operator, the vector gradient field from the previous step is transformed into dispersion distribution map data that characterizes topological discontinuities, thus realizing the mapping from the continuous field to the discrete boundary candidate set and effectively avoiding the contour breakage problem caused by threshold sensitivity in traditional edge detection.
[0152] For example, for a cable cross-section image with a resolution of 512x512, the center difference step size is set to 1 pixel. The calculated peak dispersion of the conductor layer boundary is 0.85, and the peak dispersion of the insulation layer interface is 0.62. After non-maximum suppression, the number of candidate boundary points is reduced from the initial 15,000 to 1,200, and the boundary continuity index is improved to 0.98, significantly eliminating false edge responses caused by noise and providing high-precision seed points for subsequent path tracing.
[0153] S4.2: Perform threshold segmentation based on the dispersion distribution map to filter out high-confidence boundary seed points and construct an initial boundary node network, thereby eliminating false gradient responses caused by noise and establishing discrete support points of the real physical boundary.
[0154] The system receives the scattered distribution map data generated by S4.1, which characterizes the intensity distribution of topologically discontinuous regions in the vector gradient field. Histogram statistical analysis is performed on the scattered distribution map to calculate the mean and standard deviation of global pixel grayscale values, establishing the background noise baseline level. An initial segmentation threshold is dynamically calculated based on Otsu's maximum inter-class variance method or an adaptive Gaussian mixture model to distinguish between high-confidence boundary responses and low-confidence noise interference. This dynamic segmentation threshold is applied to binarize the scattered distribution map, generating a preliminary binary boundary mask, where high-value regions are marked as candidate boundary points. Morphological opening operations are performed on the preliminary binary boundary mask, using structuring elements to remove isolated noise points and small fragments, retaining the main boundary clusters with significant topological coherence. A skeleton refinement method is applied to the cleaned boundary clusters, extracting the centerline skeleton with a single pixel width to eliminate the influence of boundary width fluctuations on subsequent node localization. Based on the curvature extrema and local maxima of gradient magnitude on the skeleton line, key feature points are sparsely sampled and extracted to construct an initial set of boundary nodes. Based on the concentric circle geometric prior of the cable cross-section, the Euclidean distance and angular constraints between adjacent nodes are calculated to eliminate outlier nodes that violate geometric topological rules. Topological connections between nodes are established through nearest neighbor interpolation or Delaunay triangulation, forming an initial boundary node network with spatial order. Through the aforementioned threshold segmentation, morphological cleaning, and topology construction processes, the scattered distribution map from the previous step is transformed into structured initial boundary node network data, achieving the expected technical effect of eliminating spurious gradient responses and establishing discrete support points for the real physical boundaries.
[0155] For example, for a 1024x1024 resolution sporadic distribution map, the global mean is calculated to be 12.5 and the standard deviation is 8.2. A dynamic segmentation threshold of 28.9 (mean plus twice the standard deviation) is set to generate a binary mask. Opening operations are performed using 3x3 rectangular structuring elements to remove isolated noise points with an area less than 10 pixels. The Zhang-Suen thinning method is applied to the remaining connected components to extract single-pixel skeletons. Nodes are sampled every 5 pixels or at curvatures greater than 0.1 on the skeleton, initially obtaining 120 nodes. Based on the concentric circle prior, outlier nodes with radial deviations exceeding 2 pixels are removed, leaving 96 high-confidence nodes. Node connections are established based on polar angle sorting to form a closed initial boundary node network, effectively supporting subsequent path tracing.
[0156] S4.3: Using the initial boundary node network as the search starting point, the maximum modulus path tracing method is executed to connect adjacent nodes along the direction of maximum vector gradient field intensity and generate a preliminary closed contour trajectory, thereby forming a continuous path skeleton that reflects the geometry of the cable cross-section.
[0157] The system receives the initial boundary node network output from S4.2 and the vector gradient field data output from S3, which serve as the topology starting point and direction guide source for path tracing.
[0158] For each seed point in the initial boundary node network, extract the gradient magnitude and direction angle of its corresponding position in the vector gradient field, and construct a set of candidate connection points within the local search window.
[0159] Based on the geometric prior of concentric circles of cable cross-section, a directional constraint function for path extension is defined, the directional deviation cost from the current node to each candidate connection point is calculated, and invalid connections that deviate from the normal threshold range are eliminated.
[0160] A global energy-minimizing path model is constructed using dynamic programming. The path cumulative energy function is defined as a weighted sum of the integral of the gradient magnitude between adjacent nodes and the curvature smoothing term.
[0161] The greedy search strategy is executed iteratively. Starting from the seed point, the next node that minimizes the local energy increment is selected in the neighborhood that satisfies the directional constraints, and the path chain is extended step by step.
[0162] The system monitors the closure indicators during the path extension process. When the Euclidean distance between the path endpoint and the starting point is less than the preset closed-loop threshold and the tangential angle is continuous, it determines that a preliminary closed contour trajectory has been formed.
[0163] By using maximum modulus path tracing and energy minimization optimization, discrete boundary seed points are transformed into physically meaningful globally coherent preliminary closed contour trajectories, thus achieving complete reconstruction of the cable cross-section topology.
[0164] S4.4: Apply curvature smoothing constraint optimization to the preliminary closed contour trajectory to eliminate high-frequency jitter in the path and correct local geometric distortion, thereby outputting a globally coherent cable cross-section contour curve that meets the requirements of smooth continuity of the cable sheath boundary.
[0165] Receive the preliminary closed contour trajectory data generated by S4.3. The trajectory consists of a sequence of discrete boundary nodes and includes high-frequency position jitter and local geometric distortion caused by residual gradient field noise.
[0166] Parametric resampling is performed on the initial closed contour trajectory. The arc length parameterization method is used to map discrete nodes to a unified parameter domain, eliminating the interference of uneven node distribution on curvature calculation and generating an equally spaced parameterized node sequence.
[0167] Based on the equally spaced parameterized node sequence, the tangent vector and normal vector of each node are calculated using the central difference method to construct a local Frenet frame, providing an orthogonal reference coordinate system for subsequent curvature quantization.
[0168] Based on the physical constraint of the smooth continuity of the cable sheath boundary, a maximum allowable curvature threshold is set, and the discrete curvature value of each node is calculated.
[0169] A weighted moving average filter is applied to smooth out abnormal nodes. The weight coefficients are set according to a Gaussian distribution, and the weights of neighboring nodes decrease exponentially with increasing distance, thus suppressing high-frequency noise while preserving low-frequency geometric features.
[0170] B-spline curve fitting is performed on the smoothed node sequence. Cubic B-spline basis functions are selected, and the control point positions are optimized by least squares method so that the fitted curve minimizes the mean square error with the original nodes while satisfying the continuity constraint.
[0171] Verify the closure and smoothness of the fitted curve, calculate the distance deviation and curvature change rate of the first and last nodes, and if the deviation is greater than the pixel-level threshold, perform endpoint fusion correction and output a globally coherent cable cross-section profile curve.
[0172] By optimizing the curvature smoothing constraint, the initial closed contour trajectory is transformed into a globally coherent cable cross-sectional contour curve that meets the requirements of smooth continuity of the cable sheath boundary, thereby achieving the expected technical effect of eliminating high-frequency jitter and correcting local geometric distortion.
[0173] For example, the initial closed contour trajectory is parameterized by arc length, with a sampling interval of 0.5 pixels, generating 200 equally spaced nodes. The curvature of each node is calculated, and a maximum allowable curvature threshold is set to 0.02. -1Pixel count. Fifteen nodes with excessive curvature were identified, and a Gaussian weighted moving average filter was applied with a standard deviation of 2.0 pixels. Cubic B-spline fitting was used with 50 control points and a least-squares iteration convergence threshold of 1e-6. The final output contour curve exhibits smooth curvature changes without breaks or sharp corners, and the geometric deviation is controlled within 0.1 pixels, significantly improving contour recognition accuracy.
[0174] like Figure 3 As shown, step S5 involves calculating the overall matching confidence level based on the globally coherent cable cross-section profile curve and the geometric template library of each cross-section, and determining whether the overall matching confidence level is lower than a preset dynamic calibration threshold. If the determination result is yes, an online prior calibration mechanism is triggered; otherwise, the cross-section geometric template library remains unchanged. Specifically, this includes:
[0175] S5.1: Obtain the global coherent cable cross-section profile curve and the geometric topology in the geometric template library of each candidate cross-section. Perform spatial morphological alignment calculation based on the Hausdorff distance metric method to generate a morphological difference matrix that characterizes the geometric deviation between the current image boundary and the standard template.
[0176] Obtain the set of globally coherent cable cross-section profile curve points after curvature smoothing, and traverse the cross-section geometry template library to retrieve the standardized geometric topology data of all candidate templates.
[0177] The centroid normalization and scale alignment preprocessing are performed on the contour curve point set and the candidate template structure respectively to eliminate the influence of translation and scaling differences on shape comparison and construct a set of geometric objects to be compared under a unified coordinate system.
[0178] Based on the Hausdorff distance metric, the minimum Euclidean distance from any point on the current contour curve to the candidate template boundary is calculated, and a forward distance mapping matrix is generated to quantify the maximum deviation of the measured boundary from the standard template.
[0179] The minimum Euclidean distance from any point on the candidate template boundary to the current contour curve is calculated in reverse, and a backward distance mapping matrix is generated to evaluate the coverage integrity and missing risk of the standard template in the measured image.
[0180] By integrating the forward and backward distance mapping matrices and taking the maximum value of the two as the bidirectional Hausdorff distance index, a morphological difference matrix is constructed to characterize the geometric deviation between the current image boundary and the standard template. This matrix fully records the geometric mismatch of each local region.
[0181] By using the above bidirectional maximum and minimum distance calculation method, the discrete contour points and template structure of the previous step are transformed into quantified morphological difference matrix data, which realizes high-sensitivity capture of cable cross-sectional geometric deformation and positional deviation, and provides accurate geometric error input for subsequent multi-source confidence fusion.
[0182] For example, for a power cable cross-section with a nominal outer diameter of 20mm, a globally coherent contour curve containing 360 sampling points is extracted. A standard concentric circle template of the corresponding specification is set in the template library, with a radius tolerance of ±0.5mm. After centroid alignment, the Euclidean distance from the contour point set to the template boundary is calculated. If the insulation layer eccentricity causes a local distance deviation of 0.8mm, the forward distance mapping matrix records 0.8mm at that angle position. The distance from the template point to the measured contour is calculated in reverse. If there is a sheath defect causing the template point to exceed the measured boundary by 2mm, the backward matrix records 2mm. The maximum value of the two, 2mm, is taken as the morphological difference value of the region, generating a full circumferential morphological difference matrix. This matrix accurately identifies the sheath defect and conductor eccentricity positions, with a geometric deviation quantification accuracy of 0.1mm, significantly improving the reliability of the geometric basis for subsequent confidence judgment.
[0183] S5.2: Using the grayscale distribution data of the morphological difference matrix and the original image data of the cable cross section, combined with the optical response feature vectors pre-stored in the cross section geometric template library, the gradient field pattern matching operation is performed using the weighted cosine similarity method to output a set of optical matching coefficients that reflect the consistency of local edge responses.
[0184] The grayscale distribution data of the morphological difference matrix generated by S5.1 and the original image data of the cable cross section are obtained as the basic input objects for optical matching operations.
[0185] Extract the pre-stored optical response feature vector from the cross-sectional geometry template library. This vector contains the typical gradient magnitude range, directional consistency threshold, and cross-layer attenuation coefficient at each layer interface.
[0186] Based on the geometric alignment relationship determined by the morphological difference matrix, local image patches corresponding to the template boundary are extracted from the original image, and the gradient histogram of the local image patches is calculated to characterize the edge response mode under the current imaging conditions.
[0187] The extracted current gradient histogram and the optical response feature vector in the template are mapped to the same high-dimensional feature space to construct a sequence of feature vectors to be matched.
[0188] Gradient field pattern matching is performed using the weighted cosine similarity method, and the optical matching coefficient is calculated using the following formula:
[0189]
[0190] in, For optical matching coefficients, Let be the weight coefficient for the i-th interface region. This is the local gradient feature vector of the current image. This is the template optical response feature vector.
[0191] Based on the differences in the sensitivity of each layer of cable material to imaging quality, the weighting coefficients are dynamically adjusted, and the conductor-insulation interface is given a higher weight to strengthen the consistency verification of key structures.
[0192] Traverse all candidate templates and their corresponding multi-layer interface regions, calculate the optical matching coefficients for each region, and form a set of optical matching coefficients that reflect the consistency of local edge response.
[0193] By using a weighted cosine similarity method and a dynamic weight allocation mechanism, the gradient information of the geometrically aligned image is quantitatively compared with historical optical priors, and a set of optical matching coefficients is output, thus achieving a robust evaluation of edge response consistency under illumination changes and noise interference.
[0194] S5.3: Perform multi-source information fusion processing on the geometric deviation value derived from the morphological difference matrix and the optical matching coefficient set, and apply the Bayesian confidence estimation model to perform joint probability inference to generate a comprehensive matching confidence that quantifies the recognition reliability of the current frame.
[0195] The set of geometric deviation values derived from the received morphological difference matrix and the set of optical matching coefficients serve as the input data source for multi-source information fusion.
[0196] The geometric deviation values are normalized and mapped to a confidence interval of zero to one to construct a geometric likelihood function that characterizes the degree of fit of the spatial structure.
[0197] We perform weighted smoothing on the optical matching coefficients to eliminate response fluctuations caused by local noise and construct an optical likelihood function that characterizes the consistency of optical properties at the material boundary.
[0198] A joint probability inference model is constructed based on Bayes' theorem, and the geometric likelihood function and the optical likelihood function are introduced as independent observation evidence into the posterior probability calculation process.
[0199] Calculate the overall matching confidence score, perform a linear transformation on the calculated posterior probability value, and quantify it into an overall matching confidence score in the range of 0 to 100, which serves as the final metric for the reliability of the current frame recognition.
[0200] By using Bayesian joint probability inference processing, the geometric deviation and optical matching data from the previous step are transformed into a quantified comprehensive matching confidence level, thereby achieving the expected technical effect of accurate assessment of recognition reliability under multimodal feature complementarity.
[0201] For example, the geometric deviation normalization coefficient is set to 0.8, the optical matching weighting coefficient is set to 0.9, and the prior probability is set to 0.5. When a geometric deviation value of 0.15 and an optical matching coefficient of 0.85 are detected in a certain frame, the geometric likelihood value and optical likelihood value are calculated to be 0.85 and 0.85 respectively. Through Bayesian inference, the posterior probability is significantly improved, and the final output comprehensive matching confidence is 82.5. This value is higher than the dynamic calibration threshold, indicating that the current template matching degree is high, and there is no need to trigger online calibration. This effectively avoids false triggering caused by fluctuations in a single feature and significantly improves the stability of the system in complex lighting environments.
[0202] S5.4: Read the preset dynamic calibration threshold parameter, and logically compare the comprehensive matching confidence with the dynamic calibration threshold. If the comprehensive matching confidence is lower than the dynamic calibration threshold, generate an online prior calibration trigger command; otherwise, maintain the current cross-sectional geometry template library state unchanged.
[0203] Read the preset dynamic calibration threshold parameter, which is determined based on the statistical mean and three times the standard deviation of the confidence distribution of historical qualified samples under standard illumination conditions, and serves as the benchmark limit for judging the model's adaptability.
[0204] Obtain the comprehensive matching confidence score generated in the previous steps. This scalar quantifies the degree of joint matching between the current frame cable cross-sectional profile and the standard topology and optical response features in the geometric template library.
[0205] The logical comparison and judgment operation is performed to compare the comprehensive matching confidence with the dynamic calibration threshold to evaluate whether the recognition reliability under the current imaging environment meets the quality control requirements.
[0206] If the overall matching confidence is lower than the dynamic calibration threshold, it indicates that there is a significant change in illumination or background interference in the current image, causing the prior model to fail, and the system generates an online prior calibration trigger command.
[0207] If the overall matching confidence level is higher than or equal to the dynamic calibration threshold, it is determined that the current cross-sectional geometry template library has sufficient environmental adaptability, and the template library state is maintained unchanged to ensure real-time processing.
[0208] Through the aforementioned threshold determination mechanism, the confidence assessment results of the previous step are transformed into explicit control commands, enabling adaptive response to lighting fluctuations in complex industrial environments and ensuring the stability of contour recognition accuracy.
[0209] For example, the dynamic calibration threshold is set to 0.85. When the overall matching confidence score of a certain image frame is 0.72 due to strong light interference from welding on site, which is less than 0.85, the system immediately generates an online prior calibration trigger command and initiates small-sample incremental learning in step S6. If the confidence score of another image frame is 0.93 under normal lighting, which is greater than 0.85, the system keeps the template library unchanged and directly outputs the detection result. This mechanism effectively avoids computational redundancy caused by frequent updates and significantly improves the robustness of contour extraction under abnormal working conditions.
[0210] S5.5: In response to the generated online prior calibration trigger command, lock the current frame image and its neighboring frame sequence as update source data, mark the corresponding template index in the cross-sectional geometry template library to be updated, so as to complete the initialization preparation of the online prior calibration mechanism and pass it to the subsequent small sample incremental learning stage.
[0211] The system receives the online prior calibration trigger command generated by S5.4 and parses the current frame timestamp and low-confidence template index identifier carried in the command. Based on the timestamp, it retrieves the original image data of the current frame and its N adjacent frames from the image buffer queue to construct a local update source dataset containing spatiotemporal context information. For each frame in the local update source dataset, it performs coordinate space mapping and uses the globally coherent cable cross-section contour curve output by S4 as a geometric mask to extract pixel grayscale values and gradient vector information within the contour neighborhood. It calculates the mean magnitude and variance of the gradient vectors within the extracted region, and selects a set of pixels with gradient direction consistency higher than a preset threshold and stable magnitudes to form a high-confidence stable boundary segment candidate set. It reads the cross-section geometric template library and locates the specific geometric-optical joint feature mapping entry to be updated based on the template index. It compares the spatial distribution features of the high-confidence stable boundary segment candidate set with the geometric topology of the template to be updated to confirm the physical layer attribute of the boundary segment. It marks the template index as a "state to be incrementally learned" and packages the statistical feature data of the stable boundary segment candidate set into an incremental learning input package. Through the above processing method, the calibration trigger signal of the previous step is transformed into structured update source data containing highly reliable boundary information and a clear target template index, realizing the data initialization preparation of the online prior calibration mechanism and providing accurate feature correction basis for subsequent small sample incremental learning.
[0212] For example, the number of neighboring frames N is set to 3, i.e., the current frame t, the previous frame t-1, and the next frame t+1 are selected, totaling 3 frames. The preset gradient direction consistency threshold is 0.85, and the modulus stability deviation threshold is 5 gray levels. When the matching confidence of the template index ID_02 is detected to be lower than 0.6, calibration is triggered. The system extracts a 5-pixel-wide strip region around the contour curve in these 3 frames. Calculation shows that the gradient direction variance of a certain insulating layer boundary in frame t is 0.02, and the mean modulus is 45, which meets the stability requirements and is included in the stable boundary segment candidate set. The gradient magnitude histogram corresponding to this candidate set is compared with the historical optical response feature vector in the ID_02 template, and ID_02 is marked as a state to be updated. The final output contains the gray-level statistics of the 3 stable boundary segments and the ID_02 index, which significantly improves the targeting and accuracy of subsequent template updates.
[0213] Step S6: In response to the triggered online prior calibration mechanism, stable boundary segment data is extracted, and the cross-sectional geometry template library is updated using the stable boundary segment data to generate an adaptively evolved cross-sectional geometry template library. Specifically, this includes:
[0214] S6.1: Based on the online prior calibration trigger command, perform multi-frame spatiotemporal correlation analysis on the current frame image and its time series neighboring frame images, use the gradient field vector continuity criterion to filter out pixel regions with low dispersion characteristics, and generate a stable boundary segment candidate set containing high confidence physical boundary information.
[0215] S6.2: Based on the generated stable boundary segment candidate set, perform statistical aggregation operation on the pixel gray-level jump patterns in the candidate set, use the local gradient direction consistency constraint to remove abnormal noise points, and calculate the stable boundary segment gray-level jump statistics that characterize the real material interface properties under the current imaging environment.
[0216] Receive the stable boundary segment candidate set generated by S6.1. This set contains the high-confidence pixel coordinates and their corresponding gradient vector data selected by spatiotemporal correlation in the current frame and neighboring frames.
[0217] For each pixel in the candidate set, extract its local neighborhood gray value in the original image, calculate the first-order gray-level difference along the gradient direction, and construct a local gray-level jump intensity sequence.
[0218] By utilizing local gradient direction consistency constraints, the cosine of the angle between gradient vectors in the neighborhood is calculated. A direction consistency threshold is set, and abnormal noise points with angles exceeding the threshold are eliminated, while structurally stable boundary pixels are retained.
[0219] For the retained stable boundary pixels, the mean and standard deviation of their gray-level jump intensity are statistically analyzed to construct a local statistical feature vector characterizing the optical properties of the material interface under the current imaging environment.
[0220] A weighted aggregation method is adopted to perform weighted fusion of local statistical features based on the confidence of the gradient magnitude of pixels, thereby eliminating random noise interference and generating globally stable gray-level transition statistics of boundary segments.
[0221] Through the above statistical aggregation and consistency constraint processing, the discrete boundary pixels of the previous step are transformed into structured statistics that characterize the optical response properties of the real physical interface, realizing robust extraction of cable contour features under dynamic lighting conditions and providing high-precision data support for the adaptive update of the template library.
[0222] For example, for a cross-sectional image of a certain type of power cable, the candidate set of stable boundary segments contains 5000 pixels. The local neighborhood size is set to 5x5 pixels, and the directional consistency threshold is set to 0.85. The calculated mean of the local gray-level jump intensity is 45.2, and the standard deviation is 3.1. After directional consistency filtering, 120 outliers are removed, leaving 4880 stable pixels. After weighted fusion based on gradient modulus confidence, the mean of the generated gray-level jump statistics is corrected to 45.5, and the standard deviation is reduced to 2.8. This statistic accurately reflects the true gray-level jump characteristics of the insulation layer and sheath interface, significantly improving the accuracy of subsequent template matching and effectively suppressing feature drift caused by fluctuations in ambient lighting.
[0223] S6.3: Based on the calculated gray-scale jump statistics of the stable boundary segment, the feature vector difference evaluation is performed on the corresponding templates in the cross-sectional geometry template library whose matching degree is lower than the dynamic calibration threshold. The new statistics are fused with the historical optical response feature vectors using the weighted average fusion method to generate a large sample incremental dataset of optical response feature vectors to be updated.
[0224] Retrieve the old version of the optical response feature vector that matches the current cable model from the cross-sectional geometry template library, and extract the pre-stored standard gradient distribution parameters as benchmark reference data.
[0225] A model for evaluating the difference in eigenvectors is constructed, and the Euclidean distance between the new statistics and the old eigenvectors in multidimensional space is calculated to quantify the degree of deviation in the current environment.
[0226] Based on the calculated difference value, a weighted fusion coefficient matrix is dynamically generated, in which the weight of the new statistic increases nonlinearly with the increase of difference, so as to enhance the adaptability to environmental changes.
[0227] A weighted average fusion method is applied to perform a linear combination operation between the new statistics and the historical optical response feature vectors.
[0228] The fused vector is normalized to eliminate dimensional differences and ensure that the gradient magnitude range and direction consistency threshold are within the standard physical range.
[0229] The normalized vector is encapsulated as a new sample unit in the large sample incremental dataset, labeled with timestamps and environmental labels, forming the large sample incremental dataset of optical response feature vectors to be updated.
[0230] By using a weighted average fusion processing method, the statistical results of the previous step are transformed into an environmentally adaptable feature dataset to be updated, enabling the prior model to respond quickly and smoothly to changes in illumination and background.
[0231] S6.4: Based on the generated large-sample incremental dataset of optical response feature vectors to be updated, perform small-sample incremental learning iterative optimization on the old version of optical response feature vectors in the cross-sectional geometry template library, adjust the gradient magnitude range parameter and cross-layer attenuation coefficient using the recursive least squares estimation method, and output the corrected adaptive optical response feature vector.
[0232] Receive a large-sample incremental dataset of optical response feature vectors to be updated. This dataset contains newly extracted statistics on gray-level transitions at stable boundary segments and historical optical response feature vectors.
[0233] A parameter optimization model based on recursive least squares estimation (RLS) is constructed, and the gradient magnitude range parameter and the cross-layer decay coefficient are defined as the state variable vector to be optimized.
[0234] Initialize the covariance matrix and forgetting factor, setting the forgetting factor to a range of 0.95 to 0.99 to give higher weight to recent observation data and suppress the cumulative effect of historical noise.
[0235] Calculate the current information vector, which is the residual difference between the measured gradient statistics of the stable boundary segment and the predicted value based on the old eigenvector.
[0236] Calculate the Kalman gain matrix to determine the proportion of contribution of new observation data to the update of state variables.
[0237] Based on the calculated Kalman gain and innovation vector, a state variable update operation is performed to correct the values of the gradient magnitude range parameter and the cross-layer attenuation coefficient.
[0238] Update the covariance matrix to reflect changes in the uncertainty of parameter estimation and to provide a basis for the next iteration.
[0239] Repeat the process of information calculation, gain update and state correction until the parameter change rate is lower than the preset convergence threshold or the maximum number of iterations is reached.
[0240] Output the corrected adaptive optics response feature vector, which incorporates the real optical characteristics of the current environment.
[0241] By using the recursive least squares estimation method, the incremental dataset from the previous step is transformed into a corrected adaptive optics response feature vector, enabling the prior model to quickly adapt to dynamic lighting environments while maintaining accuracy.
[0242] For example, for a cross-sectional image of a certain type of high-voltage cable, the forgetting factor is set to 0.98, and the initial covariance matrix is the identity matrix multiplied by 1000. The observation matrix is set as a 3x3 diagonal matrix, corresponding to the three dimensions of the gradient magnitude mean, variance, and cross-layer attenuation coefficient. When a sudden change in illumination is detected that causes a decrease in matching confidence, five consecutive frames of stable boundary segment data are collected. In the first iteration, the measured gradient magnitude mean is 120, the predicted value is 115, and the innovation is 5. After calculating the Kalman gain, the gradient magnitude parameter is updated from 115 to 118.5. After 10 iterations, the parameter change rate drops below 0.01, and a new optical response feature vector is obtained. This vector significantly improves the edge continuity of subsequent contour extraction in low-contrast regions, effectively eliminating false edge interference caused by uneven illumination.
[0243] S6.5: Based on the corrected adaptive optics response feature vector of the output, perform atomic replacement operation on the complete data structure of the corresponding template in the cross-sectional geometry template library, lock the update state using a version control mechanism, and finally generate an adaptively evolved cross-sectional geometry template library containing the latest environmental adaptation parameters.
[0244] The system receives the corrected adaptive optics response feature vector from S6.4 and uses it as the core payload of the new version data structure to be added to the database. It constructs a metadata index header containing template ID, version number, timestamp, and checksum. The corrected feature vector and the metadata index header are serialized and encapsulated to form a complete atomic update transaction package. The system reads the old data structure at the corresponding template index position in the cross-sectional geometry template library, performs a mutex lock acquisition operation, and ensures that no other read / write processes access the storage unit during the update window. The atomic update transaction package is written to a temporary buffer area, and the cyclic redundancy check (CRC) code of the new data block is calculated to verify data integrity and prevent bit-flipping errors during transmission or storage. A memory-level atomic replacement instruction is executed, overwriting the old data structure with the new version data structure in the temporary buffer area at once, ensuring that the database state remains logically consistent at any time and avoiding service interruptions caused by intermediate states. The mutex lock is released, and the version control log is updated, recording the triggering reason, confidence threshold, and feature vector change magnitude of this update, generating an adaptively evolved cross-sectional geometry template library with version tags. Through atomic replacement and version control mechanisms, the optimized parameters obtained from offline calculations are seamlessly integrated into the online runtime library, enabling the prior model to complete environmental adaptive evolution without being aware of it, thus ensuring continuous high-precision contour recognition capabilities.
[0245] For example, for a cable cross-section template of model YJV22-3x150, its template ID is TPL_150_V3. The correction vector output by S6.4 includes an adjustment of the average gradient magnitude from 128 to 135 and an adjustment of the cross-layer attenuation coefficient from 0.85 to 0.82. The system constructs a metadata header, incrementing the version number to V4 and marking the timestamp as the current millisecond. A mutex lock is requested to lock the TPL_150_V3 storage block, the new vector is written to the buffer, and the CRC32 checksum is calculated to be 0xA1B2C3D4. An atomic write operation is performed, overwriting the V3 version with the V4 version data, taking less than 1ms. The update log records the process of the confidence level increasing from 0.75 to 0.92. In the final generated template library, TPL_150_V4 takes effect immediately. When subsequent frame images are matched using the new template, the edge breakage rate is significantly reduced, and the detection service can adapt to changes in ambient lighting without restarting.
[0246] Step S7: Convert the globally coherent cable cross-sectional profile curve into structured cross-sectional analysis data, and combine it with the adaptively evolved cross-sectional geometry template library to output the final inspection results for cable manufacturing quality control. Specifically, this includes:
[0247] S7.1: Based on the global coherent cable cross-section profile curve, perform geometric parameter calculation processing, calculate physical dimensions such as conductor layer diameter, insulation layer thickness and sheath outer diameter by simulating a concentric circle model, and generate structured cross-section analysis data containing multi-dimensional geometric metric values.
[0248] Receive the global coherent cable cross-section profile curve data output by S4, perform coordinate space normalization processing, convert the pixel coordinate system into the physical millimeter coordinate system, and eliminate the influence of imaging magnification differences on geometric measurements.
[0249] Based on the transformed contour point set, the least squares method is used to fit the concentric circle model of the conductor layer, insulation layer and sheath layer, and an error objective function with the center coordinates and radius as variables is constructed. The optimal geometric parameters of each interface are solved by iterative optimization.
[0250] Based on the fitted radius values of each layer, the conductor layer diameter, the average thickness of the insulation layer, and the outer diameter of the sheath are calculated sequentially, and the standard deviation of the thickness of each layer is calculated to characterize the uniformity index.
[0251] The calculated geometric dimensions, center offset, and thickness non-uniformity are encapsulated into a structured JSON data object, associated with the timestamp of the current frame and the template ID, to generate structured cross-sectional analysis data containing multi-dimensional geometric measurements.
[0252] Through the above geometric parameter calculation and processing, the discrete contour curves are transformed into standardized physical size indicators, realizing the quantitative characterization of the cable cross-section geometry, and providing an accurate data basis for subsequent quality deviation comparison.
[0253] For example, for a power cable cross-section with a nominal diameter of 50mm, an image with a resolution of 2048x2048 pixels was acquired. After coordinate transformation, 360 uniformly distributed points on the conductor layer contour were selected for fitting. The initial center of the circle was set as the image center, and the iteration convergence threshold was 1e-6. The calculated fitting radius of the conductor layer was 10.02mm, the outer edge radius of the insulation layer was 15.01mm, and the outer edge radius of the sheath was 25.03mm. Based on this, the average thickness of the insulation layer was calculated to be 4.99mm, with a standard deviation of 0.05mm. The final output structured data included a conductor diameter of 20.04mm, an insulation thickness of 4.99mm, a sheath outer diameter of 50.06mm, and a concentricity deviation of 0.02mm, achieving a data accuracy of 0.01mm, significantly improving the repeatability and accuracy of dimensional measurements.
[0254] S7.2: Perform a multi-dimensional deviation comparison operation using the structured cross-section analysis data and the adaptively evolved cross-section geometry template library. Map and match the measured geometric measurement values with the standard tolerance zone and optical response feature vector in the template library to generate deviation evaluation indicators characterizing quality compliance.
[0255] The system receives structured cross-section analysis data generated by S7.1 and extracts multi-dimensional geometric measurements such as conductor layer diameter, insulation layer thickness, and sheath outer diameter as measured feature vectors. It then calls the adaptively evolved cross-section geometry template library to retrieve a reference template matching the current cable model, obtaining the standard tolerance band range and the corresponding optical response feature vector.
[0256] A geometric deviation calculation model is constructed by performing item-by-item difference operations between the measured geometric measurements and the nominal dimensions in the template library to generate an absolute deviation sequence. Normalization is then used to eliminate the influence of dimensions, mapping the absolute deviation to the [0,1] interval to form a standardized geometric deviation index.
[0257] Based on the optical response feature vector, the cosine similarity between the gradient field distribution of the measured image and the standard gradient pattern of the template is calculated.
[0258] The standardized geometric deviation index and optical consistency score are integrated, and the weighted Euclidean distance method is applied to calculate the overall deviation. Dynamic weighting coefficients are set to adjust the contribution ratio of geometric and optical features according to illumination stability, generating the final deviation evaluation index.
[0259] By using multidimensional deviation comparison processing, the measured data from the previous step is transformed into quantitative quality compliance indicators, thereby achieving a high-precision assessment of the manufacturing accuracy of cable cross-sections.
[0260] For example, for a 50mm diameter power cable, the measured conductor diameter deviation is 0.05mm and the insulation thickness deviation is 0.02mm. The template library has conductor diameter tolerances of ±0.1mm and insulation tolerances of ±0.05mm. The calculated standardized geometric deviations are 0.5 and 0.4, respectively. The calculated optical cosine similarity S is 0.98. With a geometric weight of 0.6 and an optical weight of 0.4, the overall deviation is 0.38. This index is below the threshold of 0.5, classifying it as a qualified product, significantly improving the robustness of quality judgment in complex environments.
[0261] S7.3: Based on the deviation evaluation index, perform quality control decision logic judgment, locate and classify abnormal areas that exceed the tolerance zone according to the preset defect classification rules, and generate preliminary detection conclusions including defect type, location coordinates and severity.
[0262] Receive the deviation evaluation index generated by S7.2, which includes the geometric dimension deviation vector and the optical response residual matrix, as the input data source for defect determination.
[0263] The preset cable manufacturing tolerance standard library is called, and the measured values of conductor diameter, insulation layer thickness and sheath outer diameter in the geometric dimension deviation vector are compared with the upper and lower limits of the allowable tolerance of the corresponding level.
[0264] For geometric parameters that exceed the tolerance range, the deviation direction and magnitude are mapped to a predefined defect classification dictionary to identify specific geometric defect types such as conductor eccentricity, insulation thin spots, or excessive sheath ellipticity.
[0265] Simultaneously analyze the optical response residual matrix, and use the local gradient anomaly detection method to scan the high-energy accumulation region in the residual distribution map to locate the spatial coordinates of non-geometric defects such as bubbles, impurities, or interface delamination inside the material.
[0266] A multidimensional defect severity assessment model was constructed, and the comprehensive defect index was calculated using the weighted Euclidean distance formula.
[0267] Based on the calculated comprehensive defect index, and in accordance with the preset quality grading threshold table, defects are classified into four levels: minor, general, serious, and fatal, to determine the current quality compliance status of the cable cross-section.
[0268] By integrating information on geometric defect types, non-geometric defect spatial coordinates, and quality levels, a structured preliminary inspection conclusion data package is generated, which includes defect codes, precise pixel coordinates, and confidence scores.
[0269] Through the above-mentioned multidimensional deviation comparison and weighted quantitative evaluation process, the abstract deviation index of the previous step is transformed into defect classification and grading conclusions with clear engineering significance, thereby achieving an accurate qualitative and quantitative description of the cable cross-section quality status.
[0270] S7.4: Combine the preliminary detection conclusions with the adaptively evolved cross-sectional geometry template library to perform visualization rendering and data encapsulation processing, map the quantitative analysis results into an intuitive quality distribution map and package it into a standard industrial protocol format, and output the final detection results for cable manufacturing quality control.
[0271] Receive preliminary detection conclusion data generated by S7.3, which includes defect type, location coordinates, and severity, as well as standard tolerance zone parameters and optical response feature vectors from the adaptively evolved cross-sectional geometry template library output by S6.
[0272] A quality distribution map rendering engine based on polar coordinate mapping is constructed, which discretizes the cable cross-section profile curve into N sampling points with equal angular intervals, and calculates the deviation between the measured geometric dimensions at each sampling point and the standard values in the template library.
[0273] The deviation is visualized and encoded using a color difference mapping method. The color gradient corresponding to the deviation threshold interval is defined. Abnormal areas that exceed the tolerance zone are marked with a bright warning color, and normal areas are marked with a reference color, generating a two-dimensional pseudo-color quality distribution heatmap.
[0274] Based on industrial communication protocol standards, a structured data encapsulation object is constructed to serialize and package the defect classification labels, quantization deviation values, timestamp information, and image metadata in the preliminary detection conclusions.
[0275] Call a JSON or XML encoder to convert the serialized data stream into a standard industrial message format that conforms to the OPC UA or Modbus TCP protocol specifications, ensuring that the data fields are compatible with the host computer monitoring system.
[0276] Through the above processing method, the results of the previous step are transformed into an intuitive and visual quality distribution map and a standardized industrial protocol data package, realizing real-time visual monitoring and automated data reporting of the test results, and improving the integration efficiency and human-computer interaction experience of the quality control system.
[0277] For example, the number of sampling points N is set to 360, corresponding to a 1-degree angular resolution. For insulation layer thickness deviation, the tolerance band is set to ±0.2mm. When the measured thickness at a sampling point is 4.5mm, and the standard value is 4.6mm, the deviation is -0.1mm, which is within the normal range and mapped to green RGB(0,255,0). If the deviation at another sampling point is -0.3mm, exceeding the lower limit, it is mapped to red RGB(255,0,0). The generated heatmap is displayed in polar coordinates, with the radial direction representing the layer structure and the angle representing the circumferential position. The final output JSON data packet contains the fields: "timestamp": "2023-10-27T10:00:00Z", "defects":[{"type": "insulation_thin", "angle": 180, "deviation": -0.3}], "image_url":"heatmap_001.png". This data packet is sent to the PLC controller via TCP port 502. The system response time is less than 50ms, which significantly improves the production line feedback speed.
[0278] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0279] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0280] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for analyzing cable cross-section images, characterized in that, Specifically, it includes: S1: Obtain the original image data of the cable cross-section and build a cross-section geometry template library based on the cable manufacturing process; S2: Use the original image data of the cable cross-section as the initial field input, and use the cross-section geometry template library to construct the gradient field to reconstruct the energy functional; S3: Iteratively solve the energy functional of the gradient field reconstruction, updating only the normal component of the gradient field in each iteration and simultaneously suppressing gradient perturbations in non-structurally permissible directions until convergence generates a vector gradient field. S4: Based on the dispersion region of the vector gradient field, locate the real physical boundary position, and by tracing the path of the maximum modulus in the vector gradient field and applying curvature smoothing constraints, synthesize a globally coherent cable cross-section profile curve that does not depend on single-point threshold determination, and complete the analysis of the cable cross-section image.
2. The cable cross-section image analysis method according to claim 1, characterized in that, It also includes the following steps: S5: Calculate the overall matching confidence based on the global continuous cable cross-section profile curve and the geometric template library of each cross-section, and determine whether the overall matching confidence is lower than the preset dynamic calibration threshold. If the determination result is yes, trigger the online prior calibration mechanism; otherwise, keep the cross-section geometric template library unchanged. S6: In response to the triggered online prior calibration mechanism, extract stable boundary segment data, update the cross-sectional geometry template library using the stable boundary segment data, and generate an adaptively evolved cross-sectional geometry template library; S7: Convert the global coherent cable cross-section profile curve into structured cross-section analysis data, and combine it with the adaptively evolved cross-section geometry template library to output the final inspection results for cable manufacturing quality control.
3. The cable cross-section image analysis method according to claim 1, characterized in that, The "based on cable manufacturing process" specifically refers to the physical constraints of the concentric distribution of conductor layers, the thickness tolerance zone of insulation layers, and the smooth continuity of sheath boundaries in the cable manufacturing process.
4. The cable cross-section image analysis method according to claim 1, characterized in that, The cross-sectional geometry template library includes geometric topology and optical response feature vectors, wherein the optical response feature vectors are statistically generated from the grayscale jump patterns of historical qualified samples under standard imaging conditions.
5. The cable cross-section image analysis method according to claim 4, characterized in that, The minimization objective of the gradient field reconstruction energy functional is defined as making the current image gradient field match the gradient distribution pattern represented by the optical response feature vector while satisfying the template topological constraints.
6. The cable cross-section image analysis method according to claim 5, characterized in that, S3 specifically includes: The initial scalar gradient field is calculated based on the original image data of the cable cross section. The normal projection operator is defined according to the geometric topology in the cross section geometric template library. The initial scalar gradient field is subjected to directional decomposition processing to separate the normal gradient component and the tangential disturbance component, and the normal gradient field component data to be optimized is obtained. The structure prior regularization term function is constructed using the optical response feature vector generated from historical qualified samples, and the normal gradient component data is substituted into the gradient field as input variables to reconstruct the energy functional. The energy value quantization calculation operation is then performed to obtain the energy functional value. Lightweight implicit iterative solution is performed on the energy generalized function value to obtain intermediate state vector gradient field data. The final state vector gradient field data is obtained by judgment and post-processing based on the intermediate state vector gradient field data. The final state vector gradient field data is preprocessed with dispersion region localization analysis and maximum modulus path tracing to verify whether it exhibits continuous closed loop topological features. This confirms that the final state vector gradient field data has eliminated the fracture defects caused by traditional edge detection, and outputs the vector gradient field.
7. The cable cross-section image analysis method according to claim 6, characterized in that, The energy quantization calculation operation is used to assess the degree of distribution deviation between the current normal gradient field component data and the standard grayscale transition mode.
8. The cable cross-section image analysis method according to claim 6, characterized in that, The process of obtaining intermediate state vector gradient field data by performing lightweight implicit iterative solution on the energy functional value includes: A lightweight implicit iterative solution method is executed for the energy function value. In each iteration cycle, only the magnitude of the normal gradient field component data is updated by gradient descent. At the same time, an unstructured allowable direction suppression filter is applied to remove noise disturbances introduced by the tangential interference component. The energy function value is gradually minimized and the directional consistency of the gradient field is enhanced to obtain the intermediate state vector gradient field data in the convergence process.
9. The cable cross-section image analysis method according to claim 6, characterized in that, The step of obtaining the final state vector gradient field data through post-processing based on the intermediate state vector gradient field data includes: Monitor the rate of change of magnitude and directional divergence of the intermediate state vector gradient field data, and determine whether they meet the preset convergence threshold conditions. If they do not meet the threshold conditions, adjust the step size parameters of the implicit iterative solution and return to execute a new round of iterative update. If they meet the threshold conditions, terminate the iterative process to obtain the final state vector gradient field data.
10. The cable cross-section image analysis method according to claim 1, characterized in that, The vector gradient field has directional continuity and intensity spatial modulation characteristics.
