Cable production recognition monitoring system and method based on cable image

CN122089723BActive Publication Date: 2026-09-18SHAANXI TONGDA CABLE MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610535797.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-22
Publication Date
2026-09-18
Estimated Expiration
2046-04-22

AI Technical Summary

Technical Problem

现有监测方法存在明显不足:传统人工检测效率低、主观性强,无法适配规模化生产;二维图像检测技术难以捕捉三维形态信息,对微小、深度缺陷识别能力有限,漏检误检率高

Benefits of technology

1.数据采集与预处理精准高效。通过多线结构光传感器获取深度图像序列,经坐标转换、栅格划分及双线性插值补全,构建出完整的电缆表面灰度曲面图,既精准还原了电缆表面三维形态信息,又有效填补了数据缺失区域,避免了因数据不完整导致的检测偏差,保障了缺陷识别的原始数据质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089723B_ABST
    Figure CN122089723B_ABST
Patent Text Reader

Abstract

This invention discloses a cable production identification and monitoring system and method based on cable images, belonging to the field of image recognition technology. The system includes: acquiring a sequence of cable surface depth images to construct a grayscale surface map along the cable surface depth direction; using the central ridge of the grayscale surface map as a dynamic axis of symmetry, detecting candidate pixels through multi-scale morphological top-hat transformation to form a symmetrical residual distribution map; combining the eight-neighbor gradient direction field and Hessian matrix curvature to remove false defect points, obtaining an effective image, and inputting it into a pre-trained multi-task neural network to simultaneously output a defect segmentation mask and category label; generating a three-dimensional mesh model with dimensional accuracy through Poisson surface reconstruction; and finally, using the physical coordinates of the defect center to drive a laser marking machine to mark a QR code containing key information, which is then associated and stored in a blockchain database. This application improves the accuracy and efficiency of defect identification, realizing the quantitative characterization and full lifecycle management of defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically a cable production identification and monitoring system and method based on cable images. Background Technology

[0002] As a core component in power transmission and communication, surface defects in cables, such as scratches and protrusions, directly affect insulation performance and service life, making real-time defect monitoring during the production process crucial. Existing monitoring methods have significant shortcomings: traditional manual inspection is inefficient, subjective, and unsuitable for large-scale production; two-dimensional image detection technology struggles to capture three-dimensional morphological information, has limited ability to identify minute and deep defects, and suffers from high rates of missed and false detections. Some methods lack precise axial dynamic symmetry positioning of the cable, resulting in incomplete multi-scale defect capture and susceptibility to noise interference producing false defects, affecting detection accuracy. Furthermore, existing technologies mostly only qualitatively identify defects, lacking three-dimensional quantitative characterization with dimensional accuracy, making it difficult to support defect severity assessment; defect data storage relies on traditional databases, which are prone to tampering and have poor traceability, hindering end-to-end quality control. Therefore, there is an urgent need for a cable production identification and monitoring technology that combines accurate identification, three-dimensional quantification, and safe traceability to address the pain points of existing technologies. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention proposes a cable production identification and monitoring system and method based on cable images. The system acquires a sequence of depth images of the cable surface to construct a grayscale surface map along the depth direction. Using the central ridge of the grayscale surface map as a dynamic axis of symmetry, candidate pixels are detected through multi-scale morphological top-hat transformation to form a symmetrical residual distribution map. False defect points are eliminated by combining the eight-neighbor gradient direction field and Hessian matrix curvature to obtain effective images. These images are then input into a pre-trained multi-task neural network, which simultaneously outputs a defect segmentation mask and category labels. A three-dimensional mesh model with dimensional accuracy is generated through Poisson surface reconstruction. Finally, a laser marking machine is driven to mark a QR code containing key information based on the physical coordinates of the defect center, and the code is associated and stored in a blockchain database. This application improves the accuracy and efficiency of defect identification, enabling quantitative characterization and full lifecycle management of defects.

[0004] To achieve the above objectives, the present invention provides the following technical solution: A cable production identification and monitoring method based on cable images includes: S1: Based on the collected cable surface image data, construct a grayscale surface map along the cable axis in the depth direction of the cable surface; S2: Using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixels are detected by multi-scale morphological top-hat transformation, and the normalized grayscale gradient difference between each candidate pixel and the corresponding point of the normal axis of symmetry is calculated to form a symmetrical residual distribution map. S3: In the symmetrical residual distribution map, calculate the eight-neighbor gradient direction field and Hessian matrix curvature of each candidate pixel, determine and remove false defect points according to the preset removal rules, and obtain the effective image of the cable surface. S4: Input the effective image of the cable surface into the pre-trained multi-task neural network. The multi-task neural network synchronously outputs the pixel-level segmentation mask and category label of the defect area. Combined with the pixel coordinates of the defect area, the corresponding three-dimensional point set is extracted from the grayscale surface image. The defect three-dimensional mesh model with dimensional accuracy is generated by Poisson surface reconstruction. S5: Based on the central physical coordinates of the defect area, drive the galvanometer laser marking machine to mark a QR code containing the defect type, central physical coordinates, and marking time at the defect location on the cable surface. The QR code is captured and decoded by a verification camera. After confirming that there are no errors, the QR code data, the defect 3D mesh model, the corresponding defect segment in the effective image of the cable surface, and the production line parameters are associated and stored in the blockchain database.

[0005] Specifically, the specific steps of S1 include: Acquire a sequence of depth images obtained by scanning the surface of a cable using a multi-line structured light sensor; The pixels in the depth image sequence are transformed from the sensor coordinate system to the world coordinate system with the cable axis as the Z-axis to obtain the three-dimensional point cloud data of the cable surface. Along the Z-axis of the world coordinate system, the three-dimensional point cloud data is projected onto the XY plane, and the projected area is divided into multiple three-dimensional spatial grids at equal intervals with a preset axial resolution and circumferential angular resolution. Collect all three-dimensional point clouds that fall within each of the three-dimensional spatial grids, calculate the average depth value of the three-dimensional point clouds along the X-axis of the world coordinate system, and use the average value as the representation depth value of the current grid. The depth values ​​of each grid cell are filled into the corresponding row and column positions in a pre-created two-dimensional matrix to obtain an initial depth matrix. The row index of the two-dimensional matrix corresponds to the axial position sequence, and the column index corresponds to the circumferential angle sequence. For grids in the initial depth matrix that have missing data, bilinear interpolation is used to complete the data using the depth values ​​of their adjacent grids, generating the final grayscale surface map of the cable surface in the depth direction.

[0006] Specifically, using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixel points are detected using multi-scale morphological top-hat transformation, including: An initial ridge line is extracted from the grayscale surface image using a skeleton extraction algorithm. The initial ridge line is then subjected to morphological thinning to obtain a thinned ridge line with a width of one pixel. Based on the linearity constraint of the cable axis, the thinned ridge line is smoothed by the sliding window least squares method to obtain the central ridge line as the dynamic symmetry axis. Based on a dynamic symmetry axis, at least three circular structural elements of different scales are used to perform a morphological top-hat transformation on the grayscale surface image. Pixels with grayscale values ​​higher than a preset threshold in the top-hat transformation results at each scale are merged to form a candidate pixel set. The radius of the circular structural elements at each scale increases in a proportional sequence along the radial direction of the cable.

[0007] Specifically, the calculation of the dynamic symmetry axis also includes: Based on the initial ridge line, a local window is taken with each axial position as the center; Within the local window, the grayscale projection perpendicular to the current initial ridge tangent direction is calculated. The peak position of the projection is taken as the correction point of the central ridge at that axial position. All correction points are connected to form the corrected dynamic symmetry axis.

[0008] Specifically, the formation process of the symmetric residual distribution map includes: For each pixel in the candidate pixel set, draw a perpendicular line from the pixel to the dynamic symmetry axis along the circumferential direction on the grayscale surface image; Calculate the first gray-level gradient value of the pixel in its vertical direction, locate the corresponding point on the vertical line that is symmetrical to the pixel about the dynamic axis of symmetry, and calculate the second gray-level gradient value of the corresponding point. Calculate the absolute difference between the first gray-level gradient value and the second gray-level gradient value, and use the ratio of the absolute difference to the global maximum gray-level gradient value of the gray-level surface map as the normalized gray-level gradient difference of the candidate pixel. An empty matrix with the same size as the grayscale surface image is created as the initial map. The position of each candidate pixel and its corresponding normalized grayscale gradient difference are filled into the empty matrix to form the symmetrical residual distribution map.

