New energy automobile wire harness terminal crimping quality on-line detection method

By calculating the tilt and distance of the outer contour area of ​​the automotive wiring harness terminal image, and combining rotation and boundary line confidence screening, the problem of inaccurate boundary lines between wires and insulation layers in traditional visual inspection is solved, achieving high-precision crimping quality assessment.

CN121962084APending Publication Date: 2026-05-01WEIHAI JUN AO ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WEIHAI JUN AO ELECTRIC CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional visual inspection algorithms struggle to accurately separate wires from insulation layers when inspecting the crimping quality of automotive wiring harness terminals, resulting in inaccurate area boundaries and an inability to assess crimping quality.

Method used

The probability of non-wire harness ends is calculated based on the tilt and distance of the outer contour region image. By rotating the image through the positioning baseline, the boundary line is screened by combining the confidence and realism of the boundary line, and a boundary line set index is constructed to accurately identify the boundary of the crimping area.

Benefits of technology

It improves the robustness of area segmentation and the completeness of crimping quality assessment, eliminates interference from insulation reflection, avoids misjudgment at crimping deformation and burrs using traditional methods, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962084A_ABST
    Figure CN121962084A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual inspection, in particular to a new energy automobile wire harness terminal crimping quality online detection method, which comprises the following steps: acquiring an outer contour area image by analyzing a connected domain of a crimping wire harness terminal image, and calculating the crimping quality of the wire harness terminal according to the inclination degree of each straight line and the distance between each straight line and the left edge of the image; determining a positioning datum line to rotate the image, and determining a final boundary based on the inclination degree of a straight line in the rotated image and the distance between the straight line and the positioning datum line in combination with the connection condition and length of the straight line and the outer contour so as to determine each segmentation region in the to-be-segmented image; comparing each segmented region with a corresponding standard region to judge the crimping quality of each segmented region; the influence of missing division or excessive division caused by the fact that traditional fixed threshold division cannot adapt to symmetrical deformation of the terminal is avoided; the misjudgment of a traditional single angle threshold value at crimping deformation and burrs is avoided, and the robustness of region segmentation and the integrity of crimping quality evaluation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Online Inspection Method for Terminal Crimping Quality of New Energy Vehicle Wiring Harnesses Technical Field

[0001] This application relates to the field of visual inspection technology, specifically to an online inspection method for the crimping quality of wiring harness terminals in new energy vehicles. Background Technology

[0002] Automotive wiring harness terminals, often referred to as the "nerves" of a vehicle, serve as carriers for electrical signal control, transmitting current and signals. The crimping quality of these terminals directly determines the reliability of signal transmission; poor crimping can lead to increased contact resistance, overheating and burning, and even malfunction. Therefore, it is essential to inspect the crimping quality of automotive wiring harness terminals after crimping to ensure that every terminal can withstand extreme conditions such as high temperature, high humidity, and vibration, guaranteeing vehicle safety during operation.

[0003] In industrial vision-based intelligent inspection scenarios, the interior of a crimped wire harness terminal simultaneously contains multiple functional areas, including a metal conductor, an insulating layer, and the crimping area. Traditional vision inspection algorithms typically segment these areas by "extracting the object's outer contour → dividing the region according to the boundary." However, because the differences in grayscale or color between the conductor and the insulating layer are subtle, edge extraction operators may misidentify the "conductor-insulation" transition zone as the object boundary, causing the region boundary lines to drift or be missed. This results in inaccurate boundary lines extracted by traditional methods for each region of the crimped wire harness terminal, making it impossible to accurately assess the quality of the crimped automotive wire harness terminal. Summary of the Invention

[0004] To address the aforementioned technical issues, this application provides an online testing method for the crimping quality of wiring harness terminals in new energy vehicles, thereby resolving the existing problems.

