Non-contact cable diameter detection method

CN118037676BActive Publication Date: 2026-09-25INSPUR QILU SOFTWARE IND
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410200290.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-23
Publication Date
2026-09-25
Estimated Expiration
2044-02-23

AI Technical Summary

Benefits of technology

[0027]本发明的有益效果是:该非接触式电缆直径检测方法,通过人工智能机器视觉技术实时对电缆直径进行自动测量,为电缆工业质检提供直径检测的同时,也能为后续工业质检时对直径数据有依赖的项目提供数据依据,不仅提高了测量精度,还大幅降低了人工检测带来的误差,实现了检测全过程的人工智能替代,进而大幅提高了产品质量,降低了生产成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118037676B_ABST
    Figure CN118037676B_ABST
Patent Text Reader

Abstract

The application particularly relates to a non-contact cable diameter detection method. The non-contact cable diameter detection method is characterized in that a camera, a light source, a laser and a background plate are arranged, the camera is used to collect a cable image; after distortion correction and picture enhancement processing are performed on the collected image, the image is input into a trained artificial intelligence machine vision real-time semantic segmentation model, element coordinate points of categories of the cable and the laser in the image are obtained, and a pixel average value of the cable diameter is obtained; the Euclidean distance of the laser coordinate of the cable center line and the Euclidean distance of the laser coordinate on the background plate are calculated, a pixel and physical relationship conversion ratio on the cable center line plane and the background plate plane is obtained, the laser coordinate is combined, and the cable physical diameter is calculated through similar triangles. The non-contact cable diameter detection method not only improves the measurement accuracy, but also greatly reduces the error caused by manual detection, realizes artificial intelligence replacement in the whole detection process, and further greatly improves the product quality and reduces the production cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a non-contact cable diameter detection method. Background Technology

[0002] In the cable industry, diameter inspection is a crucial quality control item. Diameter is an important parameter of cables, and it is of great significance for cable installation and use.

[0003] The demand for diameter testing in the cable industry stems primarily from the following reasons:

[0004] First, the accuracy of the cable diameter is closely related to safety. A diameter that is too large or too small may lead to problems such as poor heat dissipation, current overload, and signal transmission attenuation. Therefore, it is crucial to ensure that the diameter meets safety requirements.

[0005] Secondly, compliance with production standards and specifications is a basic requirement for cable manufacturing. These standards usually specify the diameter range requirements, and diameter testing can ensure that the cable quality and performance meet the standard requirements.

[0006] In addition, diameter detection plays an important role in process control and quality management, enabling real-time monitoring of the cable production process and timely adjustment and correction of production parameters to improve product quality and performance.

[0007] Therefore, the cable industry's need for diameter testing is not only to meet safety requirements, but also an important aspect of quality control and regulatory requirements.

[0008] In summary, diameter detection technology allows for real-time monitoring and control of cable diameter accuracy, enabling the timely detection and correction of cables with diameters exceeding the specified range, ensuring cable quality meets prescribed standards. Furthermore, diameter detection technology provides real-time data during the production process, helping production personnel understand changes in cable diameter. Based on these considerations, this invention proposes a non-contact cable diameter detection method. Summary of the Invention

[0009] To overcome the shortcomings of existing technologies, this invention provides a simple and efficient non-contact cable diameter detection method.

[0010] This invention is achieved through the following technical solution:

[0011] A non-contact cable diameter detection method, characterized by the following steps:

[0012] Step S1: Arrange the camera, light source, laser, and background board so that the camera, cable, and background board are aligned vertically; adjust the light source and laser, making the laser lines two parallel lasers with a fixed spacing; adjust the light source brightness and camera lens focal length to ensure the clarity of the cable diameter edge and laser lines; use the camera to capture cable images.

[0013] Step S2: Perform distortion correction on the acquired image using intrinsic and extrinsic parameter matrices to improve image accuracy;

[0014] Step S3: Perform image enhancement processing on the distortion-corrected image to increase the image's contrast and brightness;