[0009] Specifically, the steps of S3 include: The Sobel operator is used to calculate the gradient components of each candidate pixel in the horizontal and vertical directions in the symmetric residual distribution map, and then its gradient magnitude and gradient direction are calculated. The consistency of the gradient direction of all pixels in its eight neighborhood is statistically analyzed to obtain the gradient direction field of the candidate pixel in its eight neighborhood. Calculate the second-order partial derivative at each candidate pixel to construct the Hessian matrix, and obtain the principal curvature of the candidate pixel by solving the eigenvalues ​​of the Hessian matrix; preset the first consistency threshold, the second consistency threshold and the third consistency threshold. If the consistency of the gradient direction field of the eight neighborhood of any candidate pixel is lower than the first consistency threshold, and the absolute value of the principal curvature of its Hessian matrix is ​​higher than the second consistency threshold, then the point is determined to be a pseudo-defect point caused by noise. If the normalized grayscale gradient difference of any candidate pixel is lower than the third consistency threshold, then the point is determined to be a non-significant surface change. Candidate pixels that are identified as false defects or insignificant surface changes are removed from the symmetrical residual distribution map. The binary image formed by the remaining candidate pixels is the effective image of the cable surface.

[0010] Specifically, the multi-task neural network includes a shared feature extraction layer, a segmentation branch, and a classification branch; The feature extraction layer adopts a ResNet50 network structure, which includes 5 sequentially connected convolutional blocks. Each convolutional block consists of multiple convolutional layers, batch normalization layers, and ReLU activation function layers. It is used to perform layer-by-layer feature abstraction on the input effective image of the cable surface and output a shared deep feature map. The segmentation branch is connected to the output of the feature extraction layer. First, a transposed convolutional layer is used to upsample the shared deep feature map to restore the spatial resolution of the shared deep feature map to the same level as the input image. Then, a 1x1 convolutional layer is used to adjust the number of channels of the upsampled feature map to match the number of defect categories. Finally, a Softmax activation function layer is used for probability normalization to output a pixel-level segmentation mask for the defect region. The classification branch is connected to the output of the global average pooling layer at the end of the feature extraction layer. First, a global average pooling operation is performed on the shared deep feature map to convert it into a one-dimensional global feature vector. This global feature vector is then passed through a fully connected layer and mapped to an output vector with the same dimension as the number of defect categories. After batch normalization of the output vector, it is input into the Softmax activation function layer to obtain the probability distribution of each defect category. The category corresponding to the highest probability value is taken as the defect category label.

[0011] Specifically, the process of generating the three-dimensional mesh model of the defect includes: Based on the pixel-level segmentation mask, extract the three-dimensional point set corresponding to the defect region from the grayscale surface image; Calculate the normal vector of each point in the 3D point set and construct an octree space structure; Define an indicator function on the octree structure, and transform the surface reconstruction problem into solving the Poisson equation between the gradient field of the indicator function and the point normal vector field; The conjugate gradient method is used to solve the Poisson equation and obtain the value of the indicator function. The isosurface of the indicator function is extracted using the moving cube algorithm to generate a three-dimensional mesh model of the defect.

[0012] Specifically, the step of driving a galvanometer-type laser marking machine to mark a QR code containing the defect type, center physical coordinates, and marking time at the defect location on the cable surface based on the center physical coordinates of the defect area includes: Calculate the average coordinates of all points in the three-dimensional defect point set to obtain the center physical coordinates of the defect region; The defect category label, the center physical coordinates, and the current system time are combined and encoded into a single string; Use a QR code generation algorithm to convert a string into a two-dimensional code bitmap; Based on the pre-calibrated transformation relationship between the central physical coordinates and the coordinate system of the galvanometer laser marking machine, the deflection angle of the galvanometer is calculated, and the laser beam is controlled to mark the QR code at the defect location on the cable surface.

[0013] The cable production identification and monitoring system based on cable images includes: an image acquisition module, a map construction module, an effective image generation module, a defect identification module, and a QR code marking module; The image acquisition module is used to acquire cable surface depth image data, and generate a grayscale surface map of the cable surface depth direction through coordinate transformation, grid division, depth value calculation and interpolation. The map construction module is used to determine the dynamic symmetry axis of the grayscale surface map, comprehensively capture potential defect candidate pixels through multi-scale morphological top-hat transformation, calculate the normalized grayscale gradient difference, construct a symmetric residual distribution map, and focus on the defect region. The effective image generation module is used to analyze the gradient direction consistency and curvature characteristics of candidate pixels, remove false defect points caused by noise and non-significant surface change points, and select the pixels corresponding to real defects to form an effective image of the cable surface. The defect identification module is used to achieve pixel-level segmentation and category determination of defect areas through a pre-trained multi-task neural network, extract the three-dimensional point set corresponding to the defect, and generate a three-dimensional mesh model of the defect with dimensional accuracy through Poisson surface reconstruction. The QR code marking module is used to calculate the physical coordinates of the defect center and drive the laser marking machine to mark a QR code containing key information.

[0014] Compared with the prior art, the beneficial effects of the present invention are: 1. Precise and efficient data acquisition and preprocessing. Depth image sequences are acquired using a multi-line structured light sensor. Through coordinate transformation, grid division, and bilinear interpolation, a complete grayscale surface map of the cable is constructed. This accurately restores the three-dimensional morphology of the cable surface and effectively fills in missing data areas, avoiding detection bias caused by incomplete data and ensuring the quality of the original data for defect identification.

[0015] 2. High accuracy in defect candidate point screening, significantly reducing interference from false defects. Based on the optimized dynamic symmetry axis, and combined with multi-scale morphological top-hat transformation, potential defect points are comprehensively captured. Then, by calculating the eight-neighbor gradient direction field and Hessian matrix curvature, false defect points and insignificant surface changes caused by noise are accurately eliminated, improving the purity of the effective image of the cable surface and providing high-quality input for defect recognition.

[0016] 3. Strong defect identification and quantitative characterization capabilities, balancing accuracy and practicality. The pre-trained multi-task neural network, based on the ResNet50 architecture, simultaneously achieves pixel-level segmentation and category determination of defect regions, resulting in higher efficiency and more accurate identification. Combined with Poisson surface reconstruction technology, it generates a 3D mesh model of defects with dimensional accuracy, breaking through the limitation of traditional 2D detection which can only perform qualitative analysis, and realizing the quantitative characterization of defects, providing intuitive and accurate 3D data support for defect assessment.

[0017] 4. Full-process traceability and data management are safe and reliable, ensuring controllable production quality. By using a galvanometer laser marking machine to mark QR codes containing key information at defect locations, and combining this with a blockchain database to store related data, defect information can be traced and queried, while ensuring the immutability and security of the data, facilitating quality traceability and problem investigation. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the cable production identification and monitoring method based on cable images according to the present invention; Figure 2 This is a flowchart illustrating the principle of the cable production identification and monitoring method based on cable images according to the present invention. Figure 3 This is a diagram illustrating the architecture of the cable production identification and monitoring system based on cable images, as described in this invention. Detailed Implementation

[0019] Example 1: Please see Figure 1 and Figure 2 The present invention provides an embodiment of a cable production identification and monitoring method based on cable images. This embodiment takes the monitoring of surface depression defects in power cables as an example and includes the following steps: S1: Based on the collected cable surface image data, construct a grayscale surface map along the cable axis in the depth direction of the cable surface; In this embodiment, a multi-line structured light sensor is installed at the inspection station of the cable production line. The sensor is arranged parallel to the cable axis, 500 mm away from the cable surface, and the scanning rate is set to 30 frames / second to acquire depth image sequences of the cable surface in real time. In this embodiment, the cable to be inspected is a power cable, the production speed is 5 meters per minute, and the cable outer diameter is approximately 18 mm. After acquiring the depth image sequence output by the sensor, the coordinates of each pixel are transformed from the sensor coordinate system to the world coordinate system with the cable axis as the Z-axis using the calibration parameters provided by the sensor's factory calibration file, thus obtaining three-dimensional point cloud data of the cable surface. Along the Z-axis direction of the world coordinate system, the three-dimensional point cloud data is projected onto the XY plane, i.e., the cross-section of the cable, with an axial resolution of 0.5 mm (i.e., one grid row is divided every 0.5 mm in the Z-axis direction) and a circumferential angular resolution of 1 degree (i.e., one grid column is divided every 1 degree in the XY plane), forming multiple three-dimensional spatial grids. All three-dimensional point clouds falling into each three-dimensional spatial grid are counted, and the average depth value along the X-axis direction is calculated as the depth value of the point cloud. The grid represents the depth value. For example, if a grid contains four 3D points with depth values ​​of 17.8 mm, 17.9 mm, 18.0 mm, and 18.1 mm, its represented depth value is (17.8 + 17.9 + 18.0 + 18.1) / 4 = 17.95 mm. A two-dimensional matrix is ​​created, where row indices correspond to the axial position sequence along the Z-axis (e.g., Z = 1000 mm corresponds to row 1, Z = 1000.5 mm corresponds to row 2, and so on). Column indices correspond to the circumferential angle sequence (e.g., 0 degrees corresponds to column 1). 1 degree corresponds to the 2nd column, up to 359 degrees corresponds to the 360th column. The representation depth value of each grid is filled into the corresponding position in the matrix to obtain the initial depth matrix. For empty grids in the initial depth matrix due to missing point clouds, such as point clouds not being collected at any angle in the circumferential direction due to sensor occlusion, the representation depth values ​​of the four adjacent grids above, below, left and right are used for bilinear interpolation to complete the data. Finally, a grayscale surface map of the cable surface depth direction with a size of 2000×360 is generated, which corresponds to a cable axial length of 1000 mm and a circumferential length of 360 degrees.

