Data line defect detection method and system based on image recognition

By combining adaptive thresholding algorithms and convolutional neural networks, imaging parameters are dynamically adjusted, solving the problem of accurate identification of minute defects in data lines. This achieves sub-pixel level clear imaging on high-speed production lines, improving detection accuracy and efficiency.

CN121639635APending Publication Date: 2026-03-10SHENZHEN INTERMAN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately image different parts of data cables on high-speed production lines, especially for detecting minute defects in critical areas such as metal contacts and plastic seams. This results in high rates of missed and false detections, failing to meet the demands of high-speed production.

Method used

An adaptive thresholding algorithm is used to separate the foreground and background. A convolutional neural network is used to extract material and geometric features. Exposure parameters are dynamically adjusted, a region growing algorithm is used to expand the defect area, and a sharpening filter is used to improve sub-pixel sharpness. Least squares fitting is used to quantify the degree of defect.

Benefits of technology

It enables accurate identification of minute defects in data cables under complex lighting conditions, improves detection accuracy and automated classification efficiency, optimizes pipeline quality control, and achieves sub-pixel level clear imaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639635A_ABST
    Figure CN121639635A_ABST
Patent Text Reader

Abstract

The invention discloses a data line defect detection method and system based on image recognition, relates to the technical field of image recognition, and aims at obtaining real-time data line image data for a high-speed assembly line, dynamically segmenting a foreground and a background through an adaptive threshold algorithm, and extracting feature vectors of material differences and geometric shapes by adopting a convolutional neural network to obtain a data line defect detection result. The method comprises the following steps: enhancing a reflective and low-contrast region to obtain feature enhanced image data, reducing overexposure influence by dynamically adjusting exposure parameters, generating light correction image data, expanding a tiny defect candidate region by using a region growing algorithm, and improving sub-pixel-level marginal definition in combination with sharpening filtering to obtain a small defect candidate region; and quantifying the defect contour deviation through least square fitting. And when the defect quantitative index exceeds a warning threshold value, automatically marking the defect and generating a detection report. According to the invention, imaging parameters are dynamically adjusted according to geometrical characteristics and material characteristics of different parts of the data line, so that clear imaging at a sub-pixel level is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for detecting defects in data cables based on image recognition. Background Technology

[0002] As a core component for connecting and charging modern electronic devices, the quality of data cables directly impacts device performance and user experience. With the rapid growth of the consumer electronics market, the production scale of data cables is constantly expanding, making defect detection a crucial link in ensuring product quality. Traditional inspection methods largely rely on manual visual inspection or simple machine vision technology, which is insufficient to meet the demands of high-speed assembly line production. Manual inspection is inefficient and easily affected by subjective factors, while existing machine vision systems often suffer from insufficient recognition accuracy in complex environments due to changes in lighting, material differences, or the geometric complexity of the inspection area, especially in the detection of minute defects, resulting in high rates of missed and false detections. These limitations necessitate an efficient and accurate automated inspection solution to address diverse production scenarios and stringent quality requirements.

[0003] The core challenge in data cable defect detection lies in accurately locating and clearly imaging critical areas in high-speed production lines, such as the metal contacts of USB interfaces, seams in plastic casings, and connections between cables and connectors. These areas have complex reflective properties due to differences in materials and geometry, making it difficult for ordinary imaging systems to capture clear details. Reflections from metal contacts can lead to overexposure, while tiny cracks in plastic seams are difficult to detect due to low contrast. More critically, the minute structure of data cables, such as metal pins with diameters of only a few tenths of a millimeter, demands extremely high precision from the imaging system. However, existing technologies struggle to stably adjust focus and aperture parameters in dynamic environments, failing to adapt to rapid switching between different locations and complex lighting conditions. This makes the detection of minute defects a bottleneck in the industry.

[0004] Therefore, how to dynamically adjust imaging parameters to achieve sub-pixel level clear imaging based on the geometric features and material properties of different parts of the data cable on a high-speed production line has become a key issue in the field of defect detection. Summary of the Invention

[0005] This invention provides a data cable defect detection method and system based on image recognition, which enables dynamic adjustment of imaging parameters based on the geometric features and material properties of different parts of the data cable on a high-speed production line to achieve clear imaging at the sub-pixel level.

[0006] This invention provides a data cable defect detection method based on image recognition, executed by a computer, comprising: Real-time data line image data is acquired from a high-speed pipeline, and the data line image data is processed by an adaptive threshold algorithm to separate the foreground region and the background region, thereby obtaining preliminary segmented image data. Based on the preliminary segmented image data, a convolutional neural network is used to extract feature vectors of material differences and geometric shape information to obtain feature-enhanced image data; If the reflectance intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, the exposure parameters of the feature-enhanced image data are dynamically adjusted to obtain light-corrected image data. Based on the light-corrected image data, candidate regions of minute defects and their regional coordinates are determined. Based on the regional coordinates, a region growing algorithm is used to expand the boundaries of the candidate regions to cover potential cracks and pin defects, thereby obtaining expanded defect region image data. If the contrast within the extended defect region image data is lower than a preset contrast threshold, then based on the extended defect region image data, a sharpening filter is applied to enhance edge details to improve sub-pixel level clarity, resulting in sharpened image data. Subpixel-level contour point sets are extracted from the sharpened image data, and contour deviation values ​​are calculated based on the subpixel-level contour point sets through least squares fitting to quantify the degree of defects, thereby obtaining a defect quantification index. If the defect quantification index exceeds the preset warning threshold, the region corresponding to the sub-pixel contour point set is marked as a defect region, and a detection result report is output. The defect region is highlighted in the image data of the detection result report through an overlay layer.

[0007] According to the image recognition-based data cable defect detection method of the present invention, the step of processing the data cable image data through an adaptive threshold algorithm to separate the foreground region and the background region to obtain preliminary segmented image data includes: Based on the data line image data, an adaptive threshold algorithm is used to process it to separate the foreground region and the background region, thereby obtaining segmented region image data; Based on the segmented region image data, the Canny edge detection algorithm is used to extract the boundaries of metal contacts and plastic seams to obtain edge-enhanced image data. If the metal contact boundary is intact in the edge enhancement image data, then based on the edge enhancement image data, the foreground region is expanded by morphological dilation to obtain expanded foreground image data; Based on the extended foreground image data, the pixel distribution is grouped using the K-means clustering algorithm to obtain grouped image data. If the plastic seam area in the grouped image data is continuous, the background area is filled by the region growing algorithm to obtain the background-filled image data. Based on the background filling image data, the preliminary segmentation image data is obtained by integrating the metal contact and plastic seam information through equalization processing of the image data.

[0008] According to the image recognition-based data line defect detection method of the present invention, the step of extracting feature vectors of material differences and geometric shape information using a convolutional neural network based on the initially segmented image data to obtain feature-enhanced image data includes: Based on the preliminary segmented image data, a convolutional neural network is used to extract feature vectors of material differences and geometric shape information to obtain initial feature image data; Based on the initial feature image data, the feature similarity between the feature vectors is determined, and based on the feature similarity, a clustering algorithm is used to group regions to obtain grouped region data; If the pixel brightness value of the reflective area in the grouped region data exceeds a preset threshold, then the brightness distribution is adjusted by histogram equalization based on the grouped region data to obtain equalized image data. Based on the low-contrast region boundaries in the equalized image data, an edge detection algorithm is used to extract boundary lines to obtain boundary enhancement data. If there are closed geometric shapes in the boundary enhancement data, then based on the boundary enhancement data, morphological operations are used to fill the gaps to obtain filled image data; Material differences are extracted from the filled image data, and texture statistics are calculated using texture analysis methods based on the material differences to obtain a texture feature set; Based on the texture feature set, a filter is used to remove noise to obtain the feature-enhanced image data.