[0015] Step S4: Input the enhanced image into the trained AI machine vision real-time semantic segmentation model. The output information of the model includes the semantic level of each pixel. Obtain the coordinate points of elements in the image that are classified as cables and lasers. Store the minimum and maximum coordinate points on the y-axis into arrays, which are the sets of upper and lower contour coordinate points. Then store the laser coordinate points into arrays as the set of laser coordinates.

[0016] Step S5: Calculate the straight line equations for the four cable corner points on the left and right sides respectively, calculate the coordinates of the cable centerline using the four corner points, and obtain the average pixel value of the cable diameter. The cable diameter pixels are the same in the cable centerline plane and the background plane.

[0017] Step S6: Calculate the Euclidean distance between the laser coordinates of the cable centerline and the laser coordinates on the background plate to obtain the pixel-to-physical relationship conversion ratio on the cable centerline plane and the background plate plane. Combine this with the laser coordinates obtained in step S4 and calculate the physical diameter of the cable using similar triangles.

[0018] In step S2, the parameters of the intrinsic and extrinsic parameter matrices are calculated using the Zhang Zhengyou method.

[0019] In step S4, the coordinates of the four non-edge positions on the left and right sides of the cable contour are calculated by obtaining the outer contour points. Then, the line connecting the upper and lower points on the left is extended and intersected with the extension line of the right edge of the image to obtain the coordinates of the four cable corner points on the left and right sides.

[0020] In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the middle coordinates of the upper and lower coordinates of the left and right sides are taken respectively, and the line connecting the two coordinates is the cable centerline.

[0021] The area of ​​the approximate rectangle of the cable is calculated by using the coordinates of the four corner points on the left and right sides. Then, the area of ​​the approximate rectangle is divided by the top and bottom side lengths to obtain two diameters. The average of the two diameters is taken as the pixel distance of the cable diameter.

[0022] In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the approximate rectangular shape of the cable is divided into two triangles. Then, the area of ​​the two triangles is calculated using Heron's formula. The sum of the areas of the two triangles is the pixel area of ​​the approximate rectangle.

[0023] In step S6, given the physical distance between the two parallel lasers, the conversion relationship between the physical distance and pixel distance on the cable centerline and the background plate plane is obtained by using the laser coordinates obtained in step S4 and the pixel distance of the cable diameter obtained in step S5, as well as the physical distance of the cable diameter pixels between the cable centerline plane and the background plate plane.

[0024] Based on the distance from the camera to the background, the physical distance from the camera to the cable is further obtained; the angle between the camera and the cable and the tangent of the camera and the cable is calculated by combining the physical distance from the camera to the cable, the angle between the camera and the cable and the tangent of the camera and the cable. The physical diameter of the cable is then calculated.

[0025] A non-contact cable diameter detection device, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above-described method steps.

[0026] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program, when executed by a processor, implements the above-described method steps.

[0027] The beneficial effects of this invention are: This non-contact cable diameter detection method automatically measures the cable diameter in real time using artificial intelligence machine vision technology. It provides diameter detection for cable industry quality inspection and also provides data for subsequent industrial quality inspection items that rely on diameter data. This not only improves measurement accuracy but also significantly reduces errors caused by manual inspection, realizing artificial intelligence replacement of the entire inspection process, thereby greatly improving product quality and reducing production costs. Attached Figure Description

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

[0029] Appendix Figure 1 This is a schematic diagram of the method for converting the world coordinate system to the camera coordinate system according to the present invention.

[0030] Appendix Figure 2 This is a schematic diagram of a cable image captured by a camera in this invention.

[0031] Appendix Figure 3 This is a schematic diagram of the cable diameter calculation method of the present invention. Detailed Implementation

[0032] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below in conjunction with the embodiments of this invention. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0033] This non-contact cable diameter detection method includes the following steps:

[0034] Step S1: Arrange the camera, light source, laser, and background board, ensuring the camera, cable, and background board are aligned vertically; adjust the light source and laser, ensuring the laser lines are two parallel laser beams with a fixed spacing; adjust the light source brightness and camera lens focal length to ensure the clarity of the cable diameter edge and the laser lines; use the camera to capture cable images, such as... Figure 2 As shown in the figure, AB is the distance between laser pixels in the plane of the cable centerline, and CD is the distance between laser pixels in the plane where the background board is located.

