New energy automobile wire harness support assembly visual detection method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2026-08-11
AI Technical Summary
但是这种检测方法对于光照条件的要求较高,在光照条件发生变化影响识别的情况下容易造成很大的检测误差
[0016](1)拟合能力强,在正确安装,漏装,装配不合格的装配场景下,采用基于轮廓分析的检测方法可以准确地分离长槽孔与圆孔形,且拥有螺母轮廓中内径与外径同心圆轮廓特征的检测能力,具有强的拟合能力。
Smart Images

Figure CN118840323B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of new energy vehicle wiring harness assembly and manufacturing technology, specifically to a visual inspection method and system for new energy vehicle wiring harness bracket assembly based on contour feature analysis. Background Technology
[0002] With the development of the new energy vehicle industry, the demand for vehicle wiring harnesses is growing rapidly, and the assembly volume of vehicle wiring harnesses is constantly increasing. Because wiring harnesses are flexible and prone to deformation, assembly quality is unstable, leading to a surge in demand for wiring harness assembly inspection in new energy vehicles. As a crucial component in wiring harness assembly, the wiring harness bracket is frequently found to have missing or incorrectly installed nuts. Therefore, a visual inspection method and system for new energy vehicle wiring harness bracket assembly is needed to inspect the mounting nuts and long slotted holes on the bracket, achieving assembly quality inspection after completion.
[0003] Liu Liwei et al. designed an automotive wiring harness testing system based on a voltage-controlled constant current source detection method. This system uses current flowing through the conductor under test and A / D conversion to detect the voltage across the conductor to perform continuity testing on the automotive wiring harness. Simultaneously, this method is used to accurately measure the resistance and capacitance components present in the conductor. This system addresses the incomplete detection of wiring harness continuity and the inability to detect resistance and capacitance components within the wiring harness, particularly regarding the mounting nuts and long slots drilled during wiring harness assembly.
[0004] Huang Xinkang et al. proposed an image-based automotive wiring harness structure detection scheme. This scheme automatically switches between wiring harness detection algorithms by matching characters in a database, combining various traditional image detection algorithms and deep learning detection algorithms to achieve universal detection of various items across different wiring harnesses. However, this method primarily detects wiring harness coverings such as tape, adhesive tape, and cable ties, and cannot detect the installation nuts and long slotted holes in the wiring harness bracket assembly.
[0005] In existing patents, patent 2023115721897 discloses a new energy vehicle wiring harness testing device. This invention places the wiring harness on a mounting block, with the wires and interfaces at both ends of the harness falling onto a push plate. This push plate then pushes the interface, inserting it into a detection port on the testing mechanism. By setting up a sliding block, a first detection block, a second detection block, and a detection pressure sensor, the device detects the interface type. The sliding block moves up and down, changing the corresponding detection port, making the invention applicable to wiring harnesses using different interfaces. However, this method of detecting the interface type and then inserting the harness into the corresponding detection port requires setting up multiple detection ports for different types of wiring harnesses, making it difficult to truly achieve simultaneous testing of multiple different types of wiring harnesses.
[0006] In existing patents, patent 2024101425962 discloses a method for detecting automotive wiring harnesses with an automatic rejection function. Through a rejection component, a cleaning block slides from a circular groove into an inlet / outlet groove and a placement groove, thereby rejecting the wiring harness from the placement groove. The inlet / outlet groove is designed to allow the cleaning block to slide within it; its internal shape and size match the shape of the cleaning block, ensuring smooth sliding within the groove. This invention specifies a method for rejecting qualified wiring harnesses after detection, but it does not address how to detect the wiring harness.
[0007] Among existing patents, patent 2023104693592 discloses a wiring harness testing device for new energy vehicles. This device comprises two testing mechanisms. The first mechanism straightens the wiring harness, while the second mechanism uses a drive cylinder to move a grinding belt upwards, facilitating observation of fine transverse cracks in the wiring harness's coating. Simultaneously, the second mechanism uses two motors to move the grinding belt laterally and radially along the wiring harness, making the transverse and radial cracks in the coating more apparent. However, this testing method is highly dependent on lighting conditions, and changes in lighting can easily lead to significant testing errors. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention provides a visual inspection method and system for the assembly of wiring harness brackets in new energy vehicles. This method is used to inspect the assembly status of wiring harness brackets in new energy vehicles and has stronger fitting ability, stronger anti-interference ability, and better stability.
[0009] A visual inspection method for assembling wiring harness brackets in new energy vehicles includes the following steps:
[0010] Step 1: Collect assembly images of wiring harness brackets for new energy vehicles;
[0011] Step 2: Perform image preprocessing on the above wire harness bracket assembly image to obtain the connected domain of the binary image of the wire harness bracket;
[0012] Step 3: Perform contour analysis on the binary image, filter contour data, fit the contour data, and then determine the shape of the long slot hole and the circular hole.
[0013] Step 4: Determine the number of long slots and rings based on the circular hole and the long slot hole to determine the nut installation position. Determine the concentricity of the nut and the hole based on the angle between the center line connecting the long slots and the line connecting any long slot to the centroid of the circular hole, or the maximum distance between the centroids of the three circles, to determine the nut installation qualification.
[0014] A vision inspection system for automotive wiring harness bracket assembly based on contour analysis includes: an image acquisition module, mainly a camera, used to acquire information from images; an image processing module, including an image preprocessing module, a contour fitting module, and a result determination module; and a result display module, which displays the determination results from the result determination module on the software operation interface.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] (1) It has strong fitting ability. In assembly scenarios such as correct installation, missing parts, and unqualified assembly, the detection method based on contour analysis can accurately separate long slots and round holes. It also has the ability to detect the concentric circle contour features of the inner and outer diameters in the nut contour, and has strong fitting ability.
[0017] (2) It has strong anti-interference ability and stability. In the case of incorrect assembly, the detection method based on contour analysis can correctly detect the nut while suppressing the influence of the long slot hole below the nut on the detection result. It has strong anti-interference ability and stability.
[0018] (3) It has strong resistance to ambient light interference. It uses OTSU (Otsu Thresholding Method) to perform adaptive thresholding of the foreground and background. Under different lighting conditions, the OTUS algorithm can calculate the optimal threshold to clearly segment the image, and has strong resistance to ambient light interference. Attached Figure Description
[0019] Figure 1 This is a flowchart of the stent detection process based on contour analysis.
[0020] Figure 2 It provides visualization results of Hough circle inspection for four types of assemblies: correctly installed, missing parts, correctly positioned but improperly assembled, and installed in the wrong position.
[0021] Figure 3 It provides visualization results based on contour analysis for four types of assemblies: correctly installed, missing, correctly positioned but improperly assembled, and incorrectly positioned.
[0022] Figure 4 These are schematic diagrams of actual production locations under different lighting conditions. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the following description is provided in conjunction with the appendix. Figure 1-4 The present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0024] This invention provides a visual inspection method and system for assemblies of wiring harness brackets in new energy vehicles. The original wiring harness bracket image undergoes ROI (Region of Interest) cropping, grayscale conversion, and sharpening, followed by threshold segmentation to obtain a binary image of the wiring harness bracket. Then, the binary image undergoes two morphological operations: closing and dilation, to obtain the connected domain of the binary image that meets the requirements. Next, all contours in the output binary image are initially screened. The remaining contours are then compressed using the Douglas-Puk thinning algorithm to approximate the stored contour data points, thereby enabling the detection of long slots and circular contours. The detected circular contours and long slot contours are then used to determine the number of contours and the concentricity of the nuts and holes, ultimately achieving the assembly inspection of the wiring harness bracket. Based on this detection method, an image preprocessing module, a contour fitting module, and a result determination module are established to form a visual inspection system for wiring harness bracket assembly.
[0025] The specific steps of the detection method are as follows:
[0026] Step 1: Collect assembly images of wiring harness brackets for new energy vehicles;
[0027] Step 2: Perform image preprocessing on the above wire harness bracket assembly images;
[0028] Step 2.1: Perform ROI cropping and grayscale processing on the wire harness bracket assembly image;
[0029] Step 2.2: Sharpen the image after ROI cropping and grayscale conversion;
[0030] (1) The Laplace operator is used to perform a convolution operation on the original image. Since the digital image is essentially a discrete function of two-dimensional pairs, the Laplace operator can be discretized as follows:
[0031]
[0032] As can be seen from this equation, convolution of the original image using the Laplace operator can be achieved by convolving the original image with a 3x3 kernel function with a center element of -4. In the above equation, (x,y) are the horizontal and vertical coordinates of the pixel, and f(x,y) are the original pixel values of the image.
[0033] (2) To achieve the sharpening effect, pixels need to be enhanced along the gradient direction. The specific calculation is as follows:
[0034]
[0035] In the formula, G(x,y) represents the sharpened pixel value.
[0036] Step 2.3: Use OTSU to perform adaptive threshold segmentation on the foreground and background of the sharpened wire harness bracket image to obtain a binary image of the wire harness bracket.
[0037] To adapt to the varying lighting conditions in the production environment of new energy vehicle wiring harnesses, OTSU (Otsu Thresholding Method) is used here to adaptively threshold the foreground and background. It is assumed that a threshold T exists. k The wire harness bracket image can be divided into two categories: c1 (foreground) and c2 (background). Let the average pixel value of category c1 be m1, and the average pixel value of category c2 be m2. The global pixel accumulation value of the image is m. g .
[0038] Then the inter-class variance of c1 and c2 is σ. 2 The inter-class variance σ of c1 and c2 2 express:
[0039] σ 2 =p1(m1-m g ) 2 +p2(m2-m g ) 2
[0040] In the formula, p1 is the probability that any pixel in the entire image belongs to class c1, and p2 is the probability that any pixel in the entire image belongs to class c2.
[0041] Where p1, p2, m1, m2, m g The relational expression is expressed as:
[0042]
[0043] Combining the above formula, the inter-class variance σ of c1 and c2 2 It can be represented as:
[0044] σ 2 =p1p2(m1-m2) 2
[0045] To ensure that the two classes can be clearly separated in the binary image of the wire harness support after segmentation, it is necessary to guarantee the inter-class variance σ. 2 Let p be the probability of a pixel with grayscale value i appearing in the entire wire harness bracket image. i Let m(i) be the proportion of pixels with grayscale value i to the total grayscale value of the image, and p(i) be the probability of pixels with a value in the range [0, i]. Let L be the maximum grayscale value of the image. Then, when the threshold is i = T... k hour,
[0046]
[0047] The variance formula, after transformation, is expressed as:
[0048]
[0049] Among them, when the inter-class variance is the largest, T * The expression is:
[0050]
[0051] In the formula, F(T) k ) indicates that the independent variable is T k The functional expression for the variance between time classes.
[0052] Therefore, when the inter-class variance σ 2 When the maximum value is reached, the threshold T is at this point. k =T * When T * When performing binary segmentation on the wire harness bracket image using a threshold, the foreground and background in the image can be separated to the greatest extent, resulting in the desired binary image of the wire harness bracket.
[0053] Step 2.4: Perform two morphological operations, namely closing and dilation, on the binary image of the wire harness support in sequence:
[0054] Morphological operations are essentially image operations based on structuring elements. Their basic operations are dilation and erosion. The dilation operation covers the original image f with the structuring element and assigns the maximum value of the pixels in the covered area to the center position of the structuring element. The erosion operation assigns the minimum value of the pixels in the covered area to the center position of the structuring element. Based on this, another morphological operation, the closing operation, can be further introduced. The closing operation is essentially to perform a dilation operation followed by an erosion operation, that is, to increase the scale of all objects and then scale them back to the original size. This can eliminate some black noise points inside connected components in the binary image of the wire harness support.
[0055] To eliminate black noise and prevent errors in subsequent processing caused by small breaks in the connected regions of the annulus, the binary image of the wire harness bracket needs to undergo two morphological operations: closing and dilation, after thresholding. Since the wire harness bracket images analyzed by the system have obvious arc features, elliptical structuring elements are selected for the two operations to avoid destroying the smooth curves of the arc edges. This method uses a 5*5 structuring element for the closing operation and a 3*3 structuring element for the dilation operation.
[0056] The dilation operation dilate(x,y) is represented as:
[0057]
[0058] In the formula, f(x+x',y+y') represents the pixel values of the points surrounding the center point, and x' and y' represent the horizontal and vertical coordinate distances from the surrounding points to the center point.
[0059] The erosion operation erode(x,y) is represented as:
[0060]
[0061] In the formula, f(x+x',y+y') represents the pixel values of the points surrounding the center point;
[0062] Step 3: Perform contour analysis on the binary image, filter contour data, fit the contour data, and then determine the shape of the long slot hole and the circular hole.
[0063] Step 3.1: First, perform preliminary screening of all contours in the binary image of the wire harness bracket:
[0064] Contour discovery yields a vector array containing the coordinates of all points on the contour: Define contour points on the binary image of the harness support: such as any point b(x) on the binary image. b ,y b ),(x b ,y b Let b be the coordinates of the loudness point b. If a pixel with a value of 0 is found in its 4-neighborhood or 8-neighborhood, then that pixel b(x,y) belongs to the contour points. When the findContours function is called, all pixels will be scanned from left to right and from top to bottom, and the contour points of the unified connected domain will be packaged into a vector. <point>A vector array containing vectors of coordinates of all points on the contour;
[0065] Considering that the above contour method will scan the edges of all non-zero connected domains in the binary image of the wire harness bracket, and that some small-area noise and large-area edge contours are not within the scope of this system, we can filter out some small-area white noise contours by using the contour area area, and filter out large-area contours on the edges by using the contour outer rectangle pixel width box_w.
[0066] Meanwhile, by analyzing the geometric features of the circular hole and the long slot hole, it can be seen that these two features have significant differences in the aspect ratio p of the bounding rectangle of the contour. The two contours of the circular hole and the long slot hole can be separated by the aspect ratio p of each contour. Since the wire harness bracket image output by the camera under certain lighting conditions may have some noise interference, it will cause errors in contour detection. After multiple experiments, the threshold for separating the aspect ratio p of the circular hole was set to the range (0.9, 1.1), and the threshold for separating the aspect ratio p of the long slot hole was set to the range (1.3, 1.5). This can clearly separate the two contour data to be fitted without missing the key contours.
[0067] Step 3.2: After the above processing, the number of contours is generally less than 5. The remaining contours are then subjected to the Douglas-Peuker thinning algorithm to approximate and compress the stored contour data, thus completing the contour fitting. The specific implementation method is as follows:
[0068] Step 3.2.1: Extract the two farthest pixels A and B in the required approximation contour α, and connect AB;
[0069] Step 3.2.2: Traverse the contour α to find the point C that is farthest from line segment AB, excluding points A and B, and connect the three points to obtain triangle ABC;
[0070] Step 3.2.3: Traverse the contour α to find the point farthest from ΔABC three times, excluding points A, B, and C, and connect the four points to obtain quadrilateral ABCD;
[0071] Step 3.2.4: Continue in this manner until the distance from any point to any side of the contour is less than the threshold ∈, and the contour fitting is completed.
[0072] In this embodiment, to improve detection speed while ensuring maximum differentiation between circles and other shapes, the maximum distance threshold ∈ in the DP algorithm is set to 4, and the number of contour feature points remaining after thinning at this threshold is p. num Through continuous experimentation, p was determined num >8.
[0073] Step 3.3: Based on the eccentricity, determine the hole shape of the fitted contour in Step 3.2: the contour that meets the eccentricity requirement of a circle can be determined to be a circular hole, and the contour that meets the eccentricity requirement of a long slot hole can be determined to be a long slot hole.
[0074] In this example, there are two long slots and one circular hole.
[0075] Step 4: Determine the number of long slots and the number of rings based on the obtained circular holes and long slots, and determine the installation position of the nut. Based on the angle between the center line connecting the long slots and the line connecting any long slot to the centroid of the circular hole, or the maximum distance between the centroids of the three circles, determine the concentricity of the nut and the hole, and judge the installation qualification of the nut.
[0076] 4.1: Determine the nut's installation position by counting the number of long slots and the number of rings:
[0077] By determining the number of long slots and the number of rings based on the detected circular and long slot profiles, the current installation status of the nut can be determined.
[0078] In the embodiments, such as Figure 3 As shown, if the number of long slots is 2 and the number of circles is 1, it can be determined that the nut is missing; if the number of long slots is less than 2, it can be determined that the nut is installed incorrectly; if the number of long slots is 2 and the number of circles is greater than 1, it can be determined that the nut is installed in the correct position.
[0079] 4.2: Determine the qualified state of nut assembly by the angle between the center line connecting the centers of the long slots and the line connecting any long slot to the centroid of the round hole, as well as the maximum distance between the centroids of the three circles.
[0080] Assuming the nuts are installed correctly, the installation qualification is checked, specifically:
[0081] Since the binary image of the wire harness bracket segments the nut edge into a ring, three circles should be identified after the above algorithm. To ensure the concentricity of the nut and the hole, the positions of the centers of the three circles need to be determined after the circle fitting is completed. To locate and detect the center of the contour, moments are needed to describe the geometric feature information of each contour. Let M be the (m+n)th moment of the image. mn This method uses the first moment (M) of the image. 01 M 10 ) and zeroth moment (M 00 Determine the geometric features of the circular hole and the elongated slot hole separated in the algorithm described above, and further calculate the pixel centroid (x) of the image. cg ,y cg Since the image of the wire harness support being studied is a binary image, the center of the image (x) c ,y c It can be approximated by the centroid of the figure (x). cg ,y cg Calculate the radian value θ of the angle between the line l1 connecting the centers of the two long slots and the line l2 connecting the centroid of any long slot and the centroid of the annulus, to determine the degree of vertical runout during nut installation. Calculate the maximum distance d between the three centroids fitted by the annulus. cmax To determine the concentricity error of the nut installation, multiple tests were conducted under the current camera height and lighting conditions. When θ > 0.02 or d cmax If the value is greater than 2, it can be determined that the nut has a concentricity problem and the nut assembly is defective.
[0082] In step 4, the (m+n)th order moment M of the image mn The calculation formula is:
[0083] M mn =∑ m ∑ n f(x,y)x m y n In the formula, m and n represent the horizontal and vertical coordinate directions of the image.
[0084] The center of the figure (x) c ,y c ) and the centroid of the figure (x) cg ,y cg The relation is:
[0085]
[0086] For new energy vehicle wiring harness brackets with two elongated slots and one circular hole, such as Figure 2 and Figure 3 As shown, the visualization results of the Hough circle detection for the assembly of the wiring harness bracket of a new energy vehicle and the visualization results of the detection based on contour analysis of the present invention are compared and analyzed. It can be seen from the figure that under the assembly scenarios of correct installation, missing installation, and unqualified assembly, the present invention method can accurately separate the long slot hole from the circle and has the detection capability of the inner diameter and outer diameter concentric circle contour feature in the nut contour. Compared with the Hough circle detection method, it has a stronger fitting ability for non-circular contours and concentric circular contours, which verifies the accuracy of identifying different assembly errors. In the incorrect assembly scenario, the present invention method suppresses the influence of the long slot hole below the nut on the detection results while correctly detecting the nut. Compared with the Hough circle detection method, it has stronger anti-interference ability and better stability.
[0087] like Figure 4 As shown in Table 1, the actual production location samples and new energy vehicle wiring harness bracket inspection results of the method and system of the present invention under different lighting conditions were presented. The same industrial camera and method system were used in the experiment, and the system was tested under two different lighting environments: strong lighting and weak lighting, and under two different tooling conditions: white and black. The actual test results show that the method and system of the present invention are stable against ambient light interference under different lighting conditions. The method and system of the present invention did not have a single missed detection in the two different detection environments over three days, indicating that the method and system can adapt to different lighting environments and has a certain degree of robustness. Although there were some misdetections in terms of assembly quality, the average misdetection rate was generally less than 1.2%, and the present invention meets the production design requirements of the system.
[0088] Table 1. Test results of wire harness brackets under different lighting conditions.
[0089]
[0090] Based on the above detection method, the present invention also provides a visual inspection system for the assembly of wiring harness brackets for new energy vehicles, including: an image acquisition module, mainly a camera, used to acquire images; and an image processing module, including an image preprocessing module, a contour fitting module, and a result determination module.
[0091] Specifically, the image preprocessing module mainly implements ROI region segmentation and image enhancement for the wire harness bracket image. To improve operating efficiency, it first performs grayscale conversion, converting the three-channel color image into a single-channel image. Then, it sharpens the image after ROI cropping and grayscale conversion. The image enhancement algorithm used here is the Laplace sharpening algorithm.
[0092] Contour fitting module: Threshold segmentation is performed on the sharpened wire harness bracket image. To further eliminate black noise and prevent errors in subsequent processing due to small breaks in the connected areas of the annular region, after threshold segmentation, two morphological operations, closing and dilation, are performed on the binary image of the wire harness bracket. After the two morphological operations, contour analysis is performed on the binary image output by image preprocessing: First, all contours in the binary image are initially screened, and then the remaining contours are subjected to a thinning algorithm to approximate and compress the stored contour data points. The shape of the determinate contour is determined through continuous experimentation.
[0093] The result determination module analyzes the matching relationship between the output of the detection algorithm and the expected results. Specifically, it performs quantity determination on the detected circular contour and long slot contour to determine the current installation status of the nut, and calculates the radian value θ of the angle between the line l1 connecting the centers of the two long slots and the line l2 connecting the centroid of any long slot and the centroid of the annulus to determine the degree of vertical runout of the nut installation, and calculates the maximum distance d between the three centroids fitted by the annulus. cmax Determine the concentricity error of the nut installation.
[0094] The results display module displays the judgment results from the results judgment module on the software operation interface.
[0095] Based on the aforementioned detection method and system, the hardware preparation begins first: the camera is initialized; if the camera does not exist, an error is reported; if the camera exists, it is selected, the data stream is opened, and the initialization parameters are set. Once the hardware is ready, OPC (Open Platform Communication) data is read, image acquisition begins, and several processing steps are performed, including image preprocessing, contour fitting, result judgment, and result visualization. Finally, the image results are saved, and the OPC data is written to the results. After completing one detection cycle, OPC data is read again for the next detection cycle.
[0096] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.< / point>
Claims
1. A visual inspection method for assembling wiring harness brackets in new energy vehicles, characterized in that, The method includes: Step 1: Collect assembly images of wiring harness brackets for new energy vehicles; Step 2: Perform image preprocessing on the above wire harness bracket assembly image to obtain the connected domain of the binary image of the wire harness bracket; Step 3: Perform contour analysis on the binary image, filter contour data, fit the contour data, and then determine the shape of the long slot hole and the circular hole. Step 4: Determine the number of long slots and rings based on the circular hole and the long slot hole to determine the nut installation position. Determine the concentricity of the nut and the hole based on the angle between the center line connecting the long slot holes and the line connecting any long slot hole and the centroid of the circular hole, or the maximum distance between the centroids of the three circles, to determine the nut installation qualification. The specific steps for step 4 are as follows: Step 4.1: Determine the nut installation position by measuring the number of long slots and the number of rings; Step 4.2: Determine the nut assembly status by using the angle between the line connecting the centers of the long slots and the line connecting any long slot to the centroid of the circular hole, as well as the maximum distance between the centroids of the three circles; when the nut is correctly installed, the line connecting the centers of the two long slots... The line connecting the centroid of any long slot and the centroid of the torus The radian value of the included angle between The maximum distance between the centroids of the three circles fitted to the annulus. ,when or If the nut fails to meet concentricity requirements, the nut assembly is deemed unqualified.
2. The assembly visual inspection method according to claim 1, characterized in that, Step 2 includes: Step 2.1: Perform ROI cropping and grayscale processing on the wire harness bracket assembly image; Step 2.2: Sharpen the image after ROI cropping and grayscale conversion; Step 2.3: Use OTSU to perform adaptive threshold segmentation on the foreground and background of the sharpened wire harness bracket image to obtain a binary image of the wire harness bracket; Step 2.4: Perform two morphological operations, closing and dilation, on the binary image of the wire harness bracket to obtain the connected domain of the binary image of the wire harness bracket.
3. The assembly visual inspection method according to claim 2, characterized in that, In step 2.3, adaptive threshold segmentation is performed on the foreground and background of the image. The formula for calculating the inter-class variance between the background and foreground classes is as follows: ; In the formula, For inter-class variance, This is the global pixel accumulation value of the image. for for The probability of a pixel appearing in the entire wire harness bracket image. The grayscale value is The percentage of pixels that make up the total grayscale of the image.
4. The assembly visual inspection method according to claim 1, characterized in that, The specific steps in step 3 are as follows: Step 3.1: First, perform preliminary screening on all contours in the binary image of the wire harness bracket, and separate the two types of contours, circular holes and long slot holes, according to the aspect ratio of each contour. Step 3.2: Use the Douglas-Peuker thinning algorithm to approximate and compress the stored contour data to complete the contour fitting; Step 3.3: Based on the eccentricity, determine the hole shape of the fitted contour in Step 3.
2.
5. The assembly visual inspection method according to claim 4, characterized in that, In step 3.1, during the initial screening of the contour, the findContours function is used to scan the pixels and obtain a vector array. The vector array contains vectors of the coordinates of all points on the contour. The contour data to be fitted is separated by the aspect ratio of the bounding rectangle of the contour.
6. The assembly visual inspection method according to claim 5, characterized in that, The specific steps in step 3.2 are as follows: Step 3.2.1: Extract the two farthest pixels A and B in the required approximation contour, and connect AB; Step 3.2.2: Traverse the contour to find the point C that is farthest from line segment AB, excluding points A and B, and connect the three points to obtain triangle ABC; Step 3.2.3: Traverse the contour except for points A, B, and C. Find the three furthest points, connect the four points to form quadrilateral ABCD; Step 3.2.4: Continue in this manner until the distance from any point to any side of the contour is less than the set threshold, and the contour fitting is completed.
7. The assembly visual inspection method according to claim 1, characterized in that, In step 4.1, when there are 2 long slots and 1 circular hole, the specific determination rule is as follows: If the number of long slots is 2 and the number of rings is 1, then it is determined that the nut is missing. If the number of long slots is less than 2, the nut is considered to be installed incorrectly. If the number of long slots is 2 and the number of circular slots is greater than 1, then the nut is considered to be installed correctly.
8. A visual inspection system for assembling wiring harness brackets in new energy vehicles, characterized in that, The system for performing the assembly visual inspection method of claim 1 includes: an image acquisition module, which is a camera, for acquiring information from graphics; an image processing module, including an image preprocessing module, a contour fitting module, and a result determination module; and a result display module, which displays the determination results from the result determination module on the software operation interface.
Citation Information
Patent Citations
Core wire size non-contact type visual detection device and method for automobile wire harness
CN109974582A
Machine vision-based augmented reality blind area assembly guidance method
WO2022036478A1