[0009] According to the image recognition-based data line defect detection method of the present invention, if the reflectance intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, the exposure parameters of the feature-enhanced image data are dynamically adjusted to obtain light-corrected image data, including: If the reflective intensity exceeds a preset intensity threshold, an adjustment process is initiated, and an adjustment trigger signal is obtained; Based on the adjustment trigger signal, the average pixel value is iteratively calculated, and the exposure parameters are optimized using the gradient descent method to obtain the optimized exposure parameters. The optimized exposure parameters are applied to the feature-enhanced image data to reduce the pixel values ​​in overexposed areas, thus obtaining preliminary corrected image data. Based on the preliminary corrected image data, edge detection is performed using the Canny algorithm to extract boundary information, resulting in boundary-enhanced image data. Based on the boundary enhancement image data, the light correction details are fused to obtain the light correction image data.

[0010] According to the image recognition-based data line defect detection method of the present invention, the step of expanding the candidate region boundary based on the region coordinates using a region growing algorithm to cover potential cracks and pin defects, and obtaining expanded defect region image data, includes: Based on the region coordinates, the pixel position indicated by the region coordinates is used as the seed point, and the region growth algorithm is used to spread to the neighboring pixels to cover potential cracks and pin defects, so as to obtain the initial defect region image data. Based on the initial defect area image data, the pixel intensity distribution is determined. If there are pixels in the pixel intensity distribution whose intensity exceeds a preset intensity threshold, the corresponding initial defect area image data is marked as a crack defect, and the defect type is classified. Based on the aforementioned defect types, the crack defects are grouped using a clustering algorithm to determine a defect cluster set; Pixel connectivity components are calculated based on the defect cluster set. If the number of pixel connectivity components is greater than a preset threshold, adjacent components of the pixel connectivity components are merged to obtain a unified defect region. Based on the unified defect region, an edge detection algorithm is used to trace the contour lines to extract the boundary contours, thereby obtaining the extended defect region image data containing the defect boundary coordinates.

[0011] According to the image recognition-based data line defect detection method of the present invention, if the contrast within the extended defect region image data is lower than a preset contrast threshold, then based on the extended defect region image data, a sharpening filter is applied to enhance edge details to improve sub-pixel level clarity, resulting in sharpened image data, including: Based on the extended defect region image data, noise is removed through preprocessing filtering to obtain the first image data; If the contrast of the first image data is lower than a preset contrast threshold, then based on the preset contrast threshold, the high-frequency components in the first image data are extracted by the Laplacian operator to obtain the second image data. Based on the high-frequency components of the second image data, a sharpening filter is applied to enhance edge details to obtain the third image data; Based on the third image data, the resolution is improved by a sub-pixel interpolation algorithm to obtain the fourth image data; If the edge strength of the fourth image data is lower than a preset boundary threshold, then based on the fourth image data, a high-frequency component is amplified through a high-pass filter to obtain the fifth image data; Based on the fifth image data, the boundary features of the defect area are extracted using the Canny edge detection algorithm to obtain the sixth image data; Based on the boundary information of the sixth image data, morphological operations are applied to optimize the contour of the defect region to obtain the sharpened image data.

[0012] According to the image recognition-based data line defect detection method of the present invention, the step of extracting a sub-pixel level contour point set from the sharpened image data, and calculating the contour deviation value based on the sub-pixel level contour point set through least squares fitting to quantify the defect degree and obtain a defect quantification index includes: Based on the sub-pixel level contour point set, the Canny algorithm is used to perform edge detection to obtain the edge point set; Based on the set of edge points, the deviation value is calculated by least squares fitting to obtain a sequence of deviation values. If there are points in the deviation value sequence that exceed the preset deviation threshold, then the deviation distribution is analyzed using a linear regression algorithm based on the deviation value sequence to determine the distribution parameters; Based on the distribution parameters, a defect severity index is obtained, and the defect severity index is normalized to obtain the defect quantification index.

[0013] The present invention also provides a data cable defect detection system based on image recognition, comprising: The segmentation module is used to acquire real-time data line image data from the high-speed pipeline and process the data line image data through an adaptive threshold algorithm to separate the foreground region and the background region to obtain preliminary segmented image data. The feature enhancement module is used to extract feature vectors of material differences and geometric shape information based on the preliminary segmented image data using a convolutional neural network to obtain feature-enhanced image data. The light correction module is used to dynamically adjust the exposure parameters of the feature-enhanced image data if the reflectance intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, so as to obtain light-corrected image data. The defect region identification module is used to determine the candidate regions of minute defects and the region coordinates of the candidate regions based on the light-corrected image data, and to expand the boundary of the candidate regions using a region growth algorithm based on the region coordinates to cover potential cracks and pin defects, thereby obtaining expanded defect region image data. The sharpening module is used to apply sharpening filtering to enhance edge details and improve sub-pixel level clarity based on the extended defect region image data if the contrast within the region is lower than a preset contrast threshold, thereby obtaining sharpened image data. The defect index quantification module is used to extract a sub-pixel level contour point set from the sharpened image data, and calculate the contour deviation value based on the sub-pixel level contour point set by least squares fitting to quantify the degree of defect and obtain the defect quantification index. The report output module is used to mark the corresponding area of ​​the sub-pixel contour point set as a defect area if the defect quantification index exceeds a preset warning threshold, and output a detection result report. The defect area is highlighted in the image data of the detection result report through an overlay layer.

[0014] This invention provides a data cable defect detection method and system based on image recognition, offering an intelligent solution for real-time image detection of data cables on high-speed production lines. It addresses the challenge of accurately identifying minute defects in critical areas such as metal contacts and plastic seams under complex lighting conditions. For acquiring real-time data cable image data from high-speed production lines, an adaptive threshold algorithm dynamically segments the foreground and background based on local pixel distribution, highlighting key features to obtain preliminary segmented image data. Subsequently, a convolutional neural network is used to extract feature vectors of material differences and geometric shapes, enhancing reflective and low-contrast areas to obtain feature-enhanced image data. Overexposure is reduced by dynamically adjusting exposure parameters to generate light-corrected image data. Next, a region growing algorithm expands the candidate region for minute defects, combined with sharpening filtering to improve sub-pixel edge clarity. Defect contour deviation is quantified using least-squares fitting to obtain a defect quantification index. When the defect quantification index exceeds a warning threshold, the defect is automatically marked, and a detection report containing the defect quantification index and the defect area is generated. This invention significantly improves the detection accuracy and automated classification efficiency of minute defects under complex lighting conditions, optimizes production line quality control, and enables dynamic adjustment of imaging parameters based on the geometric features and material properties of different parts of the data cable on a high-speed production line to achieve sub-pixel level clear imaging. Attached Figure Description

[0015] Figure 1 This is one of the flowcharts of the data cable defect detection method based on image recognition provided in the embodiments of the present invention; Figure 2 This is the second flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention; Figure 3 This is the third flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention; Figure 4 This is the fourth flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention; Figure 5 This is the fifth flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention; Figure 6 This is the sixth flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention; Figure 7 This is the seventh flowchart of the data cable defect detection method based on image recognition provided in this embodiment of the invention. Detailed Implementation

[0016] 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.

[0017] Reference Figure 1 This invention provides a data cable defect detection method based on image recognition, comprising the following steps: Step 100: Obtain real-time data line image data from the high-speed pipeline, and process the data line image data using an adaptive threshold algorithm to separate the foreground region and the background region to obtain preliminary segmented image data; First, image data of the data cables is acquired in real time from the high-speed production line. This process is achieved using high-resolution industrial cameras deployed at key locations on the production line, which possess high frame rates and fast exposure capabilities, enabling them to accurately capture the surface morphology and structural features of the data cables during continuous movement. Due to the extremely high operating speed of the production line and potential interference factors such as ambient light fluctuations or reflections from the data cable's own material, the acquired raw image data often contains complex background noise and foreground information mixed in. Therefore, effective image preprocessing is necessary to highlight the main area of ​​the data cable to be inspected.

