Assembly gap detection method, apparatus, device, and storage medium

By generating a 3D contour point cloud and ray cluster analysis of the assembly gap, the system automatically determines whether there are hidden objects in the assembly gap, solving the problem of easy omissions during manual inspection and improving the accuracy and efficiency of the inspection.

CN115082411BActive Publication Date: 2026-04-21DONGFENG MOTOR CO LTD DONGFENG NISSAN PASSENGER VEHICLE CO +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGFENG MOTOR CO LTD DONGFENG NISSAN PASSENGER VEHICLE CO
Filing Date
2022-06-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing technology of manually inspecting assembly gaps is prone to missing detections and has low inspection efficiency.

Method used

By acquiring a two-dimensional image of the foreground component, a three-dimensional contour point cloud is generated. Using gap reference points and ray clusters to simulate the human eye's observation angle, the system automatically determines whether any hidden objects are visible in the assembly gap, thus avoiding missed detections.

Benefits of technology

This significantly improves the accuracy and efficiency of assembly gap detection, completely eliminating the possibility of missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082411B_ABST
    Figure CN115082411B_ABST
Patent Text Reader

Abstract

The application discloses an assembly gap detection method, device and equipment and a storage medium, and belongs to the technical field of vehicle assembly. The application obtains a two-dimensional image of a foreground component in a preset direction; generates a three-dimensional contour point cloud of the foreground component according to the two-dimensional image; determines a gap reference point according to the three-dimensional contour point cloud and digital model data of a background component, the gap reference point being an auxiliary point between assembly gaps; detects the assembly gap between the foreground component and the background component based on the gap reference point, sets a ray cluster based on the gap reference point, simulates a human eye observation angle by using the ray cluster, and judges whether the internal hiding can be seen or not by the intersection of the ray and the product, so that automatic judgment of the visible internal hiding is realized, the possibility of missed detection is completely avoided, and the detection efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle assembly technology, and in particular to a method, apparatus, equipment and storage medium for detecting assembly gaps. Background Technology

[0002] To ensure the aesthetics of assembly gaps, it is necessary to inspect the gaps in key areas to confirm whether the internal parts can be seen through the gaps. Currently, the method used to ensure the aesthetics of assembly gaps is to manually rotate the data to simulate whether the internal parts can be seen visually from different angles. However, manual inspection is very prone to missing certain parts and is not very efficient.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a method, apparatus, device, and storage medium for detecting assembly gaps, aiming to solve the technical problems that the manual inspection method used in the prior art is prone to missed detections and has low detection efficiency.

[0005] To achieve the above objectives, the present invention provides an assembly gap detection method, the assembly gap detection method comprising the following steps:

[0006] Acquire a two-dimensional image of the foreground component according to a preset direction;

[0007] Generate a three-dimensional contour point cloud of the foreground component based on the two-dimensional image;

[0008] The gap reference point is determined based on the three-dimensional contour point cloud and the digital model data of the background component. The gap reference point is an auxiliary point between the assembly gaps.

[0009] The assembly gap between the foreground component and the background component is detected based on the gap reference point.

[0010] Optionally, acquiring a two-dimensional image of the foreground component includes:

[0011] Acquire foreground component images in a preset direction;

[0012] The foreground component image is processed to obtain the processed foreground component image;

[0013] Extract the outer contour of the processed foreground component image to obtain a two-dimensional image of the foreground component.

[0014] Optionally, generating the three-dimensional contour point cloud of the foreground component based on the two-dimensional image includes:

[0015] Obtain the pixel coordinates of each pixel in the two-dimensional image in a pixel coordinate system, wherein the pixel coordinate system is constructed with the vertices of the two-dimensional image as the origin, and the pixel coordinates correspond to the pixels of each pixel.

[0016] The coordinates of the pixel points are transformed using the view matrix coordinate system as a reference to obtain the coordinates in the view matrix coordinate system, which is constructed with the image center point of the two-dimensional image as the origin;

[0017] The coordinates in the absolute coordinate system are calculated based on the coordinates in the view matrix coordinate system and the view matrix. The three-dimensional contour point cloud of the foreground component is generated using the coordinates in the absolute coordinate system. The pixel coordinate system and the view coordinate system are local coordinate systems established under the absolute coordinate system.

[0018] Optionally, the step of performing coordinate transformation on the pixel coordinates based on the view matrix coordinate system to obtain the coordinates in the view matrix coordinate system includes:

[0019] Obtain the image width of the two-dimensional image, the width of the corresponding view area, the image height, and the height of the corresponding view area;

