Machine vision appearance defect detection method and system for wire harness connector
By using a machine vision inspection method that integrates multiple features, the problem of accurately identifying appearance defects in wire harness connectors has been solved. This method enables intelligent detection of deformation in the crimping area, insulation layer damage, and various other defects, thereby improving inspection accuracy and quality assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies struggle to accurately identify subtle defects in wire harness connectors, especially under complex industrial conditions. These defects include minute deformations in the crimping area, abnormal edge curvature, minute tears in the insulation layer at the interface, and micro-exposed conductors. This leads to frequent misjudgments and missed detections, failing to meet the testing requirements of modern production lines.
A machine vision inspection method with multi-feature fusion is adopted. By extracting edge contours, geometric matching, curvature calculation and weighted summation of multiple indicators, the deformation of the crimping area, insulation layer damage and appearance defects of wire harness connectors can be accurately evaluated. Combined with a 3D vision system for registration and feature analysis, a comprehensive index of appearance defects is generated.
It enables intelligent inspection of the crimping quality of wire harness connectors, improves the accuracy of identifying hidden defects, dynamically quantifies the risk of insulation layer damage, covers the detection of macroscopic and microscopic defects, and realizes a closed-loop output from defect identification to quality grading.
Smart Images

Figure CN121810568A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision inspection technology, and more specifically, to a machine vision appearance defect detection method and system for wire harness connectors. Background Technology
[0002] As a critical component for electrical signal transmission in fields such as automotive, aerospace, and industrial equipment, the crimping quality of wire harness connectors directly affects the overall electrical performance and reliability of the device. Common defects in the crimping process include excessive or insufficient deformation of the crimped area, burrs, cracks, dents, and tears, burrs, and conductor exposure due to insulation damage at the crimping interface of the cable insulation layer. The presence of these defects can lead to serious safety hazards such as poor contact, short circuits, insulation breakdown, and even fire.
[0003] Traditional inspection mainly relies on manual visual inspection combined with calipers, magnifying glasses, or simple projectors, which suffers from low inspection efficiency, poor subjective consistency, and high missed detection rate. With the rapid development of automotive electronics and new energy wiring harnesses, the number of wiring harness connectors in a single vehicle has reached thousands, and manual inspection can no longer meet the pace and quality requirements of modern production lines.
[0004] Existing machine vision-based wire harness connector appearance inspection solutions mostly use single threshold segmentation or template matching methods, which can only identify obvious flash or large-area damage. However, they lack the accuracy and robustness to detect hidden defects such as small deformations in the crimping area, abnormal edge curvature, minor tears in the insulation layer at the junction, micro-exposed conductors, and crimping depressions. Especially under complex industrial conditions such as different lighting, surface oil stains, and metal reflections, misjudgments and missed judgments occur frequently.
[0005] Therefore, there is an urgent need for a machine vision inspection method that can simultaneously achieve precise quantification of geometric deformation in the crimping area, accurate assessment of insulation damage risk at the interface, and comprehensive judgment of multiple typical appearance defects, in order to improve the intelligent inspection level of wire harness connector crimping quality. Summary of the Invention
[0006] This application provides a machine vision-based method and system for detecting appearance defects in wire harness connectors. It can achieve intelligent identification and quality judgment of crimping appearance defects in wire harness connectors through multi-feature fusion, thereby improving the intelligent detection level of crimping quality of wire harness connectors.
[0007] In a first aspect, this application provides a machine vision method for detecting appearance defects in wire harness connectors, comprising the following steps: Edge contours are extracted from the acquired wire harness connector images to obtain the edge contours of the crimping area and the cable insulation area. Geometric matching is performed between the edge contour of the pressing area and the pre-stored reference contour model to calculate the positional and shape deviations between the edge contour of the pressing area and the reference contour model, and to determine the pressing deformation area. Curvature values are calculated for each edge segment within the compression deformation area, and the contour anomaly coefficient of each edge segment is determined based on the curvature difference between adjacent edge segments and the continuity of connection between edge segments. Extract the edge segment of the insulation layer at the junction of the crimping area and the cable insulation area, calculate the length of the continuous gap and the height of the burr protrusion of the edge segment of the insulation layer, and determine the risk value of insulation layer damage based on the length of the continuous gap and the height of the burr protrusion. The edge contour of the pressing area is subjected to flash detection, crack detection and dent detection to obtain the flash area, crack length and dent depth respectively, and the pressing appearance quality value is determined based on the flash area, crack length and dent depth. The contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are weighted and summed to obtain a comprehensive appearance defect index. The comprehensive appearance defect index is then compared with a preset threshold range to determine the crimping appearance quality level of the wire harness connector.
[0008] Preferably, the edge contour extraction of the acquired wire harness connector image to obtain the edge contours of the crimping area and the cable insulation area specifically includes: The image of the wire harness connector is subjected to grayscale processing and noise suppression filtering; The Canny edge detection operator is used to perform edge detection on the filtered image to obtain an initial set of edge points. Perform connected component analysis on the initial set of edge points to separate the connected components corresponding to the crimping area and the cable insulation area; Contour tracing is performed on the connected domains corresponding to the crimping area and the connected domains corresponding to the cable insulation area to obtain the edge contours of the crimping area and the cable insulation area. If a 3D vision system is used, 3D point cloud data of the wire harness connector can be acquired simultaneously and registered with the 2D image.
[0009] Preferably, the geometric matching based on the edge contour of the pressing area and the pre-stored reference contour model, and the calculation of the positional and shape deviations between the edge contour of the pressing area and the reference contour model to determine the pressing deformation area specifically includes: The baseline contour model is a normal contour interval model established based on the contours of multiple qualified samples of the same specification, and the baseline contour model is associated with a pre-stored qualified sample 3D baseline model. The edge contour of the pressing area is rigidly registered with the reference contour model to obtain the initial position deviation; Based on the initial position deviation, an iterative nearest point algorithm is used for non-rigid registration, and the 3D point cloud of the pressing area is simultaneously registered with the reference 3D model to obtain the shape deviation vector between each corresponding point. The shape deviation vector is statistically analyzed, and the region with a deviation value greater than a preset deviation threshold is selected as the pressing deformation region.
[0010] Preferably, calculating the curvature value for each edge segment within the compression deformation area, and determining the contour anomaly coefficient of each edge segment based on the curvature difference between adjacent edge segments and the continuity of connection between edge segments specifically includes: The edge contour of the compression deformation area is smoothed. The smoothed edge contour is divided into multiple edge segments according to a preset pixel length; For each edge segment, the local curvature value is calculated using the three-point method or circle fitting. Calculate the absolute value of the curvature difference between adjacent edge segments and detect whether the distance between the endpoints of adjacent edge segments is less than a preset connection threshold to determine the continuity of the connection; The absolute value of the curvature difference of each edge segment is normalized and weighted and summed with the connection continuity loss indicator to obtain the contour anomaly coefficient of that edge segment. The preset connection threshold is determined based on the statistical value of the connection gap of the edge segments of qualified samples.
[0011] Preferably, the edge segment of the insulation layer is extracted at the junction of the crimping area and the cable insulation area, and the continuity gap length and burr protrusion height of the edge segment of the insulation layer are calculated. The determination of the insulation layer damage risk value based on the continuity gap length and the burr protrusion height specifically includes: A search window is set at the junction of the crimping area and the cable insulation area to extract the edge segment of the insulation layer located within the search window; The actual missing edge point intervals are detected along the theoretical extension direction of the edge segment of the insulation layer, and the cumulative length of the missing intervals is taken as the length of the continuity gap. Perform convex hull analysis on the edge segment of the insulating layer and calculate the average deviation distance from the actual edge point to the convex hull as the burr protrusion height; Detect pixels in the insulating layer region image within the search window whose gray values are lower than a preset gray threshold, and calculate the area of the connected region of these pixels as the exposed area of the conductor; The surface delamination and depression features of the insulating layer are analyzed using 3D point cloud analysis, and the projected area of the delamination region is calculated. The insulation layer damage risk value is obtained by normalizing and weighting the length of the continuous gap, the height of the burr protrusion, the exposed area of the conductor, and the projected area of the layered region.
[0012] Preferably, the edge contour of the crimping area is subjected to flash detection, crack detection, and dent detection to obtain the flash area, crack length, and dent depth, respectively. The crimping appearance quality value is then determined based on the flash area, crack length, and dent depth, specifically including: The edge contour of the pressing area is differiated from the reference contour model to obtain the area that exceeds the reference contour model as the candidate flash edge area; the convex height of the candidate flash edge area is verified to be greater than or equal to a preset height threshold by combining 3D point cloud verification, and grayscale verification is performed on the candidate flash edge area. The area with grayscale value higher than the preset metal grayscale threshold is retained as the flash edge area, and the pixel area of the flash edge area is calculated as the flash edge area. The image of the pressing area is grayscaled, and the linear features in the image are enhanced by the Gaussian Laplacian operator. Combined with the surface depth abrupt change features detected by 3D point cloud, candidate crack regions are obtained by threshold segmentation. Regions with a length greater than a preset length threshold and a width less than a preset width threshold are filtered out as cracks, and the crack length is accumulated. Within the compression deformation area, based on the registered 3D point cloud data, the vertical distance from the 3D point corresponding to the actual contour to the reference 3D model along the Z-axis is calculated, and the maximum value is taken as the indentation depth. The surface appearance quality value is obtained by normalizing the flash area, the crack length, and the indentation depth, then weighting and summing them, and then inverting the sum.
[0013] Preferably, the comprehensive appearance defect index is obtained by weighted summing of the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value, specifically including: If the crack length is greater than or equal to a preset fatal crack length threshold, or the conductor exposed area is greater than or equal to a preset fatal exposed area threshold, then the comprehensive index of the appearance defect is set to a predetermined unqualified value. Otherwise, the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are normalized so that their values are between 0 and 1. The normalized contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are each multiplied by the corresponding preset weight coefficient determined based on the risk priority number (RPN) established by FMEA (Failure Mode and Effects Analysis). The weighted sum of the three factors yields the comprehensive index of appearance defects.
[0014] Secondly, this application provides a machine vision appearance defect detection system for wire harness connectors, comprising: The extraction module is used to extract the edge contours of the acquired wire harness connector images to obtain the edge contours of the crimping area and the cable insulation area. The processing module is used to perform geometric matching based on the edge contour of the pressing area and the pre-stored reference contour model, calculate the positional deviation and shape deviation between the edge contour of the pressing area and the reference contour model, and determine the pressing deformation area. The processing module is also used to calculate the curvature value of each edge segment in the compression deformation area, and determine the contour anomaly coefficient of each edge segment based on the curvature difference between adjacent edge segments and the continuity of the connection between edge segments; The processing module is also used to extract the edge segment of the insulation layer at the junction of the crimping area and the cable insulation area, calculate the length of the continuous gap and the height of the burr protrusion of the edge segment of the insulation layer, and determine the insulation layer damage risk value based on the length of the continuous gap and the height of the burr protrusion. The processing module is also used to perform flash detection, crack detection and depression detection on the edge contour of the crimping area, respectively to obtain the flash area, crack length and depression depth, and to determine the crimping appearance quality value based on the flash area, the crack length and the depression depth. The execution module is used to perform a weighted summation of the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value to obtain a comprehensive appearance defect index. Based on the comparison of the comprehensive appearance defect index with a preset threshold range, the crimping appearance quality level of the wire harness connector is determined.
[0015] Thirdly, this application provides a computer device, the computer device including a memory and a processor, the memory storing code, the processor being configured to acquire the code and execute the above-described machine vision appearance defect detection method for wire harness connectors.
[0016] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described machine vision appearance defect detection method for wire harness connectors.
[0017] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: In this embodiment, the edge contours of the acquired wire harness connector image are first extracted to obtain the edge contours of the crimping area and the cable insulation area. Geometric matching is then performed between the edge contours of the crimping area and a pre-stored reference contour model to calculate positional and shape deviations and determine the crimping deformation area. Curvature values are calculated for each edge segment within the crimping deformation area, and a contour anomaly coefficient is determined based on the curvature difference between adjacent edge segments and the continuity of the connection. The edge segments of the insulation layer are extracted at the junction of the crimping area and the cable insulation area, and the length of the continuity gap, the height of the burr protrusion, and the exposed area of the conductor are calculated to determine the insulation layer damage risk value. Flash detection, crack detection, and dent detection are performed on the edge contours of the crimping area to obtain the flash area, crack length, and dent depth, and to determine the crimping appearance quality value. The contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are weighted and summed to obtain a comprehensive appearance defect index. This comprehensive appearance defect index is then compared with a preset threshold range to determine the crimping appearance quality level of the wire harness connector.
[0018] Therefore, this application achieves high-precision positioning of the deformation area through rigid and non-rigid registration of the crimping area contour and the reference contour model. It also quantifies minute deformation anomalies by combining the continuity and connectivity of edge curvature, effectively suppressing the problem of missed detection of hidden defects caused by uneven crimping force. Secondly, at the junction of the crimping area and the cable insulation area, multi-feature evaluation using continuous gaps, burr protrusions, and conductor exposed area enables the system to dynamically quantify the risk of insulation layer damage, thereby improving the sensitivity to high-risk defects such as tears and burrs. Finally, it utilizes grayscale verification of flash, crack enhancement, and indentation distance... The ion transformation performs multi-type defect detection on the crimping area, enabling the detection results to cover both macroscopic appearance anomalies and capture microscopic crack details, thereby obtaining a comprehensive crimping appearance quality value. Finally, by introducing a fatal defect veto mechanism and multi-index weighted summation to generate a comprehensive appearance defect index, and automatically determining the quality level according to a preset threshold range, a closed-loop output from defect identification to quality grading is achieved. In summary, intelligent identification and quality judgment of crimping appearance defects of wire harness connectors can be realized through multi-feature fusion, thereby improving the intelligent detection level of wire harness connector crimping quality. Attached Figure Description
[0019] Figure 1 This is an exemplary flowchart of a machine vision appearance defect detection method for wire harness connectors according to some embodiments of this application; Figure 2 This is a schematic flowchart illustrating the calculation of contour anomaly coefficients according to some embodiments of this application; Figure 3 This is a schematic diagram of the structure of a machine vision appearance defect detection system for wire harness connectors according to some embodiments of this application; Figure 4 This is a schematic diagram of the structure of a computer device that implements a machine vision appearance defect detection method for wire harness connectors according to some embodiments of this application. Detailed Implementation
[0020] To better understand the technical solution of this application, the technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] refer to Figure 1 The figure is an exemplary flowchart of a machine vision appearance defect detection method for a wire harness connector according to some embodiments of this application. The machine vision appearance defect detection method for the wire harness connector mainly includes the following steps: In step S101, the edge contours of the acquired wire harness connector image are extracted to obtain the edge contours of the crimping area and the cable insulation area.
[0022] It should be noted that the wire harness connector image in this application refers to a two-dimensional grayscale image captured by an industrial camera to reflect the crimped appearance of the wire harness connector; the crimped area in this application refers to the area formed by the crimping of the metal terminal and the cable conductor in the wire harness connector; the cable insulation area in this application refers to the area covered by the outer insulation material of the cable; and the edge contour in this application refers to the continuous pixel sequence that represents the boundary of the region extracted by an edge detection algorithm.
[0023] In specific implementation, the image of the wire harness connector is subjected to grayscale processing and noise suppression filtering to enhance edge contrast; the Canny edge detection operator is used to perform edge detection on the filtered image to obtain an initial edge point set; connected component analysis is performed on the initial edge point set to separate the connected component corresponding to the crimping area and the connected component corresponding to the cable insulation area; contour tracing is performed on the connected component corresponding to the crimping area and the connected component corresponding to the cable insulation area respectively to obtain the edge contour of the crimping area and the edge contour of the cable insulation area; if a 3D vision system is used, the 3D point cloud data of the wire harness connector is acquired simultaneously and registered with the 2D image.
[0024] In step S102, geometric matching is performed based on the edge contour of the pressing area and the pre-stored reference contour model to calculate the positional deviation and shape deviation between the edge contour of the pressing area and the reference contour model, and to determine the pressing deformation area.
[0025] The baseline contour model is a normal contour interval model established based on the contours of multiple qualified samples of the same specification, and the baseline contour model is associated with a pre-stored qualified sample 3D baseline model. The edge contour of the pressing area is rigidly registered with the reference contour model to obtain the initial position deviation; Based on the initial position deviation, an iterative nearest point algorithm is used for non-rigid registration, and the 3D point cloud of the pressing area is simultaneously registered with the reference 3D model to obtain the shape deviation vector between each corresponding point. The shape deviation vector is statistically analyzed, and the region with a deviation value greater than a preset deviation threshold is selected as the pressing deformation region.
[0026] In step S103, the curvature value of each edge segment in the compression deformation area is calculated, and the contour anomaly coefficient of each edge segment is determined based on the curvature difference between adjacent edge segments and the continuity of the connection between edge segments.
[0027] It should be noted that the contour anomaly coefficient in this application refers to an index that quantifies the degree of deformation anomaly of the edge segment. In specific implementation, the contour anomaly coefficients of all edge segments are summarized, and the maximum value is selected as the overall contour anomaly coefficient of the pressing deformation area. In practice, other summarization methods such as average value and summation can also be selected according to actual detection needs. This embodiment prefers the maximum value to highlight the influence of the most severe anomaly area. This is only an example and is not intended to limit the specific scope of this application.
[0028] In some embodiments, reference Figure 2 As shown in the figure, this is a schematic flowchart illustrating the calculation of contour anomaly coefficients in some embodiments of this application, specifically using the following sampling method: In step S1031, the edge contour of the pressing deformation area is smoothed to eliminate the tiny burrs or fluctuations caused by image noise, metal reflection, etc., to avoid interfering with subsequent curvature calculation and anomaly judgment, and to ensure the stability of the contour data. In step S1032, the smoothed edge contour is divided into multiple edge segments according to a preset pixel length, and the continuous edge contour is divided into multiple small segments according to a fixed pixel length. The overall contour analysis is transformed into local small segment analysis, which makes it easier to accurately locate the specific location of the minute deformation. In step S1033, the local curvature value is calculated for each edge segment using the three-point method or the circle fitting method. Specifically, the three-point method (i.e., the curvature is obtained by fitting a curve through three points on the small segment) or the circle fitting (i.e., the small segment contour is fitted into a circle, and the curvature of the circle is used to characterize the local curvature) can be used to quantify the curvature of each edge segment and provide basic data for judging whether the curvature is abnormal. In step S1034, the absolute value of the curvature difference between adjacent edge segments is calculated, and the distance between the endpoints of adjacent edge segments is detected to determine the continuity of the connection. Specifically, the absolute value of the curvature difference between adjacent edge segments is calculated. If the absolute value of the difference is large, it indicates that the curvature of the two contours changes abruptly. For example, a normal smooth curve suddenly becomes steep, which may be an abnormal deformation. Detect the distance between the endpoints of adjacent segments. If the distance exceeds the preset threshold, it indicates that the connection between the two contour segments is broken, which is an abnormality in the continuity of the connection. In step S1035, the absolute value of the curvature difference of each edge segment is normalized and weighted and summed with the connection continuity missing marker to obtain the contour anomaly coefficient of the edge segment. Specifically, the curvature abrupt change (i.e., quantitative data) and connection break (i.e., the missing marker from qualitative to quantitative conversion) are normalized to a range of 0-1, and then summed according to weights to finally obtain the contour anomaly coefficient of each edge segment. The higher the contour anomaly coefficient, the more severe the anomaly of the contour of the segment. The preset connection threshold is determined based on the statistical value of the connection gap of the edge segments of qualified samples.
[0029] It should be noted that the connection continuity loss flag uses 0-1 encoding: if the distance between the endpoints of adjacent edge segments is ≥ the preset connection threshold (i.e., continuity is lost), the flag value is 1; if the distance is < the preset connection threshold (i.e., continuity is normal), the flag value is 0. This is only an example and is not intended to limit the specific application.
[0030] In summary, by using the logic of noise reduction, segmentation, quantification of local features, and identification of abnormal signals for comprehensive scoring, the degree of abnormality of the edge contour of the compression deformation area is transformed into a quantifiable contour abnormality coefficient, which will not be elaborated here.
[0031] In step S104, the edge segment of the insulation layer is extracted at the junction of the crimping area and the cable insulation area, the continuity gap length and burr protrusion height of the edge segment of the insulation layer are calculated, and the insulation layer damage risk value is determined based on the continuity gap length and the burr protrusion height.
[0032] It should be noted that the insulation layer damage risk value in this application refers to an indicator that quantifies the severity of damage.
[0033] In specific implementation, a search window is set at the junction of the crimping area and the cable insulation area to extract the edge segment of the insulation layer within the search window; the actual edge point missing interval is detected along the theoretical extension direction of the edge segment of the insulation layer, and the cumulative length of the missing interval is used as the continuity gap length; convex hull analysis is performed on the edge segment of the insulation layer, and the average deviation distance from the actual edge point to the convex hull is calculated as the burr protrusion height; pixels with gray values lower than a preset gray value threshold in the insulation layer area image within the search window are detected, and the area of the connected region of these pixels is calculated as the conductor exposure area; the layering and depression features of the insulation layer surface are analyzed through 3D point cloud analysis, and the projected area of the layered region is calculated; the continuity gap length, the burr protrusion height, the conductor exposure area, and the projected area of the layered region are normalized and then weighted and summed to obtain the insulation layer damage risk value.
[0034] It should be noted that when analyzing the surface layering and depression features of the insulating layer using 3D point cloud in this application, the height difference ΔZ between each point in the 3D point cloud and the theoretical surface of the insulating layer can be calculated first, and the point set with ΔZ ≥ a preset layering height threshold can be selected. Then, connected component analysis can be performed on the point set, and connected components with an area ≥ a preset minimum layering area threshold can be retained. The projected area of the connected component on the 2D plane can be used as the projected area of the layering region. This is only an example and is not intended to limit the specific scope of this application.
[0035] In step S105, the edge contour of the pressing area is subjected to flash detection, crack detection and dent detection to obtain the flash area, crack length and dent depth respectively, and the pressing appearance quality value is determined based on the flash area, crack length and dent depth.
[0036] It should be noted that the crimping appearance quality value in this application refers to an indicator that quantifies the degree of appearance defects.
[0037] In specific implementation, the edge contour of the pressing area is differiated from the reference contour model to obtain the region exceeding the reference contour model as the candidate flash region; the convex height of the candidate flash region is verified to be greater than or equal to a preset height threshold using 3D point cloud verification, and the grayscale verification of the candidate flash region is performed. Regions with grayscale values higher than a preset metal grayscale threshold are retained as flash regions, and the pixel area of the flash region is calculated as the flash area; the image of the pressing area is grayscale processed, and the linear features in the image are enhanced using the Gaussian Laplacian operator. The surface depth abrupt change features are detected using 3D point cloud, and candidate crack regions are obtained through threshold segmentation. Regions with a length greater than a preset length threshold and a width less than a preset width threshold are filtered out as cracks, and the crack length is accumulated; within the pressing deformation region, based on the registered 3D point cloud data, the vertical distance from the 3D point corresponding to the actual contour to the reference 3D model along the Z-axis is calculated, and the maximum value is taken as the indentation depth; the flash area, the crack length, and the indentation depth are normalized, weighted, and summed, and then inverted to obtain the pressing appearance quality value.
[0038] Additionally, it should be noted that the pixel area of the aforementioned fringe region can be calculated by combining it with a preset pixel equivalent and converting it into physical area (physical area = pixel area × pixel equivalent). 2 The physical area is used as the final flash area. This is only an example and is not intended to limit the scope of this application.
[0039] In step S106, the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are weighted and summed to obtain a comprehensive appearance defect index. The comprehensive appearance defect index is compared with a preset threshold range to determine the crimping appearance quality level of the wire harness connector.
[0040] It should be noted that the comprehensive appearance defect index in this application refers to a quantitative index that integrates multiple defect features, and the contour anomaly coefficient in this step is the overall contour anomaly coefficient determined in step S103 above.
[0041] In specific implementation, if the crack length is greater than or equal to a preset fatal crack length threshold, or the conductor exposed area is greater than or equal to a preset fatal exposed area threshold, then the comprehensive appearance defect index is set to a predetermined unqualified value; otherwise, the overall contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are normalized respectively, so that their values are between 0 and 1; the normalized overall contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are multiplied by the corresponding preset weight coefficient determined by the risk priority number (RPN) established based on FMEA (Failure Mode and Effects Analysis); the three weighted values are added together to obtain the comprehensive appearance defect index; the crimping appearance quality level of the wire harness connector is determined by comparing the comprehensive appearance defect index with the preset threshold range.
[0042] On the other hand, in some embodiments, this application provides a machine vision appearance defect detection system for wire harness connectors, with reference to... Figure 3 The figure is a schematic diagram of the structure of a machine vision appearance defect detection system for a wire harness connector according to some embodiments of this application. The machine vision appearance defect detection system 400 for the wire harness connector includes: The extraction module 401 is used to extract the edge contours of the acquired wire harness connector image to obtain the edge contours of the crimping area and the edge contours of the cable insulation area. Processing module 402 is used to perform geometric matching based on the edge contour of the pressing area and the pre-stored reference contour model, calculate the positional deviation and shape deviation between the edge contour of the pressing area and the reference contour model, and determine the pressing deformation area. The processing module 402 is also used to calculate the curvature value of each edge segment in the compression deformation area, and determine the contour anomaly coefficient of each edge segment based on the curvature difference between adjacent edge segments and the continuity of the connection between edge segments; The processing module 402 is further configured to extract the edge segment of the insulation layer at the junction of the crimping area and the cable insulation area, calculate the continuity gap length and burr protrusion height of the edge segment of the insulation layer, and determine the insulation layer damage risk value based on the continuity gap length and burr protrusion height. The processing module 402 is also used to perform flash detection, crack detection and depression detection on the edge contour of the pressing area, respectively obtain the flash area, crack length and depression depth, and determine the pressing appearance quality value based on the flash area, crack length and depression depth. The execution module 403 is used to perform a weighted summation of the contour anomaly coefficient, the insulation layer damage risk value and the crimping appearance quality value to obtain a comprehensive appearance defect index, and to determine the crimping appearance quality level of the wire harness connector by comparing the comprehensive appearance defect index with a preset threshold range.
[0043] In addition, this application also provides a computer device, the computer device including a memory and a processor, the memory storing code, the processor being configured to acquire the code and execute the above-described machine vision appearance defect detection method for wire harness connectors.
[0044] In some embodiments, reference Figure 4 The figure is a schematic diagram of the structure of a computer device implementing a machine vision appearance defect detection method for wire harness connectors according to some embodiments of this application. The machine vision appearance defect detection method for wire harness connectors in the above embodiments can... Figure 4 The computer device 500 shown is used to implement this, and the computer device 500 includes at least one processor 501, a communication bus 502, a memory 503, and at least one communication interface 504.
[0045] Processor 501 can be a general-purpose central processing unit (CPU) or an application-specific integrated circuit (ASIC).
[0046] The communication bus 502 can be used to transmit information between the aforementioned components.
[0047] Memory 503 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CDROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 503 may exist independently and be connected to processor 501 via communication bus 502. Memory 503 may also be integrated with processor 501.
[0048] The memory 503 stores program code for executing the solution of this application, and its execution is controlled by the processor 501. The processor 501 executes the program code stored in the memory 503. The program code may include one or more software modules. In the above embodiment, the machine vision appearance defect detection method for wire harness connectors can be implemented by the processor 501 and one or more software modules in the program code in the memory 503.
[0049] Communication interface 504 uses any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0050] In a specific implementation, as one example, a computer device may include multiple processors, each of which may be a single-core (single CPU) processor or a multi-core (multi CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0051] The aforementioned computer device can be a general-purpose computer device or a special-purpose computer device. In specific implementations, the computer device can be a desktop computer, a portable computer, a network server, a handheld digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer device.
[0052] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described machine vision appearance defect detection method for wire harness connectors.
[0053] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0054] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A machine vision method for detecting appearance defects in wire harness connectors, characterized in that, Includes the following steps: Edge contours are extracted from the acquired wire harness connector images to obtain the edge contours of the crimping area and the cable insulation area. Geometric matching is performed between the edge contour of the pressing area and the pre-stored reference contour model to calculate the positional and shape deviations between the edge contour of the pressing area and the reference contour model, and to determine the pressing deformation area. Curvature values are calculated for each edge segment within the compression deformation area, and the contour anomaly coefficient of each edge segment is determined based on the curvature difference between adjacent edge segments and the continuity of connection between edge segments. Extract the edge segment of the insulation layer at the junction of the crimping area and the cable insulation area, calculate the length of the continuous gap and the height of the burr protrusion of the edge segment of the insulation layer, and determine the risk value of insulation layer damage based on the length of the continuous gap and the height of the burr protrusion. The edge contour of the pressing area is subjected to flash detection, crack detection and dent detection to obtain the flash area, crack length and dent depth respectively, and the pressing appearance quality value is determined based on the flash area, crack length and dent depth. The contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are weighted and summed to obtain a comprehensive appearance defect index. The comprehensive appearance defect index is then compared with a preset threshold range to determine the crimping appearance quality level of the wire harness connector.
2. The method as described in claim 1, characterized in that, Edge contour extraction is performed on the acquired wire harness connector image to obtain the edge contours of the crimping area and the cable insulation area, specifically including: The image of the wire harness connector is subjected to grayscale processing and noise suppression filtering; The Canny edge detection operator is used to perform edge detection on the filtered image to obtain an initial set of edge points; Perform connected component analysis on the initial set of edge points to separate the connected components corresponding to the crimping area and the cable insulation area; Contour tracing is performed on the connected domains corresponding to the crimping area and the connected domains corresponding to the cable insulation area to obtain the edge contours of the crimping area and the cable insulation area. If a 3D vision system is used, 3D point cloud data of the wire harness connector can be acquired simultaneously and registered with the 2D image.
3. The method as described in claim 1, characterized in that, Based on the geometric matching of the edge contour of the pressing area with the pre-stored reference contour model, the positional deviation and shape deviation between the edge contour of the pressing area and the reference contour model are calculated to determine the pressing deformation area, specifically including: The baseline contour model is a normal contour interval model established based on the contours of multiple qualified samples of the same specification, and the baseline contour model is associated with a pre-stored qualified sample 3D baseline model. The edge contour of the pressing area is rigidly registered with the reference contour model to obtain the initial position deviation; Based on the initial position deviation, an iterative nearest point algorithm is used for non-rigid registration, and the 3D point cloud of the pressing area is simultaneously registered with the reference 3D model to obtain the shape deviation vector between each corresponding point. The shape deviation vector is statistically analyzed, and the region with a deviation value greater than a preset deviation threshold is selected as the pressing deformation region.
4. The method as described in claim 1, characterized in that, The curvature value of each edge segment within the compression deformation area is calculated, and the contour anomaly coefficient of each edge segment is determined based on the curvature difference between adjacent edge segments and the continuity of connection between edge segments. Specifically, this includes: The edge contour of the compression deformation area is smoothed. The smoothed edge contour is divided into multiple edge segments according to a preset pixel length; For each edge segment, the local curvature value is calculated using the three-point method or circle fitting. Calculate the absolute value of the curvature difference between adjacent edge segments and detect whether the distance between the endpoints of adjacent edge segments is less than a preset connection threshold to determine the continuity of the connection; The absolute value of the curvature difference of each edge segment is normalized and weighted and summed with the connection continuity loss indicator to obtain the contour anomaly coefficient of that edge segment. The preset connection threshold is determined based on the statistical value of the connection gap of the edge segments of qualified samples.
5. The method as described in claim 1, characterized in that, Extracting the edge segment of the insulation layer at the boundary between the crimping area and the cable insulation area, calculating the continuity gap length and burr protrusion height of the edge segment of the insulation layer, and determining the insulation layer damage risk value based on the continuity gap length and the burr protrusion height specifically includes: A search window is set at the junction of the crimping area and the cable insulation area to extract the edge segment of the insulation layer located within the search window; The actual missing edge point intervals are detected along the theoretical extension direction of the edge segment of the insulation layer, and the cumulative length of the missing intervals is taken as the length of the continuity gap. Perform convex hull analysis on the edge segment of the insulating layer and calculate the average deviation distance from the actual edge point to the convex hull as the burr protrusion height; Detect pixels in the insulating layer region image within the search window whose gray values are lower than a preset gray threshold, and calculate the area of the connected region of these pixels as the exposed area of the conductor; The surface delamination and depression features of the insulating layer are analyzed using 3D point cloud analysis, and the projected area of the delamination region is calculated. The insulation layer damage risk value is obtained by normalizing and weighting the length of the continuous gap, the height of the burr protrusion, the exposed area of the conductor, and the projected area of the layered region.
6. The method as described in claim 1, characterized in that, The edge contour of the crimping area is subjected to flash detection, crack detection, and dent detection to obtain the flash area, crack length, and dent depth, respectively. The crimping appearance quality value is then determined based on the flash area, crack length, and dent depth, specifically including: The edge contour of the pressing area is differiated from the reference contour model to obtain the area that exceeds the reference contour model as the candidate flash area. Combined with 3D point cloud verification, the convex height of the candidate flash edge region is greater than or equal to a preset height threshold. Grayscale verification is performed on the candidate flash edge region. Regions with grayscale values higher than a preset metal grayscale threshold are retained as flash edge regions. The pixel area of the flash edge region is calculated as the flash edge area. The image of the pressing area is grayscaled, and the linear features in the image are enhanced by the Gaussian Laplacian operator. Combined with the surface depth abrupt change features detected by 3D point cloud, candidate crack regions are obtained by threshold segmentation. Regions with a length greater than a preset length threshold and a width less than a preset width threshold are filtered out as cracks, and the crack length is accumulated. Within the compression deformation area, based on the registered 3D point cloud data, the vertical distance from the 3D point corresponding to the actual contour to the reference 3D model along the Z-axis is calculated, and the maximum value is taken as the indentation depth. The surface appearance quality value is obtained by normalizing the flash area, the crack length, and the indentation depth, then weighting and summing them, and then inverting the sum.
7. The method as described in claim 5 or 6, characterized in that, The comprehensive index of appearance defects is obtained by weighted summation of the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value, specifically including: If the crack length is greater than or equal to a preset fatal crack length threshold, or the conductor exposed area is greater than or equal to a preset fatal exposed area threshold, then the comprehensive appearance defect index is set to a predetermined unqualified value; otherwise, the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are normalized so that their values are between 0 and 1. The normalized contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value are each multiplied by a corresponding preset weighting coefficient determined based on the risk priority number established by failure mode and effects analysis. The weighted sum of the three factors yields the comprehensive index of appearance defects.
8. A machine vision appearance defect detection system for wire harness connectors, characterized in that, include: The extraction module is used to extract the edge contours of the acquired wire harness connector images to obtain the edge contours of the crimping area and the cable insulation area. The processing module is used to perform geometric matching based on the edge contour of the pressing area and the pre-stored reference contour model, calculate the positional deviation and shape deviation between the edge contour of the pressing area and the reference contour model, and determine the pressing deformation area. The processing module is also used to calculate the curvature value of each edge segment in the compression deformation area, and determine the contour anomaly coefficient of each edge segment based on the curvature difference between adjacent edge segments and the continuity of the connection between edge segments; The processing module is also used to extract the edge segment of the insulation layer at the junction of the crimping area and the cable insulation area, calculate the length of the continuous gap and the height of the burr protrusion of the edge segment of the insulation layer, and determine the insulation layer damage risk value based on the length of the continuous gap and the height of the burr protrusion. The processing module is also used to perform flash detection, crack detection and depression detection on the edge contour of the crimping area, respectively to obtain the flash area, crack length and depression depth, and to determine the crimping appearance quality value based on the flash area, the crack length and the depression depth. The execution module is used to perform a weighted summation of the contour anomaly coefficient, the insulation layer damage risk value, and the crimping appearance quality value to obtain a comprehensive appearance defect index. Based on the comparison of the comprehensive appearance defect index with a preset threshold range, the crimping appearance quality level of the wire harness connector is determined.
9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the machine vision appearance defect detection method for wire harness connectors as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements a machine vision method for detecting appearance defects in wire harness connectors as described in any one of claims 1 to 7.