[0020] S2: Using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixels are detected by multi-scale morphological top-hat transformation, and the normalized grayscale gradient difference between each candidate pixel and the corresponding point of the normal axis of symmetry is calculated to form a symmetrical residual distribution map. In this embodiment, the Zhang-Suen skeleton extraction algorithm is used to extract the initial ridge line from the grayscale surface image, resulting in an initial ridge line containing multiple branches. Then, morphological thinning operations, such as iterative erosion-dilation, are used to remove the branch structure, resulting in a thinned ridge line with a single pixel width. Based on the linearity constraint of the cable axis, the sliding window size is set to 5×5, i.e., 5 grids axially and 5 grids circumferentially. The thinned ridge line is smoothed using the least squares method to obtain a smoothed initial version of the central ridge line, which is approximately linearly distributed along the Z-axis in the world coordinate system. Based on the initial ridge line, a 3×3 local window is taken centered at each axial position, and the grayscale projection perpendicular to the tangent direction of the initial ridge line is calculated within the window. For example, if the tangent direction is Z... In the axial direction, the vertical direction is the radial direction in the XY plane. The projection peak position is used as the center ridge correction point for this axial position. Connecting all correction points yields the final dynamic symmetry axis. A morphological top-hat transformation is performed on the grayscale surface image using three circular structuring elements of different scales. The radii of the structuring elements increase in a proportional sequence, with an initial radius r1 = 1 pixel and a common ratio of 2. This means the three scale radii are 1, 2, and 4 pixels, corresponding to actual physical dimensions of approximately 0.157 mm, 0.314 mm, and 0.628 mm, respectively. The top-hat transformation formula is: ,in, Represents a grayscale surface image. Represents a structural element. This represents the grayscale image of the defect features obtained after morphological white cap transformation. Represents grayscale surface image Regarding structural elements Morphological opening operation; setting a preset grayscale threshold of 0.6, pixels with grayscale values ​​higher than 0.6 in the top cap transformation results at three scales are merged to form a candidate pixel set. In this embodiment, a total of 128 candidate pixels are obtained after merging, mainly concentrated in the cable axial region Z=1180 to 1220mm and the circumferential region 30-60 degrees, corresponding to the suspected area of ​​the concave defect; for each candidate pixel, for example point P, its axial row is 2360, the circumferential column is 35, corresponding to world coordinates X:2.5mm, Y:8.5mm, Z:1180mm, and its dynamic symmetry axis is plotted along the circumferential direction on the grayscale surface map, that is, X= A perpendicular line with Y=0, extending approximately 5 pixels in length within a circumferential range of 30-60 degrees, is defined. X, Y, and Z represent the horizontal, vertical, and horizontal axes in the world coordinate system, respectively, and mm represents millimeters. The first grayscale gradient value G1 = 0.75 of point P along the perpendicular line is calculated using first-order difference. The corresponding point P' on the perpendicular line, symmetrical to P about the dynamic axis of symmetry, is located with coordinates (X: -2.5mm, Y: -8.5mm, Z: 1180mm), and its second grayscale gradient value G2 = 0.12 is calculated. The global maximum grayscale gradient value G_max = 0.92. The normalized grayscale gradient difference of this candidate pixel is | G1-G2| / G_max=0.68; Create an empty matrix with 2000×360 columns, fill in the position of each candidate pixel and its normalized gray-level gradient difference to form a symmetrical residual distribution map, where the map position value corresponding to the above point P is 0.68, and the overall residual value of this region is between 0.5 and 0.7.

[0021] S3: In the symmetrical residual distribution map, calculate the eight-neighbor gradient direction field and Hessian matrix curvature of each candidate pixel, determine and remove false defect points according to the preset removal rules, and obtain the effective image of the cable surface. In this embodiment, a 3×3 Sobel operator is used to calculate the horizontal gradient components Gx and vertical gradient components Gy for each candidate pixel. For example, for point P, Gx=0.62, Gy=0.35, and the gradient magnitude is... The gradient direction θ = arctan(Gy / Gx) = 29.3 degrees. The gradient directions of the eight pixels within its eight-neighborhood are statistically analyzed. The difference between the gradient direction and θ for six of these pixels is within ±15 degrees, resulting in a gradient direction consistency of 6 / 8 = 0.75. The second-order partial derivative at point P is calculated, a Hessian matrix is ​​constructed, and the eigenvalues ​​of the Hessian matrix are solved. The principal curvature is taken from the eigenvalue with the larger absolute value. Assuming a principal curvature of 0.65, the first consistency threshold is set to 0.3, the second to 0.8, and the third to 0.2. Point P has a gradient direction consistency of 0.75 > 0.3, a principal curvature absolute value of 0.65 < 0.8, and a normalized grayscale gradient difference of 0.68 > 0.2. Therefore, it is determined to be a valid defect point. Any candidate pixel...Q The gradient direction consistency of the candidate pixel R, with an axial row of 1800 and a circumferential column of 120, is 0.25 < 0.3, and the absolute value of the principal curvature is 0.85 > 0.8, thus it is determined to be a false defect point caused by noise. The normalized grayscale gradient difference of the candidate pixel R, with an axial row of 2500 and a circumferential column of 200, is 0.15 < 0.2, thus it is determined to be a non-significant surface change. The 23 false defect points and 15 non-significant change points among the 128 candidate pixels are removed, and the remaining 90 valid defect points form a binary image, which is the effective image of the cable surface. This effective image of the cable surface clearly outlines the contour of the concave defect area with Z = 1180-1220mm and a circumferential angle of 30 degrees to 60 degrees.

[0022] S4: Input the effective image of the cable surface into the pre-trained multi-task neural network. The multi-task neural network synchronously outputs the pixel-level segmentation mask and category label of the defect area. Combined with the pixel coordinates of the defect area, the corresponding three-dimensional point set is extracted from the grayscale surface image. The defect three-dimensional mesh model with dimensional accuracy is generated by Poisson surface reconstruction. In this embodiment, the multi-task neural network includes a shared feature extraction layer, a segmentation branch, and a classification branch. The feature extraction layer uses a ResNet50 network, containing 5 convolutional blocks. Each convolutional block consists of 3-4 convolutional layers, a batch normalization layer, and a ReLU activation function layer. The input image size is 2000×360 pixels, and the output shared deep feature map size is 125×22.5 pixels. The transposed convolutional layer in the segmentation branch has a 4×4 kernel and a stride of 2, upsampling the shared deep feature map to 2000×360 pixels. A 1×1 convolutional layer adjusts the number of channels to 3, corresponding to three types of defects: depressions, bulges, and scratches. Softmax... The activation function outputs a pixel-level segmentation mask. In the classification branch, global average pooling is performed on the shared deep feature map, converting it into a 2048-dimensional one-dimensional global feature vector. This vector is then mapped to a 3-dimensional output vector through a fully connected layer. After batch normalization, the probability distribution of each category is obtained through the Softmax activation function. The multi-task neural network has been pre-trained on a dataset containing 10,000 cable defect images, including 3,000 images of dent defects, achieving a training set accuracy of 96.2%. When the effective images of the cable surface are input into the multi-task neural network, the segmentation branch outputs a pixel-level segmentation mask: defect areas are labeled as dent defects (channel 1 is activated), background areas are labeled as non-defective (channel 0 is activated), and the cross-union ratio (CUI) of the segmentation mask is 0.89. The classification branch outputs a category probability distribution vector of [0.91, 0.06, 0.03], corresponding to dents, bulges, and scratches. The category corresponding to the highest probability of 0.91 is dent defect, meaning the output defect category label is dent. Based on the segmentation mask, a 3D point set corresponding to 156 defect pixels is extracted from the grayscale surface image. The world coordinates of each point are obtained by converting the pixel index. For example, the 3D coordinates corresponding to the center pixel of the segmentation mask are (X: 2.0mm, Y: 7.8mm, Z: 1200mm), with a depth value of 16.2mm. The surface depth of a normal cable is 18.0mm, and the depth of the depression is about 1.8mm. The normal vector of each point in the 3D point set is obtained by fitting a plane with neighborhood points, and an octree spatial structure with a voxel size of 0.1mm × 0.1mm × 0.1mm is constructed to spatially partition and index the 3D point set. An indicator function is defined on the octree structure, and the Poisson equation is solved using the conjugate gradient method. The number of iterations is 500, and the convergence accuracy is 1e-6 to obtain the value of the indicator function. The moving cube algorithm is used to extract the isosurfaces where the indicator function is zero, generating a 3D mesh model of the defect. This model contains 1280 triangular facets with a dimensional accuracy of ±0.05mm, which can clearly present the shape, position, and size of the depression defect.