[0005] The online detection method for crimping quality of new energy vehicle wiring harness terminals in this application adopts the following technical solution: One embodiment of this application provides an online detection method for crimping quality of new energy vehicle wiring harness terminals, which includes the following steps: acquiring an image of the crimped wiring harness terminal; obtaining a binary image of the crimped wiring harness terminal image to determine the outer contour region image of the crimped wiring harness terminal; calculating the non-wiring harness end probability of each straight line in the outer contour region image based on the inclination degree of each straight line in the outer contour region image and the distance between each straight line and the boundary of the crimped wiring harness terminal image; taking the straight line with the smallest non-wiring harness end probability as the positioning reference line; and based on the inclination angle of the positioning reference line... The contour region image is rotated to obtain the image to be segmented for the wire harness terminals. Based on the inclination of each straight line in the image to be segmented and the distance between each straight line and the positioning reference line, the confidence level of the boundary line of each straight line in the image to be segmented is calculated to determine the suspected boundary lines in the image to be segmented. All suspected boundary lines are sorted, and based on the coordinate difference between two adjacent suspected boundary lines and the connection between each straight line and the contour of the outer contour region, combined with the length of each straight line, the final boundary line is determined to determine each segmented region in the image to be segmented. Each segmented region is compared with the corresponding standard region to determine the crimping quality of each segmented region.

[0006] In one embodiment, the outer contour region image is the region enclosed by the outer contour of the largest connected domain in the binary image.

[0007] In one embodiment, the process of obtaining the non-wire harness end probability is as follows: A preset image of the wire harness terminals in the image shows the image boundary near which the wire harness end is located when the wire harness terminals are ideally positioned; the angle between each straight line in the outer contour region image and the image boundary near which the wire harness end is located is obtained; the difference between the mean of the x-coordinates of all pixels in each straight line and the x-coordinate of the image boundary near which the wire harness end is located is taken as the distance between each straight line and the image boundary near which the wire harness end is located; the non-wire harness end probability is calculated based on the angle and the distance of each straight line in the outer contour region image, wherein the non-wire harness end probability is positively correlated with both the angle and the distance.

[0008] In one embodiment, the process of obtaining the confidence level of the dividing line is as follows: calculate the angle between each straight line in the image to be segmented and the horizontal axis, and record it as the first angle; calculate the mean ordinate of all pixels in each straight line, and calculate the difference between the mean ordinate of each straight line in the image to be segmented and the positioning reference line, and record it as the first difference; calculate the confidence level of the dividing line based on the first angle and the first difference of each straight line in the image to be segmented, wherein the confidence level of the dividing line is directly proportional to the first angle and inversely proportional to the first difference.

[0009] In one embodiment, the suspected dividing line is a straight line in the image to be segmented where the confidence level of the dividing line is greater than a preset segmentation threshold.

[0010] In one embodiment, the process of filtering boundary lines is as follows: based on the difference in the horizontal coordinates between suspected boundary lines, determine the undetermined boundary lines among the suspected boundary lines; set the marker value of each undetermined boundary line based on the connection between each undetermined boundary line and the contour of the outer contour region; calculate the boundary accuracy of each undetermined boundary line in combination with the length of each undetermined boundary line to determine the erroneous boundary lines among all undetermined boundary lines; and use the remaining suspected boundary lines other than the erroneous boundary lines as the filtered boundary lines; wherein, the boundary accuracy is positively correlated with the marker value and the length, respectively.

[0011] In one embodiment, the process of obtaining the undetermined boundary line is as follows: when the number of suspected boundary lines is greater than the predetermined number of boundary lines, the mean horizontal coordinate of all pixels in each suspected boundary line is calculated, all suspected boundary lines are arranged according to the mean horizontal coordinate, the difference between the mean horizontal coordinate of two adjacent suspected boundary lines is calculated and recorded as the second difference; two adjacent suspected boundary lines are grouped as a boundary line group; all boundary line groups are arranged in ascending order of the second difference, and the first preset number of boundary line groups are obtained as undetermined boundary line groups; the boundary lines in all undetermined boundary line groups are used as undetermined boundary lines.

[0012] In one embodiment, the process of obtaining the mark value of each undetermined boundary line is as follows: if both ends of each undetermined boundary line are connected to the contour of the outer contour region, then the mark value of each undetermined boundary line is set to a; otherwise, it is set to b; where a>b.

[0013] In one embodiment, the process of obtaining the error boundary line is as follows: the undetermined boundary line with the lowest boundary accuracy in each undetermined boundary line group is taken as the error boundary line.

