A cable defect detection optimization method and device
By acquiring images of the cable at various angles through multiple cameras and combining tracking algorithms with Kalman filtering algorithms, the problems of inaccurate quantity statistics and excessive resource consumption in cable defect detection are solved, achieving efficient and accurate cable defect detection.
Patent Information
- Application Number
- CN202310010733.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-01-05
AI Technical Summary
The existing technology for cable defect detection has the following problems: inaccurate number statistics when multiple cameras work together, excessive consumption of computing resources, and data difficulty, diversity and imbalance problems that affect detection accuracy.
Surface images of the cable at all angles are acquired through multiple cameras, and defect detection is performed using a detection model. The cable motion state is calculated by combining the tracking algorithm and the Kalman filter algorithm. The tracking results are filtered and mapped into the same image for processing, reducing unnecessary calculations.
It improves the accuracy of cable defect detection, reduces CPU calculations, reduces resource consumption, improves the accuracy of quantity statistics, and can be deployed and run on domestic AI accelerator cards.
Smart Images

Figure CN116030010B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection, and specifically provides a cable defect detection optimization method and device. Background Art
[0002] Quality is a crucial aspect of product production, and defect detection holds immense practical significance. It's a hot topic for researchers and businesses alike. During production and daily use, due to factors like processing, design, machine tool equipment failures, and harsh operating conditions, manufactured products are prone to internal defects like holes, dents, and scratches. Corrosion and fatigue damage are also common during daily use, increasing production costs, resulting in significant resource waste and economic losses, and even causing significant harm to human life.
[0003] With the continuous development of my country's equipment manufacturing industry, high-end manufacturing equipment is increasingly demanding high-standard, high-quality products. This, in turn, places higher demands on the skills of designers and on-site inspection personnel. Therefore, detecting defects in manufactured products in complex industrial processes and improving their quality without impacting production are core competitive advantages for manufacturing companies. Automated defect detection technology offers significant advantages over manual inspection. It can not only adapt to harsh environments but also operate over long periods of time with high precision and efficiency. Researching quality inspection technologies can reduce production costs, improve production efficiency and product quality, and lay a solid foundation for the intelligent transformation of the manufacturing industry.
[0004] A primary goal of artificial intelligence research is to enable machines to perform complex tasks that typically require human intelligence. However, tasks that are easy for humans, such as image recognition, speech recognition, and natural language understanding, are difficult for machines to accomplish. With the development of artificial intelligence technology, deep learning-based methods have been widely used in product defect detection due to their ability to fit arbitrarily complex functions and extract superior features.
[0005] However, current defect detection methods mainly focus on surface defect detection of objects in two-dimensional images, and the main detection targets are surface scratches and abrasions on the objects. The perspective information obtained by the two-dimensional image sequence is relatively single and cannot obtain information about products from any perspective.
[0006] Cable defect detection requires multiple cameras to work together to inspect the entire cable surface. This can lead to inaccurate counts and excessive computing resource consumption. Furthermore, data can be difficult to separate, diverse, unbalanced, and dirty, impacting defect detection accuracy. Summary of the Invention
[0007] The present invention aims to address the deficiencies of the above-mentioned prior art and provides a highly practical cable defect detection optimization method.
[0008] A further technical task of the present invention is to provide a cable defect detection optimization device that is rationally designed, safe and applicable.
[0009] The technical solution adopted by the present invention to solve its technical problem is:
[0010] A cable defect detection optimization method has the following steps:
[0011] S1. Pull multiple video streams through the camera to obtain surface images of the cable at various angles;
[0012] S2. Taking the surface images corresponding to the multiple videos as input, respectively, obtaining the detection results of the cable defects according to the detection model results and saving them in the dictionary;
[0013] S3, processing the detection frame according to the relative positions of multiple cameras and mapping it to the same image;
[0014] S4. Use the tracking algorithm to track the cable defect detection frame, obtain the tracking ID and save it.
[0015] S5. Calculate the speed and direction of the cable relative to the camera based on the tracking results;
[0016] S6, filtering the tracking results according to the speed and direction of the tracking cable relative to the camera;
[0017] S7. Filter and perform subsequent operations on the defect frame according to the tracking results.
[0018] Furthermore, in step S1, surface images of the cable at various angles are obtained, timestamps are set as unique identifiers according to time, a dictionary is established to save corresponding frame information in multiple video streams, and then each frame of the image is operated in chronological order.
[0019] Furthermore, in step S3, it further includes:
[0020] S301, calculating the theoretical imaging range of the cable in the image based on the camera focal length and the distance from the cable;
[0021] S302, based on the theoretical position, obtain the boundary line between the cable and the background through the original image, and correct the position of the cable in the image;
[0022] S303 , mapping the defect detection frame to a picture representing the cable surface according to the relative position relationship between the cameras and the position of the cable in the photo.
[0023] Furthermore, in step S4, it further includes:
[0024] S401, calculating the IOU between the defect frame predicted by the Kalman filter and the defect frame detected by the detection model;
[0025] S402: Use the Hungarian algorithm to perform data association on the defect frame position predicted by the Kalman filter and the defect frame position detected by the detection model.
[0026] Furthermore, in step S5, the speed and direction of the cable relative to the camera are calculated based on the tracking results, and the speed and acceleration of each tracked detection frame in the x and y directions are calculated based on the frame rate of the camera;
[0027] The motion state of each tracked detection frame is integrated to calculate the overall motion state of the cable.
[0028] Furthermore, in step S6, the tracking results are filtered according to the movement speed and direction of the tracking cable relative to the camera, the state of each tracker is corrected and updated, and the Kalman filter algorithm is used to predict the position where the defect frame will appear in the next frame.
[0029] Furthermore, in step S7, the defective frames are filtered and subsequently operated according to the tracking results, and the detection frames that are not successfully tracked are discarded;
[0030] The defect detection frames whose results are not marked with tracking IDs are judged, and subsequent processing operations such as alarms are performed on the defect detection frames that meet the conditions, and the tracking ID is marked, and the number of defects is increased by one; all defect frames are marked in the original image.
[0031] A cable defect detection and optimization device, comprising: at least one memory and at least one processor;
[0032] The at least one memory is configured to store a machine-readable program;
[0033] The at least one processor is configured to call the machine-readable program to execute a cable defect detection optimization method.
[0034] Compared with the prior art, the cable defect detection optimization method and device of the present invention have the following outstanding beneficial effects:
[0035] After using a detection model to identify cable defects, the present invention processes the cable defects in multiple video streams based on the relative positions of multiple cameras, mapping them into a single image. This method improves tracking accuracy in subsequent processing and reduces CPU computation.
[0036] A tracking algorithm is used to track cable defects in multiple video streams. Defects that have been identified are marked based on their tracking IDs, eliminating the need for subsequent calculations. This method reduces unnecessary card and CPU calculations, reduces resource consumption, and improves the accuracy of counts.
[0037] The cable's speed and direction are calculated based on the tracking results, and this is used to filter the tracking results and correct the tracker status, thereby improving tracking accuracy.
[0038] By quantizing the model to 8 bits, it reduces the consumption of computing resources on the board and accelerates the time calculation speed during deployment and runtime. It can be deployed and run on domestic AI accelerator cards. It has excellent versatility, flexibility, and portability. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Attachment Figure 1 It is a flow chart of a cable defect detection optimization method;
[0041] Attachment Figure 2 It is a mapping relationship diagram between the relative positions of multiple cameras and the cable defect positions in the cable defect detection optimization method;
[0042] Attachment Figure 3 It is a schematic diagram of the process of tracking the cable defect detection frame using a tracking algorithm in a cable defect detection optimization method;
[0043] Attachment Figure 4 The present invention is a flow chart of a data format for storing frame information in a cable defect detection optimization method. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the solutions of the present invention, the present invention will be further described in detail below in conjunction with specific embodiments. Obviously, the embodiments described are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] A best embodiment is given below:
[0046] like Figure 1As shown, a cable defect detection optimization method in this embodiment has the following steps:
[0047] S1, obtain three video streams and process the formats; Figure 2 As shown, in this example, three cameras form a regular triangle and shoot around the cable.
[0048] like Figure 4 As shown, the timestamp is set as a unique identifier according to the time, a dictionary is established to save the corresponding frame information in the multiple video streams, and then the following operations are performed on each frame of the picture in chronological order.
[0049] S2. Take the surface images corresponding to the multiple videos as input respectively, obtain the detection results of the cable defects according to the detection model results and save them in the dictionary.
[0050] S3, such as Figure 2 As shown, the detection frame is processed according to the relative positions of multiple cameras and mapped to the same picture, further including:
[0051] S301, calculating the theoretical imaging range of the cable in the image based on the camera focal length and the distance from the cable;
[0052] S302, based on the theoretical position, obtain the boundary line between the cable and the background through the original image, and correct the position of the cable in the image;
[0053] S303 , mapping the defect detection frame to a picture representing the cable surface according to the relative position relationship between the cameras and the position of the cable in the photo.
[0054] S4, such as Figure 4 As shown, the cable defect detection frame is tracked using a tracking algorithm, and the tracking ID is obtained and saved.
[0055] Further including:
[0056] S401, calculating the IOU between the defect frame predicted by the Kalman filter and the defect frame detected by the detection model;
[0057] S402: Use the Hungarian algorithm to perform data association on the defect frame position predicted by the Kalman filter and the defect frame position detected by the detection model.
[0058] S5. Calculate the cable's speed and direction relative to the camera based on the tracking results. Calculate the x- and y-direction speed and acceleration of each tracked detection frame based on the camera's frame rate. Combine the motion states of each tracked detection frame to calculate the cable's overall motion state (speed and rotational state).
[0059] S6. Filter the tracking results according to the speed and direction of the tracking cable relative to the camera, correct and update the status of each tracker, and use the Kalman filter algorithm to predict the position of the defect frame in the next frame.
[0060] S7. Filter and perform subsequent operations on the defective frames based on the tracking results. Discard any untracked frames. Defective frames that do not have a tracking ID are evaluated. For defective frames that meet the requirements, perform subsequent processing such as alarms, mark the tracking ID, and increment the defect count by one. All defective frames are marked in the original image.
[0061] According to the above method, a cable defect detection optimization device in this embodiment includes: at least one memory and at least one processor;
[0062] The at least one memory is configured to store a machine-readable program;
[0063] The at least one processor is configured to call the machine-readable program to execute a cable defect detection optimization method.
[0064] The above-mentioned specific implementation methods are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementation methods. Any cable defect detection optimization method and device that complies with the claims of the present invention and any appropriate changes or replacements made by ordinary technicians in the technical field shall fall within the patent protection scope of the present invention.
[0065] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A cable defect detection optimization method, characterized in that: The steps are as follows: S1. Pull multiple video streams through the camera to obtain surface images of the cable at various angles. Set the timestamp as a unique identifier based on the time, build a dictionary to save the corresponding frame information in the multiple video streams, and then operate on each frame in chronological order. S2. Taking the surface images corresponding to the multiple video streams as input, respectively, obtaining the detection results of the cable defects according to the results obtained by the input detection model and saving them in the dictionary; S3, processing the detection frame according to the relative positions of multiple cameras and mapping it to the same image; Further including: S301, calculating the theoretical imaging range of the cable in the image based on the focal length of the camera and the distance from the cable; S302, based on the theoretical position, obtain the boundary line between the cable and the background through the original image, and correct the position of the cable; S303, mapping the defect detection frame to a picture representing the cable surface according to the relative position relationship between the cameras and the position of the cable in the photo; S4. Use the tracking algorithm to track the cable defect detection frame, obtain the tracking ID and save it; Further including: S401, calculating the IOU between the defect detection frame predicted by the Kalman filter and the defect detection frame detected by the detection model; S402, using the Hungarian algorithm to perform data association between the defect detection frame position predicted by the Kalman filter and the defect detection frame position detected by the detection model; S5. Calculate the movement speed and direction of the cable relative to the camera based on the tracking results, and calculate the movement speed and acceleration of each tracked defect detection frame in the x and y directions based on the frame rate of the camera; The motion state of each tracked defect detection frame is integrated to calculate the overall motion state of the cable; S6. Filter the tracking results based on the speed and direction of the tracking cable relative to the camera, correct and update the status of each tracker, and use the Kalman filter algorithm to predict the position of the defect detection frame in the next frame; S7, filtering and performing subsequent operations on the defect detection frames according to the tracking results, and discarding the defect detection frames that have not been successfully tracked; The defect detection frames whose results are not marked with tracking IDs are judged, and subsequent alarm processing operations are performed on the defect detection frames that meet the conditions, and the tracking ID is marked, and the number of defects is increased by one; all defect detection frames are marked in the original image.
2. A cable defect detection optimization device, characterized in that: include: at least one memory and at least one processor; The at least one memory is configured to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to claim 1.
Citation Information
Patent Citations
Method, device and equipment for tracking moving object in video image, and storage medium
CN111784750A
3D model fitting generation device for cable defects and defect detection method
CN115170470A