[0023] S5: Based on the central physical coordinates of the defect area, drive the galvanometer laser marking machine to mark a QR code containing the defect type, central physical coordinates, and marking time at the defect location on the cable surface. The QR code is captured and decoded by a verification camera. After confirming that there are no errors, the QR code data, the defect 3D mesh model, the corresponding defect segment in the effective image of the cable surface, and the production line parameters are associated and stored in the blockchain database.

[0024] Furthermore, the production line parameters include at least the cable production batch number, production line number, testing time point, and equipment identification code of the multi-line structured light sensor.

[0025] Furthermore, the verification camera is used to capture and decode the QR code, including: capturing the QR code marked on the cable surface with the verification camera to obtain a QR code image; performing image processing on the QR code image, including binarization, geometric positioning, and perspective correction, to accurately extract the QR code area; decoding the extracted code area using the QR code standard decoding algorithm to obtain a decoded information string; comparing the decoded information string with the original encoding string used when driving the laser marking machine, and if the two are completely consistent, the QR code marking is determined to be correct. The QR code standard decoding algorithm is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0026] Furthermore, the data association stored in the blockchain database is realized through a unique defect event identifier; the defect event identifier is generated by concatenating the production line number, cable batch number, inspection timestamp, and a random number and then performing a hash operation; all data associated with this defect detection, including QR code data, defect 3D mesh model, image fragments, and production line parameters, are bound to this defect event identifier; on the blockchain, the defect event identifier is used as the key, and the hash value of the bound data packet is used as the value for storage.

[0027] Furthermore, the blockchain database adopts a smart contract-based access control mechanism, in which the deployed smart contract stipulates that only authorized quality inspection nodes or audit nodes can query the stored defective data or add new verification records, ensuring the security and traceability of the data.

[0028] In this embodiment, the average coordinates of all points in the defect 3D point set are calculated to obtain the center physical coordinates as (X: 2.1mm, Y: 8.0mm, Z: 1200.5mm). The defect type "depression", the center physical coordinates "X: 2.1mm, Y: 8.0mm, Z: 1200.5mm", and the marking time "2024-05-20 14:35:22" are combined into the string "Type: Depression; Coord: X2.1-Y8.0-Z1200.5; Time: 2024-05-20 14:35:22". This string is then converted into a 256×256 pixel QR code bitmap using a QR code generation algorithm. The model is IPG. The YLR-10 galvanometer laser marking machine calculates the galvanometer deflection angle based on a pre-defined transformation relationship between the world coordinate system and the marking machine coordinate system. The transformation matrix M is obtained through calibration experiments. The laser power, marking speed, and spot diameter are set. The aforementioned QR code is marked near the defect area on the cable surface, approximately 5mm from the defect center, with a marking time of about 200ms. After marking, a verification camera deployed next to the marking machine captures the QR code and decodes it using the ZBar decoding library. If the decoding result matches the encoded string, the marking is confirmed to be correct. The QR code data, the defect 3D mesh model, the corresponding defect segment from the valid image of the cable surface, and production line parameters are correlated. The SHA-256 algorithm is used to hash the correlated data, generating a data fingerprint. The data and fingerprint are then uploaded to a consortium blockchain database, whose nodes include the production workshop, quality inspection department, and warehousing center, ensuring that the data is tamper-proof and traceable.

[0029] The specific steps of S1 include: S1.1: Acquire a sequence of depth images obtained by scanning the surface of the cable using a multi-line structured light sensor; S1.2: Transform each pixel in the depth image sequence from the sensor coordinate system to the world coordinate system with the cable axis as the Z-axis to obtain the three-dimensional point cloud data of the cable surface; Furthermore, the specific steps in S1.2 include: (1) Based on the internal calibration parameters of the multi-line structured light sensor, the two-dimensional coordinates of each pixel in the depth image sequence and its corresponding depth value are converted into three-dimensional spatial points in the sensor coordinate system. The set of all these three-dimensional points constitutes the initial three-dimensional point cloud data. (2) For the initial three-dimensional point cloud data, a robust estimation algorithm is used to fit a cylindrical spatial model that best represents the overall shape of the cable, and the central axis of the cylinder is extracted as the reference axis of the cable. The robust estimation algorithm is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method. (3) Establish a new three-dimensional rectangular coordinate system, namely the world coordinate system, using the extracted cable reference axis as the Z-axis. Specifically, define the direction of the reference axis as the positive direction of the Z-axis, select a fixed point on the axis as the origin of the coordinate system, and determine the X-axis and Y-axis directions perpendicular to it according to the three-dimensional spatial geometric law to complete the construction of the coordinate system. (4) Calculate a spatial transformation relationship that maps a point from the sensor coordinate system to the world coordinate system. This transformation relationship combines the rotation transformation that aligns the coordinate axes of the sensor coordinate system to the directions of the world coordinate system and the translation transformation that translates the origin of the sensor coordinate system to the origin of the world coordinate system. (5) Apply the calculated spatial transformation relationship to each point in the initial three-dimensional point cloud data to uniformly transform the coordinate values ​​of all points to the world coordinate system with the cable's own axis as the Z-axis, and generate the final three-dimensional point cloud data.

[0030] S1.3: Project the three-dimensional point cloud data onto the XY plane along the Z-axis of the world coordinate system, and divide the projection area into multiple three-dimensional spatial grids at equal intervals with a preset axial resolution and circumferential angular resolution. Furthermore, the specific steps in S1.3 include: (1) Calculate the minimum and maximum Z coordinates of all points in the three-dimensional point cloud data to determine the processing range of the cable in the axial direction. At the same time, the default circumferential processing range is the full 360-degree circumference around the Z axis. (2) According to the given axial resolution, the axial processing range is evenly divided into continuous axial segments. According to the given circumferential angle resolution, the 360-degree circumferential range is evenly divided into continuous fan segments. A two-dimensional index grid is constructed with one axial segment and one fan segment as a group. Each cell of the two-dimensional index grid uniquely corresponds to a spatial unit to be processed later. (3) Map each generated two-dimensional index grid cell in reverse to a three-dimensional space centered on the Z-axis of the world coordinate system. Each cell corresponds to a three-dimensional space region bounded by the following boundaries: two planes perpendicular to the Z-axis bounded by the two ends of the axial segment corresponding to the cell and two half-planes containing the Z-axis bounded by the two sides of the sector segment corresponding to the cell. This three-dimensional space region is defined as a three-dimensional space grid. (4) For each point in the three-dimensional point cloud data, perform the following operations: First, determine the axial segment to which it belongs based on its Z coordinate value; second, determine the sector segment to which it belongs by calculating the angle between the projection point of the point on the XY plane and the positive direction of the X axis. Based on the determined axial segment number and sector segment number, the point can be assigned to a specific cell in the two-dimensional index grid described in the second step, that is, to a specific three-dimensional space grid defined in the third step. All point cloud data that have completed the assignment judgment are organized into the corresponding three-dimensional space grids.

[0031] S1.4: Statistically count all three-dimensional point clouds falling into each of the three-dimensional spatial grids, calculate the average depth value of the three-dimensional point clouds along the X-axis of the world coordinate system, and use the average value as the representation depth value of the current grid. S1.5: Fill the corresponding row and column positions in the pre-created two-dimensional matrix with the representation depth value of each grid cell to obtain the initial depth matrix. The row index of the two-dimensional matrix corresponds to the axial position sequence, and the column index corresponds to the circumferential angle sequence. S1.6: For grids with missing data in the initial depth matrix, use bilinear interpolation to complete the data using the depth values ​​of their adjacent grids to generate the final grayscale surface map of the cable surface in the depth direction.