[0014] In one embodiment, the process of obtaining each segmented region is as follows: obtain the smallest bounding rectangle of each pair of adjacent dividing lines as each segmented region.

[0015] This application has at least the following beneficial effects: By performing connected component analysis on the image of the crimped wiring harness terminal, this application obtains the outer contour region image of the crimped wiring harness terminal. Based on the inclination of each straight line in the outer contour region image and the distance between each straight line and the left edge of the crimped wiring harness terminal image, a positioning baseline is determined. The image is rotated using the positioning baseline, and the confidence level of the boundary lines in the rotated image is calculated. This accurately identifies the difference in directional angle between the true boundary line and the conductor edge, effectively reducing the interference of straight lines caused by insulation reflection and accurately depicting the dynamic range of the crimping area boundary. Based on the fusion and screening of the difference in the horizontal coordinate distance of the straight lines and the boundary realism, the actual boundary line set of the crimped wiring harness terminal is calculated, eliminating falsely identified boundary lines and avoiding the inability of traditional fixed threshold segmentation to adapt to the symmetrical deformation of the terminal, resulting in either omissions or over-segments. By fusing the boundary line confidence and boundary realism in a two-dimensional manner, a boundary line set index is constructed, automatically distinguishing between vertical boundary lines and parallel conductor edges. This avoids misjudgments at crimping deformation and burrs caused by traditional single-angle thresholds, improving the robustness of region segmentation and the completeness of crimping quality assessment. Attached Figure Description

[0016] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 is a flowchart of the online detection method for the crimping quality of new energy vehicle wiring harness terminals provided in this application; Figure 2 is a schematic diagram of the boundary line screening process. Detailed Implementation

[0018] To further illustrate the technical means and effects adopted by this application to achieve the intended purpose of the invention, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of the online detection method for the crimping quality of new energy vehicle wiring harness terminals proposed in this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0020] The following description, in conjunction with the accompanying drawings, details the specific scheme of the online detection method for the crimping quality of new energy vehicle wiring harness terminals provided in this application.

[0021] One embodiment of this application provides an online detection method for the crimping quality of wiring harness terminals in new energy vehicles.

[0022] Specifically, the following online detection method for crimping quality of wiring harness terminals in new energy vehicles is provided. Please refer to Figure 1. The method includes the following steps: Step S1, acquiring images of crimped wiring harness terminals.

[0023] First, the crimped wire harness terminals are placed on a testing platform. Above the testing platform, from top to bottom, are a testing camera, a fixed-focus lens, and a light source. The testing camera is used to photograph the crimped wire harness terminals; the fixed-focus lens is used to focus on the crimped wire harness terminals; and the light source provides sufficient illumination for image extraction, making the texture of the crimped wire harness terminals clearer in the captured image. The crimped terminals are mainly divided into five parts: the terminal area, the crimped wire harness end area, the wire crimping area, the wire crimping front area, and the insulation crimping area. In this embodiment, the ideal placement of the crimped wire harness terminals on the testing platform is with the wire harness terminals placed horizontally, the wire harness end near the left edge of the image, and the insulation crimping area near the right edge of the image. In other embodiments of this application, the implementer may use other placement positions.

[0024] Next, an image of the crimped wire harness terminal is captured by a detection camera. This image is then converted to grayscale using a weighted average method, and denoised using the NLM algorithm to eliminate the influence of noise on the subsequent detection results. The denoised image is recorded as the crimped wire harness terminal image. The calculation of the weighted average method and the NLM algorithm are well-known techniques, and the specific calculation steps will not be detailed here.

[0025] Step S2: Obtain a binary image of the crimped wire harness terminal image to determine the outer contour region image of the crimped wire harness terminal; based on the inclination of each straight line in the outer contour region image and the distance between each straight line and the boundary of the crimped wire harness terminal image, calculate the non-wire harness end probability of each straight line in the outer contour region image.

[0026] Because wires are flexible materials, after the crimped wire harness terminals are placed on the testing platform, the wires will bend. The interaction between the wires and the testing platform will cause the end of the crimped wire harness terminal to no longer be parallel to the left side of the captured image. This results in an uncertain vertical position of the wire harness terminal in the image, increasing the difficulty of segmenting the various parts of the crimped wire harness terminal. The crimped terminal is mainly divided into five parts: the terminal area, the crimped wire harness end area, the wire crimping area, the wire crimping front area, and the insulation crimping area.