[0018] To achieve this goal, an adaptive thresholding algorithm is used to process the original data line image data. This adaptive thresholding algorithm dynamically calculates and applies different thresholds based on the grayscale characteristics of local image regions, thereby achieving robust adaptation to uneven lighting, shadow interference, and changes in surface texture. During processing, the adaptive thresholding algorithm divides the image into multiple sub-regions and independently analyzes the pixel intensity distribution within each sub-region, generating a binarized threshold that matches the characteristics of that region. This allows the foreground region corresponding to the data line itself—i.e., the key parts to be detected, such as the line body and interfaces—to be separated from the image background, effectively suppressing irrelevant details and random noise in the background.

[0019] After processing with an adaptive thresholding algorithm, the original data line image data is transformed into preliminary segmented image data. In this data line image data, the foreground region of the data line is typically presented in a significantly binarized form, for example, with a bright white highlight representing the target object, while the background region is uniformly suppressed to black, thus creating a high-contrast visual effect. This preliminary segmentation result significantly reduces the data complexity of subsequent image analysis and processing, and provides the defect recognition module with clear and clean foreground target contours and surface information.

[0020] Step 200: Based on the preliminary segmented image data, a convolutional neural network is used to extract feature vectors of material differences and geometric shape information to obtain feature-enhanced image data; After obtaining preliminary segmented image data that separates the foreground and background, a convolutional neural network (CNN), an advanced deep learning model, is further utilized to perform in-depth feature mining and analysis on the preliminary segmented image data. Although the preliminary segmented image has outlined the basic contours of the data lines, the subtle material texture variations and complex geometric features closely related to defects contained within it require feature extraction tools for identification. Through its multi-layered network structure, the CNN can simulate the cognitive process of the human visual system, gradually abstracting highly discriminative high-level features from the preliminary segmented image data.

[0021] This convolutional neural network (CNN) processes the initially segmented input image layer by layer through a series of alternating convolutional and pooling layers. In the shallow layers, the CNN primarily captures basic visual patterns such as edges, corners, and color patches. As the network deepens, these basic features are continuously combined and abstracted, gradually forming more complex feature representations. During this process, the CNN autonomously learns and highlights local material anomalies on the data line surface caused by defects such as wear, indentations, bubbles, or contamination, including changes in reflectivity, texture disorder, or disruption of uniformity. Simultaneously, the CNN also learns geometric information, including but not limited to the curvature of the line, interface deformation, contour integrity, and the presence of abnormal protrusions or depressions.

[0022] Ultimately, the convolutional neural network fuses and encodes all this learned multi-dimensional information about material differences and geometry into a highly condensed and information-dense feature vector. This feature vector constitutes the feature-enhanced image data. Compared to the original pixel data or preliminary segmentation image, this feature-enhanced image data is a deeper digital representation that focuses more on machine understanding, reflecting the essential image attributes most relevant to defect detection and greatly suppressing irrelevant interference information.

[0023] Step 300: If the reflectance intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, the exposure parameters of the feature-enhanced image data are dynamically adjusted to obtain light-corrected image data. After obtaining feature-enhanced image data through a convolutional neural network, an intelligent light feedback and correction mechanism is introduced. Due to the diverse surface materials of data cables, localized strong reflections may occur at specific angles. Although these highlight areas are captured by the network as features and reflected in the reflection intensity values ​​of their feature vectors, excessive brightness may obscure the detailed textures of these areas, interfering with the accurate interpretation of subsequent subtle defects. Therefore, a scientifically set intensity threshold is preset to determine whether the degree of reflection reflected in the feature vectors has entered a saturation range that may affect the analysis.

[0024] When the intensity of reflected light in the feature vector exceeds a preset threshold, a dynamic exposure adjustment process is triggered. Based on parameter optimization fed back from the feature vector in the feature-enhanced image data, this may involve precise fine-tuning of the virtual exposure time, gain, or gamma value. This is done to suppress the brightness of overexposed areas while preserving and restoring as much detail as possible in shadows and midtones, resulting in light-corrected image data. After dynamically adjusting the exposure parameters of the feature-enhanced image data, the resulting light-corrected image data shows significant improvements in visual quality and data analysis suitability. It effectively eliminates the "glare" phenomenon caused by strong reflections, allowing surface structures that were originally obscured by highlights, such as minor scratches, uneven injection molding, or the microstructure of metal contacts at interfaces, to be clearly reproduced.

[0025] Step 400: Based on the light-corrected image data, determine the candidate regions of minute defects and the region coordinates of the candidate regions of minute defects, and based on the region coordinates, use a region growing algorithm to expand the boundary of the candidate regions to cover potential cracks and pin defects, thereby obtaining expanded defect region image data. After obtaining the light-corrected image data, the next step is to accurately capture and optimize the regions for minute defects. First, potential candidate regions for minute defects are located and extracted from the light-corrected image. This can be achieved by analyzing local anomalies in the image, such as abrupt changes in contrast, discontinuities in texture, or subtle statistical differences from surrounding areas. The precise coordinates of these defect regions are then output, yielding their regional coordinates. However, these initial candidate regions often only reflect the most critical or significant parts of the defect. Potential peripheral areas, such as extensions of fine cracks or blurred stitch edges, may not be fully encompassed, resulting in incomplete defect information.

[0026] Therefore, a region growing algorithm is employed to expand the boundaries of this series of discrete region coordinates. This algorithm uses each identified minor defect candidate region as a seed point and iteratively explores and merges its surrounding neighborhood according to pre-defined growth criteria, such as pixel intensity similarity, gradient continuity, or texture consistency. It adaptively extends along the potential path of the defect, for example, expanding along the direction of a crack, or gradually incorporating blurred, low-contrast edges around the stitches into the detection range. Through the processing of the region growing algorithm, the resulting expanded defect region image data significantly optimizes the initial candidate regions, ensuring that each suspected defect point is labeled with an area that fully covers its true extent, and connecting and integrating discontinuous defect signs into a unified whole—the expanded defect region image data.

[0027] Step 500: If the contrast within the extended defect region image data is lower than a preset contrast threshold, then based on the extended defect region image data, a sharpening filter is applied to enhance edge details to improve sub-pixel level clarity, resulting in sharpened image data. After obtaining the extended defect area image data, an intelligent judgment and enhancement process based on image quality is introduced. Because some defects, such as extremely fine cracks or shallow wear, may have a very smooth transition with the background, resulting in low overall contrast within the area. This low contrast makes the edge contours of the defects unclear, posing a significant challenge to subsequent sub-pixel-level measurement and classification. Therefore, a preset contrast threshold is used to filter out these visually inconspicuous but potentially high-risk suspicious areas.

[0028] When the contrast within an extended defect region is detected to be below a preset contrast threshold, a targeted image enhancement process is automatically triggered. A sharpening filter algorithm is applied, selectively enhancing high-frequency components in the image through specific convolutional kernels. Sharpening filters are applied to the edges, texture abrupt changes, and other fine details of the region to enhance edge detail. This sharpening filter operation enhances the transition gradient of pixel intensity at the defect boundary, making previously blurry and diffuse contours clear and sharp, thus significantly improving edge discernibility both visually and numerically. Therefore, after sharpening, the resulting image data achieves sub-pixel-level sharpness improvement. Not only are pixel-level edges enhanced, but within a single pixel, the intensity relationship with surrounding pixels allows for a more accurate inference of the actual crossing position of the defect edge. This sharpened image data greatly optimizes the analyzability of low-contrast defect regions, ensuring that even the most subtle and difficult-to-detect defect signals can be effectively captured and accurately evaluated for subsequent more precise geometric measurements, morphological analysis, and final defect characterization.

[0029] Step 600: Extract sub-pixel level contour point set from the sharpened image data, and calculate contour deviation value based on the sub-pixel level contour point set by least squares fitting to quantify the degree of defect and obtain defect quantification index. After obtaining the sharpened image data, the defect detection process enters the quantitative analysis stage. First, sub-pixel-level contour point sets of defect areas are extracted from these high-quality images. The defect areas are located within pixels using algorithms such as interpolation, thereby obtaining sub-pixel-level contour point sets with higher resolution and greater accuracy than the original image. These sub-pixel-level contour point sets include contour coordinate sequences. Furthermore, these sub-pixel-level contour point sets also contain the extension path of cracks, the deformed shape of stitches, or the geometry of any other defects.