[0035] Step S2: Due to deviations in lens manufacturing precision and assembly process, distortion is introduced, resulting in distortion of the original image. In order to eliminate imaging errors caused by distortion, distortion correction is performed on the acquired image using intrinsic and extrinsic parameter matrix parameters to improve image accuracy.

[0036] Image imaging is the process of moving the photographed object from the world coordinate system (X) to the world coordinate system (X). w ,Y w Z w Convert to camera coordinate system (X) c ,Y c Z cThe process of projecting light onto the image coordinate system (X,Y) and converting it to the pixel coordinate system (U,V) is called image distortion. During this conversion, image distortion can occur due to lens precision and manufacturing processes. Image distortion is generally divided into radial distortion and tangential distortion. Radial distortion is distortion distributed along the radius of the lens. It occurs because light rays bend more at the center of the lens than closer to the center. This distortion is more pronounced in ordinary, inexpensive lenses. Radial distortion mainly includes barrel distortion and pincushion distortion. Tangential distortion is caused by the lens itself not being parallel to the camera sensor plane (imaging plane) or image plane. This is often due to installation misalignment when the lens is mounted on the lens module.

[0037] The mathematical model for radial distortion is: Where r2 = x2 + y2, the radial distortion is larger at the image edges.

[0038] The mathematical model for tangential distortion is:

[0039] From the above, we can see that the distortion vector is a 5-dimensional vector, including k1, k2, k3, p1, and p2.

[0040] The relationship between the world coordinate system and the camera coordinate system is as follows:

[0041] The process of projecting a three-dimensional coordinate system onto a two-dimensional plane is called camera coordinate system to image coordinate system. Here, f is the focal length, and Z is the image coordinate system. c For general constants:

[0042] The image coordinate system is converted to the pixel coordinate system, where the center of the image physical coordinate system has coordinates (u0, v0) in the pixel coordinate system. The relationship is as follows:

[0043] From the above relationships, we can deduce that the transformation from a point in space to pixel coordinates is as follows:

[0044] The extrinsic parameter matrix is: It changes according to the captured images; the intrinsic parameter matrix is It's only related to the camera.

[0045] In step S2, the parameters of the intrinsic and extrinsic parameter matrices are calculated using the Zhang Zhengyou method.

[0046] Step S3: Perform image enhancement processing on the distortion-corrected image to increase the image's contrast and brightness;

[0047] Step S4: Input the enhanced image into the trained AI machine vision real-time semantic segmentation model. The output information of the model includes the semantic level of each pixel. Obtain the coordinate points of elements in the image that are classified as cables and lasers. Store the minimum and maximum coordinate points on the y-axis into arrays, which are the sets of upper and lower contour coordinate points. Then store the laser coordinate points into arrays as the set of laser coordinates.

[0048] The core idea of ​​real-time semantic segmentation models for artificial intelligence machine vision is to combine traditional convolutional neural network architectures with fully convolutional networks to achieve end-to-end image segmentation tasks. Its main feature is the combination of image upsampling and downsampling processes. The network structure consists of two parts: an encoder and a decoder. The encoder is responsible for gradually reducing the size of the input image and extracting local feature information; the decoder is responsible for gradually upsampling the feature map output by the encoder and combining it with the information from the encoder to ultimately generate a segmentation result of the same size as the input image.

[0049] The output of the AI ​​machine vision real-time semantic segmentation model is an H*W matrix, where H and W are the height and length of the original image, and the matrix content is category information.

[0050] Therefore, we can directly obtain the pixel coordinates of categories "cable" and "laser" in the matrix, and then obtain the minimum and maximum y-axis coordinates of the "cable" category and store them in two separate arrays, which will be the sets of upper and lower contour coordinate points. At the same time, we store the coordinates of the "laser" category in another array, denoted as the laser coordinate array.

[0051] Considering that lighting will have different reflective effects on cables of different diameters, in order to improve the stability of contour extraction, in step S4, the coordinates of the four non-edge positions on the left and right sides of the cable contour are calculated by obtaining the outer contour points. Then, the line connecting the upper and lower points on the left is extended and intersected with the extension line of the right edge of the image to obtain the coordinates of the four cable corner points on the left and right sides.