[0027] Therefore, it is necessary to locate the edges of the terminals in the crimped wiring harness terminal image and adjust the image to facilitate the subsequent identification and segmentation of various parts of the crimped wiring harness terminal, thereby improving the defect identification capability of the crimped wiring harness terminal. Since the edges of the wiring harness terminals are usually of a regular shape for easy connection, they appear as straight lines in the crimped wiring harness terminal image. Therefore, the crimped wiring harness terminal image is used as input to the Canny edge detection algorithm, and the algorithm outputs the edge image of the crimped wiring harness terminal. A closing operation is performed on the edge image to avoid small gaps in the edge lines causing discontinuity. The Canny edge detection algorithm is a well-known technology, and the specific calculation steps will not be elaborated here.

[0028] It should be noted that this application only provides one edge detection method for edge detection of crimped wiring harness terminal images. There are many existing edge detection algorithms, and implementers may also use other edge detection algorithms to perform edge detection on crimped wiring harness terminal images. This application does not impose any specific restrictions.

[0029] Since the outer contour of the crimped wire harness terminal contains the largest area, a two-pass scanning method is used to obtain all connected components of the edge image. The area of ​​each connected component is then obtained using the contourArea() function. The region enclosed by the outer contour of the connected component with the largest area is extracted and denoted as the outer contour region image. This image is a binary image (with an edge value of 255, white color, and black color for the remaining areas) and is used to characterize the outer contour region of the crimped wire harness terminal. Both the two-pass scanning method and the contourArea() function are well-known techniques, and the specific calculation steps will not be elaborated here.

[0030] It should be noted that this application only provides one method for connecting component analysis and one method for calculating the area of ​​connected components. There are many existing methods for connecting component analysis and one method for calculating the area of ​​connected components. Implementers may also use other methods for connecting component analysis and one method for calculating the area of ​​connected components to obtain the connected components and their areas. This application does not impose any specific restrictions.

[0031] To obtain the end of the crimped harness terminal, the end of the harness is typically a straight line. Therefore, the outer contour region image is used as input to the Hough line detection algorithm, and the output is the straight line in the outer contour region image, denoted as the outer contour region line. Because the placement of the crimped harness terminal is constrained by the harness clamp, the end of the crimped harness terminal is closer to the left edge of the crimped harness terminal image. Therefore, the distance from the center of each outer contour region line to the left edge of the crimped harness terminal image is obtained, where the left edge is the left side of the image border. In this embodiment, the distance is determined by the difference between the mean of the x-coordinates of all pixels in each line and the x-coordinate of the left edge. Simultaneously, due to the placement of the crimped harness terminal, the angle between the end line of the crimped harness terminal and the left edge of the crimped harness terminal image is small. Therefore, the angle between all the outer contour region lines in the crimped harness terminal and the left edge of the crimped harness terminal image is obtained, used to characterize the parallelism between the outer contour region lines and the left edge of the crimped harness terminal image. The calculation of the Hough line detection algorithm is a known technique, and the specific calculation steps will not be described here. In other embodiments of this application, the implementer may also use other line detection algorithms to obtain lines in the outer contour region image.

[0032] Therefore, the probability of a straight line in each outer contour region not being a wire harness end is calculated. This probability characterizes the likelihood that a straight line in the outer contour region is not a wire harness end. Preferably, in this embodiment, the expression for the probability of a non-wire harness end is: In the formula, This represents the probability of the non-bundle end of the i-th straight line in the outer contour region image. This represents the angle between the i-th straight line in the outer contour region image and the left edge of the crimped wire harness terminal image. This represents the distance from the i-th straight line in the outer contour region image to the left edge of the crimped wire harness terminal image. It represents 180 degrees. As a regulating factor. In this embodiment, Set to 1° to avoid When it is 0, it leads to The value is directly 0. In other embodiments of this application, the implementer may set the value according to the actual situation. The value of .

