Visual detection method and system for assembly of wire harness bracket of new energy automobile
Through the visual inspection method based on contour analysis, the problem of nut and hole detection in the assembly of new energy vehicle wiring harness brackets is solved, and accurate detection of the assembly condition of new energy vehicle wiring harness brackets is achieved. It has strong fitting, anti-interference and stability, and is suitable for For the detection of various types of wire harnesses.
Patent Information
- Application Number
- CN202410828886.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-06-25
AI Technical Summary
The existing technology cannot effectively detect the nuts and long slotted holes on the new energy vehicle wire harness bracket, resulting in unstable assembly quality and difficulty in detecting different types of wire harnesses.
Using a visual inspection method based on contour analysis, through image acquisition, preprocessing, contour fitting and result determination, accurate detection of nuts and holes on the wire harness bracket is achieved, with strong fitting, anti-interference and stability.
It achieves accurate detection of the assembly of new energy vehicle wire harness brackets, can effectively identify the installation qualification of nuts under different lighting conditions, has strong anti-interference ability and stability, and is suitable for the detection of various types of wire harnesses.
Smart Images

Figure CN118840323A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of assembly and manufacturing of wiring harnesses for new energy vehicles, and in particular to a method and system for visually inspecting the assembly of wiring harness brackets for new energy vehicles based on contour feature analysis. Background Art
[0002] With the development of the new energy vehicle industry, the demand for vehicle wiring harnesses has grown rapidly, and the assembly volume of vehicle wiring harnesses has continued to rise. Since the wiring harness is flexible and easily deformed, resulting in unstable assembly quality, the demand for new energy vehicle wiring harness assembly inspection has risen rapidly. As one of the important parts of the wiring harness assembly, the wiring harness bracket often has nuts missing or wrongly installed. Therefore, a new energy vehicle wiring harness bracket assembly visual inspection method and system is needed to detect the installation nuts and long slot-shaped punchings on the bracket to achieve assembly quality inspection after assembly is completed.
[0003] Liu Liwei and others designed an automotive wiring harness detection system based on a voltage-controlled constant current source detection method. The system uses current to flow through the tested wire and detects the voltage at both ends of the wire through A / D conversion to detect the continuity of the automotive wiring harness. At the same time, this method is used to accurately measure the resistance and capacitance components in the wire. This system targets the problems of imperfect detection of wiring harness continuity and components such as resistance and capacitance in the wiring harness, and cannot detect the mounting nuts and long slot punches on the wiring harness bracket during the wiring harness assembly process.
[0004] Huang Xinkang et al. proposed an image-based automotive wiring harness structure detection solution, which automatically switches the wiring harness detection algorithm by matching the database automotive wiring harness characters, and combines various traditional image detection algorithms with deep learning detection algorithms to achieve universal detection of various detection items of different wiring harnesses. This method mainly detects wiring harness covers such as tapes, adhesive tapes, cable ties, etc., but cannot detect the installation nuts and long slot punches in the wiring harness bracket assembly.
[0005] Among the existing patents, Patent 2023115721897 discloses a new energy vehicle wiring harness detection device. The invention places the wiring harness on a mounting block, and the wires and interfaces at both ends of the wiring harness fall onto a push plate, so that the push plate pushes the interface, and the interface is inserted into the detection port on the detection mechanism. By setting a sliding block, a No. 1 detection block, a No. 2 detection block, and a detection pressure sensor, the model of the interface is detected, so that the sliding block moves up and down, and the corresponding detection port is changed, so that the invention can be applied to wiring harnesses using different interfaces. The solution of detecting the interface model and then inserting it into the corresponding detection port requires setting up multiple detection ports for different types of wiring harnesses, which makes it difficult to truly realize the simultaneous detection of multiple different types of wiring harnesses.
[0006] Among the existing patents, Patent 2024101425962 discloses a method for detecting automotive wiring harnesses with an automatic rejection function. By setting a rejection component, the cleaning block slides from the circular groove to the inlet and outlet groove and the placement groove, thereby removing the wiring harness from the placement groove. The inlet and outlet groove is designed to allow the cleaning block to slide in it. Its internal shape and size match the shape of the cleaning block, ensuring that the cleaning block can slide smoothly in the groove. The invention specifies a method for rejecting qualified wiring harnesses after the inspection is completed, but does not involve how to inspect the wiring harness.
[0007] Among the existing patents, Patent 2023104693592 discloses a wire harness detection device for new energy vehicles, which is equipped with two detection mechanisms. The first detection mechanism straightens the wire harness, and the second detection mechanism drives the grinding belt by driving the cylinder to lift the wire harness upward, so as to observe whether there are small transverse cracks on the sheath of the wire harness. The second detection mechanism drives the grinding belt to move along the wire harness transversely and radially through two motors at the same time, making the transverse cracks and radial cracks of the sheath of the wire harness more obvious. However, this detection method has high requirements for lighting conditions, and it is easy to cause large detection errors when the lighting conditions change and affect the recognition. Summary of the invention
[0008] In view of the deficiencies in the prior art, the present invention provides a visual inspection method and system for the assembly of wiring harness brackets for new energy vehicles, which are used to detect the assembly status of wiring harness brackets for new energy vehicles. The method has stronger fitting ability, stronger anti-interference ability and better stability.
[0009] A new energy vehicle harness bracket assembly visual inspection method comprises the following steps:
[0010] Step 1: Collect the assembly picture information of the new energy vehicle wiring harness bracket;
[0011] Step 2: Perform image preprocessing on the above-mentioned wiring harness bracket assembly picture to obtain a binary image connection domain of the wiring harness bracket;
[0012] Step 3: Perform contour analysis on the binary image, filter the contour data, fit the contour data, and then determine the hole shape of the long slot hole and the circular hole;
[0013] Step 4: Determine the number of long slot holes and circular rings based on the circular holes and long slot holes, and determine the installation position of the nut. Determine the concentricity of the nut and the hole based on the angle between the center line between the long slot holes and the line between the centroid of any long slot hole and the circular hole, or the maximum distance between the centroids of the three circles, and judge the installation qualification of the nut.
[0014] A visual inspection system for automobile harness bracket assembly based on contour analysis includes: an image acquisition module: mainly a camera, used to collect information on 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 in the result determination module on a software operation interface.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] (1) Strong fitting ability. In the assembly scenarios of correct installation, missing installation, and unqualified assembly, the detection method based on contour analysis can accurately separate the long slot hole and the round hole shape, and has the detection ability of the concentric circle contour features of the inner diameter and outer diameter in the nut contour, and has strong fitting ability.
[0017] (2) 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 under 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 threshold segmentation method) to perform adaptive threshold segmentation on the foreground and background. Under different lighting conditions, the OTUS algorithm can calculate the optimal threshold by itself to clearly segment the image, and has strong resistance to ambient light interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of stent detection based on contour analysis.
[0020] Figure 2 It is the visualization result of Hough circle detection for four types of assemblies: correct installation, missing installation, correct position but unqualified assembly, and wrong position installation.
[0021] Figure 3 It is the visualization result of the detection based on contour analysis for four types of assemblies: correct installation, missing installation, correct position but unqualified assembly, and wrong position installation.
[0022] Figure 4 It is a schematic diagram of actual samples of production locations under different lighting conditions. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the following Figure 1-4 It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0024] The present invention provides a method and system for visual inspection of the assembly of a harness bracket for a new energy vehicle. After the original harness bracket image is subjected to ROI (region of interest) interception, grayscale processing and sharpening, threshold segmentation is performed to obtain a binary image of the harness bracket. Then, the binary image is subjected to two-step morphological operations of closing operation and expansion in sequence to obtain a binary image connection domain of the harness bracket that meets the requirements. Then, all contours in the output binary image are preliminarily screened, and the remaining contours are subjected to approximation compression of the stored contour data points using the Douglas-Peucker thinning algorithm, thereby realizing the detection of long slot holes and circular contours, and then the circular contours and long slot hole contours obtained by the detection are subjected to quantity determination, and the concentricity determination of the nut and the hole, and finally the assembly detection of the harness bracket is realized. Based on this detection method, an image preprocessing module, a contour fitting module, and a result determination module are respectively established to form a visual inspection system for the assembly of a harness bracket.
[0025] The specific steps of the detection method are as follows:
[0026] Step 1: Collect the assembly picture information of the new energy vehicle wiring harness bracket;
[0027] Step 2: Perform image preprocessing on the above wiring harness bracket assembly picture;
[0028] Step 2.1: Perform ROI interception and grayscale processing on the wiring harness bracket assembly image;
[0029] Step 2.2: sharpen the image after ROI interception and grayscale processing;
[0030] (1) Use the Laplace operator to perform convolution on the original image. Since the digital image is essentially a discrete function of a two-dimensional pair, the Laplace operator can be discretized as:
[0031]
[0032] It can be seen from the formula that the convolution operation of the original image using the Laplace operator can be achieved by convolving the original image with a 3*3 kernel function with a central element of -4. In the above formula, (x, y) is the horizontal and vertical coordinates of the pixel point, and f(x, y) is the original pixel value of the image.
[0033] (2) To achieve the sharpening effect, pixels are enhanced along the gradient direction. The specific calculation is:
[0034]
[0035] Where G(x,y) is the pixel value after sharpening.
[0036] Step 2.3, using OTSU to perform adaptive threshold segmentation on the foreground and background of the sharpened wire harness support image to obtain a binary image of the wire harness support;
[0037] In order to adapt to the illumination changes in the production environment of new energy vehicle wiring harnesses, OTSU (Otsu threshold segmentation method) is used here to perform adaptive threshold segmentation of the foreground and background. Assuming that there is a threshold T k The wire harness support image can be divided into two categories: c1 (foreground) and c2 (background). The pixel mean of c1 is m1, the pixel mean of c2 is m2, and the global pixel accumulation value of the image is m. g .
[0038] Then the between-class variance of c1 and c2 is σ 2 , the between-class variance σ of c1 and c2 2 express:
[0039] σ 2 =p1(m1-m g ) 2 +p2(m2-m g ) 2
[0040] Where 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] Among them, p1, p2, m1, m2, m g The relationship between them is expressed as:
[0042]
[0043] Combining the above formula, the inter-class variance σ of c1 and c2 is 2 It can be expressed as:
[0044] σ 2 =p1p2(m1-m2) 2
[0045] In order to make the two categories clearly segmented in the binary image of the harness bracket after segmentation, it is necessary to ensure that the inter-class variance σ 2 Take the maximum value and set the probability of a pixel with gray value i appearing in the entire wiring harness bracket image to p i , the proportion of pixels with gray value i in the total gray value of the image is m(i), the probability of pixels with pixel values in [0,i] is p(i), and the maximum gray value of the image is L. Then when the threshold is i=T k hour,
[0046]
[0047] The variance formula is transformed into:
[0048]
[0049] Among them, when the between-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 Function expression of the time-interclass variance.
[0052] Therefore, when the between-class variance σ 2 When the maximum value is obtained, the threshold T k =T * , when T * When the wire harness support image is binary segmented using a threshold, the foreground and background in the image can be separated to the greatest extent, thereby obtaining the desired wire harness support binary image.
[0053] Step 2.4: Perform two morphological operations of closing and dilation on the binary image of the harness support:
[0054] The essence of morphological operation is image operation based on structural element element. Its basic operations include dilation and erosion. Dilation operation is to cover structural element element on the original image f and assign the maximum value of pixels in the covered area to the center of the structural element. Erosion operation is to attach the minimum value of pixels in the covered area to the center of the structural element. On this basis, another morphological operation, closing operation, can be further derived. The essence of closing operation is to perform a dilation operation first and then an erosion operation, that is, to increase the scale of all objects and then scale them back to the original size, so that some black noise points inside the connected domain can be eliminated in the binary image of the harness bracket.
[0055] In order to eliminate black noise and prevent the existence of small breakpoints in the circular interconnected area, which may cause errors in subsequent processing, the binary image of the harness bracket needs to be subjected to two morphological operations, namely, closing and dilation, after threshold segmentation. Since the harness bracket images analyzed by the system all have obvious arc features, in order not to destroy the smooth curve of the arc edge, elliptical structural elements are selected for the two operations. This method uses a structural element of size 5*5 for closing operation and a structural element of size 3*3 for dilation operation.
[0056] The expansion operation dilate(x,y) is expressed as:
[0057]
[0058] Where f(x+x',y+y') is the pixel value of the points around the center point, and x' and y' are the horizontal and vertical coordinate distances from the surrounding points to the center point.
[0059] The erosion operation erode(x,y) is expressed as:
[0060]
[0061] Where f(x+x',y+y') is the pixel value of the points around the center point;
[0062] Step 3: Perform contour analysis on the binary image, filter the contour data, fit the contour data, and then determine the hole shape of the long slot hole and the circular hole;
[0063] Step 3.1: First, perform a preliminary screening of all contours in the binary image of the harness support:
[0064] Contour discovery, get the vector array containing the coordinates of all points on the contour: Define the contour points on the binary image of the harness support: For example, any point b(x b ,y b ),(x b ,y b ) is the coordinate of loudness point b; if a point with a pixel value of 0 is found in its 4-domain or 8-domain, then the pixel point b(x, y) belongs to the contour point. 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 Unicom domain will be packaged to obtain a vector <point>A vector array containing the 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 harness bracket, and some small area noise and large area edge contours are not within the research scope of this system, the contour area can be used to filter out the contours of some small area white noise points, and the pixel width of the contour circumscribed rectangle box_w can be used to filter out the large area contours on the edge;
[0066] At the same time, by analyzing the geometric features of circular holes and long slot holes, it can be seen that the two features have obvious differences in the value of the aspect ratio p of the circumscribed rectangle of the contour. The circular hole and the long slot hole can be separated by the aspect ratio p of each contour. Because the harness bracket image output by the camera under certain lighting conditions will have some noise interference, which will cause errors in contour discovery, after multiple experiments, the threshold of the aspect ratio p of the separation circle is set to the interval (0.9, 1.1), and the threshold of the aspect ratio p of the separation long slot hole is set to the interval (1.3, 1.5), so that the two contour data to be fitted can be clearly separated without missing the key contour;
[0067] Step 3.2: After the above processing, the number of contours is generally less than 5. The remaining contours are approximated and compressed using the Douglas-Peuker thinning algorithm to complete the contour fitting. The specific implementation method is as follows:
[0068] Step 3.2.1: Extract the two pixels A and B with the longest distance in the desired approximation contour α, and connect AB;
[0069] Step 3.2.2: Traverse the point C in contour α that is farthest from line segment AB except points A and B, and connect the three points to obtain triangle ABC;
[0070] Step 3.2.3: Traverse the points in contour α that are three times farthest from ΔABC except points A, B, and C, and connect the four points to get quadrilateral ABCD;
[0071] Step 3.2.4: Continue in this way until the distance between any point and any side of the contour is less than the threshold ∈, and the contour fitting is completed.
[0072] In the embodiment, in order to improve the detection speed and ensure that the circle is distinguished from other shapes, the maximum distance threshold ∈ in the DP algorithm is set to 4, and the number of contour feature points left after thinning under this threshold is set to p num , through continuous experimentation, determine p num >8.
[0073] Step 3.3: According to the eccentricity, the hole shape of the fitted contour in step 3.2 is judged: the contour that meets the eccentricity requirement of a circle can be judged as a circular hole, and the contour that meets the eccentricity requirement of a slotted hole can be judged as a slotted hole.
[0074] In the example, the number of the long slot holes is 2 and the number of the circular hole is 1.
[0075] Step 4: Determine the number of long slot holes and circular rings based on the circular holes and long slot holes detected, determine the installation position of the nut, and determine the concentricity of the nut and the hole based on the angle between the center line between the long slot holes and the line between any long slot hole and the center of mass of the circular hole or the maximum distance between the center of mass of the three circles to determine the installation qualification of the nut;
[0076] 4.1: Determine the installation position of the nut by the number of slot holes and rings:
[0077] The number of long slot holes and circular rings of the circular profile and the long slot hole profile obtained by detection can be determined to determine the current installation status of the nut;
[0078] In the embodiment, Figure 3 As shown, if the number of long slot holes is 2 and the number of circular rings is 1, it can be determined that the nut is missing; if the number of long slot holes is less than 2, it can be determined that the nut is incorrectly installed; if the number of long slot holes is 2 and the number of circular rings is greater than 1, it can be determined that the nut is installed in the correct position.
[0079] 4.2: The qualified state of the nut assembly is determined by the angle between the center line between the long slot holes and the line between the centroid of any long slot hole and the circular hole, as well as the maximum distance between the centroids of the three circles.
[0080] When the nut is correctly installed, the nut installation qualification is judged, specifically:
[0081] Since the binary image of the harness bracket divides the edge of the nut into a circular 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 completing the circle fitting. To locate the center of the detected contour, the geometric feature information of each contour needs to be described with the help of moments. Let the (m+n) order moment of the image be M. mn , this method uses the first-order moment of the image (M 01 ,M 10 ) and zero-order moment (M 00 ) determine the geometric features of the circular holes and long slots separated in the algorithm described above, and further calculate the pixel centroid of the graphics (x cg ,y cg ), since the image of the harness support studied at this time is a binary image, the center of the image (x c ,y c ) can be approximately equal to the center of gravity of the figure (x cg ,y cg ), calculate the radian value θ of the angle between the center line l1 of the two long slot holes and the line l2 connecting the centroid of any long slot hole and the centroid of the ring to determine the degree of vertical runout of the nut installation, and calculate the maximum distance d between the centroids of the three circles of the ring fitting cmax Determine the concentricity error of the nut installation. After multiple tests, under the current camera height and lighting conditions, when θ>0.02 or d cmax When it is >2, it can be judged that the concentricity of the nut is unqualified, and it can be judged that the nut assembly is unqualified;
[0082] Among them, the (m+n)-order moment M of the image in step 4 is mn The calculation formula is:
[0083] M mn =∑ m ∑ n f(x,y)x m y n , where m and n represent the horizontal and vertical coordinate directions of the image.
[0084] The center of the graph (x c ,y c ) and the center of gravity of the graph (x cg ,y cg ) is:
[0085]
[0086] For new energy vehicle wiring harness brackets with 2 long slot holes and 1 round hole, such as Figure 2 and Figure 3 As shown, the visualization results of the Hough circle detection of the wiring harness bracket assembly of a new energy vehicle and the visualization results of the detection based on contour analysis of the method of the present invention are respectively compared and analyzed. It can be seen from the figure that in the assembly scenarios of correct installation, missing installation, and unqualified assembly, the method of the present invention can accurately separate the long slot hole and the circle and has the detection capability of the concentric circle contour features of the inner diameter and outer diameter in the nut contour. Compared with the Hough circle detection method, it has stronger fitting capability for non-circular contours and concentric circle contours, verifying the recognition accuracy of different assembly errors; in the incorrect assembly scenario, the method of the present invention suppresses the influence of the long slot hole below the nut on the detection result while correctly detecting the nut. Compared with the Hough circle detection method, it has stronger anti-interference capability and better stability.
[0087] like Figure 4 As shown in Table 1, the actual samples of the production position and the detection results of the wiring harness bracket of new energy vehicles under different lighting conditions of the method and system of the present invention are shown. The experiment adopts the same industrial camera and method system, and applies two different lighting environments of strong lighting and weak lighting. The system is tested in two different toolings of white and black. The actual detection results show the stability of the ambient light interference of the method and system of the present invention under different lighting conditions; the method and system of the present invention did not miss a single case of detection in two different detection environments within three days, indicating that the method and system can adapt to different lighting environments and have a certain robustness; although there are some false detections in terms of assembly quality, the average false detection rate is generally lower than 1.2%, and the present invention meets the production design requirements of the system.
[0088] Table 1 Detection results of wiring harness brackets under different lighting conditions
[0089]
[0090] Based on the above detection method, the present invention also provides a new energy vehicle wiring harness bracket assembly visual inspection system, including: an image acquisition module: mainly a camera, used to collect graphics; an image processing module: including an image preprocessing module, a contour fitting module, and a result judgment module.
[0091] Specifically, the image preprocessing module mainly realizes the ROI area segmentation and image enhancement of the harness bracket image. In order to improve the operation efficiency, the grayscale operation is first performed to convert the color three-channel image into a single-channel image, and then the image after ROI interception and grayscale is sharpened. The image enhancement algorithm here adopts the Laplace sharpening algorithm;
[0092] Contour fitting module: threshold segmentation is performed on the sharpened wire harness bracket image. At the same time, in order to further eliminate black noise and prevent small breakpoints in the circular interconnected area from causing errors in subsequent processing, the wire harness bracket binary image needs to be subjected to two morphological operations of closing and dilation in sequence after threshold segmentation. After the two morphological operations of closing and dilation, contour analysis is performed on the binary image output by image preprocessing: first, all contours in the binary image are preliminarily screened, and then the remaining contours are subjected to approximation compression of the stored contour data points using a thinning algorithm, and the shape of the decidable contour is determined through continuous experiments;
[0093] Result judgment module: used to analyze the matching relationship between the results output by the detection algorithm program and the expected results. The specific content is to make quantitative judgments on the circular contours and the long slot hole contours obtained by the detection, so as to determine the current installation status of the nut, and calculate the arc value θ of the angle between the center line l1 of the two long slot holes and the line l2 connecting the centroid of any long slot hole and the centroid of the circular ring, so as to determine the degree of vertical runout of the nut installation, and calculate the maximum distance d between the centroids of the three circles of the circular ring fitting. cmax Determine the concentricity error of the nut installation.
[0094] The result display module displays the determination results in the result determination module on the software operation interface.
[0095] Based on the above detection method and system, the hardware is prepared first: the camera is initialized. If the camera does not exist, an error is reported. If the camera exists, the camera is selected and the data stream is opened and the initialization parameters are set. After the hardware is ready, the OPC (Open Platform Communication) data is read, the image is collected, and image preprocessing, contour fitting, result judgment, result visualization and other major processes are performed. Finally, the image results and OPC write results are saved. After completing one detection, the OPC data is read again for the next detection.
[0096] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.< / point>
Claims
1. A visual inspection method for assembly of wiring harness brackets for new energy vehicles, characterized in that: The method comprises: Step 1: Collect the assembly picture information of the new energy vehicle wiring harness bracket; Step 2: Perform image preprocessing on the above-mentioned wiring harness bracket assembly picture to obtain a binary image connection domain of the wiring harness bracket; Step 3: Perform contour analysis on the binary image, filter the contour data, fit the contour data, and then determine the hole shape of the long slot hole and the circular hole; Step 4: Determine the number of long slot holes and circular rings based on the circular holes and long slot holes, and determine the installation position of the nut. Determine the concentricity of the nut and the hole based on the angle between the center line between the long slot holes and the line between the centroid of any long slot hole and the circular hole, or the maximum distance between the centroids of the three circles, and judge the installation qualification of the nut.
2. The assembly visual inspection method according to claim 1, characterized in that: The step 2 includes: Step 2.1: Perform ROI interception and grayscale processing on the wiring harness bracket assembly image; Step 2.2: sharpen the image after ROI interception and grayscale processing; Step 2.3: Use OTSU to perform adaptive threshold segmentation on the foreground and background of the sharpened wire harness support image to obtain a binary image of the wire harness support; Step 2.4: Perform two morphological operations of closing and dilation on the binary image of the wire harness support in sequence to obtain the connected domain of the binary image of the wire harness support.
3. The assembly visual inspection method according to claim 2, characterized in that: In step 2.3, the foreground and background of the image are segmented by adaptive threshold, and the inter-class variance between the background and foreground classes is calculated as follows: Where, T k is the gray value threshold, σ 2 is the between-class variance, m g is the global pixel accumulation value of the image, p(T K ) is the gray value T k The probability of a pixel point appearing in the entire wiring harness bracket image, m(T K ) is the gray value T k The ratio of pixels to 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: Step 3.1: First, all contours in the binary image of the harness bracket are preliminarily screened, and two contours, circular holes and long slot holes, are separated 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 contour fitting; Step 3.3: According to 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 preliminary screening of the contour, the pixels are scanned through the findContours function to obtain a vector array, which contains the vectors of the coordinates of all points on the contour. The contour data to be fitted is separated by the aspect ratio of the circumscribed 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 pixels A and B that are the farthest apart in the contour to be approximated, and connect AB; Step 3.2.2: Traverse the point C in the contour that is farthest from line segment AB except points A and B, and connect the three points to get triangle ABC; Step 3.2.3: Traverse the points in the contour that are farthest from ΔABC three times except points A, B, and C, and connect the four points to get quadrilateral ABCD; Step 3.2.4: Repeat this process until the distance between any point and 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: The specific steps of step 4 are as follows: Step 4.1: Determine the installation position of the nut based on the number of slot holes and the number of rings; Step 4.2: Determine the qualified assembly status of the nut by the angle between the center line between the long slot holes and the line between the centroid of any long slot hole and the circular hole, and the maximum distance between the centroids of the three circles.
8. The assembly visual inspection method according to claim 7, characterized in that: In step 4.1, when the number of slotted holes is 2 and the number of circular holes is 1, the specific judgment rules are as follows: If the number of slotted holes is 2 and the number of rings is 1, it is determined that the nut is missing; If the number of slotted holes is less than 2, it is considered that the nut is incorrectly installed; If the number of slotted holes is 2 and the number of circles is greater than 1, the nut is judged to be installed in the correct position.
9. The assembly visual inspection method according to claim 7, characterized in that: In step 4.2, when the nut is correctly installed, the radian value θ of the angle between the center line l1 of the two long slot holes and the line l2 connecting the centroid of any long slot hole and the centroid of the ring; the maximum distance d between the centroids of the three circles fitted by the ring cmax , when θ>0.02 or d cmax When >2, the nut is judged to have unqualified concentricity and the nut assembly is judged to be unqualified.
10. A visual inspection method system for assembly of wiring harness brackets for new energy vehicles, characterized in that: The system includes an image acquisition module: mainly a camera, used to collect information on graphics; an image processing module: including an image preprocessing module, a contour fitting module, and a result determination module; The result display module displays the determination results in the result determination module on the software operation interface.
Citation Information
Patent Citations
Nut defect detection method and device based on machine vision
CN108176608A
Core wire size non-contact type visual detection device and method for automobile wire harness
CN109974582A
Wire harness terminal parameter detection device and detection method
CN116519033A
Machine vision-based augmented reality blind area assembly guidance method
WO2022036478A1
Cited By
Flexible wire harness intelligent assembly system and control method thereof
CN119965736A
New energy automobile wire harness ribbon assembly quality detection system based on machine vision
CN122089665A
New energy vehicle wire harness lashing assembly quality detection system based on machine vision
CN122089665B