[0020] The pixel coordinates are transformed based on the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain the coordinates in the view matrix coordinate system.

[0021] Optionally, the step of performing coordinate transformation on the pixel coordinates based on the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain coordinates in the view matrix coordinate system includes:

[0022] The horizontal coordinates in the view matrix coordinate system are calculated based on the image width, the width of the corresponding view area, and the horizontal coordinates of the pixel points.

[0023] The ordinate in the view matrix coordinate system is calculated based on the image height, the height of the corresponding view area, and the ordinate of the pixel coordinates.

[0024] The coordinates in the view matrix coordinate system are obtained based on the horizontal coordinate, the vertical coordinate, and the preset vertical coordinate in the view matrix coordinate system.

[0025] Optionally, determining the gap reference point based on the three-dimensional contour point cloud includes:

[0026] The three-dimensional contour point cloud is offset and magnified to obtain an offset point cloud. The three-dimensional contour point cloud and the offset point cloud are located in the same plane, and no rotation occurs during the process of converting the three-dimensional contour point cloud to the offset point cloud.

[0027] A ray is emitted in a preset direction based on the offset point cloud, and a reference point on the foreground component that is closest to the ray is determined. The reference point is used as the target contour point corresponding to the foreground component. The three-dimensional contour point cloud, the offset point cloud, and the foreground component are in the same preset direction.

[0028] The gap reference point is determined based on the target contour points.

[0029] Optionally, determining the gap reference point based on the target contour point includes:

[0030] Obtain the direction vector of the target contour point, and use the direction vector as the outer contour normal vector of the foreground component. The outer contour normal vector is perpendicular to the ray emitted in a preset direction with the offset point cloud as the reference.

[0031] The background reference point is determined based on the target contour point and the outer normal vector of the contour.

[0032] Determine the midpoint of the line connecting the target contour point and the background reference point, and use the midpoint of the line as the gap reference point.

[0033] Optionally, detecting the assembly gap between the foreground component and the background component based on the gap reference point includes:

[0034] Multiple gap reference points are set according to preset intervals;

[0035] Using each gap reference point as a reference, multiple clusters of conical rays are set in the assembly gap between the foreground component and the background component according to a preset angle range;

[0036] Determine whether each ray in each cluster of conical rays intersects with the background component and the exterior component corresponding to the foreground component;

[0037] If none of them intersect, it is determined that there is light leakage in the corresponding assembly gap.

[0038] Furthermore, to achieve the above objectives, the present invention also proposes an assembly gap detection device, wherein the assembly gap is the assembly gap between the background component and the foreground component, the background component is provided with a mounting hole, and the foreground component covers the mounting hole, characterized in that the assembly gap detection device comprises:

[0039] The acquisition module is used to acquire a two-dimensional image of the foreground component according to a preset direction;

[0040] The processing module is used to generate a three-dimensional contour point cloud of the foreground component based on the two-dimensional image;

[0041] The processing module is also used to determine a gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component, wherein the gap reference point is an auxiliary point between assembly gaps;

[0042] The detection module is used to detect the assembly gap between the foreground component and the background component based on the gap reference point.

[0043] Furthermore, to achieve the above objectives, the present invention also proposes an assembly gap detection device, the assembly gap detection device comprising: a memory, a processor, and an assembly gap detection program stored in the memory and running on the processor, the assembly gap detection program being configured to implement the assembly gap detection method as described above.

[0044] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing an assembly gap detection program, which, when executed by a processor, implements the assembly gap detection method as described above.

[0045] This invention acquires a two-dimensional image of a foreground component according to a preset direction; generates a three-dimensional contour point cloud of the foreground component based on the two-dimensional image; determines a gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component, the gap reference point being an auxiliary point between assembly gaps; detects the assembly gap between the foreground component and the background component based on the gap reference point, sets up a ray cluster with the gap reference point as a reference, uses the ray cluster to simulate the human eye's observation angle, and determines whether there is a visible concealment by the intersection of the ray with the product, realizing automatic judgment of visible concealments, completely avoiding the possibility of missed detection, and improving detection efficiency and accuracy. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of the assembly gap detection device for the hardware operating environment involved in the embodiments of the present invention;

[0047] Figure 2 This is a flowchart illustrating the first embodiment of the assembly gap detection method of the present invention;

[0048] Figure 3 This is a schematic diagram of the overall process of assembly gap detection according to an embodiment of the assembly gap detection method of the present invention;