[0030] Subsequently, based on the sub-pixel level contour point set, a least-squares fitting algorithm is used to establish an objective standard for quantifying the degree of defects. This least-squares fitting algorithm starts from an ideal, defect-free, perfect contour model, such as an absolute straight line or a smooth standard arc, and finds a mathematical expression that best represents this ideal model. The actual extracted sub-pixel level contour point set, including defects, is compared with this ideal model, and the vertical distance of each actual contour point from its theoretical position in the ideal model is calculated. Through the least-squares principle, the deviations of all points are integrated, and a statistically optimal contour deviation value is finally calculated. This calculated contour deviation value is the core indicator for quantifying the degree of defects, i.e., the defect quantification index. The contour deviation value can be used directly as the defect quantification index, or it can be obtained after mapping or normalizing the contour deviation value. It reflects the total deviation of the defect from the product standard specifications in terms of geometric dimensions, such as the cumulative degree of unevenness, the severity of shape distortion, or the total volume of edge burrs.

[0031] Step 700: If the defect quantification index exceeds the preset warning threshold, the region corresponding to the sub-pixel level contour point set is marked as a defect region, and a detection result report is output. The defect region is highlighted in the image data of the detection result report through an overlay layer.

[0032] After obtaining the quantitative indicators of the defects, the calculated indicators are compared with pre-set warning thresholds based on strict process standards. If the quantitative indicators exceed the threshold, as defined by the limits of the product's acceptable range, an unacceptable manufacturing defect is confirmed, triggering a judgment and alarm mechanism. The physical area corresponding to the exceeding indicator is located within the previously acquired sub-pixel-level contour point set and marked as the defect area. Simultaneously, a structured inspection result report is automatically generated. This report records key information such as the defect type, size, location coordinates, and quantitative deviation value in data form. To enhance the visualization and intuitiveness of the inspection results, an overlay layer is generated within the report. This overlay layer uses striking colors or highlighted outlines to clearly and accurately delineate and highlight the marked defect areas on the original image data. The final output inspection result report achieves deep data and image fusion, enabling operators or downstream automated sorting systems to see the exact location, specific shape, and severity of defects on the data line, allowing for rapid decisions such as product rejection and process adjustments.

[0033] This invention provides a data cable defect detection method based on image recognition, offering an intelligent solution for real-time image detection of data cables on high-speed production lines. It addresses the challenge of accurately identifying minute defects in critical areas such as metal contacts and plastic seams under complex lighting conditions. For acquiring real-time data cable image data from high-speed production lines, an adaptive threshold algorithm dynamically segments the foreground and background based on local pixel distribution, highlighting key features to obtain preliminary segmented image data. Subsequently, a convolutional neural network is used to extract feature vectors of material differences and geometric shapes, enhancing reflective and low-contrast areas to obtain feature-enhanced image data. Overexposure is reduced by dynamically adjusting exposure parameters to generate light-corrected image data. Next, a region growing algorithm expands the candidate region for minute defects, combined with sharpening filtering to improve sub-pixel edge clarity. Defect contour deviation is quantified using least-squares fitting to obtain a defect quantification index. When the defect quantification index exceeds a warning threshold, the defect is automatically marked, and a detection report containing the defect quantification index and the defect area is generated. This invention significantly improves the detection accuracy and automated classification efficiency of minute defects under complex lighting conditions, optimizes production line quality control, and enables dynamic adjustment of imaging parameters based on the geometric features and material properties of different parts of the data cable on a high-speed production line to achieve sub-pixel level clear imaging.

[0034] In one embodiment, please refer to Figure 2 The step of processing the data line image data using an adaptive thresholding algorithm to separate the foreground and background regions to obtain preliminary segmented image data includes: Step 101: Based on the data line image data, an adaptive threshold algorithm is used to process the data to separate the foreground region and the background region, thereby obtaining segmented region image data. Step 102: Based on the segmented region image data, the Canny edge detection algorithm is used to extract the boundaries of metal contacts and plastic seams to obtain edge-enhanced image data; Step 103: If the metal contact boundary is intact in the edge enhancement image data, then based on the edge enhancement image data, the foreground region is expanded by morphological dilation operation to obtain expanded foreground image data; Step 104: Based on the extended foreground image data, the pixel distribution is grouped using the K-means clustering algorithm to obtain grouped image data; Step 105: If the plastic seam area in the grouped image data is continuous, the background area is filled by the region growing algorithm to obtain the background-filled image data. Step 106: Based on the background filling image data, integrate the metal contact and plastic seam information by equalizing the image data to obtain the preliminary segmentation image data.

[0035] First, an adaptive thresholding algorithm is applied to the acquired raw data cable image data. This algorithm dynamically generates a matching binarized threshold based on the grayscale characteristics of each local region of the image, effectively separating the data cable body as foreground and background even under uneven lighting or complex background conditions, thus obtaining segmented region image data. Next, after obtaining the segmented region image data, the Canny edge detection algorithm is used for processing. With its excellent noise resistance and accurate edge localization characteristics, the Canny edge detection algorithm is applied to extract the boundaries of two key structures from the data cable surface: the outline of metal contact points with specific reflective properties and the seam boundaries of the plastic shell. The final output is edge-enhanced image data, which clearly highlights the key structural boundaries.

[0036] Next, the boundaries of the metal contacts in the edge-enhanced image data are determined to be complete and continuous. If complete, a morphological dilation operation is initiated. This operation expands the boundaries of foreground regions such as metal contacts outward in a controlled and uniform manner, ensuring that the pixels in these foreground regions are fully covered and easily identifiable in subsequent processing, thus generating extended foreground image data. Subsequently, the pixels in the extended foreground image data are unsupervisedly grouped using the K-means clustering algorithm. This K-means clustering algorithm can automatically divide the extended foreground image data into several groups with similar attributes based on the natural distribution of pixels in feature spaces such as color, brightness, or texture. It can effectively distinguish regions of different materials in the data line image, such as metal, plastic, and possible shadows or stains, ultimately obtaining grouped image data with clearer structural information.

[0037] Next, the continuity of the plastic seam region in the grouped image data is determined. If the seam is confirmed to be continuous and uninterrupted, a region growing algorithm is triggered to intelligently fill the background region. This algorithm starts from a set seed point and gradually expands according to pixel similarity criteria, integrating the discrete background regions around the plastic seam into a connected, complete background block. The final output is background-filled image data, resulting in a more thorough separation between the foreground and background. Finally, the background-filled image data undergoes equalization processing to coordinate and integrate all effective information from the metal contact to the plastic seam, balancing the contrast and detail between different parts, eliminating inconsistencies that may have been introduced in the previous processing, and thus fusing to generate preliminary segmented image data with a clear target structure and a clean background.

[0038] For example, firstly, industrial cameras installed on a high-speed production line capture real-time image data of the data line at a rate of 30 frames per second. This image data is stored in RGB format with a resolution of 1920x1080 pixels and transmitted to a processing server via an Ethernet interface, ensuring that the data latency does not exceed 50 milliseconds, thus achieving real-time monitoring. Next, an adaptive thresholding algorithm is applied to these initial image data for processing, such as the NiBlack algorithm, whose calculation formula is... Where m(x,y) is the local mean, s(x,y) is the local standard deviation, and k takes a value of -0.2. The threshold is determined by calculating the local pixel distribution within a 15x15 pixel window. For example, for a window with a pixel mean m=150 and a standard deviation s=20, the threshold is T=150-0.2*20=146. Pixels with values ​​greater than 146 are set as foreground (255), and those less than or equal to 146 are set as background (0). This separates the foreground region, such as the main body of the data line, and the background region, such as the background of the assembly line, thus obtaining the preliminary segmented image data. In this process, the algorithm analyzes the histogram of pixel distribution and detects that the pixel values ​​of the metal contact area are usually concentrated in the range of 180-220, while the plastic seam is in the range of 120-160. By applying a threshold, these key parts are highlighted. For example, after applying a threshold to the metal contact, its edge sharpness is improved by 20%, which is convenient for the subsequent defect detection logic chain to be associated with the quality control module. If the pixel ratio of the contact area in the segmented image is less than 5%, an alarm is triggered to optimize production parameters.