[0033] The ratio of the angle between the straight line in the outer contour region image and the left edge of the crimped harness terminal image to π can characterize the skewness of the straight line in the outer contour region relative to the left edge of the crimped harness terminal image. A larger skewness indicates that it is less likely to be the end edge of the crimped harness terminal. Simultaneously, since there may be straight lines parallel to the end edge of the crimped harness terminal, the distance between the straight line in the outer contour region and the left edge of the crimped harness terminal image can characterize the probability that this straight line is not the end edge of the crimped harness. Determining the probability that the straight line in the outer contour region is not the end edge of the crimped harness by using these two features characterizes the probability that the straight line in the outer contour region is the end edge of the crimped harness terminal; a larger value indicates that it is less likely to be the end edge of the crimped harness.

[0034] The smaller the angle between the outer contour line and the vertical axis, and the smaller the distance from the left edge of the crimped wire harness terminal image, the lower the probability that the outer contour line is not the end of the wire harness. This indicates that the outer contour line is more likely to be the end edge line of the wire harness. Rotating the image through this line can improve the segmentation of the crimped wire harness terminal in subsequent visual inspection, and can also reduce the segmentation time and improve the accuracy of visual inspection.

[0035] Step S3: The straight line with the lowest probability of not being the end of the wire harness is used as the positioning reference line; the outer contour area image is rotated based on the tilt angle of the positioning reference line to obtain the wire harness terminal to be segmented image; based on the tilt degree of each straight line in the to-be-segmented image and the distance between each straight line in the to-be-segmented image and the positioning reference line, the confidence level of the boundary line of each straight line in the to-be-segmented image is calculated to determine the suspected boundary line in the to-be-segmented image.

[0036] The straight line of the outer contour region with the lowest probability of being a non-wire harness end is denoted as the positioning reference line, used to characterize the end of the crimped wire harness terminal. Next, the angle θ between the positioning reference line and the vertical axis of the crimped wire harness terminal image is obtained. The image is then rotated by θ degrees with the center of the crimped wire harness terminal image as the origin, so that the positioning reference line is perpendicular to the horizontal axis of the image. This rotated image of the crimped wire harness terminal is denoted as the wire harness terminal image to be segmented.

[0037] The crimped wire harness terminal consists of five parts, with clear dividing lines between adjacent parts. These dividing lines are represented as straight lines in the image. To segment the five parts of the crimped wire harness terminal, the image to be segmented is used as input to the Hough line detection algorithm, and the output is all the straight lines in the image. In other embodiments of this application, the implementer may also use other line detection algorithms to obtain the straight lines in the image. Because the wire is bound, the edges of the wire are easily identified as straight lines, and the edges of the crimped wire harness terminal are also easily identified as straight lines. However, the straight lines of the wire and the edges of the wire harness terminal are parallel or nearly parallel to the horizontal axis of the image to be segmented, while the dividing lines of each region are perpendicular or nearly perpendicular to the horizontal axis of the image. Therefore, the angle between all the straight lines in the image to be segmented and the horizontal axis of the image is obtained to characterize the direction of the straight line distribution in the image. At the same time, since the shape of the crimped wire harness terminal is close to symmetrical, the segmentation centers of each region should ideally be on the same horizontal line. Therefore, the mean value of the ordinate of all pixels in each straight line in the image to be segmented of the wire harness terminal is calculated and denoted as the vertical distance, which is used to characterize the vertical height of the straight line in the image to be segmented of the wire harness terminal.

[0038] The difference between the perpendicular distances of each straight line in the image to be segmented from the positioning reference line in the wire harness terminal is denoted as the first difference. This difference can be the absolute value of the difference, the square of the difference, a ratio, etc.

[0039] Therefore, the confidence score of the boundary line for each straight line in the image to be segmented from the wire harness terminal is calculated. Preferably, in this embodiment, the expression for the confidence score of the boundary line is: In the formula, This represents the confidence level of the boundary line of the j-th straight line in the image to be segmented from the wire harness terminal. The angle between the j-th straight line in the image to be segmented from the wire harness terminal and the horizontal axis is denoted as the first included angle. This represents the vertical distance of the j-th straight line in the image to be segmented from the wire harness terminal; Indicates the vertical distance from the positioning baseline; This represents the parameter tuning factor, specifically a minimum value greater than 0, used to prevent the denominator from being 0; in this embodiment, it is set to 1. Wherein, This is the first difference.