[0049] Figure 4 This is a schematic diagram of the ray cluster distribution in an embodiment of the assembly gap detection method of the present invention;

[0050] Figure 5This is a flowchart illustrating the second embodiment of the assembly gap detection method of the present invention;

[0051] Figure 6 This is a flowchart illustrating the third embodiment of the assembly gap detection method of the present invention;

[0052] Figure 7 This is a schematic diagram of contour acquisition for an embodiment of the assembly gap detection method of the present invention;

[0053] Figure 8 This is the process of establishing a gap reference point in an embodiment of the assembly gap detection method of the present invention;

[0054] Figure 9 This is a structural block diagram of the first embodiment of the assembly gap detection device of the present invention.

[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0056] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0057] Reference Figure 1 , Figure 1 This is a schematic diagram of the assembly gap detection device for the hardware operating environment involved in the embodiments of the present invention.

[0058] like Figure 1 As shown, the assembly gap detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1The structure shown does not constitute a limitation on the assembly gap detection equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0060] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and an assembly gap detection program.

[0061] exist Figure 1 In the assembly gap detection device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the assembly gap detection device of the present invention can be set in the assembly gap detection device. The assembly gap detection device calls the assembly gap detection program stored in the memory 1005 through the processor 1001 and executes the assembly gap detection method provided in the embodiment of the present invention.

[0062] This invention provides a method for detecting assembly gaps, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of an assembly gap detection method according to the present invention.

[0063] In this embodiment, the assembly gap detection method includes the following steps:

[0064] Step S10: Obtain a two-dimensional image of the foreground component according to a preset direction.

[0065] In this embodiment, the execution entity can be the assembly gap detection device, which has functions such as data processing, data communication, and program execution. The assembly gap detection device can be a computer device such as a tablet, computer, or server. Of course, other devices with similar functions can also be used, and this embodiment does not limit this. For ease of explanation, this embodiment uses an assembly gap detection device as an example.

[0066] It should be noted that, in order to ensure the aesthetics of the assembly gaps, it is necessary to inspect the gaps in key areas to confirm whether the internal parts can be seen through the gaps. Currently, the method used to ensure the aesthetics of the assembly gaps is to manually rotate the data to simulate whether the internal parts can be seen visually from different angles. However, manual inspection is very prone to missing certain parts and is not very efficient.

[0067] In this embodiment, to solve the aforementioned technical problems, the two-dimensional image of the part is processed to identify the maximum contour of the foreground part. Through coordinate transformation, the two-dimensional contour point cloud is converted into the actual contour point cloud of the product. Then, auxiliary points are constructed based on the actual contour point cloud of the product to generate the midpoint of the gap. Ray clusters are used to simulate the human eye's observation angle, and the intersection of the rays with the product determines whether there are visible concealments. This achieves automatic judgment of visible concealments, completely avoiding the possibility of missed detections, thereby improving detection efficiency and accuracy. Specifically, in this embodiment, the following is used... Figure 3 The overall scheme of this embodiment will be described using an example.

[0068] like Figure 3 As shown, the overall process in this embodiment mainly includes image processing, contour recognition, and ray cluster analysis. Image processing includes 3D data generation and image processing. 3D data refers to acquiring the 3D model data of the foreground component. Image generation involves generating an image of the foreground component in the vehicle direction using NX. In this embodiment, the vehicle direction is the opposite of the vehicle's forward movement, i.e., the direction from the front of the vehicle to the rear. The image processing includes grayscale conversion, binarization, morphological erosion, and contour extraction. Contour recognition includes coordinate transformation and recognition. Coordinate transformation converts 2D image points back to CAD 3D space based on the view matrix. Contour recognition obtains the actual contour point cloud of the foreground component. Ray cluster analysis mainly includes auxiliary point establishment and ray cluster detection. Auxiliary point establishment determines the midpoint of the gap. Ray cluster detection uses the midpoint of the gap as the starting point and emits a cluster of conical rays distributed at a set angle range and interval. By simulating the human eye's viewing angle through ray clusters, automatic detection of visible internal structures is achieved, ensuring detection efficiency and accuracy.

[0069] It should be noted that this embodiment is for detecting the assembly gap, which is the assembly gap between the background component and the foreground component. The background component has mounting holes, and the foreground component covers the mounting holes.

[0070] In this specific implementation, it is necessary to first obtain a two-dimensional image of the foreground component, which can reflect the two-dimensional outline of the foreground component. The specific process of obtaining the two-dimensional image of the foreground component in this embodiment can be implemented as follows.