[0039] This embodiment demonstrates a high degree of intelligent adaptiveness by dynamically adjusting the processing strategy based on intermediate results. Furthermore, it employs targeted processing techniques such as edge detection, morphological operations, clustering, and region growing for two significantly different components: metal contacts and plastic seams. Finally, through balanced integration, it achieves high-precision segmentation of multi-material and multi-structure data lines in complex backgrounds.

[0040] In one embodiment, please refer to Figure 3 The step of extracting feature vectors of material differences and geometric shape information based on the preliminary segmented image data, using a convolutional neural network, to obtain feature-enhanced image data includes: Step 201: Based on the preliminary segmented image data, a convolutional neural network is used to extract feature vectors of material differences and geometric shape information to obtain initial feature image data; Step 202: Based on the initial feature image data, determine the feature similarity between the feature vectors, and based on the feature similarity, use a clustering algorithm to group regions to obtain grouped region data; Step 203: If the pixel brightness value of the reflective area in the grouped region data exceeds a preset threshold, then based on the grouped region data, the brightness distribution is adjusted by histogram equalization to obtain equalized image data. Step 204: Based on the low-contrast region boundaries in the equalized image data, an edge detection algorithm is used to extract boundary lines to obtain boundary enhancement data; Step 205: If there is a closed geometric shape in the boundary enhancement data, then fill the gaps based on the boundary enhancement data through morphological operations to obtain filled image data; Step 206: Extract material differences from the filled image data; based on the material differences, calculate texture statistics using texture analysis methods to obtain a texture feature set. Step 207: Based on the texture feature set, a filter is used to remove noise to obtain the feature-enhanced image data.

[0041] First, a convolutional neural network is used to perform deep feature learning on the initially segmented image data. This network can automatically and efficiently abstract high-dimensional feature vectors representing material differences (such as the gloss and texture of metal and plastic) and geometric shapes (such as contour curvature and angles) from pixel data, generating initial feature image data containing semantic information. Based on the initial feature image data, the feature similarity between feature vectors is calculated, and a clustering algorithm is used to intelligently group the regions in the image. This clustering algorithm automatically groups pixels with similar material and geometric attributes into the same category based on the similarity of the feature vectors in the initial feature image data, thus dividing the initial feature image data into several sets of similar regions, forming grouped region data. This process effectively distinguishes different functional components and the background on the data line.

[0042] Next, an adaptive processing mechanism based on reflection conditions is introduced to evaluate whether the pixel brightness values ​​of the reflected areas identified in the grouped region data exceed a preset threshold. If they do, histogram equalization processing is triggered to remap the brightness distribution of the global or local areas, stretching the dynamic range of the image, thereby suppressing overexposure, enhancing shadow details, and obtaining equalized image data with a more uniform brightness distribution. Subsequently, for low-contrast areas that may exist in the equalized image, a high-sensitivity edge detection algorithm is used to locate and extract these blurry boundaries that are difficult to distinguish with the naked eye, obtaining clear and coherent boundary line information, i.e., boundary enhancement data, which makes hidden defects such as minor scratches or material boundaries visible.

[0043] Next, the system detects whether the lines in the boundary enhancement data form geometrically closed contours. If closed geometric shapes are detected in the boundary enhancement data, indicating that closure is confirmed, morphological operations are applied to fill any small holes or breaks within the closed contours, generating filled image data to ensure the integrity of potential defect areas. Texture patterns representing material differences are extracted from the filled image data, and texture analysis methods are used to calculate quantitative texture statistics describing texture characteristics, such as roughness, directionality, and contrast. These texture statistics are then aggregated into a texture feature set characterizing the surface state. Furthermore, filters are applied to the texture feature set to remove noise components that may be introduced by complex lighting changes, smoothing out random texture fluctuations caused by non-defects while preserving the true defect signals. The final output is feature-enhanced image data with significantly enhanced features.

[0044] For example, the initial segmentation of the input raw image data is performed first. The Otsu thresholding algorithm is used to automatically calculate the threshold. For instance, the pixel value range of 0-255 in the grayscale image is divided into foreground and background. By minimizing the intra-class variance, the threshold T=128 is obtained. Further edge detection, such as the Canny algorithm, is applied with parameters sigma=1.5 and low thresholds of 50 and high thresholds of 150 to extract contours, ensuring that the segmented region covers the object boundary. This step involves histogram analysis of pixel distribution, inferring that the background noise accounts for approximately 30%, thereby optimizing the segmentation accuracy and providing clean region input for subsequent feature extraction. Next, a convolutional neural network, such as the ResNet-50 model, is used to extract feature vectors. The input size is adjusted to 224x224 pixels. Forward propagation is used for calculation, where the first convolutional layer uses a 7x7 kernel, a stride of 2, and 64 filters to capture low-level edge features. The analysis process includes gradient descent optimization of the loss function, such as cross-entropy. The learning rate is set to 0.001. After 100 training iterations, the feature vector dimension is 2048, representing the deep semantics of the image. Convolutional neural networks (CNNs) capture material differences and geometric information through multiple convolutional operations, such as consecutive 3x3 convolutional layers, combined with residual connections. For example, the number of filters is progressively increased from the second to the fourth layer, reaching 512. When analyzing material differences, the texture covariance matrix is ​​calculated, leading to the conclusion that the contrast of reflective areas in metallic materials is improved by 20%. Geometric features are determined through curvature calculations, such as identifying edges with a curvature greater than 0.5, ensuring feature robustness. The resulting feature-enhanced image data is then obtained. Upsampling and feature fusion, such as using a decoder with a U-Net architecture, map the feature vectors back to their original size. The enhanced image pixel values ​​are normalized to the range of 0-1. The feature vectors specifically represent reflective and low-contrast areas under complex lighting conditions. For instance, a Gaussian filter with sigma=2 is used to smooth reflective spots, and the percentage of pixels with a gradient magnitude less than 10 in low-contrast areas is 15%.

[0045] In this embodiment, semantic grouping of regions is achieved through cluster analysis, and equalization and morphological filling processes are dynamically triggered based on grouping information and geometric attributes. Furthermore, by combining quantitative analysis of material texture with targeted filtering and denoising, environmental interference can be effectively removed and defect features can be highlighted.

[0046] In one embodiment, please refer to Figure 4 If the reflectance intensity of the feature vector in the enhanced image data exceeds a preset intensity threshold, the exposure parameters of the enhanced image data are dynamically adjusted to obtain light-corrected image data, including: Step 301: If the reflective intensity exceeds a preset intensity threshold, the adjustment process is initiated, and an adjustment trigger signal is obtained; Step 302: Based on the adjustment trigger signal, iteratively calculate the average pixel value, and use the gradient descent method to optimize the exposure parameters to obtain the optimized exposure parameters; Step 303: Apply the optimized exposure parameters to the feature-enhanced image data to reduce the pixel values ​​in overexposed areas and obtain preliminary corrected image data; Step 304: Based on the preliminary corrected image data, the Canny algorithm is used to perform edge detection to extract boundary information and obtain boundary-enhanced image data; Step 305: Based on the boundary enhancement image data, fuse the light correction details to obtain the light correction image data.

[0047] First, an intelligent judgment condition based on reflective intensity is established. When the reflective intensity in the feature-enhanced image data exceeds a preset intensity threshold based on optical characteristics, a dynamic adjustment process is automatically initiated, and an adjustment trigger signal is generated. Upon receiving the adjustment trigger signal, parameter optimization is performed. The overall brightness distribution is evaluated by iteratively calculating the average pixel value of the image, and the gradient descent optimization algorithm is used to finely search and adjust the exposure parameters, guided by the target brightness. This process involves multiple feedback loops, ultimately finding a set of optimal exposure parameters that most effectively suppress overexposure—the optimized exposure parameters.

