Cable identification and bending radius rapid measurement method and device

Through the Swin-Unet deep learning network and Bezier curve fitting method, combined with RGB-D data, the problem of insufficient adaptability and fitting accuracy of segmentation network in cable bending radius measurement is solved, and high-precision and fast cable bending radius measurement is achieved, which is suitable for complex industrial environments.

CN120495239APending Publication Date: 2025-08-15SOUTH CHINA NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510590248.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, the cable bending radius measurement has problems such as insufficient adaptability of segmented networks, limited curve fitting accuracy, and poor single adaptability of image preprocessing methods, resulting in insufficient measurement accuracy and efficiency.

Method used

The method of fitting the Swin-Unet deep learning network and Bezier curve is adopted, combined with RGB-D dual-modal data fusion, and the contrast and contour features are optimized through local adaptive enhancement and composite mapping function. The cable mask segmentation is used for Swin-Unet network, and the cable space curve is reconstructed through Bezier curve fitting, and the curvature is directly calculated to obtain the bending radius.

Benefits of technology

It realizes high-precision and fast cable bending radius measurement, improves segmentation accuracy, strong fitting flexibility, and increases measurement speed by more than 90%. It adapts to complex industrial environments and is highly robust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495239A_ABST
    Figure CN120495239A_ABST
Patent Text Reader

Abstract

The invention discloses a cable identification and bending radius rapid measurement method and device. The method is realized based on a Swinin-Unet deep learning network and Bezier curve fitting. Comprising the steps that RGB-D bimodal images of a cable are acquired, and the RGB-D bimodal images comprise an RGB image and a depth image; local adaptive enhancement is carried out on the RGB image, and a composite mapping function is adopted to optimize contrast and contour features; carrying out cable mask segmentation on the RGB-D image by using a Swinin-Unet network; extracting a cable center line feature point based on an OpenCV refinement algorithm, and reconstructing a cable space curve through Bezier curve fitting; and calculating the derivative of the Bezier curve, calculating the curvature of each point of the cable by using a curvature formula, and obtaining the bending radius of the cable through the curvature. The device comprises an image acquisition module, an image processing module, a semantic segmentation module, a feature extraction and fitting module and a bending radius calculation module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent detection technology, and in particular to a cable mask segmentation and bending radius rapid measurement method and device based on a Swin-Unet deep learning network and Bezier curve fitting. Background Art

[0002] Cable bend radius is a key parameter for evaluating cable performance and service life. In aerospace, shipbuilding, rail vehicles, and large-scale electrical equipment, the cable's bend radius directly impacts its mechanical strength and electrical performance. Accurately measuring cable bend radius is crucial to ensuring safe equipment operation and extending cable life.

[0003] Cable bend radius measurement primarily involves cable identification and bend radius measurement. Latex filament molding processes, such as those in CN118628983B, utilize images to identify cable cross-sections. Cable bend radius measurement, such as those in patents CN115221709A and CN119245480A, focuses on automated measurement.

[0004] The above-mentioned specific patent reference documents are:

[0005] 1) "A cable identification method and system based on image processing", patent authorization announcement number CN118628983B. This patent relates to a cable identification method and system based on image processing. The cable identification method based on image processing includes: collecting cross-sectional images of cable insulation materials and processing them; performing image segmentation and defect detection on the processed cross-sectional images, identifying and marking defects in the images, and locating the starting point of the water tree phenomenon based on the marked defects; establishing a water tree phenomenon generation and development prediction model based on the starting point of the water tree phenomenon; using adaptive optical compensation methods and image enhancement methods to dynamically adjust imaging parameters in real time; using a multi-level resolution image acquisition strategy to dynamically adjust image resolution; collecting original cross-sectional image data and performing preprocessing; real-time monitoring and analysis of image data and electrical stress data to identify potential water tree phenomena and insulation material defects. The cable identification of the present invention is different from the above inventions. It is aimed at the identification of the entire cable and identifies the cable mask to facilitate the subsequent calculation of the bending radius of the cable.

[0006] 2) "A method for automatically detecting the bending radius of cables in a three-dimensional model", patent publication number CN115221709A. This patent relates to a method for automatically detecting the bending radius of cables in a three-dimensional model, comprising the following steps: S1. Designing a wiring harness information collection function, traversing the model information of the three-dimensional model, searching for the harness, and presenting it to the user through an interface display; S2. Setting a wiring bending radius process input function, wherein the user inputs the specific process requirements of the cable through the EDIT control; S3. Designing a wiring cable information collection function, traversing the cables in the selected harness, and presenting the specific information to the user through an interface display, wherein the user selects the cables and the selected cables are displayed separately; the present invention can accurately obtain the bending data of all cables and detect whether the wiring is reasonable during wiring design, thereby improving the wiring quality and reducing the workload of wiring engineers. At the same time, the present invention utilizes the accuracy and engineering practicality of computer-aided three-dimensional wiring to improve the reliability and stability of cable routing. The cable detection and measurement process of the present invention is different from the above invention. It uses a deep learning method to segment the cables and quickly measures the radius after reconstruction.