[0032] Using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixel points are detected using multi-scale morphological top-hat transformation, including: S2.1: The skeleton extraction algorithm is used to extract the initial ridge line of the grayscale surface image, and the initial ridge line is subjected to morphological thinning operation to obtain a thinned ridge line with a single pixel width; Furthermore, the specific steps of S2.1 include: (1) Threshold segmentation is performed on the input grayscale surface image. Pixels with grayscale values ​​higher than the preset threshold are identified as the foreground region, representing the bright central part of the cable. Pixels with grayscale values ​​lower than the preset threshold are identified as the background region, thus obtaining a binary image. (2) Perform distance transformation calculation on the obtained binary image to obtain the spatial distance from each foreground pixel to its nearest background pixel and generate a distance transformation map. The value of each pixel in the distance transformation map represents its distance from the background. The spatial distance calculation formula is a conventional means that can be understood and implemented by those skilled in the art. This application is not limited to a specific partitioning method. (3) Using a local sliding window to traverse the distance transformation map, identify all local maxima points in the distance transformation map. The distance values ​​of these local maxima points are all greater than the distance values ​​of all adjacent pixels in their eight neighborhoods. The set of these points constitutes the candidate point set of the central skeleton. (4) Connect the obtained local maxima points according to their spatial adjacency to form one or more continuous pixel chains. These pixel chains together constitute the initial ridge line that depicts the direction of the cable center. The initial ridge line is usually several pixels wide and has uneven edges. (5) Perform morphological thinning operation on the obtained initial ridge line. The morphological thinning operation is an iterative process. In each iteration, a 3×3 window is used to traverse the initial ridge line. Based on the connection mode of the eight neighbors of the current pixel point, it is determined whether it is a deletable boundary point and whether the deletion will not destroy the topological continuity of the ridge line. In each iteration, all boundary points that meet the conditions are deleted synchronously. This iterative process is repeated until there are no more pixels that can be deleted. At this time, a single-pixel wide middle ridge line is obtained. (6) Check the obtained single-pixel width intermediate ridge, identify and delete the short branches or burrs that exist in it. These burrs are branches containing only a very small number of pixels. At the same time, ensure the connectivity of the main body of the ridge so that each ridge pixel except the endpoints has exactly two adjacent pixels. The final curve obtained after this optimization process is the required single-pixel width thinned ridge.

[0033] S2.2: Based on the linearity constraint of the cable axis, the thinned ridge line is smoothed by the sliding window least squares method to obtain the central ridge line as the dynamic symmetry axis. The sliding window least squares method is a conventional means that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method. Furthermore, the specific steps of S2.2 include: defining a sliding window along the ridge direction, fitting the ridge points into a straight line within the window; assigning different weights to each ridge point based on its distance from the fitted straight line, with smaller distances resulting in higher weights; refitting the straight line based on the new weights, iterating until the ridge converges to a smooth curve, which is the dynamic symmetry axis.

[0034] S2.3: Based on the dynamic symmetry axis, at least three circular structural elements of different scales are used to perform morphological top-hat transformation on the grayscale surface image, and the pixels with gray values ​​higher than the preset threshold in the top-hat transformation results at each scale are merged to form a candidate pixel set, wherein the radius of the circular structural elements at each scale increases in a proportional sequence along the radial direction of the cable.

[0035] Furthermore, morphological top-hat transformation is an image processing technique used to extract highlight areas smaller than the structuring element in an image. It is often used to correct uneven lighting and extract small objects.

[0036] Furthermore, the specific steps in S2.3 include: (1) Based on the size distribution characteristics of cable surface defects, a set of scale parameters for detection is set. This set of scale parameters includes a minimum scale radius, a maximum scale radius and a total number of scales. Based on these scale parameters, a sequence of circular structural element radius values ​​that increase proportionally is generated. (2) Select each value in the generated radius value sequence as the current scale, generate a corresponding circular structural element with the current scale as the radius, and use this circular structural element to perform morphological closing operation on the grayscale surface image to obtain a background estimation image. Perform difference operation between the original grayscale surface image and the background estimation image to obtain an image that highlights the local bright area with a size smaller than the current structural element, which is the top hat transformation map at the current scale. (3) For each generated single-scale top-hat transform map, set a grayscale threshold to distinguish between the background and significant features. Traverse each pixel in the single-scale top-hat transform map. If its grayscale value is higher than the grayscale threshold, then the pixel is determined as a candidate pixel at the current scale. All the pixels determined as candidates together constitute the candidate pixel set at this scale. (4) Repeat (2)-(3) under all preset scales to obtain multiple single-scale candidate pixel sets corresponding to the number of scales. Merge these single-scale candidate pixel sets from different scales to form a complete set of candidate pixel points covering multiple size defect features.

[0037] The calculation of the dynamic symmetry axis also includes: Based on the initial ridge line, a local window is taken with each axial position as the center; Within the local window, the grayscale projection perpendicular to the current initial ridge tangent direction is calculated. The peak position of the projection is taken as the correction point of the central ridge at that axial position. All correction points are connected to form the corrected dynamic symmetry axis.

[0038] The formation process of the symmetric residual distribution map includes: A1: For each pixel in the candidate pixel set, draw a perpendicular line from the pixel to the dynamic symmetry axis along the circumferential direction on the grayscale surface image. A2: Calculate the first grayscale gradient value of the pixel in its vertical direction, locate the corresponding point on the vertical line that is symmetrical to the pixel about the dynamic axis of symmetry, and calculate the second grayscale gradient value of the corresponding point. Furthermore, the specific steps of A2 include: (1) For a candidate pixel on a grayscale surface, first determine the perpendicular line from it to the dynamic symmetry axis. Along this perpendicular line, with the dynamic symmetry axis as the origin, define the candidate pixel itself and the corresponding point that is symmetrical about the dynamic symmetry axis. The candidate pixel and its corresponding point are equidistant from the dynamic symmetry axis, but are located on opposite sides of the axis. (2) Using the defined vertical line as the path, the gray values ​​of dense and equally spaced sampling points on the path are calculated by bilinear interpolation, thereby generating a continuous gray value change curve, which is called a gray profile. The bilinear interpolation method is a conventional means that can be understood and implemented by those skilled in the art. This application is not limited to a specific partitioning method. (3) The candidate pixels and their symmetrical points determined in the first step are accurately mapped to the corresponding positions on the continuous grayscale profile generated in the second step; (4) On the continuous grayscale profile, the first derivative of the candidate pixel position and its symmetrical point position is calculated by the central difference method. The central difference method is: for each target point, take the difference between the grayscale values ​​of the previous sampling point and the next sampling point, divide it by the distance between the two points, and obtain the grayscale change rate of the point. (5) The rate of change at the candidate pixel is the first gray gradient value, and the rate of change at its symmetrical point is the second gray gradient value.

[0039] A3: Calculate the absolute difference between the first gray-level gradient value and the second gray-level gradient value, and use the ratio of the absolute difference to the global maximum gray-level gradient value of the gray-level surface map as the normalized gray-level gradient difference of the candidate pixel. A4: Create an empty matrix with the same size as the grayscale surface image as the initial map. Fill the empty matrix with the position of each candidate pixel and its corresponding normalized grayscale gradient difference to form the symmetrical residual distribution map.

[0040] The specific steps of S3 include: S3.1: The Sobel operator is used to calculate the gradient components of each candidate pixel in the horizontal and vertical directions in the symmetric residual distribution map, and then its gradient magnitude and gradient direction are calculated. The gradient direction consistency of all pixels in its eight neighborhood is statistically analyzed to obtain the gradient direction field of the candidate pixel in its eight neighborhood. The Sobel operator is a conventional means that can be understood and implemented by those skilled in the art. This application is not limited to a specific partitioning method. Furthermore, the specific steps of S3.1 include: (1) Using the nine-square grid region formed by the candidate pixel and its eight neighboring pixels as the processing unit, the horizontal Sobel operator and the vertical Sobel operator are used to perform convolution operation with the region respectively, and the gradient components in the horizontal direction and the gradient components in the vertical direction of each of the nine pixels are calculated simultaneously. Based on the horizontal and vertical gradient components of each pixel, the corresponding gradient direction angle is calculated by trigonometric function operation. Among them, trigonometric function is a conventional means that can be understood and implemented by those skilled in the art. This application is not limited to a specific partitioning method. (2) Divide the 360 ​​degrees of the circle into multiple preset angle intervals, and map the nine gradient direction angles obtained to the corresponding angle intervals according to their angle values, thereby converting the continuous gradient direction angles into discrete direction interval numbers. (3) Statistically determine the frequency of occurrence of the nine directional interval numbers, find the directional interval number with the highest frequency, and determine it as the dominant directional interval of the nine-square grid area. At the same time, calculate the frequency of occurrence of the dominant directional interval and use this frequency value as a quantitative indicator of the gradient direction consistency in the area. (4) The determined dominant direction interval number and its corresponding consistency frequency value are combined together to form a vector describing the local gradient direction distribution characteristics of the candidate pixel, which is the eight-neighbor gradient direction field.

[0041] S3.2: Calculate the second-order partial derivative at each candidate pixel to construct the Hessian matrix, and obtain the principal curvature of the candidate pixel by solving the eigenvalues ​​of the Hessian matrix; Furthermore, in the Hessian matrix, the element in the upper left corner is the second-order partial derivative value in the horizontal direction, the element in the lower right corner is the second-order partial derivative value in the vertical direction, and the elements in the upper right and lower left corners are mixed partial derivative values. At the same time, the matrix determinant calculation formula is used to solve the eigenvalues. The matrix determinant calculation formula is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0042] S3.3: Preset the first consistency threshold, the second consistency threshold, and the third consistency threshold; If the consistency of the gradient direction field of the eight neighborhood of any candidate pixel is lower than the first consistency threshold, and the absolute value of the principal curvature of its Hessian matrix is ​​higher than the second consistency threshold, then the point is determined to be a pseudo-defect point caused by noise. If the normalized grayscale gradient difference of any candidate pixel is lower than the third consistency threshold, then the point is determined to be a non-significant surface change. S3.4: Candidate pixels that are determined to be false defects or non-significant surface changes are removed from the symmetrical residual distribution map. The binary image formed by the remaining candidate pixels is the effective image of the cable surface.

