Computer vision-based copper strand surface defect detection method and system

By employing adaptive image enhancement and multi-round region growth verification techniques, combined with the CLAHE algorithm and stranding cycle iterative fitting, surface defects in copper stranded wires are accurately detected. This solves the problems of high false detection rate and inaccurate defect classification, achieving high-precision automated detection and graded early warning.

CN122391141APending Publication Date: 2026-07-14SHAANXI TONGDA CABLE MFG CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHAANXI TONGDA CABLE MFG CO LTD
Filing Date
2026-04-17
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing technologies suffer from high false detection rates, inaccurate defect classification, difficulty in distinguishing defect types and quantifying severity, and severe reflection interference, all of which affect the accuracy and efficiency of detection.

Method used

Adaptive image enhancement, stranding cycle iterative fitting, and multi-round region growth and verification techniques are employed, combined with the CLAHE algorithm to suppress reflection. Structurally abnormal regions are accurately marked through standard stranding cycle iterative fitting and residual analysis. Seed points are adaptively selected and three rounds of verification are performed to segment the real surface defect region and classify the defect level according to the nominal specifications of the copper stranded wire.

Benefits of technology

It significantly reduces the false detection rate, improves detection accuracy and stability, achieves high-precision automated detection and graded early warning, and enhances the comprehensiveness and industrial applicability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391141A_ABST
    Figure CN122391141A_ABST
Patent Text Reader

Abstract

The application discloses a copper stranded wire surface defect detection method and system based on computer vision, and relates to the technical field of computer vision, and comprises the following steps: collecting continuous frame color images of a copper stranded wire surface, pre-processing the color images to obtain enhanced images after preprocessing; extracting a center axis of the copper stranded wire based on the enhanced images, sampling along the center axis to generate a stranded profile distance sequence, marking a real structure abnormal area through standard stranded cycle iterative fitting and residual analysis; adaptively selecting a seed point in the real structure abnormal area, generating a defect candidate area through multiple rounds of region growing and contour constraint conditions, executing three rounds of verification on each defect candidate area, and segmenting out a real surface defect area; fusing structure abnormal area and surface defect area information, dividing defect levels according to the nominal specification of the copper stranded wire, generating a detection report and outputting an early warning signal, and realizing high-precision automatic detection and grading early warning of defects such as broken wires, corrosion and bulges.
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, specifically to a method and system for detecting surface defects in copper stranded wires based on computer vision. Background Technology

[0002] As an important material for power transmission and electrical connection, the surface quality of copper stranded wire directly affects its conductivity and mechanical strength. Traditional copper stranded wire surface defect detection mainly relies on manual visual inspection or simple optical inspection equipment. Manual visual inspection involves operators observing the surface of the copper stranded wire to identify defects such as broken wires, corrosion, and wear. However, this method is inefficient and easily affected by subjective factors. Optical inspection equipment uses basic image processing techniques, such as threshold segmentation and edge detection, to perform preliminary analysis of the copper stranded wire surface, which can improve the detection efficiency to some extent. However, it is limited by the simplicity of the algorithm and cannot cope with complex surface textures and reflective interference.

[0003] In existing technologies, computer vision-based detection methods have been gradually applied in the industrial field. For example, fixed threshold segmentation or template matching techniques are used to identify surface defects. However, these methods are poorly adaptable to the periodic changes in the stranded structure of copper wires, and are prone to misjudging normal texture fluctuations as defects, resulting in a high false detection rate. In addition, the metallic reflective properties of the copper wire surface can interfere with image acquisition. Existing methods usually use a single illumination adjustment or filtering algorithm, which is difficult to completely eliminate the influence of reflection, further reducing the accuracy of detection. Another shortcoming of existing technologies is the insufficient refinement of defect classification and assessment. Most methods can only identify the existence of defects, but cannot distinguish the specific type of defects, such as broken wires, corrosion pits, bulges, etc., or quantify the severity of defects. The lack of scientific classification and early warning mechanisms for defect levels makes it difficult to directly use the detection results for production quality control and equipment maintenance decisions, thus limiting their value in practical industrial applications. Summary of the Invention

[0004] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a computer vision-based method and system for detecting surface defects in copper stranded wires. By combining adaptive image enhancement, stranding cycle iterative fitting, and multi-round region growth and verification techniques, it solves the problems of high false detection rate and inaccurate defect classification caused by surface reflection interference and complex stranding texture of copper stranded wires in traditional detection methods. It achieves high-precision automated detection and graded early warning of defects such as broken wires, corrosion, and bulging.

[0005] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a computer vision-based method for detecting surface defects in copper stranded wires, comprising: The copper stranded wire is controlled to pass through the detection area at a preset speed at a uniform speed. Continuous frame color images of the surface of the copper stranded wire are acquired. The color images are preprocessed to obtain the preprocessed enhanced image. Based on the enhanced image, the central axis of the copper stranded wire is extracted, and a stranding contour distance sequence is generated by sampling along the central axis. Through iterative fitting of the standard stranding cycle and residual analysis, the real structural anomaly region is marked. Seed points are adaptively selected within the real structural anomaly region. Defect candidate regions are generated through multiple rounds of region growth and contour constraints. Three rounds of verification are performed on each defect candidate region to segment out the real surface defect region. The system integrates information from structural anomaly areas and surface defect areas, classifies defect levels according to the nominal specifications of copper stranded wires, marks defect types and locations, generates inspection reports, and outputs early warning signals.

