Defect visual detection tracking method for semi-conductive band cable
By combining the YOLOv5 model and Kalman filter algorithm with the Hungarian algorithm, defect detection of semiconducting strip cables is performed, which solves the problem of low detection efficiency in existing technologies and achieves efficient and accurate defect tracking.
Patent Information
- Application Number
- CN202411142197.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2025-01-07
AI Technical Summary
Existing cable defect detection methods are inefficient, lack comprehensive coverage, and cannot meet the demands of modern industry for efficient and accurate detection.
The YOLOv5 model is used to process images of semiconducting cable strips. Kalman filtering and Hungarian algorithms are combined to match and track defect candidate boxes. Multiple cameras are deployed for omnidirectional detection to ensure clear imaging and select defect candidate boxes that meet the criteria.
It improves the stability and accuracy of cable defect detection, reduces false alarms and duplicate alarms, and achieves efficient defect tracking.
Smart Images

Figure CN119273616A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a defect visual detection and tracking method for a semi-conductive cable, and relates to the field of machine vision applications. Background Art
[0002] In the rapidly developing fields of power, communications and industrial automation, cables are key information and energy transmission carriers, and their quality and reliability are crucial. The cable industry is facing new changes and challenges. With the rise of new energy, the demand for access and transmission of renewable energy has increased, and the requirements for cables have also continued to increase. At the same time, the rapid development of emerging fields such as smart homes, industrial automation and the Internet of Things has brought new market opportunities to the cable industry.
[0003] However, during the production, installation and long-term use of semi-conductive cables, they are easily affected by environmental, stress, aging and other factors, resulting in defects such as insulation damage, conductor breakage, and tape scratches and wrinkles. If these defects are not discovered and handled in time, they will seriously threaten the safety and stable operation of the system. Existing cable defect detection methods, such as manual inspections and regular testing, are not only inefficient, but also difficult to fully cover, and it is difficult to meet the needs of modern industry for efficient and accurate detection. Summary of the invention
[0004] In view of the problems of the prior art, the present invention provides a defect visual detection and tracking method for a semi-conductive cable, which has the characteristics of strong versatility and simple implementation and has broad application prospects.
[0005] The specific scheme proposed by the present invention is:
[0006] The present invention provides a defect visual detection and tracking method for a semi-conductive ribbon cable, comprising:
[0007] S1: Deploy the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive ribbon cable is within the camera's working field of view;
[0008] S2: Adjust the various parameters of the camera to ensure clear imaging without frame loss;
[0009] S3: Collect the original image of the semi-conductive cable, input the original image into the yolov5 model frame by frame, process the frame image through the yolov5 model and return the defect candidate frame in the frame image;
[0010] S4: Preset the length and width pixel value thresholds of the candidate frames and the defect classification probability thresholds as filtering conditions, filter out the defect candidate frames in the frame image that do not meet the filtering conditions, and obtain defect candidate frames that meet the conditions;
[0011] S5: Target detection is performed based on the defect candidate frames that meet the conditions in the frame image, and trajectory information corresponding to the detected target is created.
[0012] The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box.
[0013] The tracking process is repeated until each frame of the acquired image is tracked;
[0014] S6: Record the results of each frame of the original image and display the defect candidate frames that are successfully tracked.
[0015] Furthermore, in S1 of the method for visually detecting and tracking defects of a semi-conductive tape cable, four cameras are deployed and fixed in an electric control cabinet so that the height of the four cameras is the same as the center height of the cable, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive tape cable is kept within the working field of view of the four cameras.
[0016] Further, in S2 of the method for visually detecting and tracking defects of a semi-conductive cable, adjusting various parameters of the camera includes:
[0017] Adjust the light source of the camera so that the semi-conductive cables are clearly illuminated in the four cameras; adjust the aperture of the camera by rotating it clockwise and focus so that the cables are not out of focus in the picture; use the camera driver software to adjust the camera, set the exposure time, set the gain, and set the acquisition frequency.
[0018] Furthermore, in S4 of the defect visual detection and tracking method for a semi-conductive cable, the defect classification probability threshold value and the pixel value length and width thresholds of the defect candidate box are set according to the parameters of the frame image, or the defect classification probability threshold is set to 0.7, the pixel value length threshold of the defect candidate box is set to 500, and the pixel value width threshold of the defect candidate box is set to 300.
[0019] Furthermore, in S6 of the defect visual detection and tracking method for a semi-conductive cable, a tracking ID is generated for a successfully tracked defect candidate frame. If a new successfully tracked defect candidate frame appears, the tracking ID is increased by one, and the number of defects within a period of time is counted based on the tracking ID; the successfully tracked defect candidate frame is drawn on the original image, and the defect candidate frame information and the original image are stored in redis, and each frame of the image is synthesized into a video stream for push streaming display.
[0020] The present invention also provides a defect visual detection and tracking device for a semi-conductive cable, comprising a deployment management module, a camera management module, an acquisition input module, a yolov5 model analysis module, a filtering module, a tracking module and a display management module.
[0021] The deployment management module deploys the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive belt cable is within the camera head working field of view;
[0022] The camera management module adjusts the various parameters of the camera to ensure clear imaging without frame loss;
[0023] The acquisition input module acquires the original image of the semi-conductive cable and inputs the original image into the yolov5 model frame by frame. The yolov5 model analysis module processes the frame image through the yolov5 model and returns the defect candidate frame in the frame image.
[0024] The filtering module presets the pixel value thresholds of the length and width of the candidate frame and the defect classification probability threshold as filtering conditions, filters out the defect candidate frames that do not meet the filtering conditions in the frame image, and obtains defect candidate frames that meet the conditions;
[0025] The tracking module detects targets based on the defect candidate frames that meet the conditions in the frame image and creates trajectory information corresponding to the detected targets.
[0026] The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box.
[0027] The tracking process is repeated until each frame of the acquired image is tracked;
[0028] The display management module records the results of each frame of the original image and displays the defect candidate frames that are successfully tracked.
[0029] Furthermore, the deployment management module of the defect visual detection and tracking device for the semi-conductive tape cable deploys 4 cameras, and fixes the 4 cameras in the electric control cabinet so that the height of the 4 cameras is the same as the center height of the cable, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive tape cable is kept within the working field of view of the 4 cameras.
[0030] Furthermore, the camera management module of the defect visual detection and tracking device for a semi-conductive cable adjusts various parameters of the camera, including:
[0031] Adjust the light source of the camera so that the semi-conductive cables are clearly illuminated in the four cameras; adjust the aperture of the camera by rotating it clockwise and focus so that the cables are not out of focus in the picture; use the camera driver software to adjust the camera, set the exposure time, set the gain, and set the acquisition frequency.
[0032] Furthermore, the tracking module of the defect visual detection and tracking device for the semi-conductive cable sets the defect classification probability threshold value and the pixel value length and width thresholds of the defect candidate box according to the parameters of the frame image, or sets the defect classification probability threshold to 0.7, sets the pixel value length threshold of the defect candidate box to 500, and sets the pixel value width threshold of the defect candidate box to 300.
[0033] Furthermore, the display management module of the defect visual detection and tracking device for the semi-conductive cable generates a tracking ID for the successfully tracked defect candidate frame. If a new successfully tracked defect candidate frame appears, the tracking ID is increased by one, and the number of defects within a period of time is counted according to the tracking ID; the successfully tracked defect candidate frame is drawn on the original image, and the defect candidate frame information and the original image are stored in redis, and each frame of the image is synthesized into a video stream for push streaming display.
[0034] The benefits of the present invention are:
[0035] The present invention detects and tracks defects in semi-conductive cables, processes frame images through the yolov5 model and returns defect candidate frames in the frame images, screens defect candidate frames that meet the conditions, and further uses the Kalman filter algorithm and the Hungarian algorithm to match the detection frame and prediction frame of the defect candidates to achieve tracking of the defect candidate frames. Compared with other methods, the present invention has better stability and robustness, is more conducive to improving the accuracy of the system, and solves the problems of inaccurate cable defect detection, multiple false alarms, and repeated alarms of the same defect. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic flow chart of the method of the present invention.
[0037] Figure 2 It is a schematic diagram of the tracking process of the method of the present invention. DETAILED DESCRIPTION
[0038] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0039] Example 1
[0040] The present invention provides a defect visual detection and tracking method for a semi-conductive ribbon cable, comprising:
[0041] S1: Deploy the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive ribbon cable is within the camera's working field of view.
[0042] Among them, 4 cameras can be preferably deployed in S1, and the 4 cameras can be fixed in the electric control cabinet, so that the height of the 4 cameras is the same as the center height of the cable, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive cables are kept within the working field of the 4 cameras.
[0043] S2: Adjust the various parameters of the camera to ensure clear imaging without frame loss.
[0044] The adjustment of various parameters of the camera in S2 may further include:
[0045] Adjust the light source of the camera so that the semi-conductive cables are clearly illuminated in the four cameras; rotate the camera aperture clockwise to adjust the focus so that the cables are not out of focus in the picture; use the camera driver software to adjust the camera, such as setting the exposure time to 7000, the gain to 10, and the acquisition frequency to 10 to ensure clear imaging and no frame loss.
[0046] S3: Collect the original image of the semi-conductive cable, input the original image into the yolov5 model frame by frame, process the frame image through the yolov5 model and return the defect candidate box in the frame image.
[0047] S4: Preset the length and width pixel value thresholds of the candidate frames and the defect classification probability thresholds as filtering conditions, filter out the defect candidate frames in the frame image that do not meet the filtering conditions, and obtain defect candidate frames that meet the conditions.
[0048] In S4, the defect classification probability threshold value and the pixel value length and width threshold of the defect candidate frame can be set according to the parameters of the frame image.
[0049] For example, the defect classification probability threshold is set to 0.7, the pixel value length threshold of the defect candidate box is set to 500, and the pixel value width threshold of the defect candidate box is set to 300. Defect boxes that do not meet the threshold are filtered out.
[0050] S5: Target detection is performed based on the defect candidate frames that meet the conditions in the frame image, and trajectory information corresponding to the detected target is created.
[0051] The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box.
[0052] The tracking process is repeated until each frame of the acquired image is tracked.
[0053] S5 can read the speed of the semi-conductive cable on the meter, measure the length of the cable under the camera's field of view, and calculate the number of pixels moved by the cable in each frame of the image, and pass this as the initial speed to the Kalman filter; for example, the defect candidate frame that meets the conditions detected in the first frame can create its corresponding trajectory information. Initialize the motion variable of the Kalman filter, and predict its corresponding prediction frame through the Kalman filter.
[0054] Perform IOU matching on the defect candidate detection frame obtained by target detection in the frame image and the prediction frame predicted by trajectory information in the previous frame, and then calculate the cost matrix based on the result of IOU matching. All cost matrices obtained from the result of IOU matching are used as the input of the Hungarian algorithm to obtain linear matching results. If the data of successful pairing of the detection frame and the prediction frame is retained, the previous frame and the next frame are tracked successfully. The corresponding defect candidate detection frame is updated through Kalman filtering. Repeat the tracking process until the tracking of each captured frame is completed.
[0055] S6: Record the results of each frame of the original image and display the defect candidate frames that are successfully tracked.
[0056] In S6, a tracking ID can be further generated for the successfully tracked defect candidate frame. If a new successfully tracked defect candidate frame appears, the tracking ID is increased by one, and the number of defects within a period of time is counted based on the tracking ID. The successfully tracked defect candidate frame is drawn on the original image, and the defect candidate frame information and the original image are stored in redis, and each frame of the image is synthesized into a video stream for push streaming display.
[0057] Example 2
[0058] The present invention also provides a defect visual detection and tracking device for a semi-conductive cable, comprising a deployment management module, a camera management module, an acquisition input module, a yolov5 model analysis module, a filtering module, a tracking module and a display management module.
[0059] The deployment management module deploys the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive belt cable is within the camera head working field of view;
[0060] The camera management module adjusts the various parameters of the camera to ensure clear imaging without frame loss;
[0061] The acquisition input module acquires the original image of the semi-conductive cable and inputs the original image into the yolov5 model frame by frame. The yolov5 model analysis module processes the frame image through the yolov5 model and returns the defect candidate frame in the frame image.
[0062] The filtering module presets the pixel value thresholds of the length and width of the candidate frame and the defect classification probability threshold as filtering conditions, filters out the defect candidate frames that do not meet the filtering conditions in the frame image, and obtains defect candidate frames that meet the conditions;
[0063] The tracking module detects targets based on the defect candidate frames that meet the conditions in the frame image and creates trajectory information corresponding to the detected targets.
[0064] The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box.
[0065] The tracking process is repeated until each frame of the acquired image is tracked;
[0066] The display management module records the results of each frame of the original image and displays the defect candidate frames that are successfully tracked.
[0067] As the information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0068] Similarly, the device of the present invention detects and tracks defects in semi-conductive cables, processes the frame image through the yolov5 model and returns the defect candidate frame in the frame image, screens the defect candidate frame that meets the conditions, and further uses the Kalman filter algorithm and the Hungarian algorithm to match the detection frame and the prediction frame of the defect candidate to achieve tracking of the defect candidate frame. Compared with other methods, it has better stability and robustness, is more conducive to improving the accuracy of the system, and solves the problems of inaccurate cable defect detection, multiple false alarms, and repeated alarms of the same defect.
[0069] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0070] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for visually detecting and tracking defects of a semi-conductive ribbon cable, characterized in that include: S1: Deploy the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive ribbon cable is within the camera's working field of view; S2: Adjust the various parameters of the camera to ensure clear imaging without frame loss; S3: Collect the original image of the semi-conductive cable, input the original image into the yolov5 model frame by frame, process the frame image through the yolov5 model and return the defect candidate frame in the frame image; S4: Preset the length and width pixel value thresholds of the candidate frames and the defect classification probability thresholds as filtering conditions, filter out the defect candidate frames in the frame image that do not meet the filtering conditions, and obtain defect candidate frames that meet the conditions; S5: Target detection is performed based on defect candidate frames that meet the conditions in the frame image, and trajectory information corresponding to the detected target is created. The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box. The tracking process is repeated until each frame of the acquired image is tracked; S6: Record the results of each frame of the original image and display the defect candidate frames that are successfully tracked.
2. A method for visually detecting and tracking defects of a semi-conductive ribbon cable according to claim 1, characterized in that Four cameras are deployed in S1 and fixed in the electric control cabinet so that the height of the four cameras is the same as the center height of the cables, there is no other obstruction between the cameras and the cables, the cameras are kept level, and the semi-conductive cables are kept within the working field of view of the four cameras.
3. A method for visually detecting and tracking defects of a semi-conductive ribbon cable according to claim 1, Its feature is to adjust various camera parameters in S2, including: Adjust the light source of the camera so that the semi-conductive cables are clearly illuminated in the four cameras; adjust the aperture of the camera by rotating it clockwise and focus so that the cables are not out of focus in the picture; use the camera driver software to adjust the camera, set the exposure time, set the gain, and set the acquisition frequency.
4. According to the defect visual detection and tracking method of a semi-conductive cable according to claim 1, it is characterized in that in S4, the defect classification probability threshold value and the pixel value length and width thresholds of the defect candidate box are set according to the parameters of the frame image, or the defect classification probability threshold is set to 0.7, the pixel value length threshold of the defect candidate box is set to 500, and the pixel value width threshold of the defect candidate box is set to 300.
5. According to the defect visual detection and tracking method of a semi-conductive cable according to claim 1, it is characterized in that a tracking ID is generated for the successfully tracked defect candidate frame in S6, and if a new successfully tracked defect candidate frame appears, the tracking ID is increased by one, and the number of defects within a period of time is counted according to the tracking ID; the successfully tracked defect candidate frame is drawn on the original image, and the defect candidate frame information and the original image are stored in redis, and each frame of the image is synthesized into a video stream for push streaming display.
6. A defect visual detection and tracking device for semi-conductive ribbon cables, characterized in that It includes deployment management module, camera management module, acquisition input module, yolov5 model analysis module, filtering module, tracking module and display management module. The deployment management module deploys the camera for image acquisition so that the camera head height is the same as the cable center height, there is no other obstruction between the camera and the cable, the camera is kept level, and the semi-conductive belt cable is within the camera head working field of view; The camera management module adjusts the various parameters of the camera to ensure clear imaging without frame loss; The acquisition input module acquires the original image of the semi-conductive cable and inputs the original image into the yolov5 model frame by frame. The yolov5 model analysis module processes the frame image through the yolov5 model and returns the defect candidate frame in the frame image. The filtering module presets the pixel value thresholds of the length and width of the candidate frame and the defect classification probability threshold as filtering conditions, filters out the defect candidate frames that do not meet the filtering conditions in the frame image, and obtains defect candidate frames that meet the conditions; The tracking module detects targets based on the defect candidate frames that meet the conditions in the frame image and creates trajectory information corresponding to the detected targets. The Kalman filter algorithm is used to predict the prediction box of the detection target, and the detection box of the target detection in the frame image is matched with the prediction box of the previous frame image by IOU matching. The cost matrix is calculated based on the result of IOU matching, and the Hungarian algorithm is used to calculate the linear matching result based on the cost matrix. The detection box and prediction box that are successfully matched are retained to track the defect candidate box. The tracking process is repeated until each frame of the acquired image is tracked; The display management module records the results of each frame of the original image and displays the defect candidate frames that are successfully tracked.
7. A defect visual detection and tracking device for a semi-conductive ribbon cable according to claim 6, characterized in that The deployment management module deploys 4 cameras, fixes the 4 cameras in the electric control cabinet, makes the height of the 4 cameras the same as the center height of the cables, has no other obstructions between the cameras and the cables, keeps the cameras level, and keeps the semi-conductive cables within the working field of view of the 4 cameras.
8. The defect visual detection and tracking device for a semi-conductive ribbon cable according to claim 6 is characterized in that The camera management module adjusts various camera parameters, including: Adjust the light source of the camera so that the semi-conductive cables are clearly illuminated in the four cameras; adjust the aperture of the camera by rotating it clockwise and focus so that the cables are not out of focus in the picture; use the camera driver software to adjust the camera, set the exposure time, set the gain, and set the acquisition frequency.
9. The defect visual detection and tracking device for a semi-conductive ribbon cable according to claim 6 is characterized in that The tracking module sets the defect classification probability threshold value and the pixel value length and width thresholds of the defect candidate box according to the parameters of the frame image, or sets the defect classification probability threshold to 0.7, sets the pixel value length threshold of the defect candidate box to 500, and sets the pixel value width threshold of the defect candidate box to 300.
10. A method for visually detecting and tracking defects of a semi-conductive ribbon cable according to claim 6, characterized in that The display management module generates a tracking ID for the successfully tracked defect candidate frame. If a new successfully tracked defect candidate frame appears, the tracking ID is increased by one, and the number of defects within a period of time is counted based on the tracking ID. The successfully tracked defect candidate frame is drawn on the original image, and the defect candidate frame information and the original image are stored in redis. Each frame of the image is synthesized into a video stream for push streaming display.