[0007] 3) "A cable bending radius measuring device and measuring method", patent publication number CN119245480A. This patent relates to a cable bending radius measuring device and measuring method, the measuring device includes a measuring plate, at least one side of the measuring plate is set as an arc-shaped bending edge; the measuring plate is provided with a wire diameter mark at one side of the arc-shaped bending edge, the wire diameter mark is used to mark the cross-sectional area of the cable; the bending radius of the arc-shaped bending edge is set to the minimum bending radius of the cable of the cross-sectional area; it can replace visual inspection or a ruler to measure the bending radius of the cable, improve measurement accuracy and efficiency, avoid the bending radius of the cable being less than the required minimum bending radius, thereby ensuring that the bending radius of the cable meets the requirements, which is beneficial to the safe use of the cable. The detection device and process of the present invention are different from the above inventions. The present invention uses a camera to directly identify the split cable and measures the radius based on the identification result. Summary of the Invention

[0008] In order to solve the above technical problems, the purpose of the present invention is to provide a cable mask segmentation and bending radius rapid measurement method and device based on Swin-Unet deep learning network and Bezier curve fitting. This method and device realize fast and contactless measurement of cable bending radius through RGB-D dual-modal data fusion, Swin-Unet high-precision segmentation, Bezier curve algebraic reconstruction and curvature calculation, which effectively solves the problems of insufficient adaptability of segmentation network, limited curve fitting accuracy and poor adaptability of single image preprocessing method in the prior art.

[0009] The purpose of the present invention is achieved through the following technical solutions:

[0010] A method for quickly measuring cable identification and bending radius, comprising:

[0011] The method is based on the Swin-Unet deep learning network and Bezier curve fitting and includes the following steps:

[0012] Step A obtains an RGB-D dual-modal image of the cable, including an RGB image and a depth image;

[0013] Step B performs local adaptive enhancement on the RGB image and uses a composite mapping function to optimize contrast and contour features;

[0014] Step C uses the Swin-Unet network to perform cable mask segmentation on the RGB-D image;

[0015] Step D extracts the cable centerline feature points based on the OpenCV thinning algorithm and reconstructs the cable space curve through Bezier curve fitting;

[0016] Step E calculates the derivative of the Bezier curve, uses the curvature formula to calculate the curvature of each point of the cable, and obtains the bending radius of the cable through the curvature.

[0017] A cable identification and bending radius rapid measurement device, comprising:

[0018] Image acquisition module, used to obtain RGB-D dual-modal images of cables;

[0019] Image processing module, used to optimize RGB images and depth images;

[0020] Semantic segmentation module, used to perform cable mask segmentation on the optimized RGB-D image;

[0021] Feature extraction and fitting module, used to extract the center line of the mask and perform curve fitting;

[0022] The bending radius calculation module is used to calculate the spatial bending radius of the cable.

[0023] Compared with the prior art, one or more embodiments of the present invention may have the following advantages:

[0024] Swin-Unet combines a windowed self-attention mechanism with high segmentation accuracy to significantly improve the accuracy of mask segmentation for slender cables. The algorithm offers strong fitting flexibility, with Bezier curves dynamically optimized through control points to adapt to the complex local bending shapes of cables and reduce fitting errors. The algorithm also offers excellent computational efficiency, directly calculating curvature through Bezier derivatives to avoid iterative sampling or complex reconstruction, increasing measurement speed by over 90%. Furthermore, the algorithm adaptively corrects measurement results based on curvature distribution analysis to enhance robustness. The algorithm also offers wide adaptability to various scenarios, with a dual-modal RGB-D fusion enhancement algorithm suitable for complex industrial environments such as uneven lighting and occlusion. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a flowchart of a fast cable bending radius measurement method based on RGB-D dual-modal deep semantic segmentation and algebraic reconstruction;

[0026] Figure 2 This is the Swin-Unet model architecture diagram. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be described in further detail below with reference to embodiments and accompanying drawings.

[0028] like Figure 1 The figure shows a flow chart of a fast cable bending radius measurement method based on RGB-D dual-modal deep semantic segmentation and algebraic reconstruction, which includes the following steps:

[0029] Step A obtains an RGB-D dual-modal image of the cable, including an RGB image and a depth image;

[0030] Step B performs local adaptive enhancement on the RGB image and uses a composite mapping function to optimize contrast and contour features;

[0031] Step C uses the Swin-Unet network to perform cable mask segmentation on the RGB-D image;

[0032] Step D extracts the cable centerline feature points based on the OpenCV thinning algorithm and reconstructs the cable space curve through Bezier curve fitting;

[0033] Step E calculates the derivative of the Bezier curve, uses the curvature formula to calculate the curvature of each point of the cable, and obtains the bending radius of the cable through the curvature.

[0034] The above step 20 specifically includes: performing local adaptive enhancement on each channel of the RGB image, making is the pixel value of the cth channel of the enhanced image, is the pixel value of the cth channel of the original image, α and β are the enhancement scale parameters of high and low grayscale regions (used to control the enhancement effect), then:

[0035]

[0036] Let γ, δ and ∈ be the mapping function parameters (used to adjust the contrast and brightness of the image), we have:

[0037]

[0038] The above step 30 specifically includes: Figure 2 As shown in Figure 2, the Swin-Unet network contains an encoder-decoder structure. The encoder uses the Swin Transformer to extract multi-scale features of the image. The core of the Swin Transformer lies in its hierarchical self-attention mechanism. By dividing the input image into non-overlapping windows and calculating self-attention within each window, it reduces computational complexity and captures local features. The calculation formula of the self-attention mechanism is as follows:

[0039] Q=XW Q ,K=XW K ,V=XW V

[0040]

[0041] Where Q, K, and V represent query, key, and value matrices respectively; W Q 、W K and W V is the corresponding weight matrix; d is the dimension of the feature vector; Softmax is the flexible maximum calculation method used to convert the attention score into a probability distribution; X is the input feature vector.

[0042] The decoder restores and integrates the features extracted by the encoder through progressive upsampling and feature fusion. Skip connections are used to fuse the encoder and decoder feature maps, preserving more detailed information and ultimately generating accurate cable mask segmentation results. During training, the network is trained on a dataset encompassing a variety of cable types and scenarios to improve segmentation accuracy and robustness.

[0043] The above step 40 specifically includes: using the cv2.ximgproc.thinning function in OpenCV to perform thinning processing on the binary image after cable mask segmentation, and extracting the coordinate sequence of the central feature points of the cable as follows, where l is the number of feature points:

[0044]

[0045] Then, Bezier curve fitting is performed. Let n be the degree of the Bezier curve and t be the parameter of the Bezier curve, which is used to control the position of the points on the curve. Then, we have:

[0046]

[0047] The above step 50 specifically includes: calculating the curvature and bending radius using the derivative of the Bezier curve, and the first and second order derivatives of the Bezier curve are respectively:

[0048]

[0049] According to the first and second order derivatives of the Bezier curve, the curvature formula can be obtained as follows:

[0050]

[0051] Therefore, the final cable bending radius R c :

[0052]

[0053] A cable identification and bending radius rapid measurement device based on deep learning and Bezier curve fitting includes an image acquisition module, an image processing module, a semantic segmentation module, a feature extraction and fitting module, and a bending radius calculation module. The image acquisition module is used to obtain an RGB-D image of the cable; the image processing module is used to optimize the RGB image and the depth image; the semantic segmentation module is used to perform cable mask segmentation on the optimized RGB-D image; the feature extraction and fitting module is used to extract the mask centerline and perform curve fitting; and the bending radius calculation module is used to calculate the spatial bending radius of the cable.

[0054] The image acquisition module integrates an RGB camera and a depth sensor to synchronously acquire RGB-D images of the cable; the image processing module performs local channel adaptive enhancement and composite mapping optimization on the RGB image; the semantic segmentation module is based on SwinTransformer for multi-scale feature extraction and mask generation; the feature extraction and fitting module uses a morphological refinement algorithm to extract the mask centerline; and the bending radius calculation module directly solves the curvature and bending radius through derivatives and displays the measurement results.

[0055] The method and device provided in the above embodiment have a mask segmentation error of ≤1.5%, and a bending radius measurement accuracy of ±0.1mm; a single measurement takes less than 2 seconds, supports multiple types of cables (diameter 1mm-50mm) and complex background scenes, and is suitable for non-contact, high-precision measurement of cable bending radius in complex scenes such as aerospace, ships, and rail transportation.