[0043] Furthermore, the first, second, and third consistency thresholds are set based on the following: the first consistency threshold is obtained by statistical analysis of the gradient direction field of a large number of defect-free cable sample images, and the low quantile of its statistical distribution is taken as the threshold to filter out spurious responses with inconsistent directions caused by texture noise; the second consistency threshold is set based on the theoretical range of the eigenvalues ​​of the Hessian matrix to identify abnormal responses with high curvature caused by isolated noise points; the third consistency threshold is determined by ROC curve analysis to effectively suppress interference from non-significant grayscale changes while ensuring a high defect detection rate.

[0044] Furthermore, the rules for determining false defects also include: calculating the local contrast of the candidate pixel in the symmetrical residual distribution map, that is, the ratio of the gray value of the pixel to the average gray value of the surrounding background area; if the local contrast is lower than the fourth consistency threshold, the candidate pixel is determined to be a low contrast interference; the low contrast interference points are removed together with the false defects and non-significant surface change points.

[0045] The multi-task neural network includes a shared feature extraction layer, a segmentation branch, and a classification branch; The feature extraction layer adopts a ResNet50 network structure, which includes 5 sequentially connected convolutional blocks. Each convolutional block consists of multiple convolutional layers, batch normalization layers, and ReLU activation function layers. It is used to perform layer-by-layer feature abstraction on the input effective image of the cable surface and output a shared deep feature map. The segmentation branch is connected to the output of the feature extraction layer. First, a transposed convolutional layer is used to upsample the shared deep feature map to restore the spatial resolution of the shared deep feature map to the same level as the input image. Then, a 1x1 convolutional layer is used to adjust the number of channels of the upsampled feature map to match the number of defect categories. Finally, a Softmax activation function layer is used for probability normalization to output a pixel-level segmentation mask for the defect region. Furthermore, the transposed convolutional layer in the segmentation branch is specifically configured as follows: it includes a four-level upsampling structure, each level receiving skip connection features from the corresponding scale of the feature extraction layer; each level first uses transposed convolution to double the resolution of the feature map, and then concatenates the output of the transposed convolution with the feature map of the same scale from the encoder; the concatenated feature map is then subjected to 3x3 convolution, batch normalization, and ReLU activation operations in sequence to fuse semantic and spatial information from different levels.

[0046] The classification branch is connected to the output of the global average pooling layer at the end of the feature extraction layer. First, a global average pooling operation is performed on the shared deep feature map to convert it into a one-dimensional global feature vector. This global feature vector is then passed through a fully connected layer and mapped to an output vector with the same dimension as the number of defect categories. After batch normalization of the output vector, it is input into the Softmax activation function layer to obtain the probability distribution of each defect category. The category corresponding to the highest probability value is taken as the defect category label.

[0047] Furthermore, the training process of the multi-task neural network includes: using a labeled image dataset containing various cable surface defects, wherein the labeling includes pixel-level segmentation masks and image-level category labels; optimizing the parameters of the shared encoder, segmentation decoder, and classification decoder using stochastic gradient descent; and applying data augmentation operations such as random rotation, scaling, and brightness changes to the input image during training to improve the generalization ability of the model. Here, stochastic gradient descent is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0048] Furthermore, the training process of the multi-task neural network is optimized using a joint loss function. The joint loss function consists of a weighted sum of segmentation loss and classification loss, where the segmentation loss is the sum of cross-entropy loss and Dice loss, used to simultaneously optimize pixel-level classification accuracy and region overlap. The classification loss is a standard cross-entropy loss, used to optimize the accuracy of defect category discrimination. The network parameters of the feature extraction layer, segmentation branch, and classification branch are updated simultaneously through the backpropagation algorithm, enabling the model to learn defect segmentation and classification tasks synchronously and efficiently. The cross-entropy loss, Dice loss, and backpropagation algorithm are conventional methods that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0049] The process of generating the defect 3D mesh model includes: S4.1: Based on the pixel-level segmentation mask, extract the three-dimensional point set corresponding to the defect region in the grayscale surface image; Furthermore, before extracting the corresponding three-dimensional point set from the grayscale surface image, the coordinates of the pixels in the defect area are subjected to morphological closing operations to fill any small holes that may exist in the segmentation mask, ensuring that the extracted three-dimensional point set can completely cover the defect area.

[0050] S4.2: Calculate the normal vector of each point in the 3D point set and construct an octree space structure; Further, the normal vector of each point in the 3D point set is calculated, including: for each point in the 3D point set, using its coordinates as the center of a sphere and a preset search radius as the radius, finding all neighboring points within the sphere in the point set; the set of these neighboring points constitutes the local neighborhood of the point; calculating the average coordinates of all points in the local neighborhood to obtain the neighborhood center point, and subtracting the coordinates of this center point from the coordinates of each point in the neighborhood to obtain the centered point set; calculating the covariance matrix of these centered point sets; calculating the eigenvalues ​​and eigenvectors of the covariance matrix, taking the eigenvector corresponding to the smallest eigenvalue, normalizing this vector to unit length, and using it as the initial normal vector of the point; setting a global reference direction, comparing the dot product of the initial normal vector of each point with this global reference direction, and if the dot product result is negative, inverting the normal vector to ensure that all normal vectors face the same direction.

[0051] Furthermore, an octree spatial structure is constructed based on the 3D point set whose normal vectors have been calculated, including: (1) Calculate the boundaries of the entire three-dimensional point set in the three coordinate axes to form a minimum cuboid space that can enclose all points, and use this space as the root node of the octree. (2) Starting from the root node, if the number of points contained in a node exceeds the preset threshold and its spatial size is greater than the minimum granularity threshold, then the cuboid space represented by the node is evenly divided into eight subspaces, each subspace becoming a child node. This judgment and subdivision process is repeated for each newly generated child node until all nodes are indivisible. These indivisible nodes are called leaf nodes. (3) Traverse each point in the three-dimensional point set, and according to its spatial coordinates, traverse the octree from the root node down level by level until the leaf node to which it belongs is found, and record the point in this leaf node.

[0052] S4.3: Define an indicator function on the octree structure to transform the surface reconstruction problem into solving the Poisson equation between the gradient field of the indicator function and the point normal vector field; Furthermore, the specific steps of S4.3 include: (1) Define each node in the constructed octree, i.e. a cube cell, as a spatial sampling point. Treat the unknown indicator function value at each node as an unknown. Then arrange these unknown indicator function values ​​of all nodes into a one-dimensional vector according to the preset spatial order. This vector is the core unknown quantity that this method needs to solve. (2) Traverse each point in the 3D point cloud of normal vectors. For each point, find the octagonal leaf node where it is located. Based on the relative position of the point and the center of the node, use trilinear interpolation weights to distribute the 3D normal vector value of the point to the leaf node and its multiple neighboring nodes. After performing this operation on all points in the point cloud, perform a weighted average of all vector contributions accumulated on each octagonal node. Finally, obtain a smooth vector value representing the direction of the normal vector of the local region on each octagonal node. These vector values ​​on all nodes together constitute a vector field defined on the octagonal node. (3) For the vector field defined on the octree node, calculate its divergence at each node. The divergence is calculated as follows: calculate the rate of change of the vector at the node in the X, Y, and Z directions respectively, and then add these three rates of change together. When calculating the rate of change, use the vector values ​​of the node and its direct adjacent nodes in the octree, such as the front, back, left, right, top, and bottom adjacent nodes, and obtain them through the central difference method. Calculate the divergence value at each node. All these divergence values ​​constitute a scalar field defined on the octree node, called the divergence field. (4) Establish a set of linear equations with the defined unknown indicator function vector as the solution objective. The coefficient matrix of the linear system is determined by the spatial adjacency relationship between the octree nodes, which specifically reflects the finite difference approximation of the Laplace operator, i.e. the sum of the second derivative operators, in the octree discrete space. The right-hand side of the linear system is the vector composed of the divergence field obtained in the third step. (5) The large sparse linear system established in the fourth step is solved by using the preconditioned conjugate gradient method. Iteration starts from an initial guess solution, where the initial guess solution is usually set as the zero vector. In each iteration, a search direction and a step size are determined based on the residual calculated from the current solution and combined with the preconditioner to update the current solution vector. This process is repeated until the solution vector meets the preset convergence accuracy. The solution vector obtained at this time is the indicator function value on each octree node. (6) Set an isosurface threshold, usually set to zero. Use the moving cube algorithm to traverse each node of the octree, i.e. the cube, check the indicator function values ​​obtained from step 5 at the eight vertices of the cube, find the preset isosurface configuration table based on the comparison relationship between these values ​​and the threshold, determine the way the isosurface passes through the cube, and calculate the corresponding triangular facets. Finally, collect all the triangular facets generated in the cube to form the final three-dimensional triangular mesh surface model.