[0048] Next, the calculated optimized exposure parameters are applied to the original feature-enhanced image data, performing a global or regional remapping to specifically reduce the pixel brightness values ​​of overexposed areas, restoring potentially lost details while preserving the visual quality of normally exposed areas as much as possible, thus generating preliminary corrected image data. Subsequently, the preliminary corrected image data undergoes quality verification and information enhancement. The Canny edge detection algorithm is used to further process the image. This algorithm can accurately capture edge information that appears after brightness adjustment, thereby extracting more complete and accurate boundary information to form boundary-enhanced image data.

[0049] Finally, an information fusion operation is performed to combine the light correction effect brought about by the optimized exposure parameters with the clear structural information contained in the boundary enhancement image data to generate light-corrected image data that has both suitable lighting conditions for analysis and retains the crucial edge and contour details.

[0050] For example, the original image data is first enhanced using a convolutional neural network. For instance, the Sobel operator is used to calculate gradients to highlight edge features. Specifically, a 3x3 convolutional kernel is applied to each pixel to calculate the horizontal and vertical gradients. Assuming the input image resolution is 1920x1080, the enhanced feature vector has a dimension of 512, including brightness distribution statistics. Next, a reflectivity index is extracted from the feature vector, such as calculating the average value of the brightness component in the vector. If its value exceeds a preset threshold of 0.85 (0.85), a dynamic adjustment mechanism is triggered. This judgment is based on the vector analysis process, where the proportion of pixels exceeding the brightness threshold of 255 in the vector is used for verification, ensuring logical continuity with the enhancement steps. This is because the enhanced edge features help accurately locate reflective areas, thus avoiding misjudging normal bright areas. When dynamically adjusting exposure parameters, an iterative optimization algorithm is used. For example, the exposure factor is initialized to 1.0, and then the average pixel value of the image is calculated iteratively. If the current average value is 220, which is greater than the target of 180, the exposure factor is reduced by 0.1 in each iteration, and then reapplied to the image matrix, multiplied by a coefficient, and normalized. The iteration stops when the average value drops below 175, usually requiring 3-5 iterations. This is used in intelligent photography systems to automatically correct night scene reflections to improve image quality. The final result is light-corrected image data; for example, the pixel value of overexposed areas in the output image is reduced from 250 to 150, ensuring overall dynamic range balance. The optimization effect is analyzed by comparing the PSNR with the original image. If the PSNR is greater than 30dB, the correction is considered successful.

[0051] In this embodiment, edge detection and information fusion form a closed loop of self-verification and quality assurance, ensuring that the light correction operation suppresses highlights while enhancing edge and structural information that has a significant impact on defect detection.

[0052] In one embodiment, please refer to Figure 5 The process of expanding the candidate region boundary using a region growing algorithm based on the region coordinates to cover potential cracks and pin defects, resulting in expanded defect region image data, includes: Step 401: Based on the region coordinates, using the pixel position indicated by the region coordinates as the seed point, a region growth algorithm is used to spread to neighboring pixels to cover potential cracks and pin defects, thereby obtaining initial defect region image data. Step 402: Based on the initial defect area image data, determine the pixel intensity distribution. If there are pixels in the pixel intensity distribution whose intensity exceeds a preset intensity threshold, then mark the corresponding initial defect area image data as a crack defect to obtain the classified defect type. Step 403: Based on the classified defect type, the crack defects are grouped using a clustering algorithm to determine the defect cluster set; Step 404: Calculate pixel connectivity components based on the defect cluster set. If the number of pixel connectivity components is greater than a preset threshold, merge adjacent components of the pixel connectivity components to obtain a unified defect region. Step 405: Based on the unified defect region, an edge detection algorithm is used to trace the contour lines to extract the boundary contours, thereby obtaining the extended defect region image data containing the defect boundary coordinates.

[0053] First, tiny candidate defect regions are located from the light-corrected image data, and their coordinate information is obtained to obtain the region coordinates corresponding to these tiny candidate defect regions. These region coordinates are used as the initial defect location, which serves as the starting point for defect analysis. Based on the determined initial defect location, the pixel position indicated by the initial defect location is used as a seed point. A region growing algorithm is then used to expand to neighboring pixels to cover potential cracks and pin defects. This region growing algorithm uses these initial locations as seed points and gradually expands and merges to surrounding neighboring pixels according to preset similarity criteria (such as pixel intensity, color, or texture features). This effectively connects scattered defect points to form a more complete defect region, thus obtaining the initial defect region image data and amplifying the visibility and analyzability of the defects.

[0054] Subsequently, a preliminary defect type judgment mechanism based on pixel intensity distribution was introduced. This mechanism analyzed the pixel intensity distribution characteristics within the initial defect area. If an abnormal area with pixel intensity exceeding a preset threshold was found, it was marked as a potential crack defect based on the characteristic that such high-intensity signals are often associated with crack defects. This achieved preliminary defect classification, resulting in defect type data with type labels. Further, a clustering algorithm was used to manage the classified defects. This algorithm automatically groups dispersed, similar-type defects into several defect clusters based on their similarity in spatial location, morphological features, or intensity distribution.

[0055] Next, these defect cluster sets are optimized by calculating the pixel connected components within each defect cluster set to quantify the discreteness of its internal structure. If a defect cluster set contains too many connected components, exceeding a preset threshold, it indicates that the defect may have been over-segmented into multiple discontinuous small segments. In this case, these adjacent connected components are intelligently merged to obtain a unified defect region that more accurately reflects the true extent of the defect. Finally, the unified defect region is precisely demarcated, and an edge detection algorithm is used to trace and extract the contour lines of the region, thereby obtaining extended defect region image data containing the defect boundary coordinates.

[0056] For example, the original image data is first processed through light correction, such as using a gamma correction algorithm to perform a non-linear transformation on the image pixel values, specifically changing the grayscale value of each pixel. Convert to ,in, A value of 1.2 is used to compensate for brightness deviations caused by uneven lighting. The analysis process includes calculating the overall average brightness of the image; if it is lower than a threshold of 100, correction is applied to ensure the accuracy of subsequent defect detection. This results in a more uniform brightness distribution in the corrected image data, making it easier to identify minute defects. Next, the coordinates of candidate regions for minute defects are obtained based on the corrected image. For example, the Canny edge detection algorithm is used with low thresholds of 50 and high thresholds of 150 to extract edge contours. Then, morphological dilation is performed to expand the edges using 3x3 structuring elements. The edge intensity distribution is analyzed; if it exceeds 1.5 times the average intensity, it is marked as a candidate, resulting in a list of rectangular regions with coordinates such as (120, 150) to (130, 160). These coordinates are used as seed points for subsequent algorithms, forming a process from correction to detection to improve defect localization accuracy. Then, a region growth algorithm is used to expand the boundary of the candidate region to cover potential cracks and pin defects. Starting from each seed point, such as (125, 155), the algorithm spreads to the neighboring pixels. Based on the similarity threshold, the gray level difference between the current pixel and the seed is calculated. If it is less than 20, the pixel is included in the region. The algorithm iterates until no new pixels are added. If the area of ​​the region before and after expansion increases by more than 30%, it is confirmed that the potential defects are covered, and the image data of the expanded defect region is obtained.

[0057] In this embodiment, a multi-level, intelligent analysis strategy is constructed. By integrating scattered signals into meaningful regions through region growing, and achieving early and rapid classification based on intensity features, the distribution patterns of complex defects are effectively identified through clustering and merging of connected components. This effectively solves the problem of multiple tiny adjacent defects being misjudged as isolated points or over-segmented.