[0056] Although the embodiments disclosed herein are as described above, the contents described herein are merely embodiments for facilitating understanding of the present invention and are not intended to limit the present invention. Any person skilled in the art may make any modifications and variations in the form and details of the embodiments without departing from the spirit and scope of the present invention. However, the scope of patent protection of the present invention shall remain subject to the scope defined by the appended claims.

Claims

1. A method for quickly measuring cable identification and bending radius, characterized in that: The method is based on the Swin-Unet deep learning network and Bezier curve fitting and includes the following steps: Step A obtains an RGB-D dual-modal image of the cable, including an RGB image and a depth image; Step B performs local adaptive enhancement on the RGB image and uses a composite mapping function to optimize contrast and contour features; Step C uses the Swin-Unet network to perform cable mask segmentation on the RGB-D image; Step D extracts the cable centerline feature points based on the OpenCV thinning algorithm and reconstructs the cable space curve through Bezier curve fitting; Step E calculates the derivative of the Bezier curve, uses the curvature formula to calculate the curvature of each point of the cable, and obtains the bending radius of the cable through the curvature.

2. The cable identification and bending radius rapid measurement method according to claim 1, characterized in that: In the step B, each channel of the RGB image is locally adaptively enhanced, and the image contrast is enhanced by a composite mapping function of a Gamma function and an exponential function.

3. The cable identification and bending radius rapid measurement method according to claim 2, characterized in that: make is the pixel value of the cth channel of the enhanced image, is the pixel value of the cth channel of the original image, α and β are the scale parameters for enhancing the high and low grayscale regions respectively, then: Where γ, δ, and ∈ are mapping function parameters, which are used to adjust the contrast and brightness of the image.

4. The cable identification and bending radius rapid measurement method according to claim 1, characterized in that: In step C, the Swin-Unet network includes an encoder-decoder structure. The encoder uses the Swin Transformer to extract multi-scale features of the image, divides the image into non-overlapping windows through a windowed self-attention mechanism, and calculates local features within the window. The calculation formula of the self-attention mechanism is: Where Q, K and V represent query, key and value matrices respectively; W Q 、W K and W V is the corresponding weight matrix; d is the dimension of the feature vector; Softmax is the flexible maximum calculation method used to convert the attention score into a probability distribution; X is the input feature vector.

5. The cable identification and bending radius rapid measurement method according to claim 4, characterized in that: The decoder generates a cable mask segmentation result through upsampling and feature fusion, including restoring and integrating the features extracted by the encoder, and fusing the feature map in the encoder with the feature map in the decoder through skip connection to generate a cable mask segmentation result.

6. The cable identification and bending radius rapid measurement method according to claim 1, characterized in that: The cv2.ximgproc.thinning function in OpenCV is used to thin the binary image after cable mask segmentation, and the coordinate sequence of the central feature points of the cable is extracted as follows: Then perform Bezier curve fitting, we have: Where l is the number of feature points, n is the degree of the Bezier curve, and t is the parameter of the Bezier curve. The position of the points on the curve is controlled by the degree and parameter of the curve.

7. The cable identification and bending radius rapid measurement method according to claim 1, characterized in that: The step 50 specifically includes: calculating the curvature and the bending radius using the derivative of the Bezier curve, where the first and second order derivatives of the Bezier curve are: According to the first and second order derivatives of the Bezier curve, the curvature formula is: Therefore, the final cable bending radius R c :

8. A device for implementing the cable identification and bending radius rapid measurement method according to any one of claims 1 to 7, characterized in that: include: Image acquisition module, used to obtain RGB-D dual-modal images of cables; Image processing module, used to optimize RGB images and depth images; Semantic segmentation module, used to perform cable mask segmentation on the optimized RGB-D image; Feature extraction and fitting module, used to extract the center line of the mask and perform curve fitting; The bending radius calculation module is used to calculate the spatial bending radius of the cable.

9. The cable identification and bending radius rapid measurement device according to claim 8, characterized in that: The image acquisition module integrates an RGB camera and a depth sensor to synchronously acquire RGB-D images of the cable; the image processing module performs local channel adaptive enhancement and composite mapping optimization on the RGB image; the semantic segmentation module performs multi-scale feature extraction and mask generation based on the Swin Transformer; the feature extraction and fitting module uses a morphological refinement algorithm to extract the mask centerline; and the bending radius calculation module directly solves the curvature and bending radius through derivatives and displays the measurement results.

Citation Information

Patent Citations

  • Three-dimensional model cable bending radius automatic detection method

    CN115221709A

  • A cable identification method and system based on image processing

    CN118628983B

  • Cable bending radius measuring device and measuring method

    CN119245480A