[0071] In this specific implementation, the foreground component image is first acquired in a preset direction, where the preset direction is the opposite of the vehicle's forward direction, i.e., the direction from the front of the vehicle to the rear. After obtaining the foreground component image, this embodiment performs image processing on the foreground component image to obtain a processed foreground component image. The image processing process in this embodiment includes, but is not limited to, grayscale conversion, binarization, morphological erosion, and contour extraction. After image processing, the processed foreground component image is obtained. Then, this embodiment further identifies the maximum contour of the processed foreground component image to obtain a two-dimensional image of the foreground component, which reflects the two-dimensional contour point cloud of the foreground component.

[0072] Step S20: Generate a three-dimensional contour point cloud of the foreground component based on the two-dimensional image.

[0073] In a specific implementation, after obtaining the two-dimensional image of the foreground component, the two-dimensional image can be transformed to obtain the three-dimensional contour point cloud of the foreground component. Specifically, coordinate transformation can be used to convert the two-dimensional image points back to three-dimensional space to obtain the three-dimensional contour point cloud of the foreground component.

[0074] Step S30: Determine the gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component.

[0075] In practice, the actual contour of the foreground component can be identified through a 3D contour point cloud, and gap reference points can be obtained by combining this with the digital model data of the background component. Background reference points can be determined based on the digital model data of the background component. Based on the actual contour of the foreground component and the background reference points, gap reference points can be obtained. For example, the background reference points determine the nearest point of the bumper, and the actual contour of the foreground component determines the contour points of the exterior trim. This gap reference point is the midpoint of the gap between the nearest point of the bumper and the contour points of the exterior trim, used for final assembly gap detection. It is important to emphasize that this gap reference point is an auxiliary point for assembly gaps, used as an auxiliary point for subsequent ray analysis.

[0076] Step S40: Detect the assembly gap between the foreground component and the background component based on the gap reference point.

[0077] In specific implementation, after determining the gap reference point, this embodiment can use the gap reference point as a benchmark to detect the assembly gap between the foreground component and the background component. The detection method includes setting multiple gap reference points at preset intervals, and using each gap reference point as a benchmark, setting multiple clusters of conical rays in the assembly gap between the foreground component and the background component according to a preset angle range. Figure 4 As shown.

[0078] Specifically, Figure 4In this embodiment, multiple gap reference points are set according to a preset interval, starting from the gap reference point. Then, corresponding conical rays are set at each gap reference point according to a preset angle range, thereby obtaining multiple clusters of conical rays. The preset interval can be set according to actual measurement needs, and the angle range of each cluster of conical rays and the angle interval between each ray can also be set according to actual needs. In this embodiment, there are no restrictions on these aspects.

[0079] After setting up multiple clusters of conical rays, for each ray in each cluster, it is determined whether it intersects with the bumper and exterior trim. If they all intersect, it indicates that the assembly gap is small, and the interior of the vehicle cannot be observed through human eye simulation. Conversely, if it does not intersect with at least one of the bumper and exterior trim, it indicates that the assembly gap is large, and the interior of the vehicle can be observed through human eye simulation. In this case, this embodiment determines that there is light leakage in the assembly gap.

[0080] This embodiment acquires a two-dimensional image of the foreground component according to a preset direction; generates a three-dimensional contour point cloud of the foreground component based on the two-dimensional image; determines a gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component, the gap reference point being an auxiliary point between assembly gaps; detects the assembly gap between the foreground component and the background component based on the gap reference point, sets up a ray cluster with the gap reference point as a reference, uses the ray cluster to simulate the human eye's observation angle, and determines whether there is a visible concealment by the intersection of the ray and the product, realizing automatic judgment of visible concealments, completely avoiding the possibility of missed detection, and improving detection efficiency and accuracy.

[0081] refer to Figure 5 , Figure 5 This is a flowchart illustrating a second embodiment of an assembly gap detection method according to the present invention.

[0082] Based on the first embodiment described above, in the assembly gap detection method of this embodiment, step S20 specifically includes:

[0083] Step S201: Obtain the pixel coordinates of each pixel in the two-dimensional image in the pixel coordinate system.

[0084] Step S202: Perform coordinate transformation on the pixel coordinates using the view matrix coordinate system as a reference to obtain the coordinates in the view matrix coordinate system.

[0085] In this specific implementation, before performing coordinate transformation, it is necessary to first obtain the pixel coordinates of each pixel in the two-dimensional image. Then, coordinate transformation is performed based on the view matrix coordinate system, so that the pixel coordinates of the two-dimensional image are transformed into coordinates in the view matrix coordinate system. The pixel coordinate system is constructed with the vertices of the two-dimensional image as the origin, and the obtained pixel coordinates correspond to the pixels of each pixel.