[0006] Furthermore, the CLAHE algorithm is used to perform reflection suppression processing on the color image, and the weighted average method is used to convert the reflection-suppressed color image into a single-channel grayscale image. Taking the single-channel grayscale image as the processing object, the Otsu adaptive threshold segmentation algorithm is used to calculate the optimal segmentation threshold of the grayscale image. Based on the optimal segmentation threshold, the image pixels are divided into foreground and background categories, resulting in a segmented binary image. Morphological opening operation is performed on the segmented binary image, and the copper stranded wire main body region with the largest area is retained through connected component analysis. The output is a foreground image containing only copper stranded wires. Taking the foreground image as the processing object, a bilateral filtering algorithm is used to perform smoothing enhancement processing, and the preprocessed enhanced image is finally output.

[0007] Furthermore, taking the enhanced image as the processing object, the Zhang-Suen thinning algorithm is used to refine the outline of the main copper stranded wire region in the enhanced image, obtain the central axis of single pixel width and determine its extension direction; the sampling step size along the extension direction of the central axis is set to 1 / 2 of the diameter of a single strand of copper stranded wire, and sampling points are selected sequentially according to this step size. The vertical distance from the two sides of each sampling point to the central axis is calculated by the line segment scanning method perpendicular to the central axis, and the sampling points are arranged in the sampling order to form a stranded outline distance sequence.

[0008] Furthermore, from the stranding profile distance sequence, continuous image segments without surface defects are selected as normal fitting samples. The initial period range for the standard stranding period iterative fitting is [D, 3D], where D is the nominal diameter of a single strand of copper wire. The least squares fitting algorithm is used to fit the period curve of the normal fitting samples to obtain the initial fitting period curve. The matching degree between the initial fitting period curve and the distance values ​​of each sampling point in the normal fitting samples is calculated. If the matching degree is lower than the preset matching degree threshold, the fitting period range is adjusted by ±0.2D, and the fitting operation is re-executed to obtain a new fitting period curve. This process continues until the matching degree between the fitting period curve and the normal samples is ≥ the matching degree threshold. At this point, the fitting period is the standard stranding period of the copper wire, and the corresponding fitting period curve is the standard profile curve.

[0009] Furthermore, for each sampling point in the twisted contour distance sequence, the residual between its distance value and the corresponding position distance value of the standard contour curve is calculated. The entire twisted contour distance sequence is traversed, and the regions where the absolute value of the residual is greater than the residual threshold are marked as candidate regions for structural anomalies. The coordinates of the starting and ending sampling points of each candidate region are recorded. For the marked candidate regions, the continuous length of residual anomalies within the candidate regions is counted. If the continuous length of residual anomalies within the candidate regions exceeds 3 sampling steps, it is determined to be a real structural anomaly region, and its pixel coordinate range in the color image is recorded.

[0010] Furthermore, the selection criteria for initial seed points are as follows: the grayscale value is uniform within a 10×10 pixel neighborhood of the pixel, the difference between the grayscale value of all pixels in the neighborhood and the grayscale value of the pixel is less than 5 grayscale levels, and the pixel is located within the main body area of ​​the copper stranded wire; an adaptive growth criterion is set: the difference threshold between the grayscale value of the pixel to be included in the growth area and the average grayscale value of all pixels in the current growth area is dynamically adjusted according to the average grayscale value of the current area, specifically, the difference threshold is equal to 10% of the average grayscale value of the current growth area; contour constraints are set: the growth range is strictly limited to the main body area of ​​the copper stranded wire, and if the pixel to be grown is located outside the main body area of ​​the copper stranded wire, it is directly excluded and not included in the growth area.

[0011] Furthermore, starting from the selected initial seed point, according to the set adaptive growth criteria and contour constraints, pixel by pixel is judged and adjacent pixels that meet the conditions are included to form an initial growth region. This initial growth region is marked as a normal copper stranded wire region. The edge pixels of the normal copper stranded wire region formed in the first round of growth are used as new seed points. The average gray value of the region where the new seed point is located is recalculated, and the gray value difference threshold is adjusted according to the adaptive growth criteria. Region growth is performed again to expand the range of the normal copper stranded wire region. The growth operation is repeated until no new pixels can be included in the normal copper stranded wire region after a certain round of growth, and growth stops. At this time, the set of pixels in the real structural abnormal area that are not marked as normal copper stranded wire regions is the defect candidate region.