[0040] In other embodiments of this application, the expression for the confidence level of the boundary line may also be: .

[0041] In the segmented image of the wire harness terminal, the boundary lines of each region of the wire harness terminal are perpendicular or nearly perpendicular to the horizontal axis. Therefore, by dividing the angle between the straight lines in the segmented image of the wire harness terminal and the horizontal axis by π, the distribution direction of the straight lines in the segmented image of the wire harness terminal can be characterized. Simultaneously, due to the symmetry of the shape of the crimped wire harness terminal, the center positions of the boundary lines of each region are located on the same horizontal line, resulting in a small difference between the vertical distance of the boundary line center position and the vertical distance of the positioning reference line. Therefore, the confidence level of the boundary lines in the segmented image of the wire harness terminal, determined by these two features, can characterize the probability that the straight lines in the segmented image of the wire harness terminal are boundary lines; the larger the value, the greater the probability that the straight line is a boundary line.

[0042] The higher the confidence level of a straight line as a dividing line, the more likely it is to be a dividing line. The more accurate the division of each area of ​​the crimp terminal is through this line, the more accurate the subsequent visual inspection can be.

[0043] Regarding the confidence scores of the boundary lines in the image to be segmented for the aforementioned wire harness terminals, the confidence score is higher when the line is the boundary line of each region, and lower when the line is not a boundary line. Therefore, the confidence scores of all the aforementioned line boundary lines are used as input to the Otsu's method, and the output is the segmentation threshold. Lines with a boundary line confidence score greater than the segmentation threshold are recorded as suspected boundary lines. The relationship between the number of suspected boundary lines and N is compared, where N is the number of lines used to divide the regions. In this implementation, N is set to 6 because there are five regions in the crimped wire harness terminal, and 6 lines are needed to form 5 regions. When the number of suspected boundary lines equals N, it indicates that the lines in the suspected boundary line set are the boundaries of each region of the crimped wire harness terminal. When the number of suspected boundary lines is less than N, it indicates that there are not enough boundary lines to distinguish the different regions of the wire harness terminal, and the wire harness terminal has serious defects. When the number of elements in the suspected boundary line set is greater than N, it indicates that there exists a straight line formed by the insulation layer and the wire, which is mistakenly identified as a boundary line due to the need for alignment between the insulation layer and the wire. The Otsu's method is a well-known technique, and its specific process will not be elaborated further.

[0044] It should be noted that this application only provides one threshold segmentation method for threshold segmentation of the confidence of the boundary lines of all lines in the image to be segmented. There are many existing threshold segmentation methods, and implementers may also use other threshold segmentation algorithms to calculate the segmentation threshold of the confidence of the boundary lines. This application does not impose any specific restrictions.

[0045] Step S4: Sort all suspected dividing lines, and determine the final dividing lines based on the coordinate difference between two adjacent suspected dividing lines and the connection between each straight line and the contour of the outer contour area, combined with the length of each straight line, so as to determine each segmented region in the image to be segmented; compare each segmented region with the corresponding standard region to judge the pressing quality of each segmented region.

[0046] Since the boundary lines are located at different positions, the average abscissa of all pixels in each suspected boundary line is calculated. All suspected boundary lines are arranged according to the average abscissa, and the difference between the average abscissa of two adjacent suspected boundary lines is calculated and recorded as the second difference. Two adjacent suspected boundary lines are grouped as a boundary line group. Since there is a certain distance between the various areas of the crimped wiring harness terminal, the distance between the misidentified boundary line and the true boundary line is small. Therefore, all boundary line groups are arranged in ascending order of the second difference, and the first MN boundary line groups are obtained as the undetermined boundary line groups. The straight lines in the undetermined boundary line groups are recorded as undetermined boundary lines. Here, M represents the number of suspected boundary lines, and MN represents the number of misidentified boundary lines.