[0052] Step S5: Calculate the straight line equations for the four cable corner points on the left and right sides respectively, calculate the coordinates of the cable centerline using the four corner points, and obtain the average pixel value of the cable diameter. The cable diameter pixels are the same in the cable centerline plane and the background plane.

[0053] In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the middle coordinates of the upper and lower coordinates of the left and right sides are taken respectively, and the line connecting the two coordinates is the cable centerline.

[0054] The area of ​​the approximate rectangle of the cable is calculated by using the coordinates of the four corner points on the left and right sides. Then, the area of ​​the approximate rectangle is divided by the top and bottom side lengths to obtain two diameters. The average of the two diameters is taken as the pixel distance of the cable diameter, and this is used to form a conversion relationship between pixels and actual distance with the known actual cable diameter.

[0055] Considering the impact of lighting on the stability of cables with different diameters, after obtaining the outer contour points, the coordinates of four points at 1 / 7 of the horizontal direction on the left and right sides of the cable were calculated. Then, the intersection points of the two straight lines and the rightmost straight line of the image were calculated using the upper and lower coordinates to obtain the coordinates of the right side of the image. The position of the cable centerline was calculated using the coordinates of the four corner points on the left and right sides, and the area near the centerline was cropped. At the same time, the diameter pixel length of the cable was calculated using the four corner points.

[0056] By obtaining the values ​​at the left and right horizontal 1 / 7 points along the x-axis from the shape of the image, the data of the contour points with these two values ​​on the x-axis are placed into two arrays. The maximum and minimum values ​​on the y-axis of the two arrays are then taken. This allows the coordinates of four points at the left and right horizontal 1 / 7 points of the cable contour to be combined. By connecting the top and bottom lines, two straight line coordinates are obtained and their intersection points are found with the rightmost straight line. This allows the rightmost corner point to be obtained.

[0057] In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the approximate rectangular shape of the cable is divided into two triangles. Then, the area of ​​the two triangles is calculated using Heron's formula. The sum of the areas of the two triangles is the pixel area of ​​the approximate rectangle.

[0058] Heron's formula is: Where a, b, and c are the lengths of the three sides, and p = (a + b + c) / 2; the lengths of the three sides can be calculated using the coordinates of the three points.

[0059] Step S6: Calculate the Euclidean distance between the laser coordinates of the cable centerline and the laser coordinates on the background plate to obtain the pixel-to-physical relationship conversion ratio on the cable centerline plane and the background plate plane. Combine this with the laser coordinates obtained in step S4 and calculate the physical diameter of the cable using similar triangles.

[0060] In step S6, given the physical distance between the two parallel lasers, the conversion relationship between the physical distance and pixel distance on the cable centerline and the background plate plane is obtained by using the laser coordinates obtained in step S4 and the pixel distance of the cable diameter obtained in step S5, as well as the physical distance of the cable diameter pixels between the cable centerline plane and the background plate plane.

[0061] Based on the distance from the camera to the background, the physical distance from the camera to the cable is further obtained; the angle between the camera and the cable and the tangent of the camera and the cable is calculated by combining the physical distance from the camera to the cable, the angle between the camera and the cable and the tangent of the camera and the cable. The physical diameter of the cable is then calculated.

[0062] As attached Figure 3 As shown, given the physical distance AJ from camera A to plane BC (background plane) and the physical distance BJ between the two parallel lasers through step S1, we can obtain... Let this be denoted as σ. From step S4, we know the pixel distance b of the FG plane (the plane of the cable centerline) and the pixel distance c of the laser in the BC plane, so we can determine the conversion relationship between the physical distance and pixel distance between the two planes; and from step S5, we know the pixel distance h of the cable diameter, then...

[0063]

[0064] After calculating the cable centerline length FI based on the corner coordinates, the lengths AI and FG can be calculated.

[0065] according to pass We can obtain AH = AI + OD - OD*sinσ. We can obtain DE = 2*OD*cosσ. Therefore, we can obtain... achievable OD refers to the cable radius.

[0066] The non-contact cable diameter detection device includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above-described method steps.