[0012] Furthermore, three rounds of verification are performed on each defect candidate region, including area verification, grayscale feature verification, and contour association verification. Area verification involves calculating the pixel area of ​​each defect candidate region and converting it to the actual area. If the actual area is less than 1 / 4 of the cross-sectional area of ​​a single strand of copper wire, it is discarded. Grayscale feature verification involves retaining candidate regions if their grayscale values ​​are randomly distributed or exhibit linear abrupt changes. If a defect candidate region is located at the strand contour and accompanied by a strand contour break, it is classified as a broken wire defect. If a defect candidate region is located on the strand surface and has no strand contour break, it is classified as a corrosion pit or localized wear defect. The defect candidate regions retained after these three rounds of verification are the segmented actual surface defect regions.

[0013] Furthermore, information on real structural anomaly regions, including region type, coordinate range, and size, and information on real surface defect regions, including defect type, coordinate range, and size, are extracted. If a real structural anomaly region exhibits abnormal twisting cycle fluctuations and the presence of wire breakage defects, it is classified as uneven twisting accompanied by wire breakage defects. If a real structural anomaly region is a localized bulge without surface defects, it is classified as a bulge defect. If the area of ​​corrosion pits or wear defects within a real structural anomaly region exceeds 30%, it is classified as localized corrosion or wear accompanied by twisting anomalies. If no real structural anomaly region is detected and only surface defects are present, it is classified as a simple surface defect and its specific subtype is labeled. Based on the nominal specifications of the copper stranded wire, all identified defects are classified into three levels: minor, moderate, and severe. Minor defects are defined as a single defect whose actual area is less than 5% of the total cross-sectional area of ​​the copper stranded wire, and the length of a single abnormal structural area is less than two standard stranding cycles. Moderate defects are defined as a single defect whose actual area is 5% to 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single abnormal structural area is 2 to 5 standard stranding cycles. Severe defects are defined as a single defect whose actual area is greater than 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single abnormal structural area is more than five standard stranding cycles. If a moderate or higher defect is found in the inspection report, an early warning signal is issued. Moderate defects trigger a yellow warning, and severe defects trigger a red warning.

[0014] A computer vision-based copper stranded wire surface defect detection system includes: The image acquisition module controls the copper stranded wire to pass through the detection area at a preset speed, acquires continuous frames of color images of the surface of the copper stranded wire, and preprocesses the color images to obtain the preprocessed enhanced image. The structural anomaly detection module extracts the central axis of the copper stranded wire based on the enhanced image, samples along the central axis to generate a stranding contour distance sequence, and marks the real structural anomaly area through iterative fitting of the standard stranding cycle and residual analysis. The surface defect segmentation module adaptively selects seed points within the real structural anomaly region, generates defect candidate regions through multiple rounds of region growth and contour constraints, performs three rounds of verification on each defect candidate region, and segments out the real surface defect region. The defect early warning module integrates information from structural anomaly areas and surface defect areas, classifies defect levels according to the nominal specifications of copper stranded wires, marks the defect type and location, generates inspection reports, and outputs early warning signals.

[0015] (III) Beneficial Effects This invention provides a method and system for detecting surface defects in copper stranded wires based on computer vision, which has the following advantages: (1) By controlling the uniform motion of the copper stranded wire and acquiring high-resolution color images, the CLAHE algorithm is combined to suppress reflective interference, the weighted average method is used to convert it into a grayscale image, and the main area of ​​the copper stranded wire is extracted by Otsu threshold segmentation and morphological processing. Finally, bilateral filtering is used to enhance image details, effectively eliminating metal reflection and noise interference, preserving the key surface features of the copper stranded wire, providing a high-quality image basis for subsequent defect detection, and significantly improving the accuracy and stability of detection.

[0016] (2) By extracting the central axis of the copper stranded wire and generating the stranded profile distance sequence, combined with standard stranding cycle iterative fitting and residual analysis, the real structural abnormal area is accurately marked. The period curve is dynamically adjusted by least square fitting, which effectively distinguishes normal texture fluctuations from real defects, significantly reducing the false detection rate. The accuracy of the abnormal area is ensured by residual threshold and continuity verification, providing reliable structural abnormality location for subsequent defect detection, improving the pertinence and efficiency of detection, and enhancing the system's adaptability to complex stranded textures.

[0017] (3) Through adaptive seed point selection, multi-round region growth and three-round verification mechanism, the surface defects of copper stranded wire are accurately segmented. The adaptive growth criteria and contour constraints effectively distinguish normal texture and defect areas, avoiding false detection. Area verification eliminates minor interference. Gray-scale feature verification identifies random or abrupt distribution. Contour association verification accurately classifies defect types such as broken wires and corrosion, significantly improving the accuracy and robustness of defect detection, ensuring that only real defects are retained, and providing a reliable basis for subsequent graded early warning.