[0058] In one embodiment, please refer to Figure 6 If the contrast within the extended defect region image data is lower than a preset contrast threshold, then based on the extended defect region image data, a sharpening filter is applied to enhance edge details to improve sub-pixel level sharpness, resulting in sharpened image data, including: Step 501: Based on the extended defect region image data, noise is removed through preprocessing filtering to obtain the first image data; Step 502: If the contrast of the first image data is lower than a preset contrast threshold, then based on the preset contrast threshold, the high-frequency components in the first image data are extracted by the Laplacian operator to obtain the second image data. Step 503: Based on the high-frequency components of the second image data, a sharpening filter is applied to enhance edge details to obtain the third image data; Step 504: Based on the third image data, the resolution is improved by a sub-pixel interpolation algorithm to obtain the fourth image data; Step 505: If the edge intensity of the fourth image data is lower than a preset boundary threshold, then based on the fourth image data, the high-frequency component is amplified through a high-pass filter to obtain the fifth image data; Step 506: Based on the fifth image data, the boundary features of the defect region are extracted using the Canny edge detection algorithm to obtain the sixth image data; Step 507: Based on the boundary information of the sixth image data, apply morphological operations to optimize the contour of the defect region to obtain the sharpened image data.

[0059] First, the image data of the extended defect region is preprocessed by applying a specific filtering algorithm to effectively suppress random noise in the image, thus obtaining the first image data. A contrast-based conditional judgment mechanism is introduced to evaluate the overall contrast level of the first image data. If the contrast of the first image data is lower than a preset contrast threshold, it indicates that the defect edges may be blurred, triggering an enhancement process. The Laplacian operator is used to extract high-frequency components from the image; these high-frequency components typically correspond to edge and detail information, thus obtaining second image data that highlights structural features.

[0060] Next, a sharpening filter is applied to the extracted high-frequency components to further enhance this high-frequency information, making the transition boundary between defects and the background clearer and sharper, thus presenting significantly enhanced edge details in the third image data. To overcome the limitations of the original image resolution, a sub-pixel interpolation algorithm is used to upsample the third image data, inserting virtual points between pixels to calculate more refined intensity values, thereby generating fourth image data with higher spatial resolution, improving the edge localization accuracy to the sub-pixel level.

[0061] Next, the edge strength of the fourth image data is determined. If the edge strength of the fourth image data fails to reach a preset boundary threshold, a high-pass filter is activated to process the fourth image data. This high-pass filter selectively amplifies high-frequency signals and suppresses low-frequency background, thereby significantly enhancing weak edges in the fifth image data. Subsequently, the Canny edge detection algorithm is used to process the fifth image data. This Canny edge detection algorithm can accurately identify and extract the complete boundary features of the defect region, generating a sixth image data with precise boundary positioning. Finally, based on the boundary information provided by the sixth image data, morphological operations are applied to post-optimize the contour of the defect region to smooth jagged edges and fill minor breaks, resulting in sharpened image data with a more complete, smooth, and accurate contour.

[0062] In this embodiment, the most suitable enhancement steps are dynamically triggered based on the real-time state of the image (such as contrast and edge strength), demonstrating a high degree of intelligence and adaptability. In particular, by combining the Laplacian operator, sharpening filtering, and subpixel interpolation, the detection accuracy is advanced from the pixel level to the subpixel level while effectively enhancing the edges, significantly improving the ability to identify blurry defects.

[0063] In one embodiment, please refer to Figure 7 The step of extracting a sub-pixel level contour point set from the sharpened image data, and calculating the contour deviation value based on the sub-pixel level contour point set through least squares fitting to quantify the degree of defect, thereby obtaining a defect quantification index, includes: Step 601: Based on the sub-pixel level contour point set, the Canny algorithm is used to perform edge detection to obtain the edge point set; Step 602: Based on the edge point set, calculate the deviation value by least squares fitting to obtain the deviation value sequence; Step 603: If there are points in the deviation value sequence that exceed a preset deviation threshold, then based on the deviation value sequence, the deviation distribution is analyzed by a linear regression algorithm to determine the distribution parameters. Step 604: Based on the distribution parameters, obtain the defect severity index, and normalize the defect severity index to obtain the defect quantification index.

[0064] First, based on the obtained sub-pixel level contour point set, the high-precision Canny algorithm is applied again for edge detection to verify the data on a higher precision basis, filter out possible interference points, and ensure that the final edge point set used for analysis has the highest accuracy and reliability.

[0065] After obtaining the edge point set, a least-squares fitting method is used for calculation. This method finds an ideal geometric contour, such as a straight line or arc, that best approximates all edge points and calculates the perpendicular distance between each actual edge point and this ideal contour, thereby generating a sequence of deviation values ​​reflecting the deviations at various points on the contour. This sequence of deviation values ​​reflects the degree of deformation at every minute location on the contour. Then, an intelligent judgment and analysis mechanism is introduced to scan the entire deviation value sequence and detect any outliers exceeding a preset deviation threshold. If an outlier exceeding the preset threshold is detected, indicating an exceedance of tolerance, a statistical analysis process is triggered. A linear regression algorithm is used to model the distribution trend of the deviation values, analyze their changing patterns, and thus determine key parameters that characterize the defect distribution, such as overall tilt, fluctuation amplitude, or concentrated abnormal areas.

[0066] Finally, based on the distribution parameters determined by the analysis, one or more defect severity indicators are generated to represent the overall defect level. To ensure good comparability and interpretability, these indicators are further normalized, mapping them to a standardized numerical range, and the final output is a quantitative defect index. This quantitative defect index reflects the severity of the defect.

[0067] This embodiment deeply integrates geometric measurement with statistical process analysis to form a multi-level defect quantification paradigm. Through regression analysis, it grasps the distribution pattern and trend of defects as a whole, thereby making a more comprehensive assessment of the degree of defects. Finally, through normalization processing, it generates standardized defect quantification indicators.

[0068] The image recognition-based data cable defect detection system provided by the present invention is described below. The image recognition-based data cable defect detection system described below can be referred to in correspondence with the image recognition-based data cable defect detection method described above.

[0069] This invention discloses a data cable defect detection system based on image recognition, comprising: The segmentation module is used to acquire real-time data line image data from the high-speed pipeline and process the data line image data through an adaptive threshold algorithm to separate the foreground region and the background region to obtain preliminary segmented image data. The feature enhancement module is used to extract feature vectors of material differences and geometric shape information based on the preliminary segmented image data using a convolutional neural network to obtain feature-enhanced image data. The light correction module is used to dynamically adjust the exposure parameters of the feature-enhanced image data if the reflectance intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, so as to obtain light-corrected image data. The defect region identification module is used to determine the candidate regions of minute defects and the region coordinates of the candidate regions based on the light-corrected image data, and to expand the boundary of the candidate regions using a region growth algorithm based on the region coordinates to cover potential cracks and pin defects, thereby obtaining expanded defect region image data. The sharpening module is used to apply sharpening filtering to enhance edge details and improve sub-pixel level clarity based on the extended defect region image data if the contrast within the region is lower than a preset contrast threshold, thereby obtaining sharpened image data. The defect index quantification module is used to extract a sub-pixel level contour point set from the sharpened image data, and calculate the contour deviation value based on the sub-pixel level contour point set by least squares fitting to quantify the degree of defect and obtain the defect quantification index. The report output module is used to mark the corresponding area of ​​the sub-pixel contour point set as a defect area if the defect quantification index exceeds a preset warning threshold, and output a detection result report. The defect area is highlighted in the image data of the detection result report through an overlay layer.