[0067] The readable storage medium stores a computer program that, when executed by a processor, implements the above-described method steps.

[0068] The embodiments described above are merely one specific implementation of the present invention. Ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included within the protection scope of the present invention.

Claims

1. A non-contact cable diameter detection method, characterized in that: Includes the following steps: Step S1: Arrange the camera, light source, laser, and background board so that the camera, cable, and background board are aligned vertically; adjust the light source and laser, making the laser lines two parallel lasers with a fixed spacing; adjust the light source brightness and camera lens focal length to ensure the clarity of the cable diameter edge and laser lines; use the camera to capture cable images. Step S2: Perform distortion correction on the acquired image using intrinsic and extrinsic parameter matrices to improve image accuracy; Step S3: Perform image enhancement processing on the distortion-corrected image to increase the image's contrast and brightness; Step S4: Input the enhanced image into the trained AI machine vision real-time semantic segmentation model. The output information of the model includes the semantic level of each pixel. Obtain the coordinate points of elements in the image that are classified as cables and lasers. Store the minimum and maximum coordinate points on the y-axis into arrays, which are the sets of upper and lower contour coordinate points. Then store the laser coordinate points into arrays as the set of laser coordinates. Step S5: Calculate the straight line equations for the four cable corner points on the left and right sides respectively, calculate the coordinates of the cable centerline using the four corner points, and obtain the average pixel value of the cable diameter. The cable diameter pixels are the same in the cable centerline plane and the background plane. Step S6: Calculate the Euclidean distance between the laser coordinates of the cable centerline and the laser coordinates on the background plate to obtain the pixel-to-physical relationship conversion ratio on the cable centerline plane and the background plate plane. Combine this with the laser coordinates obtained in step S4 and calculate the physical diameter of the cable using similar triangles.

2. The non-contact cable diameter detection method according to claim 1, characterized in that: In step S2, the parameters of the intrinsic and extrinsic parameter matrices are calculated using the Zhang Zhengyou method.

3. The non-contact cable diameter detection method according to claim 1, characterized in that: In step S4, the coordinates of the four non-edge positions on the left and right sides of the cable contour are calculated by obtaining the outer contour points. Then, the line connecting the upper and lower points on the left is extended and intersected with the extension line of the right edge of the image to obtain the coordinates of the four cable corner points on the left and right sides.

4. The non-contact cable diameter detection method according to claim 3, characterized in that: In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the middle coordinates of the upper and lower coordinates of the left and right sides are taken respectively, and the line connecting the two coordinates is the cable centerline. The area of ​​the approximate rectangle of the cable is calculated by using the coordinates of the four corner points on the left and right sides. Then, the area of ​​the approximate rectangle is divided by the top and bottom side lengths to obtain two diameters. The average of the two diameters is taken as the pixel distance of the cable diameter.

5. The non-contact cable diameter detection method according to claim 4, characterized in that: In step S5, after obtaining the coordinates of the four cable corner points on the left and right sides, the approximate rectangular shape of the cable is divided into two triangles. Then, the area of ​​the two triangles is calculated using Heron's formula. The sum of the areas of the two triangles is the pixel area of ​​the approximate rectangle.

6. The non-contact cable diameter detection method according to claim 5, characterized in that: In step S6, given the physical distance between the two parallel lasers, the conversion relationship between the physical distance and pixel distance on the cable centerline and the background plate plane is obtained by using the laser coordinates obtained in step S4 and the pixel distance of the cable diameter obtained in step S5, as well as the physical distance of the cable diameter pixels between the cable centerline plane and the background plate plane. Based on the distance from the camera to the background, the physical distance from the camera to the cable is further obtained; the angle between the camera and the cable and the tangent of the camera and the cable is calculated by combining the physical distance from the camera to the cable, the angle between the camera and the cable and the tangent of the camera and the cable. The physical diameter of the cable is then calculated.

7. A non-contact cable diameter detection device, characterized in that: It includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the steps of the method as described in any one of claims 1 to 6.

8. A readable storage medium, characterized in that: The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Overhead line detection method and system based on cable inspection robot

    CN114778560A

  • Cable shielding layer overlapping rate detection method and device, medium and equipment

    CN116993664A