[0047] Furthermore, since the insulation and wires are typically contained within the wire harness terminals, the straight line formed by the insulation and wires is usually shorter than the boundary line length and does not connect to the outer contour of the crimped wire harness terminals. It is determined whether both ends of each straight line connect to the outer contour of the outer contour region image. If both ends are connected, it is marked as 2; if not connected or only one end is connected, it is marked as 1. This characterizes the distribution state of the undetermined boundary lines. Therefore, the boundary accuracy of each extracted straight line is calculated. Preferably, in this embodiment, the expression for the boundary accuracy is: In the formula, This indicates the boundary truth of the k-th undetermined boundary line. , These represent the number of pixels and the label value of the k-th undetermined boundary line in the image, respectively.

[0048] Since the boundary lines of each region are usually connected to the outer contour of the wire harness terminal, while the wire and insulation are not connected to the outer contour, the length of the straight line and the degree of connection with the outer contour can characterize whether the straight line is likely to be a boundary line. The larger both are, the more likely the straight line is to be a boundary line.

[0049] The greater the accuracy of the dividing line, the more likely the line is to be the dividing line of each area of ​​the actual crimp terminal. In the process of industrial vision inspection, the results of dividing by the line are more accurate, and the effect of vision inspection is also more accurate.

[0050] The boundary line with the lowest boundary accuracy in each group of undetermined boundary lines is designated as the erroneous boundary line. All erroneous boundary lines are removed from the suspected boundary line set. The set after removal is denoted as the boundary line set. For example, in the two groups of undetermined boundary lines (3,4) and (6,7), if the boundary accuracy of line 4 is smaller than that of line 3, then line 4 is removed and line 3 is retained; if the boundary accuracy of line 6 is smaller than that of line 7, then line 6 is removed and line 7 is retained. Next, the smallest bounding rectangle of each pair of adjacent boundary lines is used as each segmented region to characterize the various regions of the crimped wire harness terminal. From left to right, these are the terminal region, the crimped wire harness end region, the wire crimping region, the wire crimping front region, and the insulation crimping region.

[0051] Next, a standard crimped wiring harness terminal image without defects is acquired, and the image is manually segmented into different regions. The crimping quality of each segmented region is determined by calculating the similarity between the segmented region and the corresponding region in the standard crimped wiring harness terminal image. The SSIM (Structural Similarity Score) between each segmented region and its corresponding standard region is calculated and judged using a similarity threshold. If the SSIM between each segmented region and its corresponding standard region is greater than or equal to the similarity threshold, the crimping quality within that segmented region is good; otherwise, a problem with the crimping within that segmented region is identified. In this embodiment, the similarity threshold is set to 0.9. In other embodiments of this application, the implementer can set the similarity threshold according to the actual situation.

[0052] Figure 2 shows a schematic diagram of the boundary line screening process.

[0053] In summary, this application embodiment obtains the outer contour region image of the crimped wiring harness terminal by performing connected component analysis on the image of the crimped wiring harness terminal. Based on the inclination of each straight line in the outer contour region image and the distance between each straight line and the left edge of the crimped wiring harness terminal image, a positioning reference line is determined. The image is rotated using the positioning reference line, and the confidence of the boundary lines in the rotated image is calculated. This accurately identifies the difference in directional angle between the real boundary line and the conductor edge, effectively reducing the interference of straight lines caused by insulation reflection and accurately depicting the dynamic range of the crimping area boundary. Based on the fusion and screening of the difference in the horizontal coordinate distance of the straight lines and the boundary authenticity, the actual boundary line set of the crimped wiring harness terminal is calculated, eliminating falsely identified boundary lines and avoiding the omission or over-segmentation caused by the inability of traditional fixed threshold segmentation to adapt to the symmetrical deformation of the terminal. By fusing the boundary line confidence and boundary authenticity in two dimensions, a boundary line set index is constructed, automatically distinguishing between vertical boundary lines and parallel conductor edges. This avoids the misjudgment of traditional single-angle threshold at crimping deformation and burrs, improving the robustness of region segmentation and the completeness of crimping quality assessment.

[0054] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.