[0086] It should be noted that in this embodiment, the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area of ​​the two-dimensional image are first obtained. Then, the pixel coordinates are transformed based on the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain the coordinates in the view matrix coordinate system. It is further important to emphasize that the view matrix coordinate system is constructed with the image center point of the two-dimensional image as the origin.

[0087] In this specific implementation, the horizontal coordinate in the view matrix coordinate system is calculated based on the image width, the width of the corresponding view area, and the horizontal coordinate corresponding to the pixel coordinate; the vertical coordinate in the view matrix coordinate system is calculated based on the image height, the height of the corresponding view area, and the vertical coordinate corresponding to the pixel coordinate; and the coordinates in the view matrix coordinate system are obtained based on the horizontal coordinate in the view matrix coordinate system, the vertical coordinate in the view matrix coordinate system, and the preset vertical coordinate.

[0088] Specifically, x c = (c-w2 / 2)*W1 / w2, y c =(rh / 2)*H / h, z c =0, where w2: image width; W1 is the corresponding X width of the view area; h is the image height; H is the corresponding Y width of the view area, the pixel coordinates are (c,r), and the coordinates in the view matrix coordinate system are (xc,yc,zc). The vertical coordinate zc can be set to 0, that is, the coordinates in the view matrix coordinate system are (xc,yc,0). Of course, it can be adjusted according to actual needs, and this embodiment does not impose any restrictions on it.

[0089] Step S203: Calculate the coordinates in the absolute coordinate system based on the coordinates in the view matrix coordinate system and the view matrix, and generate the three-dimensional contour point cloud of the foreground component using the coordinates in the absolute coordinate system.