[0053] S4.4: Solve the Poisson equation using the conjugate gradient method to obtain the value of the indicator function. The formula for the conjugate gradient method is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method. S4.5: The isosurface of the indicator function is extracted using the moving cube algorithm to generate a three-dimensional mesh model of the defect. The calculation formula of the moving cube algorithm is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0054] Furthermore, after generating the 3D mesh model of the defect, the process also includes optimizing the mesh: using the Laplacian smoothing algorithm to iteratively adjust the positions of the mesh vertices to eliminate surface noise and smooth irregular protrusions; and using the edge collapse algorithm to simplify the mesh, reducing the number of triangles while maintaining the main geometric features of the defect, thereby improving the model rendering and storage efficiency. The Laplacian smoothing algorithm and the edge collapse algorithm are both conventional methods that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method.

[0055] The process of using a galvanometer-type laser marking machine to mark a QR code containing the defect type, center physical coordinates, and marking time at the defect location on the cable surface, based on the central physical coordinates of the defect area, includes: S5.1: Calculate the average coordinates of all points in the three-dimensional point set of the defect to obtain the central physical coordinates of the defect region; S5.2: Encode the defect category label, center physical coordinates, and current system time into a single string; S5.3: Use a QR code generation algorithm to convert a string into a two-dimensional code bitmap. The QR code generation algorithm is a conventional method that can be understood and implemented by those skilled in the art, and this application is not limited to a specific partitioning method. S5.4: Based on the pre-calibrated transformation relationship between the central physical coordinates and the coordinate system of the galvanometer laser marking machine, calculate the deflection angle of the galvanometer and control the laser beam to mark the QR code at the defect location on the cable surface.

[0056] Further, the coordinates are converted into deflection commands for the galvanometer, including: using the pre-calibrated rigid body transformation parameters from the world coordinate system to the galvanometer marking machine coordinate system, the three-dimensional coordinates of the defect center point in the world coordinate system are converted into three-dimensional coordinates in the galvanometer marking machine coordinate system through rotation and translation operations; the converted three-dimensional coordinates of the marking machine are projected onto the two-dimensional scanning plane of the laser galvanometer along the laser optical path to obtain a two-dimensional projection point coordinate; based on the focal length parameters of the laser marking machine and the two-dimensional projection point coordinates obtained in the previous step, the precise angle values ​​for controlling the deflection of the X-axis galvanometer and the Y-axis galvanometer are calculated respectively through geometric relationships.

[0057] Furthermore, the laser and galvanometer work together to complete the marking process, including: rasterizing the QR code bitmap image to be marked and converting it into a laser switch control timing pulse signal synchronized with the scanning motion of the galvanometer. The laser switch control timing pulse signal specifies when the laser should turn on high power for marking and when it should turn off or maintain low power; converting the calculated X-axis and Y-axis galvanometer deflection angles into control signals, such as analog voltage or digital pulses, to drive the X-axis and Y-axis galvanometer motors, respectively; sending the laser switch control timing pulse signal to the laser in real time, and simultaneously sending the generated control signal to the galvanometer system in real time, controlling the galvanometer system to drive the laser beam to scan along the trajectory of the QR code, and synchronously controlling the laser to turn on high power at the trajectory points to be marked, thereby accurately marking the QR code pattern at the defect location on the cable surface.

[0058] Furthermore, the marking parameters of the galvanometer laser marking machine are adaptively adjusted according to the cable surface material. Specifically, a material database is pre-established to store parameter sets of laser power, scanning speed, and marking frequency corresponding to different cable surface materials. Based on the cable material information of the current production line, the corresponding parameter set is queried from the material database and loaded into the controller of the galvanometer laser marking machine. The QR code marking operation is performed based on the loaded parameter set to ensure clear marking without damaging the cable surface.

[0059] Example 2: Please see Figure 3 Another embodiment of the present invention provides: a cable production identification and monitoring system based on cable images, comprising: Image acquisition module, map construction module, effective image generation module, defect recognition module, QR code marking module; The image acquisition module is used to acquire cable surface depth image data. Through coordinate transformation, raster division, depth value calculation and interpolation, it generates a complete and accurate grayscale surface map of the cable surface depth direction. The map construction module is used to determine the dynamic symmetry axis of the grayscale surface map, comprehensively capture potential defect candidate pixels through multi-scale morphological top-hat transformation, calculate the normalized grayscale gradient difference, construct a symmetric residual distribution map, and focus on suspected defect areas. The effective image generation module is used to analyze the gradient direction consistency and curvature characteristics of candidate pixels, remove false defect points caused by noise and non-significant surface change points, and select the pixels corresponding to real defects to form an effective image of the cable surface. The defect identification module is used to achieve pixel-level segmentation and category determination of defect areas through a pre-trained multi-task neural network, extract the three-dimensional point set corresponding to the defect, and generate a three-dimensional mesh model of the defect with dimensional accuracy through Poisson surface reconstruction, so as to achieve accurate identification and quantitative characterization of defects. The QR code marking module is used to calculate the physical coordinates of the defect center and drive the laser marking machine to mark a QR code containing key information. After verification, the defect-related data is associated with the production line parameters and stored in the blockchain database to achieve full-process traceability of defects and data security management.

[0060] The map construction module includes: a ridge extraction unit, a pixel detection unit, and a map construction unit; The ridge extraction unit is used to obtain the initial ridge line using a skeleton extraction algorithm. After morphological refinement, a single-pixel wide ridge line is obtained. Based on the cable axial linearity constraint, the initial dynamic symmetry axis is obtained by smoothing through the sliding window least squares method. Then, a local window is taken with each axial position as the center to calculate the grayscale projection perpendicular to the tangent direction of the initial ridge line. The ridge line is corrected with the projection peak position to form the final dynamic symmetry axis, ensuring that the symmetry axis accurately matches the actual axis of the cable. The pixel detection unit performs a morphological top-hat transformation on the grayscale surface image based on a dynamic symmetry axis and using at least three circular structuring elements of different scales. It merges pixels with grayscale values ​​higher than a preset threshold at each scale to form a candidate pixel set, comprehensively covering potential defects of different sizes. The graph construction unit is used to construct a perpendicular line from the circumference to the dynamic axis of symmetry for each candidate pixel, calculate the gray-level gradient value of the point and its symmetrical point, calculate the absolute difference between the two and compare it with the global maximum gray-level gradient value to obtain the normalized gray-level gradient difference, fill the position of the candidate pixel and the corresponding difference into a matrix with the same size as the gray-level surface map, and generate a symmetrical residual distribution graph.

[0061] The effective image generation module includes: a gradient direction field unit and a curvature calculation unit; The gradient direction field unit is used to calculate the horizontal and vertical gradient components of each candidate pixel in the symmetric residual distribution map using the Sobel operator, thereby obtaining the gradient magnitude and gradient direction. The consistency of the gradient direction of all pixels in the eight neighborhood of the point is statistically analyzed to form an eight-neighbor gradient direction field, which reflects the gradient distribution pattern around the pixel. The curvature calculation unit is used to calculate the second-order partial derivative of each candidate pixel, construct the Hessian matrix, and obtain the principal curvature of the point by solving the eigenvalues ​​of the Hessian matrix, which characterizes the surface curvature of the region where the pixel is located.

[0062] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the present invention. All of these variations are within the protection scope of the present invention.

Claims