[0018] (4) By integrating information on structural anomaly areas and surface defect areas, and combining the nominal specifications of copper stranded wires, defects are accurately classified and graded. A standardized report is generated by associating multiple frames of detection results. This realizes the correlation between defect type and stranding structure anomaly, significantly improving the comprehensiveness and accuracy of defect analysis. The graded early warning mechanism promptly alerts risks, providing a scientific basis for production quality control. At the same time, it avoids human error and improves detection efficiency and industrial applicability. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the steps of the copper stranded wire surface defect detection method based on computer vision of the present invention. Figure 2 This is a schematic diagram of the process for detecting surface defects in copper stranded wires based on computer vision, as described in this invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Please see Figures 1-2 This invention provides a computer vision-based method for detecting surface defects in copper stranded wires, comprising the following steps: Step 1: Control the copper stranded wire to pass through the detection area at a preset speed at a uniform speed, acquire continuous frame color images of the surface of the copper stranded wire, preprocess the color images to obtain the preprocessed enhanced image; Step one includes the following: Step 101: Control the copper stranded wire to pass through the detection area at a preset speed of 0.3~0.8m / s; the industrial camera acquires continuous frame color images of the surface of the copper stranded wire, with the image resolution set to 2048×1080 pixels, and the acquired images are transmitted to the image processing unit in real time; the illumination intensity of the 45° oblique ring light source is adjustable from 500 to 2000 lux to avoid specular reflection on the metal surface of the copper stranded wire; Step 102: After receiving the acquired color image, the CLAHE algorithm is used to perform reflection suppression processing: the RGB three channels of the color image are separated and the luminance channel is extracted. By dividing the image into 8×8 pixel blocks, the histogram contrast threshold of each image block is limited to 2. The luminance channel is equalized, and the gray values ​​of the reflective areas are adjusted to a preset range. The gray values ​​of the reflective areas are 230~255, and the preset range is 180~220. The processed luminance channel is then re-fused with the original RGB channels to obtain the color image after reflection suppression. The color image after reflection suppression is converted into a single-channel grayscale image using a weighted average method, with the weighting coefficients set to R:G:B=0.299:0.587:0.114. Step 103: Using a single-channel grayscale image as the processing object, the Otsu adaptive threshold segmentation algorithm is used to calculate the optimal segmentation threshold for the grayscale image. Based on the optimal segmentation threshold, the image pixels are divided into foreground and background categories. The foreground is the copper stranded wire, and the background is the conveyor belt, background board, etc. Morphological opening operation is performed on the segmented binary image, and the structuring element is set as a 3×3 rectangle to remove small noise in the background. Through connected component analysis, the connected component with the largest area is retained, that is, the main area of ​​the copper stranded wire. The final output is a foreground image containing only the copper stranded wire. Step 104: Using the foreground image as the processing object, a bilateral filtering algorithm is used to perform smoothing enhancement processing; the filter window size is set to 5×5, the spatial domain standard deviation is 2, and the grayscale domain standard deviation is 5; through this filtering process, while preserving the detailed features such as the outline of the copper strands and surface defects, surface defects such as broken wires and corrosion pits are removed, and interference noise such as camera electronic noise and tiny dust on the surface of the copper strands is eliminated, and the pre-processed enhanced image is finally output. When using this method, refer to steps 101 to 104: By controlling the uniform movement of the copper stranded wire and acquiring high-resolution color images, the CLAHE algorithm is used to suppress reflective interference. The image is then converted to grayscale using a weighted average method. The main body region of the copper stranded wire is extracted through Otsu threshold segmentation and morphological processing. Finally, bilateral filtering is used to enhance image details. This effectively eliminates metal reflection and noise interference, preserves the key surface features of the copper stranded wire, and provides a high-quality image foundation for subsequent defect detection, significantly improving the accuracy and stability of the detection.