[0090] In this embodiment, after obtaining the coordinates in the view matrix coordinate system, the coordinates in the absolute coordinate system can be calculated based on these coordinates and the view matrix. The specific calculation formula is as follows: (X,Y,Z)=M*(x c ,y c,z c ), where (X,Y,Z) are the calculated coordinates in the absolute coordinate system, M is the view matrix, (x c ,y c ,z c The coordinates are in the view matrix coordinate system. The elements in the view matrix can be set according to actual needs, but this embodiment does not impose any restrictions on this.

[0091] In practice, the coordinates in the absolute coordinate system are three-dimensional coordinates. The three-dimensional contour point cloud can be obtained based on the coordinates in the absolute coordinate system. The three-dimensional contour point cloud reflects the actual contour point cloud of the foreground component.

[0092] It should be emphasized that the pixel coordinate system and the view coordinate system in this embodiment are local coordinate systems established under the absolute coordinate system. The absolute coordinate system is the absolute coordinate system of the 3D design system, and the coordinates of all points in the system are determined by the origin of this coordinate system.

[0093] This embodiment obtains the pixel coordinates of each pixel in the two-dimensional image in the pixel coordinate system; performs coordinate transformation on the pixel coordinates using the view matrix coordinate system as a reference to obtain the coordinates in the view matrix coordinate system; calculates the coordinates in the absolute coordinate system based on the coordinates in the view matrix coordinate system and the view matrix; and generates the three-dimensional contour point cloud of the foreground component using the coordinates in the absolute coordinate system. By converting the two-dimensional contour point cloud into a three-dimensional contour point cloud through the view matrix coordinate system and the absolute coordinate system, a more accurate actual contour point cloud of the foreground component can be obtained, thereby further improving the detection accuracy.

[0094] refer to Figure 6 , Figure 6 This is a flowchart illustrating a third embodiment of an assembly gap detection method according to the present invention.

[0095] Based on the first embodiment described above, in the assembly gap detection method of this embodiment, step S30 specifically includes:

[0096] Step S301: The three-dimensional contour point cloud is offset and magnified to obtain an offset point cloud.

[0097] In practical implementation, after obtaining the maximum contour point cloud, in order to obtain a more accurate offset point cloud and reference points on the foreground component, this embodiment performs offset magnification on the maximum contour point cloud. The magnified offset point cloud is shown below. Figure 7 As shown, Figure 7 In the diagram, A represents the maximum contour point cloud, and B represents the offset point cloud. There is an offset between the offset point cloud after offset magnification and the maximum contour point cloud before processing.

[0098] It needs to be emphasized that, such as Figure 7 As shown, the 3D contour point cloud and the offset point cloud obtained after offset magnification are located on the same plane, and no rotation occurs during the process of converting the 3D contour point cloud to the offset point cloud, so as to ensure that the 3D contour point cloud and the contour of the foreground part correspond in shape in the preset direction, thereby improving the gap detection accuracy.

[0099] Step S302: Using the offset point cloud as a reference, emit a ray in a preset direction, and determine the reference point on the foreground component that is closest to the ray, and use the reference point as the target contour point corresponding to the foreground component.

[0100] In practical implementation, after obtaining the offset point cloud, this embodiment emits a ray in a preset direction based on the offset point cloud. The preset direction is the direction opposite to the vehicle's forward direction. After emitting the ray, the reference point closest to the ray can be found on the foreground component. Figure 7 P1 and P2 are shown in the diagram. These reference points are also the target contour points of the foreground component. V1 is the direction vector corresponding to P1, and V2 is the direction vector corresponding to P2.

[0101] Step S303: Determine the gap reference point based on the target contour points.

[0102] In practice, the gap reference point can be determined based on the target contour point, and then the gap can be detected by following the steps in the above embodiment.

[0103] It should be noted that in this embodiment, the following is used: Figure 8 Let's take an example to illustrate. Figure 8 The outer contour normal vector Vi shown can be obtained based on the target contour point. The direction vector of the target contour point is the outer contour normal vector corresponding to the foreground component. This outer contour normal vector is perpendicular to the ray emitted in a preset direction based on the offset point cloud. Further, the background component reference point is determined based on the target contour point and the outer contour normal vector. Specifically, starting from the foreground component contour point Pi, the background component reference point Qi is found along the outer contour normal vector Vi. After determining the foreground component contour point Pi and the background component reference point Qi, in this embodiment, the midpoint of the line connecting the foreground component contour point Pi and the background component reference point Qi is found. This midpoint is the gap reference point, that is... Figure 8 Ci is shown in the diagram. The background reference point can be the point closest to the ray on the bumper surface; this is not limited in this embodiment.

[0104] In this embodiment, the three-dimensional contour point cloud is offset and magnified to obtain an offset point cloud; a ray is emitted from the offset point cloud in a preset direction, and the reference point on the foreground component closest to the ray is determined; the direction vector of the target contour point is obtained; a background component reference point is determined based on the target contour point and the outer normal vector of the contour; the midpoint of the line connecting the target contour point and the background component reference point is determined, and the midpoint of the line is used as the gap reference point, which can obtain a more accurate gap reference point, thereby improving the accuracy of detection.

[0105] Furthermore, embodiments of the present invention also propose a storage medium storing an assembly gap detection program, wherein the assembly gap detection program, when executed by a processor, implements the steps of the assembly gap detection method described above.

[0106] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.

[0107] Reference Figure 9 , Figure 9 This is a structural block diagram of the first embodiment of the assembly gap detection device of the present invention.

[0108] like Figure 9 As shown, the assembly gap detection device proposed in this embodiment of the invention includes:

[0109] The acquisition module 10 is used to acquire a two-dimensional image of the foreground component according to a preset direction;

[0110] Processing module 20 is used to generate a three-dimensional contour point cloud of the foreground component based on the two-dimensional image;

[0111] The processing module 20 is further configured to determine a gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component, wherein the gap reference point is an auxiliary point between assembly gaps;

[0112] The detection module 30 is used to detect the assembly gap between the foreground component and the background component based on the gap reference point.

[0113] This embodiment acquires a two-dimensional image of the foreground component according to a preset direction; generates a three-dimensional contour point cloud of the foreground component based on the two-dimensional image; determines a gap reference point based on the three-dimensional contour point cloud and the digital model data of the background component, the gap reference point being an auxiliary point between assembly gaps; detects the assembly gap between the foreground component and the background component based on the gap reference point, sets up a ray cluster with the gap reference point as a reference, uses the ray cluster to simulate the human eye's observation angle, and determines whether there is a visible concealment by the intersection of the ray and the product, realizing automatic judgment of visible concealments, completely avoiding the possibility of missed detection, and improving detection efficiency and accuracy.

[0114] In one embodiment, the acquisition module 10 is further configured to acquire an image of a foreground component of a vehicle in a preset direction; perform image processing on the foreground component image to obtain a processed foreground component image; and extract the maximum contour of the processed foreground component image to obtain a two-dimensional image of the foreground component.

[0115] In one embodiment, the processing module 20 is further configured to obtain the pixel coordinates of each pixel in the two-dimensional image in a pixel coordinate system, wherein the pixel coordinate system is constructed with the vertex of the two-dimensional image as the origin, and the pixel coordinates correspond to the pixels of each pixel; perform coordinate transformation on the pixel coordinates with a view matrix coordinate system as a reference to obtain the coordinates in the view matrix coordinate system, wherein the view matrix coordinate system is constructed with the image center point of the two-dimensional image as the origin; calculate the coordinates in the absolute coordinate system based on the coordinates in the view matrix coordinate system and the view matrix; and generate the three-dimensional contour point cloud of the foreground component using the coordinates in the absolute coordinate system, wherein the pixel coordinate system and the view coordinate system are local coordinate systems established under the absolute coordinate system.

[0116] In one embodiment, the processing module 20 is further configured to obtain the image width of the two-dimensional image, the width of the corresponding view area, the image height, and the height of the corresponding view area; and to perform coordinate transformation on the pixel coordinates according to the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain the coordinates in the view matrix coordinate system.

[0117] In one embodiment, the processing module 20 is further configured to calculate the horizontal coordinate in the view matrix coordinate system based on the image width, the width of the corresponding view area, and the horizontal coordinate corresponding to the pixel coordinate; calculate the vertical coordinate in the view matrix coordinate system based on the image height, the height of the corresponding view area, and the vertical coordinate corresponding to the pixel coordinate; and obtain the coordinates in the view matrix coordinate system based on the horizontal coordinate in the view matrix coordinate system, the vertical coordinate in the view matrix coordinate system, and a preset vertical coordinate.

[0118] In one embodiment, the processing module 20 is further configured to: determine the maximum contour point cloud of the foreground component based on the three-dimensional point cloud; perform offset magnification on the maximum contour point cloud to obtain an offset point cloud; emit a ray in a preset direction based on the offset point cloud, and determine the reference point on the foreground component that is closest to the ray, and use the reference point as the target contour point corresponding to the foreground component; and determine a gap reference point based on the target contour point.

[0119] In one embodiment, the processing module 20 is further configured to acquire the direction vector of the target contour point, use the direction vector as the outer contour normal vector corresponding to the foreground component, the outer contour normal vector being perpendicular to a ray emitted in a preset direction with the offset point cloud as a reference; determine a background component reference point based on the target contour point and the outer contour normal vector; determine the midpoint of the line connecting the target contour point and the background component reference point, and use the midpoint of the line as a gap reference point.

[0120] In one embodiment, the detection module 30 is further configured to set multiple gap reference points at preset intervals; set multiple clusters of conical rays at the assembly gap between the foreground component and the background component according to a preset angle range, with each gap reference point as a reference; determine whether each ray in each cluster of conical rays intersects with the background component and the outer trim component corresponding to the foreground component; if they do not intersect, it is determined that there is light leakage in the corresponding assembly gap.

[0121] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0122] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0123] In addition, for technical details not described in detail in this embodiment, please refer to the assembly gap detection method provided in any embodiment of the present invention, which will not be repeated here.