1. A cable production identification and monitoring method based on cable images, characterized in that, include: S1: Based on the collected cable surface image data, construct a grayscale surface map along the cable axis in the depth direction of the cable surface; S2: Using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixels are detected by multi-scale morphological top-hat transformation, and the normalized grayscale gradient difference between each candidate pixel and the corresponding point of the normal axis of symmetry is calculated to form a symmetrical residual distribution map. S3: In the symmetrical residual distribution map, calculate the eight-neighbor gradient direction field and Hessian matrix curvature of each candidate pixel, determine and remove false defect points according to the preset removal rules, and obtain the effective image of the cable surface. S4: Input the effective image of the cable surface into the pre-trained multi-task neural network. The multi-task neural network synchronously outputs the pixel-level segmentation mask and category label of the defect area. Combined with the pixel coordinates of the defect area, the corresponding three-dimensional point set is extracted from the grayscale surface image. The defect three-dimensional mesh model with dimensional accuracy is generated by Poisson surface reconstruction. S5: Based on the central physical coordinates of the defect area, drive the galvanometer laser marking machine to mark a QR code containing the defect type, central physical coordinates, and marking time at the defect location on the cable surface. The QR code is photographed and decoded by the verification camera. After confirming that there are no errors, the QR code data, the defect three-dimensional mesh model, the corresponding defect fragment in the effective image of the cable surface, and the production line parameters are associated and stored in the blockchain database. The formation process of the symmetric residual distribution map includes: For each pixel in the candidate pixel set, draw a perpendicular line from the pixel to the dynamic symmetry axis along the circumferential direction on the grayscale surface image; Calculate the first gray-level gradient value of the pixel in its vertical direction, locate the corresponding point on the vertical line that is symmetrical to the pixel about the dynamic axis of symmetry, and calculate the second gray-level gradient value of the corresponding point. Calculate the absolute difference between the first gray-level gradient value and the second gray-level gradient value, and use the ratio of the absolute difference to the global maximum gray-level gradient value of the gray-level surface map as the normalized gray-level gradient difference of the candidate pixel. Create an empty matrix with the same size as the grayscale surface image as the initial map, and fill the empty matrix with the position of each candidate pixel and its corresponding normalized grayscale gradient difference to form the symmetrical residual distribution map. The specific steps of S3 include: The Sobel operator is used to calculate the gradient components of each candidate pixel in the horizontal and vertical directions in the symmetric residual distribution map, and then its gradient magnitude and gradient direction are calculated. The consistency of the gradient direction of all pixels in its eight neighborhood is statistically analyzed to obtain the gradient direction field of the candidate pixel in its eight neighborhood. Calculate the second-order partial derivative at each candidate pixel to construct the Hessian matrix, and obtain the principal curvature of the candidate pixel by solving the eigenvalues ​​of the Hessian matrix; preset the first consistency threshold, the second consistency threshold and the third consistency threshold. If the consistency of the gradient direction field of the eight neighborhood of any candidate pixel is lower than the first consistency threshold, and the absolute value of the principal curvature of its Hessian matrix is ​​higher than the second consistency threshold, then the point is determined to be a pseudo-defect point caused by noise. If the normalized grayscale gradient difference of any candidate pixel is lower than the third consistency threshold, then the point is determined to be a non-significant surface change. Candidate pixels that are identified as false defects or insignificant surface changes are removed from the symmetrical residual distribution map. The binary image formed by the remaining candidate pixels is the effective image of the cable surface.

2. The cable production identification and monitoring method based on cable images as described in claim 1, characterized in that, The specific steps of S1 include: Acquire a sequence of depth images obtained by scanning the surface of a cable using a multi-line structured light sensor; The pixels in the depth image sequence are transformed from the sensor coordinate system to the world coordinate system with the cable axis as the Z-axis to obtain the three-dimensional point cloud data of the cable surface. Along the Z-axis of the world coordinate system, the three-dimensional point cloud data is projected onto the XY plane, and the projected area is divided into multiple three-dimensional spatial grids at equal intervals with a preset axial resolution and circumferential angular resolution. Collect all three-dimensional point clouds that fall within each of the three-dimensional spatial grids, calculate the average depth value of the three-dimensional point clouds along the X-axis of the world coordinate system, and use the average value as the representation depth value of the current grid. The depth values ​​of each grid cell are filled into the corresponding row and column positions in a pre-created two-dimensional matrix to obtain an initial depth matrix. The row index of the two-dimensional matrix corresponds to the axial position sequence, and the column index corresponds to the circumferential angle sequence. For grids in the initial depth matrix that have missing data, bilinear interpolation is used to complete the data using the depth values ​​of their adjacent grids, generating the final grayscale surface map of the cable surface in the depth direction.

3. The cable production identification and monitoring method based on cable images as described in claim 2, characterized in that, Using the central ridge line of the grayscale surface image as the dynamic axis of symmetry, candidate pixel points are detected using multi-scale morphological top-hat transformation, including: An initial ridge line is extracted from the grayscale surface image using a skeleton extraction algorithm. The initial ridge line is then subjected to morphological thinning to obtain a thinned ridge line with a width of one pixel. Based on the linearity constraint of the cable axis, the thinned ridge line is smoothed by the sliding window least squares method to obtain the central ridge line as the dynamic symmetry axis. Based on a dynamic symmetry axis, at least three circular structural elements of different scales are used to perform a morphological top-hat transformation on the grayscale surface image. Pixels with grayscale values ​​higher than a preset threshold in the top-hat transformation results at each scale are merged to form a candidate pixel set. The radius of the circular structural elements at each scale increases in a proportional sequence along the radial direction of the cable.

4. The cable production identification and monitoring method based on cable images as described in claim 3, characterized in that, The calculation of the dynamic symmetry axis also includes: Based on the initial ridge line, a local window is taken with each axial position as the center; Within the local window, the grayscale projection perpendicular to the current initial ridge tangent direction is calculated. The peak position of the projection is taken as the correction point of the central ridge at that axial position. All correction points are connected to form the corrected dynamic symmetry axis.

5. The cable production identification and monitoring method based on cable images as described in claim 4, characterized in that, The multi-task neural network includes a shared feature extraction layer, a segmentation branch, and a classification branch; The feature extraction layer adopts a ResNet50 network structure, which includes 5 sequentially connected convolutional blocks. Each convolutional block consists of multiple convolutional layers, batch normalization layers, and ReLU activation function layers. It is used to perform layer-by-layer feature abstraction on the input effective image of the cable surface and output a shared deep feature map. The segmentation branch is connected to the output of the feature extraction layer. First, a transposed convolutional layer is used to upsample the shared deep feature map to restore the spatial resolution of the shared deep feature map to the same level as the input image. Then, a 1x1 convolutional layer is used to adjust the number of channels of the upsampled feature map to match the number of defect categories. Finally, a Softmax activation function layer is used for probability normalization to output a pixel-level segmentation mask for the defect region. The classification branch is connected to the output of the global average pooling layer at the end of the feature extraction layer. First, a global average pooling operation is performed on the shared deep feature map to convert it into a one-dimensional global feature vector. This global feature vector is then passed through a fully connected layer and mapped to an output vector with the same dimension as the number of defect categories. After batch normalization of the output vector, it is input into the Softmax activation function layer to obtain the probability distribution of each defect category. The category corresponding to the highest probability value is taken as the defect category label.

6. The cable production identification and monitoring method based on cable images as described in claim 5, characterized in that, The process of generating the defect 3D mesh model includes: Based on the pixel-level segmentation mask, extract the three-dimensional point set corresponding to the defect region from the grayscale surface image; Calculate the normal vector of each point in the 3D point set and construct an octree space structure; Define an indicator function on the octree structure, and transform the surface reconstruction problem into solving the Poisson equation between the gradient field of the indicator function and the point normal vector field; The conjugate gradient method is used to solve the Poisson equation and obtain the value of the indicator function. The isosurface of the indicator function is extracted using the moving cube algorithm to generate a three-dimensional mesh model of the defect.

7. The cable production identification and monitoring method based on cable images as described in claim 6, characterized in that, The process of using a galvanometer-type laser marking machine to mark a QR code containing the defect type, center physical coordinates, and marking time at the defect location on the cable surface, based on the central physical coordinates of the defect area, includes: Calculate the average coordinates of all points in the three-dimensional defect point set to obtain the center physical coordinates of the defect region; The defect category label, the center physical coordinates, and the current system time are combined and encoded into a single string; Use a QR code generation algorithm to convert a string into a two-dimensional code bitmap; Based on the pre-calibrated transformation relationship between the central physical coordinates and the coordinate system of the galvanometer laser marking machine, the deflection angle of the galvanometer is calculated, and the laser beam is controlled to mark the QR code at the defect location on the cable surface.

8. A cable production identification and monitoring system based on cable images, used to implement the cable production identification and monitoring method based on cable images according to any one of claims 1-7, characterized in that, include: Image acquisition module, map construction module, effective image generation module, defect recognition module, QR code marking module; The image acquisition module is used to acquire cable surface depth image data, and generate a grayscale surface map of the cable surface depth direction through coordinate transformation, grid division, depth value calculation and interpolation. The map construction module is used to determine the dynamic symmetry axis of the grayscale surface map, comprehensively capture potential defect candidate pixels through multi-scale morphological top-hat transformation, calculate the normalized grayscale gradient difference, construct a symmetric residual distribution map, and focus on the defect region. The effective image generation module is used to analyze the gradient direction consistency and curvature characteristics of candidate pixels, remove false defect points caused by noise and non-significant surface change points, and select the pixels corresponding to real defects to form an effective image of the cable surface. The defect identification module is used to achieve pixel-level segmentation and category determination of defect areas through a pre-trained multi-task neural network, extract the three-dimensional point set corresponding to the defect, and generate a three-dimensional mesh model of the defect with dimensional accuracy through Poisson surface reconstruction. The QR code marking module is used to calculate the physical coordinates of the defect center and drive the laser marking machine to mark a QR code containing key information.

Citation Information

Patent Citations

  • Three-dimensional imaging detection method for surface defects of connector

    CN120703106A

  • Egg product defect detection and grading method and system based on deep learning technology

    CN121746794A