[0022] Step 2: Extract the central axis of the copper stranded wire based on the enhanced image, sample along the central axis to generate a stranding profile distance sequence, and mark the real structural anomaly areas through standard stranding cycle iterative fitting and residual analysis; Step two includes the following: Step 201: Using the enhanced image as the processing object, perform skeleton extraction operation; use the Zhang-Suen thinning algorithm to refine the contour of the main copper stranded wire region in the enhanced image, retain the connectivity and integrity of the contour, and finally obtain the central axis of single pixel width, and at the same time determine the extension direction of the central axis, that is, the length direction of the copper stranded wire. Step 202: Using the central axis as a reference, set the sampling step size along the extension direction of the central axis. The sampling step size is fixed at 1 / 2 of the diameter of a single strand of copper wire to ensure that the sampling density covers the details of the stranded texture. From the beginning to the end of the central axis, select sampling points in sequence according to the set step size. For each sampling point, use the line segment scanning method perpendicular to the extension direction of the central axis to calculate the vertical distance from the two sides of the copper wire at the sampling point to the central axis. Arrange the vertical distances of all sampling points in the sampling order to form a continuous stranded contour distance sequence. Step 203: Based on the twisting profile distance sequence, perform standard twisting cycle iterative fitting, specifically including: Step 2031: Select continuous image segments without surface defects from the stranding profile distance sequence as normal fitting samples, with a sample length of not less than 5 estimated stranding cycles. Step 2032: Initialize the fitting period range to [D, 3D], where D is the nominal diameter of a single strand of copper wire in mm. Use the least squares fitting algorithm to fit the period curve of the normal fitting sample to obtain the initial fitting period curve. Step 2033: Calculate the matching degree between the initial fitted periodic curve and the distance values ​​of each sampling point in the normal fitted sample. The matching degree is calculated as follows: First, calculate the average absolute error between the distance value of each sampling point and the corresponding value of the initial fitted periodic curve. Then, divide the average absolute error by the standard deviation of the distance value of the normal sample to obtain the ratio. Finally, subtract the ratio from 1 to get the matching degree. Step 2034: If the matching degree is lower than the preset matching degree threshold, which is fixed at 0.95, the fitting period range is adjusted by ±0.2D, and the fitting operation is re-executed to obtain a new fitting period curve. Step 2035: Repeat steps 2033 to 2034 until the matching degree between the fitted period curve and the normal sample is greater than or equal to the matching degree threshold. The fitting period at this time is the standard stranding period of the copper stranded wire, and the corresponding fitted period curve is the standard profile curve. Step 204: For each sampling point in the twisted profile distance sequence, calculate the residual between its actual distance value and the corresponding distance value of the standard profile curve. The residual is the difference between the actual distance value and the corresponding distance value of the standard profile curve. Set a residual threshold, which is 1 / 3 of the amplitude of the standard twisting period. The amplitude is the difference between the maximum and minimum distance values ​​in the standard profile curve. Traverse the entire twisted profile distance sequence and mark the areas where the absolute value of the residual is greater than the residual threshold as candidate areas for structural anomalies. Record the coordinates of the starting and ending sampling points of each candidate area. Step 205: Perform neighborhood continuity verification on the marked candidate regions: Calculate the continuous length of residual abnormal points within the candidate regions. The continuous length is the product of the number of consecutive abnormal sampling points and the sampling step size. If the continuous length of residual abnormal points within the candidate regions exceeds 3 sampling steps, it is determined to be a true structural abnormal region, and its pixel coordinate range in the original image is recorded. If the continuous length of residual abnormal points within the candidate regions does not exceed 3 sampling steps, it is determined to be a small fluctuation of the twisted texture or image noise interference, and is removed and not included in the subsequent detection range.

[0023] When using this method, refer to steps 201 to 205: By extracting the central axis of the copper stranded wire and generating a stranding profile distance sequence, combined with standard stranding cycle iterative fitting and residual analysis, the real structural anomaly areas are accurately marked. The period curve is dynamically adjusted using least squares fitting, which effectively distinguishes normal texture fluctuations from real defects, significantly reducing the false detection rate. Through residual threshold and continuity verification, the accuracy of the anomaly areas is ensured, providing reliable structural anomaly localization for subsequent defect detection, improving the targeting and efficiency of detection, and enhancing the system's adaptability to complex stranding textures.

[0024] Step 3: Adaptively select seed points within the real structural anomaly region, generate defect candidate regions through multiple rounds of region growth and contour constraints, perform three rounds of verification on each defect candidate region, and segment out the real surface defect region; Step two includes the following: Step 301: Using the enhanced image as the basis, and the pixel coordinate range of each real structural anomaly region as the selection boundary, adaptively select 3 to 5 initial seed points within each real structural anomaly region; the selection criteria for the initial seed points are: the gray value is uniform within the 10×10 pixel neighborhood where the pixel is located, the difference between the gray value of all pixels in the neighborhood and the gray value of the pixel is less than 5 gray levels, and the pixel is located within the main body area of ​​the copper stranded wire; Step 302: Set adaptive growth criteria: The difference threshold between the gray value of the pixel to be included in the growth area and the average gray value of all pixels in the current growth area is dynamically adjusted according to the average gray value of the current area. Specifically, the difference threshold is equal to 10% of the average gray value of the current growth area; Set contour constraints: The growth range is strictly limited to the main body area of ​​the copper stranded wire. If the pixel to be grown is located outside the main body area of ​​the copper stranded wire, it is directly excluded and not included in the growth area. Step 303: First round of growth: Starting from the selected initial seed point, according to the set adaptive growth criteria and contour constraints, pixel by pixel is judged and adjacent pixels that meet the conditions are included to form an initial growth region. This initial growth region is marked as a normal copper stranded wire region. Second round of growth: The edge pixels of the normal copper stranded wire region formed in the first round of growth are used as new seed points. The average gray value of the region where the new seed point is located is recalculated, and the gray value difference threshold is adjusted according to the adaptive growth criteria. Region growth is performed again to expand the range of the normal copper stranded wire region. Termination condition: The growth operation is repeated until no new pixels can be included in the normal copper stranded wire region after a certain round of growth, and growth stops. At this time, the set of pixels in the real structural abnormal area that are not marked as normal copper stranded wire regions are the defect candidate regions. Step 304: Perform three rounds of verification on each candidate defect region to eliminate false defects: Area verification: Calculate the pixel area of ​​each candidate defect region and convert it to the actual area using the pixel equivalent of an industrial camera, i.e., the actual physical size corresponding to a single pixel. If the actual area is less than 1 / 4 of the cross-sectional area of ​​a single strand of copper wire, it is judged as a false defect, such as tiny dust particles or image noise, and is eliminated; Gray-scale feature verification: Extract the gray-scale distribution features of each candidate defect region. If the gray-scale values ​​of the candidate defect region are randomly distributed or exhibit a linear abrupt distribution, the candidate label is retained. Random distribution means there is no obvious pattern. Linear abrupt change distribution refers to a sudden change in gray value along a certain direction, with the abrupt change amplitude being more than 3 times the gray value fluctuation range of the normal copper stranded wire area; if the gray value distribution characteristics of the defect candidate area are consistent with those of the normal copper stranded wire area, it is judged as a false defect and is removed; contour association verification: combined with the copper strand wire contour extracted from the enhanced image, if the defect candidate area is located at the wire contour and accompanied by a wire contour break, it is judged as a wire break defect; if the defect candidate area is located on the wire surface and has no wire contour break, it is judged as a corrosion pit or local wear defect; the defect candidate area retained after three rounds of verification is the segmented real surface defect area.