[0124] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0125] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0127] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for detecting assembly gap, wherein the assembly gap is the assembly gap between a background component and a foreground component, the background component has a mounting hole, and the foreground component covers the mounting hole, characterized in that, The assembly gap detection method includes: Acquire a two-dimensional image of the foreground component according to a preset direction; Generate a three-dimensional contour point cloud of the foreground element based on the two-dimensional image; The three-dimensional contour point cloud is offset and magnified to obtain an offset point cloud. The three-dimensional contour point cloud and the offset point cloud are located in the same plane, and no rotation occurs during the process of converting the three-dimensional contour point cloud to the offset point cloud. A ray is emitted in a preset direction based on the offset point cloud, and a reference point on the foreground component that is closest to the ray is determined. The reference point is used as the target contour point corresponding to the foreground component. The three-dimensional contour point cloud, the offset point cloud, and the foreground component are in the same preset direction. Obtain the direction vector of the target contour point, and use the direction vector as the outer contour normal vector of the foreground component. The outer contour normal vector is perpendicular to the ray emitted in a preset direction with the offset point cloud as the reference. The background reference point is determined based on the target contour point and the outer normal vector of the contour. Determine the midpoint of the line connecting the target contour point and the background reference point, and use the midpoint of the line as the gap reference point, which is an auxiliary point between assembly gaps; The assembly gap between the foreground component and the background component is detected based on the gap reference point.

2. The assembly gap detection method as described in claim 1, characterized in that, The acquisition of the two-dimensional image of the foreground element includes: Acquire foreground image in a preset direction; The foreground image is processed to obtain the processed foreground image; Extract the outer contour of the processed foreground image to obtain a two-dimensional image of the foreground.

