Automobile wire harness surface defect detection method and system based on visual intelligence
Patent Information
- Application Number
- CN202610317841.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-16
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-03-16
AI Technical Summary
(1)本发明通过对线束表面点云数据进行候选点选取与局部曲面平滑修正,优先保留最接近线束整体轴线的代表点,并利用邻域曲面拟合对点位进行投影校正,有效削弱了扫描噪声和局部毛刺对表面形态的干扰,使后续分析所基于的点云数据更加连续、稳定,从而提高了对真实表面形貌的还原精度。
Smart Images

Figure CN122222959B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial vision technology, and in particular to a method and system for detecting surface defects in automotive wiring harnesses based on visual intelligence. Background Technology
[0002] Industrial vision technology is a comprehensive technical system that utilizes image sensors, processing algorithms, and intelligent analysis methods to perform non-contact identification, measurement, and detection of objects in the production process. It is widely used in dimensional measurement, defect detection, assembly verification, barcode recognition, and other processes, possessing advantages such as high speed, accuracy, and high repeatability. It has become one of the indispensable core supporting technologies for achieving intelligent and automated manufacturing in modern industries.
[0003] In existing technologies, a common approach to defect identification combines two-dimensional image acquisition with threshold analysis. This method uses an industrial camera to image the wire harness surface from multiple angles, and filters out areas potentially containing defects by setting grayscale differences or contour edge sharpness as criteria. This method can identify macroscopic defects such as scratches and holes under ideal lighting and structural regularity conditions. However, when the wire harness is bent, twisted, or under non-uniform lighting, the mapping relationship between image grayscale changes and actual defects is disrupted, making it difficult to accurately reflect the true three-dimensional morphological features of the wire harness surface, thus leading to a significant increase in both false positive and false negative rates.
[0004] In summary, existing technologies cannot accurately reflect the true three-dimensional morphological features of the wire harness surface under load conditions. Summary of the Invention
[0005] This invention provides a visual intelligence-based method and system for detecting surface defects in automotive wiring harnesses, enabling accurate reflection of the true three-dimensional morphological features of the wiring harness surface under load conditions.
[0006] In a first aspect, to address the aforementioned technical problems, this invention provides a visual intelligence-based method for detecting surface defects in automotive wiring harnesses, comprising: Collect point cloud data of the wire harness surface; Candidate points are selected from the point cloud data of the wire harness surface to obtain a candidate point set of the wire harness surface. The candidate point set of the wire harness surface is then smoothed to obtain a smoothed surface point cloud representation. A local neighborhood point set is constructed based on the surface point cloud representation. The three-dimensional coordinates of all points in the local neighborhood point set are counted and a covariance matrix is constructed. The covariance matrix is then subjected to eigenvalue decomposition to obtain the orientation vector field. Based on the orientation vector field, a gradient tensor matrix is constructed and the gradient magnitude is calculated. The gradient magnitude is compared with a preset gradient threshold to obtain a preliminary defect candidate set. The preliminary defect candidate set is clustered to obtain initial clusters, and then filtered based on the initial clusters to obtain continuous hidden danger areas; Extract the feature vector of the continuous hidden danger area, determine the main direction axis, and extract the central axis point based on the main direction axis to obtain the candidate set of central axis points and calculate the inclination index; Based on the tilt index, a defect assessment is performed on the continuous hidden danger area to obtain a list of confirmed defects. Based on the confirmed defect list, perform defect projection rasterization visual mapping to obtain a surface defect mapping map; Based on the surface defect mapping map, neighboring points of high-risk areas are screened to obtain neighboring points, and based on the neighboring points, fine sampling is performed to obtain an accurate surface point cloud dataset.
[0007] Secondly, the present invention provides a vision-based intelligent automotive wiring harness surface defect detection system, comprising: The data acquisition module is used to collect point cloud data of the wire harness surface; The smoothing module is used to select candidate points from the point cloud data of the wire harness surface to obtain a set of candidate points on the wire harness surface, and to smooth and correct the set of candidate points on the wire harness surface to obtain a smoothed surface point cloud representation. The vector field module is used to construct a local neighborhood point set based on the surface point cloud representation, count the three-dimensional coordinates of all points in the local neighborhood point set and construct a covariance matrix, and perform eigenvalue decomposition on the covariance matrix to obtain the orientation vector field. The preliminary screening module is used to construct a gradient tensor matrix and calculate the gradient magnitude based on the orientation vector field, and compare the gradient magnitude with a preset gradient threshold to obtain a preliminary defect candidate set. The hidden danger area module is used to perform clustering processing on the preliminary defect candidate set to obtain initial clusters, and to filter based on the initial clusters to obtain continuous hidden danger areas; The tilt module is used to extract the feature vector of the continuous hidden danger area, determine the main direction axis, extract the central axis point based on the main direction axis, obtain the candidate set of central axis points, and calculate the tilt index. The defect list module is used to perform defect assessment on the continuous hidden danger area based on the tilt index, and obtain a confirmed defect list. The defect mapping module is used to perform defect projection rasterization visual mapping based on the confirmed defect list to obtain a surface defect mapping map. The precise dataset module is used to filter neighborhood points of high-risk areas based on the surface defect mapping map, obtain neighborhood points, and perform fine sampling based on the neighborhood points to obtain a precise surface point cloud dataset.
[0008] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention selects candidate points and performs local surface smoothing correction on the point cloud data of the wire harness surface, prioritizes the retention of representative points that are closest to the overall axis of the wire harness, and uses neighborhood surface fitting to perform projection correction on the point positions, which effectively reduces the interference of scanning noise and local burrs on the surface morphology, making the point cloud data on which the subsequent analysis is based more continuous and stable, thereby improving the accuracy of restoring the real surface morphology.
[0009] (2) Based on the smoothed surface point cloud, this invention constructs a local covariance matrix and extracts the corresponding orientation vector to form a vector field that reflects the spatial orientation change of the surface. Combined with gradient anomaly screening, it can directly identify abnormal areas that are inconsistent with normal curvature from the angle of spatial orientation change, avoid misjudgment caused by relying solely on height or grayscale changes, and significantly improve the reliability of identifying small protrusions and depressions.
[0010] (3) This invention integrates discrete anomaly points into a hidden danger area with spatial continuity by performing multidimensional feature similarity calculation and cluster extraction on preliminary defect candidate points, and further performs tilt analysis and volume assessment on the hidden danger area based on the main direction axis, effectively distinguishing normal wire bundle bending from the true defect morphology, reducing the false alarm rate caused by structural orientation changes, and improving the accuracy of defect judgment results.
[0011] (4) After generating the surface defect mapping map, the present invention only performs neighborhood point screening and fine sampling for high-risk areas. It triggers high-resolution acquisition commands through local curvature calculation and performs secondary directional scanning on key areas. While ensuring detection accuracy, it avoids over-sampling of the overall surface, thereby improving the ability to distinguish defect details while taking into account detection efficiency and data processing load. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the process for detecting surface defects in automotive wiring harnesses based on visual intelligence, provided in the first embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the automotive wiring harness surface defect detection system based on visual intelligence provided in the second embodiment of the present invention. Detailed Implementation
[0013] 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.
[0014] Reference Figure 1 The first embodiment of the present invention provides a method for detecting surface defects in automotive wiring harnesses based on visual intelligence, comprising the following steps: S11, collect point cloud data of the wire harness surface; S12, select candidate points from the point cloud data of the wire harness surface to obtain a set of candidate points on the wire harness surface, and smooth the set of candidate points on the wire harness surface to obtain a smoothed surface point cloud representation. S13, construct a local neighborhood point set based on the surface point cloud representation, count the three-dimensional coordinates of all points in the local neighborhood point set and construct a covariance matrix, and perform eigenvalue decomposition on the covariance matrix to obtain the orientation vector field. S14. Based on the orientation vector field, construct the gradient tensor matrix and calculate the gradient magnitude. Compare the gradient magnitude with a preset gradient threshold to obtain a preliminary defect candidate set. S15, perform clustering on the preliminary defect candidate set to obtain initial clusters, and filter according to the initial clusters to obtain continuous hidden danger areas; S16, extract the feature vector of the continuous hidden danger area, determine the main direction axis, and extract the central axis point based on the main direction axis to obtain the candidate set of central axis points and calculate the inclination index; S17. Based on the tilt index, a defect assessment is performed on the continuous hidden danger area to obtain a list of confirmed defects. S18. Based on the confirmed defect list, perform defect projection rasterization visual mapping to obtain a surface defect mapping map. S19. Based on the surface defect mapping map, neighboring points of high-risk areas are filtered to obtain neighboring points, and based on the neighboring points, fine sampling is performed to obtain an accurate surface point cloud dataset.
[0015] In step S11, point cloud data of the wire harness surface is acquired.
[0016] It is worth noting that a 3D laser scanner with a scanning accuracy of no less than 0.1 mm was used to perform a static scan of the wire bundle located on the conveyor belt. Before scanning, the wire bundle was ensured to be fixed on the rotating bracket. By slowly rotating the workpiece, the scanning head completely covered the entire surface of the wire bundle from multiple angles, avoiding point cloud omissions due to obstruction. During the scanning process, the scanning resolution was set to 6 points per millimeter, the laser pulse frequency was 50 kHz, and the multi-wire bundle stitching function was enabled to improve the completeness of long wire bundle acquisition. The acquired raw point cloud included the wire bundle body, the background clamping structure, and some environmental interference, with approximately 1.2 million points. To improve subsequent processing efficiency, the obtained raw data was stored as an ASCII format text file, with each point containing X, Y, and Z 3D coordinates and reflection intensity.
[0017] In step S12, candidate points are selected from the wire harness surface point cloud data to obtain a wire harness surface candidate point set, and the wire harness surface candidate point set is smoothed to obtain a smoothed surface point cloud representation, including: Calculate the shortest distance from each point in the point cloud data on the surface of the wire harness to the centroid axis of the entire wire harness, and select the point with the smallest shortest distance as the representative point to obtain the candidate point set on the surface of the wire harness; For each representative point in the candidate point set of the wire harness surface, a local neighborhood centered on the representative point is constructed, and a quadratic surface is fitted to the neighborhood points of the representative point under the local neighborhood to obtain a quadratic surface. Based on the quadratic surface, the representative point is projected and corrected to obtain a smoothed surface point cloud representation.
[0018] It is worth noting that the shortest distance from all nodes of the point cloud data on the wire harness surface to the centroidal axis of the entire wire harness is calculated, and the point with the smallest distance within that node is retained, thus obtaining the candidate point set on the wire harness surface. The Euclidean distance is calculated by connecting the point's position to the starting point of the wire harness's principal axis, and then calculating the magnitude of the cross product of this vector and the axis direction vector; this represents the shortest perpendicular distance from the point to the line. For example, for three points P1, P2, and P3 in a voxel, their distances to the axis are calculated to be 0.73 mm, 0.48 mm, and 1.06 mm respectively; therefore, P2 is selected as the representative point of this voxel.
[0019] It should be noted that before calculating the distance from the point to the axis, the overall central axis of the bundle must first be estimated. The original point cloud data of the bundle surface can be first clustered based on Euclidean distance to separate the bundle body from the background noise. The point cloud of the bundle body is sliced along its general direction, which can be preliminarily estimated by principal component analysis, and the centroid of each slice is calculated. Then, spline curves, such as B-spline fitting, are performed using these slice centroid points, and the resulting smooth curve is the overall centroid axis of the bundle. This axis reflects the spatial center trajectory of the bundle and is not sensitive to local bending and twisting.
[0020] Subsequently, for each representative point in the candidate point set on the wire harness surface, smoothing is performed to obtain a smoothed surface point cloud representation. Specifically, a target point is selected. The three-dimensional coordinates of this point are (10.00 mm, 5.00 mm, 3.00 mm). A neighborhood with a radius of 2.5 mm is constructed centered on this point, and five neighboring points are extracted, with spatial coordinates as follows: Point 1 (9.80, 5.00, 2.95), Point 2 (10.20, 5.00, 3.08), Point 3 (10.00, 4.80, 2.96), Point 4 (10.00, 5.20, 3.05), and Point 5 (10.10, 5.10, 3.06). To describe the relative positional relationships of these points locally, the horizontal, vertical, and elevation values of each neighboring point are subtracted from the center point's values. The corresponding values are used to construct a local coordinate system. In this coordinate system, the position of the center point is defined as... The local coordinates of the remaining neighboring points are (-0.20, 0.00, -0.05) for point 1, (0.20, 0.00, +0.08) for point 2, (0.00, -0.20, -0.04) for point 3, (0.00, 0.20, +0.05) for point 4, and (0.10, 0.10, +0.06) for point 5.
[0021] Subsequently, a quadratic surface is constructed using a fitting function combined with these local coordinates. The expression for the fitting function is as follows: ,in, and These are the x and y coordinates of the local coordinate system. For local height, and These primarily characterize the curvature of the local surface in the x and y directions, and are related to the principal curvatures. Characterizes the degree of distortion of the surface. Let the first slope of the center point be along the x-direction. This represents the first-order slope of the surface along the y-direction. This is the height offset of the surface at the origin. This is achieved by adjusting the local coordinates... and Substitute the coordinates into the above fitting function, and combine them with the local coordinates. The values were obtained by solving for the six parameters using the least squares method. In this example, the key parameters obtained were the first-order horizontal slope d = 0.42, the first-order vertical slope e = -0.35, and the constant term f = 0.01.
[0022] Based on this result, the normal direction at that point is further constructed. Specifically, this is done using the slope value... and The initial normal vector (-0.42, 0.35, 1.0) is synthesized by treating the horizontal and vertical tilt components respectively, and then normalized by dividing the original normal vector by its own magnitude. The normalized unit normal vector is then (-0.3685, 0.3071, 0.8774). Based on the offset value f = 0.01 mm of the fitted surface at this point, the vertical offset in the normal direction is calculated to be 0.008774 mm. Finally, the original point... After retreating that distance along the normal direction, a new smoothing point is obtained, with coordinates (10.0032, 4.9973, 2.9923) mm.
[0023] In step S13, a local neighborhood point set is constructed based on the surface point cloud representation. The three-dimensional coordinates of all points in the local neighborhood point set are statistically analyzed, and a covariance matrix is constructed. Then, the covariance matrix is subjected to eigenvalue decomposition to obtain the orientation vector field, including: Take any point in the smoothed surface point cloud representation as the center point, construct a local neighborhood point set with the center point as the sphere center, and count the three-dimensional coordinates of all points in the local neighborhood point set. Use the three-dimensional coordinates to calculate the geometric center position of the local neighborhood point set, and perform centering processing on the coordinates of each neighborhood point based on the geometric center position to obtain the relative position offset of each neighborhood point. A three-dimensional covariance matrix is constructed based on the relative position offset, and eigenvalue decomposition is performed on the covariance matrix to obtain the corresponding eigenvalues and eigenvectors. The eigenvector with the smallest eigenvalue among the eigenvalues is selected as the orientation vector field.
[0024] It is worth noting that the smoothed surface point cloud represents any coordinate point within it. A local neighborhood is established centered on this point, and all neighboring points within a spherical area with a radius of 3.0 mm are selected to form the neighborhood point set, denoted as . The three-dimensional coordinates of each neighboring point are: There are a total of N points. First, calculate the geometric center coordinates of these points, i.e. Then, the coordinates of each point are subtracted from the geometric center to obtain the relative position offset. Based on this, a three-dimensional covariance matrix is constructed. It is a symmetric 3×3 real matrix, composed of the following components. For example, taking the neighborhood of a given point as an example, the neighborhood contains 38 points, and the calculated covariance matrix is: Performing standard eigenvalue decomposition on the covariance matrix yields three eigenvalues: =0.028、 =0.010、 =0.0043, the corresponding three feature vectors are as follows: Corresponding to (0.65, 0.72, -0.25), Corresponding to (0.70, -0.68, -0.22), Corresponding to (0.19, -0.12, 0.974). Select the smallest eigenvalue. The eigenvector (0.19, -0.12, 0.974) corresponding to =0.0043 is used as the orientation vector field of that point.
[0025] In step S14, based on the orientation vector field, a gradient tensor matrix is constructed and the gradient magnitude is calculated. The gradient magnitude is then compared with a preset gradient threshold to obtain a preliminary defect candidate set, including: Obtain each coordinate point and three-dimensional unit direction vector in the orientation vector field, select any coordinate point as the center point, construct a spherical neighborhood with the center point as the sphere center, extract the direction vector of all points in the spherical neighborhood, and perform partial derivative estimation based on the direction vector to obtain the direction derivative. Sort the direction derivatives in descending order to obtain the gradient tensor matrix. The gradient tensor matrix is calculated using the Frobenius norm to obtain the gradient magnitude. When the gradient magnitude is greater than a preset gradient threshold, the node with the gradient magnitude is included in the preliminary defect candidate set.
[0026] It is worth noting that, to obtain all coordinate points and three-dimensional unit direction vectors of the orientation vector field, an arbitrary point is selected as the center and combined with a spherical neighborhood with a radius of 3 mm, and all direction vectors within the spherical neighborhood are counted.
[0027] Subsequently, using the center point as a reference, the rate of change of the direction vectors in the neighborhood is calculated along the three coordinate axes based on their spatial distribution. Specifically, along the x-axis, the difference between the two nearest neighboring points to the center point is extracted, and divided by the coordinate distance between these two points in the x-axis to obtain the directional derivative of the center point in the x-axis. The partial derivatives in the y-axis and z-axis are estimated using the same method. The partial derivatives in the three directions are then arranged in descending order to construct a 3x3 gradient tensor matrix. In this matrix, each column corresponds to the three spatial directions: x, y, and z.
[0028] It is worth noting that the gradient tensor matrix is constructed using local surface fitting based on the moving least squares method to estimate the directional derivative. Specifically, for the center point and points in its spherical neighborhood, the three-dimensional coordinates and orientation vector components of the neighborhood points are first used as observation data. To estimate the directional derivative of the orientation vector component at the center point in the corresponding direction, a first- or second-order polynomial is used to locally fit the functional relationship between the orientation vector component and the coordinate points. The polynomial coefficients are obtained by solving the least squares problem, and finally all partial derivatives are arranged into a 3x3 gradient tensor matrix. This method has better robustness to discrete point clouds.
[0029] For example, a center point C is selected with coordinates (10.0, 5.0, 3.0). Several neighboring points are obtained within a spherical neighborhood with a radius of 3 mm. Assume that the two nearest neighboring points to the center point in the positive and negative x-axis directions are respectively... (10.5, 5.0, 3.0) and The coordinates (9.6, 5.0, 3.0) have x-component values of 0.42 and 0.28 respectively. Therefore, the rate of change in the x-direction is calculated as (0.42-0.28) / (10.5-9.6) = 0.156. Using the same method, the rate of change in the y-axis is 0.09, and in the z-axis it is 0.21. The rates of change in these three directions are then arranged according to their magnitude and filled into the corresponding x, y, and z columns, thus constructing the 3x3 gradient tensor matrix corresponding to the center point.
[0030] Next, the gradient tensor matrix is processed using the Frobenius norm to obtain a quantized gradient magnitude. For example, if a gradient tensor matrix is G = ... .
[0031] The gradient magnitude at that point can then be calculated using the Frobenius norm. ≈0.60.
[0032] The preset gradient threshold is 0.45. If the calculated gradient magnitude is greater than the preset gradient threshold, the point will be included in the preliminary defect candidate set.
[0033] The preset gradient threshold is set based on historical point cloud data statistics. After statistically analyzing the gradient magnitude values of over 100,000 coordinate points in the normal area of the wire harness surface, the data shows an approximate normal distribution, with a mean of 0.285 and a standard deviation of 0.082. Following this normal distribution, the threshold is set by adding twice the standard deviation to the mean. .
[0034] In step S15, the preliminary defect candidate set is clustered to obtain initial clusters, and then filtered based on the initial clusters to obtain continuous hidden danger areas, including: For any two points in the preliminary defect candidate set, calculate the three-dimensional spatial Euclidean distance and the orientation vector cosine similarity, and perform maximum and minimum normalization on the three-dimensional spatial Euclidean distance and the orientation vector cosine similarity to generate normalized spatial distance and normalized directional difference index. The normalized spatial distance and normalized directional difference index are fused using preset weighting parameters to obtain the similarity score between point pairs, and the similarity scores are arranged in rows and columns to construct a multidimensional feature similarity matrix; Based on the multidimensional feature similarity matrix, clustering is performed using a preset similarity threshold to obtain preliminary clusters; Based on a preset minimum cluster size threshold, noise cluster point sets are removed from the initial clusters to obtain continuous hidden danger areas.
[0035] Next, two parameters are calculated for the candidate points: spatial Euclidean distance, obtained by summing the square differences between the three-dimensional coordinates and taking the square root; and cosine similarity, obtained by dot product of the two unit orientation vectors to obtain the cosine of the angle between them. Then, the minimum-maximum normalization method is used to standardize the spatial Euclidean distance between all point pairs, that is, subtracting the minimum distance in the candidate set from each distance value and dividing by the difference between the maximum and minimum distances to obtain the normalized spatial Euclidean distance. The cosine similarity of the orientation vectors is also normalized using minimum-maximum normalization to obtain the normalized cosine similarity. Then, according to the set weight parameters, the two normalized indices are weighted and summed to obtain the similarity score. For example, if the normalized spatial distance of a pair of points is 0.325, the orientation difference is 0.075, the distance weight is set to 0.6, and the orientation difference weight is set to 0.4, then its similarity score is 0.225.
[0036] The weighting of distance and orientation difference was based on correlation analysis results from historical data. By statistically analyzing a large number of candidate points in labeled defect areas, the Pearson correlation coefficient between the spatial Euclidean distance and similarity labels was calculated. The results showed that the correlation coefficient between distance and similarity score was approximately 0.80, while the correlation coefficient between orientation difference and similarity score was approximately 0.70. Since the correlations were close, but spatial distance had a slightly higher impact on defect distribution, a slightly higher weight (0.6) was assigned to the distance term during weighted fusion, while the weight of the orientation difference term was set to 0.4. By arranging the similarity scores between all candidate points pairwise and generating a two-dimensional matrix corresponding to rows and columns, a complete multidimensional feature similarity matrix could be constructed.
[0037] Subsequently, all neighboring points that meet the similarity threshold requirements are found in the multidimensional feature similarity matrix and included in the initial cluster. For each newly added point, this operation is repeated to continue searching for its neighboring similar points, continuously expanding the clustering range until no more points meet the conditions.
[0038] After initial clustering, the number of points within each preliminary cluster is counted. If the number of points in a cluster is lower than the set minimum cluster size threshold, the cluster is considered a set of discrete noise points and is discarded. For example, in a specific processing step, the minimum cluster size is set to 30 points. The candidate set is clustered into three clusters with 87, 19, and 11 points respectively. According to the rules, only the cluster with 87 points is retained, and the other two are considered isolated outliers.
[0039] The remaining clusters represent the continuous hazard areas. Within each cluster, attributes such as centroid coordinates, bounding box size, principal direction vector, and average depth deviation are extracted to describe the spatial morphological characteristics of the defect group. For example, a cluster with its centroid located at (152.3, -47.6, 8.9) has dimensions of 48 mm, 22 mm, and 2.4 mm (length, width, and height), an average depth deviation of 1.05 mm, and exhibits a strip-like convex trend.
[0040] The selection of the preset similarity threshold is based on the observation of the average similarity score distribution of point pairs in known continuous defect areas, and the 95th percentile is set as the judgment threshold. For example, a value of 0.35 means that only when the weighted similarity score between two points is less than 0.35 is it considered that they are sufficiently similar and can be clustered into one class.
[0041] The preset minimum cluster size threshold was determined based on a comparative analysis of a large number of normal and defective samples. By statistically analyzing the distribution of the number of effective points covered by different types of defects in the point cloud, it was found that meaningful continuous defect regions contain more than 30 effective points under normal scanning accuracy, while clusters with fewer than this number of points mostly show a scattered distribution or a discontinuous trend.
[0042] In step S16, feature vectors of the continuous hidden danger area are extracted, the main direction axis is determined, and the central axis points are extracted based on the main direction axis to obtain a candidate set of central axis points and calculate the inclination index, including: Obtain the three-dimensional spatial coordinates of all points in the continuous hazard area; Based on the principal component analysis method, the three-dimensional coordinates are feature extracted, the covariance matrix is constructed and eigenvalue decomposition is performed, and the eigenvector with the largest eigenvalue is selected as the principal direction axis of the continuous hidden danger area. Along the main directional axis, the continuous hidden danger area is divided into multiple parallel cross-sections, and the boundary point set and centroid coordinates are extracted in each parallel cross-section. The Euclidean distance from each point in the boundary point set to the centroid coordinates is calculated, and the internal points are filtered based on the Euclidean distance to obtain the central axis point candidate set. The candidate set of central axis points is connected based on the principle of minimum connection distance to form a continuous skeleton path, and equidistant point columns on the path are extracted according to a set interval. Based on the equidistant point array, the tangential vector of each point and the rate of change of direction between adjacent points are calculated, and the rate of change of direction is statistically averaged over the entire path range to obtain the inclination index of the continuous hidden danger area.
[0043] It is worth noting that, to determine the principal direction axis of the continuous hazard area, principal component analysis (PCA) is used to extract features from the 3D coordinates of all points within the area. By calculating the covariance matrix and performing eigenvalue decomposition, principal component vectors representing the distribution direction of the point cloud are obtained. The eigenvector corresponding to the largest eigenvalue is taken as the first principal axis direction. For example, suppose the continuous hazard area contains a total of 120 3D coordinate points. First, mean-reduction processing is performed on these coordinate points to construct... The coordinate matrix is calculated, and its covariance matrix is then computed. Eigenvalue decomposition is then performed on the covariance matrix to obtain three eigenvalues and their corresponding eigenvectors. The direction of the eigenvector corresponding to the largest eigenvalue represents the main expansion direction of the point cloud in that region.
[0044] After determining the main direction, the entire continuous hazard area is divided into multiple cross-sections along the direction, with a layer thickness of 1 mm. In each cross-section, a convex hull algorithm, such as the Graham scan, or a boundary extraction algorithm suitable for non-convex shapes, such as the Alpha Shapes algorithm, is used to extract the boundary point set of the point cloud for that layer, and the centroid position of that layer is calculated. Then, the distance from each point to the centroid is calculated, retaining only internal points whose distance is less than 70% of the maximum boundary radius of the current layer, and discarding peripheral boundary points to obtain a candidate set of central axis points. The Graham scan method involves scanning a set of discrete points on a plane sequentially after sorting them by polar angle, discarding points that form an interior angle greater than 180°. For example, if a cross-section contains 23 points, the convex hull algorithm identifies 9 boundary points, and the centroid coordinates of all points in that layer are calculated. The Euclidean distance from each point to the centroid is then calculated, resulting in a maximum boundary radius of 6.3 mm. An internal point retention threshold of 70% is set, meaning only points with a distance less than 70% of the centroid are retained. Points in millimeters are used to eliminate the remaining peripheral points, and finally, the points in the dense central region are retained as the candidate set of central axis points for this layer.
[0045] The threshold for retaining internal points was set based on statistical analysis of cross-sections of a large number of labeled defect areas. By calculating the Euclidean distance from all points to the centroid in each layer of multiple consecutive defect areas, the distribution characteristics were fitted. The results showed that the average distance value was approximately 3.1 mm, and the standard deviation was approximately 0.75 mm. Based on the normal distribution, the mean plus twice the standard deviation was taken as the upper limit of the distance, i.e., 3.1 + 2 × 0.75 = 4.6 mm. In the corresponding samples, the average maximum boundary radius of each layer was approximately 6.5 mm, thus the ratio of the retained distance to the maximum radius was 4.6 / 6.5 ≈ 0.71. This ratio was finally rounded to 70% and used as the internal point retention threshold.
[0046] Subsequently, all the central axis points in the candidate set are connected in spatial order, and a continuous skeleton path is formed using the principle of minimum connection distance. For example, suppose a candidate set of central axis points contains 8 three-dimensional coordinate points. First, any one of these points is selected as the starting point, and its Euclidean distance to the remaining points in the set is calculated. The point with the smallest distance is found and used as the next connection point. Then, with this point as the current point, the above process is repeated, continuing to find the point with the smallest Euclidean distance from the remaining unconnected points, and so on, until all points are connected, forming a non-repeating, approximately shortest continuous skeleton path sequence.
[0047] On a continuous skeleton path sequence, equidistant point columns are extracted at 1-m intervals, and the tangential vector between each pair of adjacent points is calculated. Furthermore, the angle between adjacent tangential vectors is calculated to obtain the rate of change of direction per unit length of the path. Finally, the cumulative average of all rate of change of direction along the path is used to obtain the inclination index of the continuous hazard area. For example, after skeleton extraction and sampling, a continuous skeleton path of approximately 42 mm in length is obtained for a certain continuous hazard area. Along this path, 43 equidistant points are extracted at 1-m intervals, forming 42 pairs of adjacent points. For each pair, its tangential vector is calculated; for example, the coordinates of the two points in the 5th pair are... (12.3,45.6,7.2) and (13.2, 45.8, 7.5), corresponding to the tangential vector is = - =(0.9,0.2,0.3), which becomes a unit vector after normalization. Then, it is compared with adjacent segments. Calculate the cosine of the angle by multiplying the dot product, and then the arccosine to obtain the angle itself. If the angle is 3.6 degrees, the rate of change of direction per unit length is 3.6° / mm. Average the rate of change of direction of all 42 segments. If the result is 2.4° / mm, this is the inclination index of the region.
[0048] In step S17, based on the tilt index, a defect assessment is performed on the continuous hidden danger area to obtain a confirmed defect list, including: When the tilt index of the continuous hidden danger area is greater than the preset tilt threshold, voxelization processing is performed on the continuous hidden danger area to divide the continuous hidden danger area into cubic voxel units of fixed size, and the number of voxels occupied by the point cloud is counted to calculate the geometric volume of the entity. If the geometric volume of the entity is greater than a preset volume threshold, the continuous potential hazard area is determined to be a real defect and included in the list of confirmed defects. If the geometric volume of the entity is not greater than the preset volume threshold, then the continuous potential hazard area is determined to be a non-defect area and is removed.
[0049] It is worth noting that when the tilt index exceeds a preset tilt threshold, a voxelization method is used to divide the region corresponding to the tilt index into cubic voxel units of fixed size. For example, the voxel side length is set to 0.5 mm, and the number of voxels occupied by the point cloud is counted and summed to obtain the solid geometric volume of the region. For example, if a continuous region has a total of 68 occupied voxels after voxelization, its geometric volume is 68 × 0.125 = 8.5 cubic millimeters.
[0050] If the geometric volume of the entity is greater than the preset volume threshold, the region is considered to have sufficient solidity in terms of shape. Combined with the aforementioned tilt index, it is confirmed as a real defect and included in the list of confirmed defects. Otherwise, if the volume of the region is not greater than the preset volume threshold to form a structure with a significantly convex shape, it may be an error caused by local disturbance or abnormal edge curvature, and it will not be confirmed as a defect.
[0051] The preset tilt threshold is based on the extraction of skeleton paths and the calculation of direction change rate of several real protruding defect areas. The results show that the tilt index has a mean of 1.6° / mm and a standard deviation of 0.4° / mm. Therefore, the mean plus twice the standard deviation, i.e., 1.6 + 0.8 = 2.4° / mm, is selected as the preset tilt threshold.
[0052] Similarly, the preset volume threshold is determined by voxelizing the confirmed defect areas and counting the number of occupied voxels, resulting in a geometric volume distribution within a range of 5.1 mm³ and 0.45 mm³. Therefore, the mean plus twice the standard deviation is chosen, i.e., 5.1 + 0.9 = 6.0 mm³.
[0053] In step S18, based on the confirmed defect list, a defect projection rasterization visual mapping is performed to obtain a surface defect mapping map, including: Extract the three-dimensional coordinates of the centroid and the maximum depth value of each confirmed defect in the confirmed defect list to construct a two-dimensional point set; The two-dimensional point set is projected onto a two-dimensional plane and divided into several grid cells. The grid cells are then labeled with risk levels according to a preset depth level threshold to generate a surface defect mapping map.
[0054] It is worth noting that the three-dimensional information of each identified defect is extracted from the list of confirmed defects. The three-dimensional information includes the three-dimensional spatial coordinates of the centroid and the maximum depth value.
[0055] Then, a two-dimensional point set is constructed using the three-dimensional information. Specifically, the coordinates of each centroid are preserved along the X and Y axes, and the maximum depth value is used as the Z axis of that centroid coordinate.
[0056] Next, a two-dimensional mapping network is constructed based on the two-dimensional point set. Specifically, the entire projection plane is divided into several square grid cells with a side length of 1.0 mm, and each two-dimensional projection point is assigned to a corresponding grid cell according to its coordinates. For each projection point, its position number in the grid cell is calculated based on its two-dimensional coordinates. and Let x and y represent the minimum x and y coordinates of the lower left corner of the projection plane, respectively. Then, the grid cell number to which a projection point belongs is _____. The grid cell number it belongs to is in, This represents the grid side length. For example, if the x-coordinate range of the two-dimensional projection plane is [10.0mm, 20.0mm] and the y-coordinate range is [5.0mm, 15.0mm], and the coordinates of a certain projection point are (x=12.3mm, y=8.7mm), then its corresponding grid number is... Therefore, this point is assigned to cell (2,3) in the two-dimensional grid matrix.
[0057] After constructing the two-dimensional mapping network, the intensity value of each grid cell in each network is classified into hazard levels to obtain a surface defect mapping map. Specifically, the depth classification threshold is set to three levels: depths less than 1.5 mm are defined as low-level hazards and marked in green; depths between 1.5 mm and 2.5 mm are defined as medium-level hazards and marked in yellow; and depths exceeding 2.5 mm are defined as high-level hazards and marked in red.
[0058] The preset depth level threshold is set based on the statistical distribution results of historical actual inspection data. Through depth measurement and analysis of multiple confirmed defect areas, it was found that the maximum depth value exhibits obvious layering characteristics. Areas with a depth of less than 1.5 mm usually correspond to slight surface undulations caused by the process and do not affect functional safety. Areas with a depth between 1.5 and 2.5 mm mostly show mild to moderate bulges or cracks, which have potential risks. When the depth exceeds 2.5 mm, it involves serious protrusions, indentations, or signs of fracture, which require priority treatment.
[0059] In step S19, based on the surface defect mapping map, neighboring points of high-risk areas are filtered to obtain neighboring points, and based on these neighboring points, fine sampling is performed to obtain a precise surface point cloud dataset, including: All grid cells marked as high-risk levels are selected from the surface defect mapping map, and local point cloud regions are extracted from the wire harness surface point cloud data according to the spatial location of the grid cells. A spatial neighborhood with a preset radius is constructed based on the center point of the local point cloud region, and a set of neighborhood points is obtained by filtering the spatial neighborhood. Local surface fitting is then performed on the set of neighborhood points to estimate the average curvature. When the average curvature is greater than a preset mutation threshold, a high-resolution acquisition command is generated, and a secondary scan is performed on the corresponding area according to the high-resolution acquisition command to obtain an accurate surface point cloud dataset.
[0060] It's worth noting that all grid cells marked in red were selected from the surface defect mapping map. For each red cell, its spatial location in the original wire harness surface point cloud data was extracted. Then, a neighborhood with a radius of 3 mm was selected in the original wire harness surface point cloud data, centered on that location. Points satisfying a Euclidean distance of less than 3 mm to the center point were selected from the point cloud based on distance criteria, assuming a final result of 36 neighborhood points.
[0061] Next, these 36 neighborhood points will be uniformly transformed into a local coordinate system. Specifically, for each neighborhood point ( , , Subtract the center point coordinates from each coordinate to obtain the relative coordinates. , , Subsequently, surface fitting is performed on the local surface using these relative coordinate points. A quadratic surface form is selected. Substituting the x′ and y′ coordinates of each neighboring point into this expression, and using the corresponding z′ as the observed value, an overdetermined system of equations is constructed. The least squares method is then used to derive the equations from the six coefficients. , , , , and The solution process aims to minimize the squared difference between the actual height z′ of all neighboring points and the predicted height of the fitted surface, thereby obtaining the optimal fitted surface.
[0062] Once the parameters are determined, the geometric curvature at this representative point can be further estimated. For a quadratic surface, the magnitude of its principal curvature at the local center point is mainly determined by... and Two second-order terms determine the curvature. Using the standard deviation estimation method, these two parameters are extracted, and the curvature values in the two principal directions are calculated separately. The arithmetic mean of the two values is then taken to obtain the average curvature at that point. For example, if m=0.38 and n=0.27 are estimated using the least squares method, then the transverse principal curvature... Longitudinal principal curvature Taking the average value, the average curvature at that point is (0.76 + 0.54) / 2 = 0.65. .
[0063] If the average curvature is greater than the preset abrupt change threshold of 0.60 This generates a high-resolution acquisition command, which specifically includes adjusting two parameters: the laser pulse emission frequency and the spatial step size. For example, under normal scanning conditions, the pulse frequency is set to 50 kHz and the step size is 0.8 mm, while under the high-resolution acquisition command, the pulse frequency is increased to 120 kHz and the step size is reduced to 0.25 mm.
[0064] Subsequently, the laser scanning device performs a secondary scan of the identified area according to the updated acquisition instructions. The scanning trajectory no longer follows the traditional straight grid, but instead increases the number of detours and point density in areas with significant surface variations. For example, for a red grid area with pits, the number of point clouds acquired by the system increased dramatically from 180 to 2200, and the average point spacing decreased from 1.1 mm to 0.3 mm. After acquisition, the newly acquired high-density point cloud data is output as precise surface point cloud data, ensuring the accuracy and continuity of the information.
[0065] Precise surface point cloud data not only improves spatial resolution but also corrects errors present in the initial scan, providing a reliable basis for subsequent defect assessment and production decisions. The overall process forms a closed-loop processing path from hazard identification to adaptive sampling and data updating, effectively enhancing the detection depth and accuracy of complex areas.
[0066] The preset mutation threshold was established based on historical actual test samples, and curvature measurements were performed on multiple representative wire harness surface regions. These regions covered typical states of surface smoothness, slight undulation, moderate fluctuation, and severe mutation. After collecting a large amount of average curvature data from representative points, statistics showed that the data followed a normal distribution. The mean of the average curvature values from these samples was approximately 0.40. The standard deviation is approximately 0.10. The preset mutation threshold is calculated based on the mean plus two standard deviations, i.e., 0.4 + 2 × 0.10 = 0.60. .
[0067] It should be noted that the specific values of the preset thresholds involved in this invention, such as gradient threshold, similarity threshold, tilt threshold, volume threshold, curvature change threshold, and fusion weights, such as spatial distance and directional difference weights, can be determined through an offline calibration process. This process is based on a calibration dataset consisting of wire harness samples in known states. This dataset should contain a certain number, for example, no less than 50 qualified wire harness samples with no surface defects, in point cloud data under different bending and torsion states; as well as point cloud data of known defective wire harness samples with various typical defects, such as scratches, protrusions, dents, and indentations. The defect locations and types have been precisely defined manually or by high-precision measuring equipment.
[0068] Specifically, using equipment and parameters consistent with the method of this invention, point cloud acquisition is performed on all samples in the calibration dataset. On the qualified sample data, the method is run up to the key steps, batch extracting features such as gradient magnitude values of all local regions, tilt and volume of continuous defective areas, and curvature values of normal surfaces. The distribution of these feature values, such as mean and standard deviation, is calculated. Based on the statistical distribution of the qualified sample features, it is typically assumed to follow or approximately follow a normal distribution, using the mean plus 2 to 3 times the standard deviation as the initial threshold, corresponding to a 95%-99.7% confidence interval. Subsequently, on known defect samples... The threshold is validated to ensure effective detection of all known defects. Simultaneously, by adjusting the standard deviation factor or directly fine-tuning the threshold, the false alarm rate on qualified samples is controlled to an acceptable level, such as <1%. For fusion weights, such as the distance and direction weights in S15, optimization methods such as grid search and cross-validation can be used on known defect samples to find the weight combination that maximizes the clustering integrity of defect areas and minimizes the false clustering of normal areas. Through the above systematic calibration, a set of stable parameters adapted to specific production line conditions can be obtained. In practical applications, this can be periodically recalibrated according to changes in product specifications or equipment updates.
[0069] In summary, this invention discloses a visual intelligence-based method for detecting surface defects in automotive wiring harnesses. The method involves acquiring point cloud data of the wiring harness surface, selecting candidate points close to the centroidal axis, and performing local surface fitting to obtain a smooth point cloud representation. Based on the smooth point cloud, a covariance matrix is constructed and eigenvalue decomposition is performed to generate an orientation vector field. Orientation gradient anomalies are extracted to obtain a preliminary defect candidate set. Continuous potential hazard regions are formed through multi-dimensional clustering. The principal direction axis of the potential hazard regions is extracted, the tilt is calculated, and the volume is evaluated. A list of confirmed defects is then selected. The confirmed defects are projected and rasterized to generate a defect visualization. Further fine sampling is performed on high-risk areas to obtain a high-precision surface point cloud dataset. This method accurately reflects the true three-dimensional morphological features of the wiring harness surface under load conditions.
[0070] Reference Figure 2The second embodiment of the present invention provides a vision-based intelligent automotive wiring harness surface defect detection system, comprising: The data acquisition module is used to collect point cloud data of the wire harness surface; The smoothing module is used to select candidate points from the point cloud data of the wire harness surface to obtain a set of candidate points on the wire harness surface, and to smooth and correct the set of candidate points on the wire harness surface to obtain a smoothed surface point cloud representation. The vector field module is used to construct a local neighborhood point set based on the surface point cloud representation, count the three-dimensional coordinates of all points in the local neighborhood point set and construct a covariance matrix, and perform eigenvalue decomposition on the covariance matrix to obtain the orientation vector field. The preliminary screening module is used to construct a gradient tensor matrix and calculate the gradient magnitude based on the orientation vector field, and compare the gradient magnitude with a preset gradient threshold to obtain a preliminary defect candidate set. The hidden danger area module is used to perform clustering processing on the preliminary defect candidate set to obtain initial clusters, and to filter based on the initial clusters to obtain continuous hidden danger areas; The tilt module is used to extract the feature vector of the continuous hidden danger area, determine the main direction axis, extract the central axis point based on the main direction axis, obtain the candidate set of central axis points, and calculate the tilt index. The defect list module is used to perform defect assessment on the continuous hidden danger area based on the tilt index, and obtain a confirmed defect list. The defect mapping module is used to perform defect projection rasterization visual mapping based on the confirmed defect list to obtain a surface defect mapping map. The precise dataset module is used to filter neighborhood points of high-risk areas based on the surface defect mapping map, obtain neighborhood points, and perform fine sampling based on the neighborhood points to obtain a precise surface point cloud dataset.
[0071] It should be noted that the vision-based intelligent automotive wiring harness surface defect detection system provided in this embodiment of the invention is used to execute all the process steps of the vision-based intelligent automotive wiring harness surface defect detection method described in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0072] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0073] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for detecting surface defects in automotive wiring harnesses based on visual intelligence, characterized in that, include: Collect point cloud data of the wire harness surface; Candidate points are selected from the point cloud data of the wire harness surface to obtain a candidate point set of the wire harness surface. The candidate point set of the wire harness surface is then smoothed to obtain a smoothed surface point cloud representation. A local neighborhood point set is constructed based on the surface point cloud representation. The three-dimensional coordinates of all points in the local neighborhood point set are counted and a covariance matrix is constructed. The covariance matrix is then subjected to eigenvalue decomposition to obtain the orientation vector field. Based on the orientation vector field, a gradient tensor matrix is constructed and the gradient magnitude is calculated. The gradient magnitude is compared with a preset gradient threshold to obtain a preliminary defect candidate set. The preliminary defect candidate set is clustered to obtain initial clusters, and then filtered based on the initial clusters to obtain continuous hidden danger areas; Extract the feature vector of the continuous hidden danger area, determine the main direction axis, and extract the central axis point based on the main direction axis to obtain the candidate set of central axis points and calculate the inclination index; Based on the tilt index, a defect assessment is performed on the continuous hazard area to obtain a confirmed defect list, including: when the tilt index of the continuous hazard area is greater than a preset tilt threshold, voxelization processing is performed on the continuous hazard area to divide it into cubic voxel units of fixed size, and the number of voxels occupied by the point cloud is counted to calculate the solid geometric volume; if the solid geometric volume is greater than a preset volume threshold, the continuous hazard area is determined to be a real defect and included in the confirmed defect list; if the solid geometric volume is not greater than the preset volume threshold, the continuous hazard area is determined to be a non-defect area and is removed. Based on the confirmed defect list, perform defect projection rasterization visual mapping to obtain a surface defect mapping map; Based on the surface defect mapping map, neighboring points of high-risk areas are screened to obtain neighboring points, and based on the neighboring points, fine sampling is performed to obtain an accurate surface point cloud dataset.
2. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The process of selecting candidate points from the wire harness surface point cloud data to obtain a wire harness surface candidate point set, and then smoothing the wire harness surface candidate point set to obtain a smoothed surface point cloud representation, includes: Calculate the shortest distance from each point in the point cloud data on the surface of the wire harness to the centroid axis of the entire wire harness, and select the point with the smallest shortest distance as the representative point to obtain the candidate point set on the surface of the wire harness; For each representative point in the candidate point set of the wire harness surface, a local neighborhood centered on the representative point is constructed, and a quadratic surface is fitted to the neighborhood points of the representative point under the local neighborhood to obtain a quadratic surface. Based on the quadratic surface, the representative point is projected and corrected to obtain a smoothed surface point cloud representation.
3. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The process of constructing a local neighborhood point set based on the surface point cloud representation, statistically analyzing the 3D coordinates of all points in the local neighborhood point set and constructing a covariance matrix, and performing eigenvalue decomposition on the covariance matrix to obtain an orientation vector field includes: Take any point in the smoothed surface point cloud representation as the center point, construct a local neighborhood point set with the center point as the sphere center, and count the three-dimensional coordinates of all points in the local neighborhood point set. Use the three-dimensional coordinates to calculate the geometric center position of the local neighborhood point set, and perform centering processing on the coordinates of each neighborhood point based on the geometric center position to obtain the relative position offset of each neighborhood point. A three-dimensional covariance matrix is constructed based on the relative position offset, and eigenvalue decomposition is performed on the covariance matrix to obtain the corresponding eigenvalues and eigenvectors. The eigenvector with the smallest eigenvalue among the eigenvalues is selected as the orientation vector field.
4. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The process involves constructing a gradient tensor matrix and calculating the gradient magnitude based on the orientation vector field, then comparing the gradient magnitude with a preset gradient threshold to obtain a preliminary defect candidate set, including: Obtain each coordinate point and three-dimensional unit direction vector in the orientation vector field, select any coordinate point as the center point, construct a spherical neighborhood with the center point as the sphere center, extract the direction vector of all points in the spherical neighborhood, and perform partial derivative estimation based on the direction vector to obtain the direction derivative. Sort the direction derivatives in descending order to obtain the gradient tensor matrix. The gradient tensor matrix is calculated using the Frobenius norm to obtain the gradient magnitude. When the gradient magnitude is greater than a preset gradient threshold, the node with the gradient magnitude is included in the preliminary defect candidate set.
5. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The preliminary defect candidate set is clustered to obtain initial clusters, and then filtered based on these initial clusters to obtain continuous hazard areas, including: For any two points in the preliminary defect candidate set, calculate the three-dimensional spatial Euclidean distance and the orientation vector cosine similarity, and perform maximum and minimum normalization on the three-dimensional spatial Euclidean distance and the orientation vector cosine similarity to generate normalized spatial distance and normalized directional difference index. The normalized spatial distance and normalized directional difference index are fused using preset weighting parameters to obtain the similarity score between point pairs, and the similarity scores are arranged in rows and columns to construct a multidimensional feature similarity matrix; Based on the multidimensional feature similarity matrix, clustering is performed using a preset similarity threshold to obtain preliminary clusters; Based on a preset minimum cluster size threshold, noise cluster point sets are removed from the initial clusters to obtain continuous hidden danger areas.
6. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The process of extracting feature vectors from the continuous hazard area, determining the main direction axis, extracting the central axis points based on the main direction axis, obtaining a candidate set of central axis points, and calculating the inclination index includes: Obtain the three-dimensional spatial coordinates of all points in the continuous hazard area; Based on the principal component analysis method, the three-dimensional coordinates are feature extracted, the covariance matrix is constructed and eigenvalue decomposition is performed, and the eigenvector with the largest eigenvalue is selected as the principal direction axis of the continuous hidden danger area. Along the main directional axis, the continuous hidden danger area is divided into multiple parallel cross-sections, and the boundary point set and centroid coordinates are extracted in each parallel cross-section. The Euclidean distance from each point in the boundary point set to the centroid coordinates is calculated, and the internal points are filtered based on the Euclidean distance to obtain the central axis point candidate set. The candidate set of central axis points is connected based on the principle of minimum connection distance to form a continuous skeleton path, and equidistant point columns on the path are extracted according to a set interval. Based on the equidistant point array, the tangential vector of each point and the rate of change of direction between adjacent points are calculated, and the rate of change of direction is statistically averaged over the entire path range to obtain the inclination index of the continuous hidden danger area.
7. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The step of performing defect projection rasterization visual mapping based on the confirmed defect list to obtain a surface defect mapping map includes: Extract the three-dimensional coordinates of the centroid and the maximum depth value of each confirmed defect in the confirmed defect list to construct a two-dimensional point set; The two-dimensional point set is projected onto a two-dimensional plane and divided into several grid cells. The grid cells are then labeled with risk levels according to a preset depth level threshold to generate a surface defect mapping map.
8. The method for detecting surface defects in automotive wiring harnesses based on visual intelligence according to claim 1, characterized in that, The process involves filtering neighboring points of high-risk areas based on the surface defect mapping map to obtain neighboring points, and then performing fine sampling based on these neighboring points to obtain an accurate surface point cloud dataset, including: In the surface defect mapping map, all grid cells marked in red are filtered out, and the original wire harness surface point cloud data of the grid cells are extracted. All grid cells marked as high-risk levels are selected from the surface defect mapping map, and local point cloud regions are extracted from the original wire harness surface point cloud data according to the spatial location of the grid cells. A spatial neighborhood with a preset radius is constructed based on the center point of the local point cloud region, and a set of neighborhood points is obtained by filtering the spatial neighborhood. Local surface fitting is then performed on the set of neighborhood points to estimate the average curvature. When the average curvature is greater than a preset mutation threshold, a high-resolution acquisition command is generated, and a secondary scan is performed on the corresponding area according to the high-resolution acquisition command to obtain an accurate surface point cloud dataset.
9. A vision-based intelligent automotive wiring harness surface defect detection system, characterized in that, include: The data acquisition module is used to collect point cloud data of the wire harness surface; The smoothing module is used to select candidate points from the point cloud data of the wire harness surface to obtain a set of candidate points on the wire harness surface, and to smooth and correct the set of candidate points on the wire harness surface to obtain a smoothed surface point cloud representation. The vector field module is used to construct a local neighborhood point set based on the surface point cloud representation, count the three-dimensional coordinates of all points in the local neighborhood point set and construct a covariance matrix, and perform eigenvalue decomposition on the covariance matrix to obtain the orientation vector field. The preliminary screening module is used to construct a gradient tensor matrix and calculate the gradient magnitude based on the orientation vector field, and compare the gradient magnitude with a preset gradient threshold to obtain a preliminary defect candidate set. The hidden danger area module is used to perform clustering processing on the preliminary defect candidate set to obtain initial clusters, and to filter based on the initial clusters to obtain continuous hidden danger areas; The tilt module is used to extract the feature vector of the continuous hidden danger area, determine the main direction axis, extract the central axis point based on the main direction axis, obtain the candidate set of central axis points, and calculate the tilt index. The defect list module is used to perform defect assessment on the continuous hidden danger area based on the tilt index to obtain a confirmed defect list. This includes: when the tilt index of the continuous hidden danger area is greater than a preset tilt threshold, performing voxelization processing on the continuous hidden danger area, dividing the continuous hidden danger area into cubic voxel units of fixed size, and counting the number of voxels occupied by the point cloud to calculate the entity's geometric volume; if the entity's geometric volume is greater than a preset volume threshold, then the continuous hidden danger area is determined to be a real defect and included in the confirmed defect list; if the entity's geometric volume is not greater than the preset volume threshold, then the continuous hidden danger area is determined to be a non-defect area and is removed. The defect mapping module is used to perform defect projection rasterization visual mapping based on the confirmed defect list to obtain a surface defect mapping map. The precise dataset module is used to filter neighborhood points of high-risk areas based on the surface defect mapping map, obtain neighborhood points, and perform fine sampling based on the neighborhood points to obtain a precise surface point cloud dataset.
Citation Information
Patent Citations
Building facade defect intelligent detection method
CN119887763A
Multi-angle vehicle defect measurement using surface-adaptive optical corrections
US20250314599A1