[0025] When using this method, refer to steps 301 to 304: By employing an adaptive seed point selection, multi-round region growth, and three-round verification mechanism, surface defects of copper stranded wires are accurately segmented. Adaptive growth criteria and contour constraints effectively distinguish normal textures from defect areas, avoiding false detections. Area verification eliminates minor interferences, grayscale feature verification identifies random or abrupt distributions, and contour correlation verification accurately classifies defect types such as broken wires and corrosion. This significantly improves the accuracy and robustness of defect detection, ensuring that only genuine defects are retained, providing a reliable basis for subsequent graded early warning.

[0026] Step 4: Integrate information from structural anomaly areas and surface defect areas, classify defect levels according to the nominal specifications of the copper stranded wire, mark the defect type and location, generate an inspection report, and output an early warning signal.

[0027] Step four includes the following: Step 401: Extract information on real structural anomaly regions, including region type, coordinate range, and size, and information on real surface defect regions, including defect type, coordinate range, and size, and perform correlation matching and fusion judgment. The judgment rules are as follows: If the real structural anomaly region is an abnormal stranding period fluctuation, which means that the stranding period of the region deviates from the standard stranding period curve by more than 15%, and there are identified wire breakage defects in the region, then the fusion judgment is uneven stranding accompanied by wire breakage defects; if the real structural anomaly region is a local bulge, which means that the outline of the region extends beyond the edge of the main copper stranded wire region. If the actual size corresponding to the height of the bulge exceeds the diameter of a single strand of wire, and there are no real surface defects in this area, it is directly identified as a bulge defect. If there are identified corrosion pits or local wear defects in the area of ​​real structural abnormality, and the actual area of ​​the surface defect accounts for more than 30% of the actual area of ​​the corresponding structural abnormality area, it is identified as a local corrosion or wear accompanied by stranding abnormality defect. If no real structural abnormality area is detected, but there are identified wire breakage, corrosion pits, or local wear defects, it is directly identified as a simple surface defect, and the specific defect subtype is marked, such as wire breakage, corrosion pits, or local wear. Step 402: Based on the nominal specifications of the copper stranded wire, including single strand diameter, total cross-sectional area, and standard stranding cycle, and combined with the actual size and impact range of each defect, classify all judged defects into three levels: minor, moderate, and severe. The specific classification criteria are as follows: Minor defect: The actual area of ​​a single defect is less than 5% of the total cross-sectional area of ​​the copper stranded wire, and the length of a single actual structural abnormal area is less than 2 standard stranding cycles; Moderate defect: The actual area of ​​a single defect is 5% to 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single actual structural abnormal area is 2 to 5 standard stranding cycles; Severe defect: The actual area of ​​a single defect is greater than 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single actual structural abnormal area exceeds 5 standard stranding cycles. Step 403: Mark the type, grade, actual size, and pixel coordinate range of each defect on the acquired original color image to generate a defect annotation map for a single frame image; perform correlation analysis on the defect annotation results of continuously acquired multi-frame images, and eliminate duplicate annotations of the same defect in adjacent frames by matching the continuity of defect coordinates, forming a defect distribution trajectory over the entire length of the copper stranded wire; based on the single-frame annotation results and the correlation analysis results of consecutive frames, generate a standardized inspection report. The report should include at least: the nominal specifications of the copper stranded wire, inspection speed, inspection time, total number of defects, number and distribution location of each type of defect, grade of each defect, and whether there are any non-conforming products. The presence of severe defects indicates a non-conforming product; if the inspection report contains moderate or higher defects, output a warning signal, where a moderate defect triggers a yellow warning, prompting a key review, and a severe defect triggers a red warning, prompting immediate shutdown and isolation of non-conforming products.

[0028] When using this method, please refer to the content of steps 401 to 403: By fusing information from structural anomaly areas and surface defect areas, and combining this with the nominal specifications of the copper stranded wire, defects are accurately classified and graded. Furthermore, by associating multiple frames of detection results to generate standardized reports, the correlation between defect types and stranding structure anomalies is achieved. This significantly improves the comprehensiveness and accuracy of defect analysis. The graded early warning mechanism promptly alerts to risks, providing a scientific basis for production quality control. At the same time, it avoids human error and improves detection efficiency and industrial applicability.