3. The assembly gap detection method as described in claim 1, characterized in that, The step of generating a three-dimensional contour point cloud of the foreground element based on the two-dimensional image includes: Obtain the pixel coordinates of each pixel in the two-dimensional image in a pixel coordinate system, wherein the pixel coordinate system is constructed with the vertices of the two-dimensional image as the origin, and the pixel coordinates correspond to the pixels of each pixel. The coordinates of the pixel points are transformed using the view matrix coordinate system as a reference to obtain the coordinates in the view matrix coordinate system, which is constructed with the image center point of the two-dimensional image as the origin; The coordinates in the absolute coordinate system are calculated based on the coordinates in the view matrix coordinate system and the view matrix. The three-dimensional contour point cloud of the foreground element is generated using the coordinates in the absolute coordinate system. The pixel coordinate system and the view matrix coordinate system are local coordinate systems established under the absolute coordinate system.

4. The assembly gap detection method as described in claim 3, characterized in that, The step of performing coordinate transformation on the pixel coordinates based on the view matrix coordinate system to obtain the coordinates in the view matrix coordinate system includes: Obtain the image width of the two-dimensional image, the width of the corresponding view area, the image height, and the height of the corresponding view area; The pixel coordinates are transformed based on the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain the coordinates in the view matrix coordinate system.

5. The assembly gap detection method as described in claim 4, characterized in that, The step of performing coordinate transformation on the pixel coordinates based on the image width, the width of the corresponding view area, the image height, and the height of the corresponding view area to obtain coordinates in the view matrix coordinate system includes: The horizontal coordinates in the view matrix coordinate system are calculated based on the image width, the width of the corresponding view area, and the horizontal coordinates of the pixel points. The ordinate in the view matrix coordinate system is calculated based on the image height, the height of the corresponding view area, and the ordinate of the pixel coordinates. The coordinates in the view matrix coordinate system are obtained based on the horizontal coordinate, the vertical coordinate, and the preset vertical coordinate in the view matrix coordinate system.

6. The assembly gap detection method according to any one of claims 1 to 5, characterized in that, The detection of the assembly gap between the foreground component and the background component based on the gap reference point includes: Multiple gap reference points are set according to preset intervals; Using each gap reference point as a reference, multiple clusters of conical rays are set in the assembly gap between the foreground component and the background component according to a preset angle range; Determine whether each ray in each cluster of conical rays intersects with the background piece and the outer decorative piece corresponding to the foreground piece; If none of them intersect, it is determined that there is light leakage in the corresponding assembly gap.

7. An assembly gap detection device, wherein the assembly gap is the assembly gap between a background component and a foreground component, the background component has a mounting hole, and the foreground component covers the mounting hole, characterized in that, The assembly gap detection device includes: The acquisition module is used to acquire a two-dimensional image of the foreground component according to a preset direction; The processing module is used to generate a three-dimensional contour point cloud of the foreground element based on the two-dimensional image; The processing module is further configured to perform offset magnification on the three-dimensional contour point cloud to obtain an offset point cloud, wherein the three-dimensional contour point cloud and the offset point cloud are located on the same plane and the process of converting the three-dimensional contour point cloud to the offset point cloud does not involve rotation. A ray is emitted in a preset direction based on the offset point cloud, and a reference point on the foreground component that is closest to the ray is determined. The reference point is used as the target contour point corresponding to the foreground component. The three-dimensional contour point cloud, the offset point cloud, and the foreground component are in the same preset direction. Obtain the direction vector of the target contour point, and use the direction vector as the outer contour normal vector of the foreground component. The outer contour normal vector is perpendicular to the ray emitted in a preset direction with the offset point cloud as the reference. The background reference point is determined based on the target contour point and the outer normal vector of the contour. Determine the midpoint of the line connecting the target contour point and the background reference point, and use the midpoint of the line as the gap reference point, which is an auxiliary point between assembly gaps; The detection module is used to detect the assembly gap between the foreground component and the background component based on the gap reference point.

8. An assembly gap detection device, characterized in that, The assembly gap detection device includes: a memory, a processor, and an assembly gap detection program stored in the memory and running on the processor, the assembly gap detection program being configured to implement the assembly gap detection method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores an assembly gap detection program, which, when executed by a processor, implements the assembly gap detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Aviation component fitting gap three-dimensional morphology evaluation method based on point cloud data

    CN111737822A