[0055] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0056] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions of some of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. An online inspection method for the crimping quality of wiring harness terminals in new energy vehicles, characterized in that, The method includes the following steps: acquiring an image of the crimped wire harness terminal; obtaining a binary image of the crimped wire harness terminal image to determine the outer contour region image of the crimped wire harness terminal; calculating the non-wire harness end probability of each straight line in the outer contour region image based on the inclination of each straight line and the distance between each straight line and the boundary of the crimped wire harness terminal image; using the straight line with the lowest non-wire harness end probability as the positioning reference line; rotating the outer contour region image based on the inclination angle of the positioning reference line to obtain the wire harness terminal to be segmented image; calculating the boundary line confidence of each straight line in the to-be-segmented image based on the inclination of each straight line in the to-be-segmented image and the distance between each straight line in the to-be-segmented image and the positioning reference line to determine the suspected boundary lines in the to-be-segmented image; sorting all suspected boundary lines, and determining the final boundary line based on the coordinate difference between two adjacent suspected boundary lines, the connection between each straight line and the contour of the outer contour region, and the length of each straight line, to determine each segmented region in the to-be-segmented image; comparing each segmented region with the corresponding standard region to determine the crimping quality of each segmented region.

2. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The outer contour region image is the region enclosed by the outer contour of the largest connected domain in the binary image.

3. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The process of obtaining the non-wire harness end probability is as follows: A preset image of the wire harness terminals in the image shows the image boundary near which the wire harness end is located when the terminals are ideally positioned; the angle between each straight line in the outer contour region image and the image boundary near which the wire harness end is located is obtained; the difference between the mean of the x-coordinates of all pixels in each straight line and the x-coordinate of the image boundary near which the wire harness end is located is taken as the distance between each straight line and the image boundary near which the wire harness end is located; the non-wire harness end probability is calculated based on the angle and the distance of each straight line in the outer contour region image, and the non-wire harness end probability is positively correlated with both the angle and the distance.

4. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The process of obtaining the confidence of the dividing line is as follows: calculate the angle between each straight line in the image to be segmented and the horizontal axis, and record it as the first angle; calculate the mean of the ordinate of all pixels in each straight line, and calculate the difference between the mean of the ordinate of each straight line in the image to be segmented and the positioning reference line, and record it as the first difference; The confidence level of the dividing line is calculated based on the first angle and the first difference between each straight line in the image to be segmented. The confidence level of the dividing line is directly proportional to the first angle and inversely proportional to the first difference.

5. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The suspected dividing line is a straight line in the image to be segmented where the confidence level of the dividing line is greater than a preset segmentation threshold.

6. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The process of screening the boundary line is as follows: based on the difference in the horizontal coordinate between the suspected boundary lines, the undetermined boundary line among the suspected boundary lines is determined; Based on the connection between each undetermined boundary line and the contour of the outer contour region, a mark value is set for each undetermined boundary line. The boundary accuracy of each undetermined boundary line is calculated in combination with the length of each undetermined boundary line to determine the erroneous boundary lines among all undetermined boundary lines. The remaining suspected boundary lines, excluding the erroneous boundary lines, are selected as the boundary lines. The boundary accuracy is positively correlated with the mark value and the length, respectively.

7. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 6, characterized in that, The process of obtaining the undetermined boundary lines is as follows: when the number of suspected boundary lines is greater than the predetermined number of boundary lines, calculate the average horizontal coordinate of all pixels in each suspected boundary line, arrange all suspected boundary lines according to the average horizontal coordinate, calculate the difference between the average horizontal coordinate of two adjacent suspected boundary lines, and record it as the second difference; group two adjacent suspected boundary lines as a boundary line group; arrange all boundary line groups in ascending order of the second difference, and obtain the first preset number of boundary line groups as undetermined boundary line groups; and use the boundary lines in all undetermined boundary line groups as undetermined boundary lines.

8. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 6, characterized in that, The process of obtaining the mark value of each undetermined boundary line is as follows: if both ends of each undetermined boundary line are connected to the contour of the outer contour region, then the mark value of each undetermined boundary line is set to a; otherwise, it is set to b; where a>b.

9. The online inspection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 8, characterized in that, The process of obtaining the error boundary line is as follows: the boundary line with the lowest boundary accuracy in each group of undetermined boundary lines is taken as the error boundary line.

10. The online detection method for the crimping quality of wiring harness terminals in new energy vehicles as described in claim 1, characterized in that, The process of obtaining each segmented region is as follows: obtain the smallest bounding rectangle of each pair of adjacent boundary lines, and use it as each segmented region.