[0029] This invention also provides a computer vision-based copper stranded wire surface defect detection system, comprising: an image acquisition module, a structural anomaly detection module, a surface defect segmentation module, and a defect early warning module, wherein: The image acquisition module controls the copper stranded wire to pass through the detection area at a preset speed, acquires continuous frames of color images of the surface of the copper stranded wire, and preprocesses the color images to obtain the preprocessed enhanced image. The structural anomaly detection module extracts the central axis of the copper stranded wire based on the enhanced image, samples along the central axis to generate a stranding contour distance sequence, and marks the real structural anomaly area through iterative fitting of the standard stranding cycle and residual analysis. The surface defect segmentation module adaptively selects seed points within the real structural anomaly region, generates defect candidate regions through multiple rounds of region growth and contour constraints, performs three rounds of verification on each defect candidate region, and segments out the real surface defect region. The defect early warning module integrates information from structural anomaly areas and surface defect areas, classifies defect levels according to the nominal specifications of copper stranded wires, marks the defect type and location, generates inspection reports, and outputs early warning signals.

[0030] In the application, the various formulas mentioned are all calculated by removing dimensions and taking their numerical values. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The coefficients in the formulas are set by those skilled in the art according to the actual situation.

[0031] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, and combinations thereof. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.

[0032] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0033] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for detecting surface defects in copper stranded wires based on computer vision, characterized in that: include: The copper stranded wire is controlled to pass through the detection area at a preset speed at a uniform speed. Continuous frame color images of the surface of the copper stranded wire are acquired. The color images are preprocessed to obtain the preprocessed enhanced image. Based on the enhanced image, the central axis of the copper stranded wire is extracted, and a stranding contour distance sequence is generated by sampling along the central axis. Through iterative fitting of the standard stranding cycle and residual analysis, the real structural anomaly region is marked. Seed points are adaptively selected within the real structural anomaly region. Defect candidate regions are generated through multiple rounds of region growth and contour constraints. Three rounds of verification are performed on each defect candidate region to segment out the real surface defect region. The system integrates information from structural anomaly areas and surface defect areas, classifies defect levels according to the nominal specifications of copper stranded wires, marks defect types and locations, generates inspection reports, and outputs early warning signals.

2. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 1, characterized in that: The CLAHE algorithm is used to suppress reflections in the color image. A weighted average method is then used to convert the reflection-suppressed color image into a single-channel grayscale image. Using this single-channel grayscale image as the processing object, the Otsu adaptive threshold segmentation algorithm is employed to calculate the optimal segmentation threshold. Based on this optimal threshold, the image pixels are divided into foreground and background categories, resulting in a segmented binary image. Morphological opening operations are performed on the segmented binary image. Connected component analysis is used to retain the largest copper stranded wire body region, outputting a foreground image containing only the copper stranded wire. Using this foreground image as the processing object, a bilateral filtering algorithm is used for smoothing and enhancement, ultimately outputting a pre-processed enhanced image.

3. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 2, characterized in that: Using the enhanced image as the processing object, the Zhang-Suen thinning algorithm is used to refine the outline of the main copper stranded wire region in the enhanced image, obtain the central axis of single pixel width and determine its extension direction; the sampling step size along the extension direction of the central axis is set to 1 / 2 of the diameter of a single strand of copper stranded wire, and sampling points are selected sequentially according to this step size. The vertical distance from the two sides of each sampling point to the central axis is calculated by the line segment scanning method perpendicular to the central axis, and the sampling points are arranged in the sampling order to form a stranded outline distance sequence.

4. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 3, characterized in that: From the stranding profile distance sequence, continuous image segments without surface defects are selected as normal fitting samples. The initial period range of the standard stranding period iterative fitting is [D, 3D], where D is the nominal diameter of a single strand of copper wire. The least squares fitting algorithm is used to fit the period curve of the normal fitting samples to obtain the initial fitting period curve. The matching degree between the initial fitting period curve and the distance value of each sampling point in the normal fitting sample is calculated. If the matching degree is lower than the preset matching degree threshold, the fitting period range is adjusted by ±0.2D, and the fitting operation is re-executed to obtain a new fitting period curve. This process continues until the matching degree between the fitting period curve and the normal sample is ≥ the matching degree threshold. At this point, the fitting period is the standard stranding period of the copper wire, and the corresponding fitting period curve is the standard profile curve.

5. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 4, characterized in that: For each sampling point in the twisted contour distance sequence, calculate the residual between its distance value and the distance value at the corresponding position of the standard contour curve. Traverse the entire twisted contour distance sequence and mark the regions where the absolute value of the residual is greater than the residual threshold as candidate regions for structural anomalies. Record the coordinates of the starting and ending sampling points of each candidate region. For the marked candidate regions, count the continuous length of residual anomalies within the candidate regions. If the continuous length of residual anomalies within the candidate regions exceeds 3 sampling steps, it is determined to be a real structural anomaly region, and its pixel coordinate range in the color image is recorded.

6. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 1, characterized in that: The initial seed point selection criteria are as follows: the gray value is uniform within a 10×10 pixel neighborhood of the pixel, the difference between the gray value of all pixels in the neighborhood and the gray value of the pixel is less than 5 gray levels, and the pixel is located within the main body area of ​​the copper stranded wire; an adaptive growth criterion is set: the difference threshold between the gray value of the pixel to be included in the growth area and the average gray value of all pixels in the current growth area is dynamically adjusted according to the average gray value of the current area, specifically, the difference threshold is equal to 10% of the average gray value of the current growth area; contour constraints are set: the growth range is limited to the main body area of ​​the copper stranded wire. If the pixel to be grown is located outside the main body area of ​​the copper stranded wire, it is directly excluded and not included in the growth area.

7. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 6, characterized in that: Starting from the selected initial seed point, according to the set adaptive growth criteria and contour constraints, each pixel is judged and adjacent pixels that meet the conditions are included to form an initial growth region, which is marked as a normal copper stranded wire region. The edge pixels of the normal copper stranded wire region formed in the first round of growth are used as new seed points. The average gray value of the region where the new seed point is located is recalculated, and the gray value difference threshold is adjusted according to the adaptive growth criteria. Region growth is performed again to expand the range of the normal copper stranded wire region. The growth operation is repeated until no new pixels are included in the normal copper stranded wire region after a certain round of growth, and growth stops. At this time, the set of pixels in the real structural abnormal area that are not marked as normal copper stranded wire regions is the defect candidate region.

8. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 7, characterized in that: Three rounds of verification were performed on each defect candidate region, including area verification, grayscale feature verification, and contour association verification. Area verification involved calculating the pixel area of ​​each defect candidate region and converting it to the actual area. If the actual area was less than 1 / 4 of the cross-sectional area of ​​a single strand of copper wire, it was discarded. Grayscale feature verification involved retaining candidate regions if their grayscale values ​​were randomly distributed or exhibited a linear abrupt change. If a defect candidate region was located at the strand contour and accompanied by a break in the strand contour, it was classified as a broken wire defect. If a defect candidate region was located on the strand surface and had no break in the strand contour, it was classified as a corrosion pit or localized wear defect. The defect candidate regions retained after these three rounds of verification were the segmented actual surface defect regions.

9. The method for detecting surface defects in copper stranded wires based on computer vision according to claim 1, characterized in that: Extract information about real structural anomaly regions, including region type, coordinate range, and size; extract information about real surface defect regions, including defect type, coordinate range, and size. If a real structural anomaly region exhibits abnormal twisting cycle fluctuations and contains broken wire defects, it is classified as uneven twisting accompanied by broken wire defects. If a real structural anomaly region is a localized bulge without surface defects, it is classified as a bulge defect. If the area of ​​corrosion pits or wear defects within a real structural anomaly region exceeds 30%, it is classified as localized corrosion or wear accompanied by twisting anomalies. If no real structural anomaly region is detected and only surface defects exist, it is classified as a simple surface defect and its specific subtype is labeled. Based on the nominal specifications of the copper stranded wire, all identified defects are classified into three levels: minor, moderate, and severe. Minor defects are defined as a single defect whose actual area is less than 5% of the total cross-sectional area of ​​the copper stranded wire, and the length of a single abnormal structural area is less than two standard stranding cycles. Moderate defects are defined as a single defect whose actual area is 5% to 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single abnormal structural area is 2 to 5 standard stranding cycles. Severe defects are defined as a single defect whose actual area is greater than 20% of the total cross-sectional area of ​​the copper stranded wire, or the length of a single abnormal structural area is more than five standard stranding cycles. If a moderate or higher defect is found in the inspection report, an early warning signal is issued. Moderate defects trigger a yellow warning, and severe defects trigger a red warning.

10. A computer vision-based copper stranded wire surface defect detection system, used to implement the computer vision-based copper stranded wire surface defect detection method according to any one of claims 1 to 9, characterized in that: include: The image acquisition module controls the copper stranded wire to pass through the detection area at a preset speed, acquires continuous frames of color images of the surface of the copper stranded wire, and preprocesses the color images to obtain the preprocessed enhanced image. The structural anomaly detection module extracts the central axis of the copper stranded wire based on the enhanced image, samples along the central axis to generate a stranding contour distance sequence, and marks the real structural anomaly area through iterative fitting of the standard stranding cycle and residual analysis. The surface defect segmentation module adaptively selects seed points within the real structural anomaly region, generates defect candidate regions through multiple rounds of region growth and contour constraints, performs three rounds of verification on each defect candidate region, and segments out the real surface defect region. The defect early warning module integrates information from structural anomaly areas and surface defect areas, classifies defect levels according to the nominal specifications of copper stranded wires, marks the defect type and location, generates inspection reports, and outputs early warning signals.