[0070] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image recognition-based data line defect detection method, characterized by, The computer is executed, comprising: Real-time data line image data is obtained from a high-speed pipeline, and the data line image data is processed by an adaptive threshold algorithm to separate foreground and background regions to obtain preliminary segmentation image data; Based on the preliminary segmentation image data, a convolutional neural network is used to extract feature vectors of material difference and geometric shape information to obtain feature-enhanced image data; If the reflection intensity of the feature vector in the feature-enhanced image data exceeds a preset intensity threshold, the exposure parameters of the feature-enhanced image data are dynamically adjusted to obtain light correction image data; Based on the light correction image data, a micro-defect candidate region and the region coordinates of the micro-defect candidate region are determined, and based on the region coordinates, a region growing algorithm is used to expand the candidate region boundary to cover potential cracks and needle defect to obtain expanded defect region image data; If the contrast within the region in the expanded defect region image data is lower than a preset contrast threshold, based on the expanded defect region image data, a sharpening filter is applied to enhance edge details to improve sub-pixel level clarity to obtain sharpening processing image data; Sub-pixel level contour point sets are extracted from the sharpening processing image data, and based on the sub-pixel level contour point sets, a least squares fitting calculation is performed to calculate a contour deviation value to quantify the defect degree to obtain a defect quantization index; If the defect quantization index exceeds a preset warning threshold, the region corresponding to the sub-pixel level contour point set is marked as a defect region, and a detection result report is output, wherein the defect region is highlighted in the image data of the detection result report through a superposition layer. 2.The image recognition-based data line defect detection method of claim 1, wherein, The preliminary segmentation image data is obtained by processing the data line image data by an adaptive threshold algorithm to separate foreground and background regions, comprising: Based on the data line image data, an adaptive threshold algorithm is used for processing to separate foreground and background regions to obtain segmentation region image data; Based on the segmentation region image data, a Canny edge detection algorithm is used to extract metal contact and plastic joint boundaries to obtain edge-enhanced image data; If the metal contact boundary in the edge-enhanced image data is complete, the edge-enhanced image data is used to expand the foreground region by a morphological dilation operation to obtain expanded foreground image data; Based on the expanded foreground image data, a K-means clustering algorithm is used for pixel distribution grouping to obtain grouped image data; If the plastic joint region in the grouped image data is continuous, the background region is filled by a region growing algorithm to obtain filled background image data; Based on the filled background image data, the metal contact and plastic joint information are integrated by equalization processing image data to obtain the preliminary segmentation image data. 3.The image recognition-based data line defect detection method of claim 1, wherein, The feature-enhanced image data is obtained by extracting feature vectors of material difference and geometric shape information based on the preliminary segmentation image data using a convolutional neural network, comprising: Based on the preliminary segmentation image data, a convolutional neural network is used to extract feature vectors of material difference and geometric shape information to obtain initial feature image data; Based on the initial feature image data, determine the feature similarity between the feature vectors, and based on the feature similarity, use a clustering algorithm to group regions to obtain grouped region data; If the pixel brightness value of the reflection region in the grouped region data exceeds the preset threshold value, then based on the grouped region data, adjust the brightness distribution using a histogram equalization method to obtain equalized image data; Based on the low-contrast region boundary in the equalized image data, use an edge detection algorithm to extract boundary lines to obtain boundary enhancement data; If there is a closed geometric shape in the boundary enhancement data, then based on the boundary enhancement data, fill the gaps through morphological operations to obtain filled image data; From the filled image data, extract material differences, based on the material differences, use a texture analysis method to calculate texture statistics to obtain a texture feature set; Based on the texture feature set, use a filter to remove noise to obtain the feature-enhanced image data. 4.The image recognition-based data line defect detection method of claim 1, wherein, If the feature vector in the feature-enhanced image data exceeds the preset intensity threshold, then dynamically adjust the exposure parameters of the feature-enhanced image data to obtain light correction image data, including: If the reflection intensity exceeds the preset intensity threshold, then start the adjustment process to obtain an adjustment trigger signal; Based on the adjustment trigger signal, iteratively calculate the average pixel value, and use a gradient descent method to optimize the exposure parameters to obtain optimized exposure parameters; Apply the optimized exposure parameters to the feature-enhanced image data to reduce the pixel value of the overexposed region to obtain preliminary correction image data; Based on the preliminary correction image data, use a Canny algorithm for edge detection to extract boundary information to obtain boundary-enhanced image data; Based on the boundary-enhanced image data, fuse the light correction details to obtain the light correction image data. 5.The image recognition-based data line defect detection method of claim 1, wherein, Based on the region coordinates, use a region growing algorithm to expand the candidate region boundary to cover potential cracks and stitch defects to obtain expanded defect region image data, including: Based on the region coordinates, use the pixel position indicated by the region coordinates as a seed point, and use a region growing algorithm to spread to the neighborhood pixels to cover potential cracks and stitch defects to obtain initial defect region image data; Based on the initial defect region image data, judge the pixel intensity distribution, if there is a pixel intensity exceeding the preset intensity threshold in the pixel intensity distribution, then mark the corresponding initial defect region image data as a crack defect to obtain a classified defect type; Based on the classified defect type, group the crack defects through a clustering algorithm to determine a defect cluster set; Based on the defect cluster set, calculate the pixel connected components, if the number of pixel connected components is greater than a preset number threshold, then merge adjacent components of the pixel connected components to obtain a unified defect region; Based on the unified defect region, use an edge detection algorithm to track the contour line to extract the boundary contour to obtain the expanded defect region image data containing the defect boundary coordinates. 6.The image recognition-based data line defect detection method of claim 1, wherein, If the contrast in the region in the extended defect region image data is lower than a preset contrast threshold, then based on the extended defect region image data, sharpening filter is applied to enhance edge details to improve sub-pixel level definition, to obtain sharpening processing image data, including: Based on the extended defect region image data, pre-processing filter is used to remove noise to obtain first image data; If the contrast of the first image data is lower than a preset contrast threshold, then based on the preset contrast threshold, Laplace operator is used to extract high-frequency components in the first image data to obtain second image data; Based on the high-frequency components of the second image data, sharpening filter is applied to enhance edge details to obtain third image data; Based on the third image data, sub-pixel interpolation algorithm is used to improve resolution to obtain fourth image data; If the edge intensity of the fourth image data is lower than a preset boundary threshold, then based on the fourth image data, high-pass filter is used to amplify high-frequency components to obtain fifth image data; Based on the fifth image data, Canny edge detection algorithm is used to extract boundary features of the defect region to obtain sixth image data; Based on the boundary information of the sixth image data, morphological operation is applied to optimize the profile of the defect region to obtain the sharpening image data. 7.The image recognition-based data line defect detection method of claim 1, wherein, The sub-pixel level profile point set is extracted from the sharpening processing image data, and based on the sub-pixel level profile point set, the least square fitting is used to calculate the profile deviation value to quantify the defect degree to obtain the defect quantization index, including: Based on the sub-pixel level profile point set, Canny algorithm is used for edge detection to obtain an edge point set; Based on the edge point set, least square fitting is used to calculate the deviation value to obtain a deviation value sequence; If there is a point in the deviation value sequence that exceeds a preset deviation threshold, then based on the deviation value sequence, linear regression algorithm is used to analyze the deviation distribution to determine the distribution parameters; Based on the distribution parameters, the defect degree index is obtained, and the defect degree index is normalized to obtain the defect quantization index.

8. An image recognition-based data line defect detection system, characterized by, Including: The segmentation module is used to obtain real-time data line image data from a high-speed pipeline, and the adaptive threshold algorithm is used to process the data line image data to separate the foreground region and the background region to obtain preliminary segmentation image data; The feature enhancement module is used to extract feature vectors of material differences and geometric shape information based on the preliminary segmentation image data using a convolutional neural network to obtain feature enhancement image data; The light correction module is used to dynamically adjust the exposure parameters of the feature enhancement image data if the reflection intensity of the feature vector in the feature enhancement image data exceeds a preset intensity threshold to obtain light correction image data; The defect region identification module is used to determine the micro defect candidate region and the region coordinates of the micro defect candidate region based on the light correction image data, and to expand the candidate region boundary based on the region coordinates using a region growing algorithm to cover potential cracks and needle defect to obtain extended defect region image data; a sharpening processing module configured to, if the contrast within the region in the extended defect region image data is lower than a preset contrast threshold, apply sharpening filtering to enhance edge details based on the extended defect region image data to improve sub-pixel level definition, to obtain sharpening processing image data; a defect index quantification module configured to extract a set of sub-pixel level contour points from the sharpening processing image data, and calculate a contour deviation value based on the set of sub-pixel level contour points by least square fitting to quantify a defect degree, to obtain a defect quantification index; a report output module configured to, if the defect quantification index exceeds a preset alert threshold, mark a corresponding region in the set of sub-pixel level contour points as a defect region, and output a detection result report, wherein the defect region is highlighted in the image data of the detection result report by a superimposition layer.