Vehicle assembly detection method and device, electronic equipment and readable medium
By projecting and collecting laser images in the vehicle body area and fitting straight lines and rectangles, the problems of low efficiency and low accuracy of vehicle clearance and surface difference detection are solved, and high accuracy detection is achieved.
Patent Information
- Application Number
- CN202510824746.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-26
AI Technical Summary
In the prior art, vehicle clearance and surface difference detection efficiency are low and the accuracy is not high, especially manual detection efficiency, while robot detection accuracy is not high.
Project linear laser light in the target body area of the vehicle, collect laser images, and determine the target straight line and rectangle by fitting straight lines and curved laser points, and then calculate the gap and surface difference according to the preset strategy.
It realizes high-accurate gap and surface difference detection, is suitable for vehicle components of different shapes and sizes, and has flexible detection capabilities.
Smart Images

Figure CN120538431A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle assembly detection method, device, electronic device, and readable medium. Background Art
[0002] In related technologies, gap and flush detection of vehicles can be performed manually using a gap gauge or flush gauge, or using a handheld gap and flush meter. However, manual detection is inefficient. Alternatively, robots can be controlled to detect flush and gap using gap and flush detection sensors. However, this method suffers from low detection accuracy and inability to quickly and efficiently detect gap and flush. Summary of the Invention
[0003] The embodiments of the present application provide a vehicle assembly detection method, device, electronic device and computer-readable storage medium to solve the problems of low efficiency in manual detection of vehicle gaps and flushness, and the method of controlling a robot to use gap and flushness detection sensors to detect the flushness and gaps of the vehicle, which has low detection accuracy and cannot quickly and effectively perform gap and flushness detection.
[0004] The present application discloses a vehicle assembly detection method, comprising: Projecting a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; Acquiring a laser image of the target vehicle body area; displaying a linear laser located in the target vehicle body area on the laser image; the linear laser including a laser gap located at a splicing position of the vehicle parts; the linear laser including at least two laser points; the linear laser including at least one laser line to be processed surrounding the laser gap; the laser line to be processed including a curved laser close to the laser gap and a linear laser away from the laser gap; Fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser; Fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; Based on the target straight line and the target rectangle, the gap between the at least two vehicle components is determined according to a preset gap determination strategy, and / or the flushness between the at least two vehicle components is determined according to a preset flushness determination strategy.
[0005] Optionally, one side of the linear laser is connected to one side of the curved laser; and fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser includes: Adding the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; Determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point on a line perpendicular to a preset horizontal line; For any of the remaining laser points, if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold, the remaining laser point is added to the set of laser points for the straight line to be fitted; The laser points in the to-be-fitted straight line laser point set are used as the to-be-fitted straight line laser points, and the to-be-fitted straight line laser points are fitted to obtain the target straight line.
[0006] Optionally, fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed includes: Using the curve laser point as the curve laser point to be fitted; Fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; Determining the angle difference between the target straight line and any long side of the initial rectangle; If the angle difference is less than a preset angle threshold, the initial rectangle is used as the target rectangle; If the angle difference is not less than the preset angle threshold, the laser point of the curve to be fitted is re-determined, and the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted is repeated until the target rectangle is obtained.
[0007] Optionally, fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed includes: Determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; Determining coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determining a covariance matrix of the at least one point using the coordinate information; Performing eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle and the coordinates of the center point of the initial rectangle in the coordinate system; The initial rectangle is determined based on at least one of the length, the width, the rotation angle, and the center point coordinates.
[0008] Optionally, the vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on a surface of the first vehicle component and a second laser to be processed located on a surface of the second vehicle component; and determining the flushness between the at least two vehicle components according to a preset flushness determination strategy includes: Determining a vertical distance between a laser point of a line to be fitted by the first laser to be processed and a target line of the second laser to be processed; Based on the perpendicular distance, a flush difference between the first vehicle component and the second vehicle component is determined.
[0009] Optionally, determining the gap between the at least two vehicle components according to a preset gap determination strategy includes: taking the wide side of the target rectangle of the first laser to be processed, which is close to the laser gap, as the first wide side; using the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; determining a vertical distance between any curved laser point of the first laser to be processed and the first wide side; If the vertical distance between the curved laser point and the first wide side is less than a second preset distance threshold, determining the vertical distance between the curved laser point and the second wide side; A gap between the first vehicle component and the second vehicle component is determined based on a perpendicular distance between the curvilinear laser point and the second broadside.
[0010] Optionally, re-determining the laser point of the curve to be fitted includes: For any curved laser point of the laser to be processed, determining a second distance between the curved laser point and the laser gap; If the second distance is not greater than a third preset distance threshold, the curve laser point is used as the curve laser point to be fitted.
[0011] The present application also discloses a vehicle assembly detection device, comprising: A projection module is used to project a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; An acquisition module is configured to acquire a laser image of the target vehicle body area; the laser image displays a linear laser located in the target vehicle body area; the linear laser includes a laser gap located at a splicing position of the vehicle components; the linear laser includes at least two laser points; the linear laser includes at least one laser line to be processed surrounding the laser gap; the laser line to be processed includes a curved laser close to the laser gap and a straight laser away from the laser gap; a straight line fitting module, configured to fit the straight line laser points of the linear laser to obtain a target straight line corresponding to the linear laser; a rectangle fitting module, configured to fit the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; A flushness determination module is configured to determine the gap between the at least two vehicle components based on the target straight line and the target rectangle according to a preset gap determination strategy, and / or determine the flushness between the at least two vehicle components according to a preset flushness determination strategy.
[0012] Optionally, one side of the linear laser is connected to one side of the curved laser; and the straight line fitting module includes: A first adding submodule is used to add the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; a first distance determination submodule, configured to determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point, perpendicular to a preset horizontal line; a second adding submodule, configured to, for any of the remaining laser points, add the remaining laser point to the set of laser points for the straight line to be fitted if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold; The straight line fitting submodule is used to use the laser points in the set of straight line laser points to be fitted as the straight line laser points to be fitted, and to fit the straight line laser points to be fitted to obtain the target straight line.
[0013] Optionally, the rectangle fitting module includes: The laser point of the curve to be fitted is used as a submodule, which is used to use the laser point of the curve as the laser point of the curve to be fitted; A rectangle fitting submodule is used to fit the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; An angle difference determination submodule, used to determine the angle difference between the target straight line and any long side of the initial rectangle; The target rectangle is used as a submodule, and is used to use the initial rectangle as the target rectangle if the angle difference is less than a preset angle threshold; The redetermining submodule is used to redetermine the laser point of the curve to be fitted if the angle difference is not less than the preset angle threshold, and repeatedly perform the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted until the target rectangle is obtained.
[0014] Optionally, the rectangle fitting submodule includes: a target convex polygon determining unit, configured to determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; a covariance matrix determining unit, configured to determine coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determine a covariance matrix of the at least one point using the coordinate information; an eigendecomposition unit, configured to perform eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle, and the coordinates of the center point of the initial rectangle in the coordinate system; An initial rectangle determining unit is configured to determine the initial rectangle based on at least one of the length, the width, the rotation angle, and the center point coordinates.
[0015] Optionally, the vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on a surface of the first vehicle component and a second laser to be processed located on a surface of the second vehicle component; and the flushness determination module includes: A first vertical distance determination submodule, configured to determine a vertical distance between a laser point of a line to be fitted by the first laser beam to be processed and a target line of the second laser beam to be processed; The flushness determination submodule is configured to determine a flushness between the first vehicle component and the second vehicle component based on the vertical distance.
[0016] Optionally, the flushness determination module includes: The first wide side is used as a submodule, for taking the wide side of the target rectangle of the first laser to be processed close to the laser gap as the first wide side; The second wide side is used as a submodule, for taking the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; a second vertical distance determination submodule, configured to determine a vertical distance between any curved laser point of the first laser to be processed and the first wide side; a third vertical distance determination submodule, configured to determine a vertical distance between the curved laser point and the second broadside if the vertical distance between the curved laser point and the first broadside is less than a second preset distance threshold; The gap determination submodule is configured to determine a gap between the first vehicle component and the second vehicle component based on a vertical distance between the curved laser point and the second broadside.
[0017] Optionally, the re-determining submodule includes: a second distance determining unit, configured to determine, for any curved laser point of the laser to be processed, a second distance between the curved laser point and the laser gap; The laser point of the curve to be fitted is used as a unit, and is used to take the laser point of the curve as the laser point of the curve to be fitted if the second distance is not greater than a third preset distance threshold.
[0018] The embodiment of the present application further discloses an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to implement the method described in the embodiment of the present application when executing the program stored in the memory.
[0019] The embodiments of the present application also disclose one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to perform the method described in the embodiments of the present application.
[0020] The embodiments of the present application include the following advantages: In an embodiment of the present application, a linear laser is projected onto at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the body; a laser image of the target body area is collected; a linear laser located in the target body area is displayed on the laser image; the linear laser includes a laser gap located at the splicing position of the vehicle components; the linear laser includes at least two laser points; the linear laser includes at least one laser to be processed around the laser gap; the laser to be processed includes a curved laser close to the laser gap and a straight laser away from the laser gap; the straight laser points of the straight laser are fitted to obtain a target straight line corresponding to the straight laser; the curved laser points and the straight laser points of the curved laser are fitted to obtain a target rectangle corresponding to the laser to be processed; based on the target straight line and the target rectangle, the gap between the at least two vehicle components is determined according to a preset gap determination strategy, and / or the face difference between the at least two vehicle components is determined according to a preset face difference determination strategy. For the detection of gaps and flushness between vehicle components, a linear laser is projected onto the surface of the vehicle component. By performing straight line fitting and rectangle fitting on the laser to be processed in the laser image, a target straight line and a target rectangle of the laser to be processed are obtained. Based on the target straight line and the target rectangle, the gap between at least two vehicle components is determined according to a preset gap determination strategy, and / or the flushness between at least two vehicle components is determined according to a preset flushness determination strategy. This achieves high-accuracy detection of gaps and flushness, and realizes flexible detection of gaps and flushness between vehicle components of different shapes and sizes. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a flowchart of the steps of a vehicle assembly detection method provided in an embodiment of the present application; Figure 2 is a schematic diagram of a laser line scan 3D (three-dimensional) camera provided in an embodiment of the present application; Figure 3 is a schematic diagram of a vehicle assembly detection system provided in an embodiment of the present application; Figure 4 is a schematic diagram of collecting a laser image of a target vehicle area provided in an embodiment of the present application; Figure 5 This is a schematic diagram of dividing a linear laser provided in an embodiment of the present application; Figure 6 is a schematic diagram of a target straight line provided in an embodiment of the present application; Figure 7 is a schematic diagram of a target rectangle provided in an embodiment of the present application; Figure 8 This is a flowchart of the steps of another vehicle assembly detection method provided in an embodiment of the present application; Figure 9 This is a structural block diagram of a vehicle assembly detection device provided in an embodiment of the present application; Figure 10 is a block diagram of an electronic device provided in an embodiment of the present application; Figure 11 It is a schematic diagram of a computer-readable medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0023] Reference Figure 1 , shows a flowchart of the steps of a vehicle assembly detection method provided in an embodiment of the present application, which may specifically include the following steps: Step 101: Projecting a linear laser onto at least one target body region of a preset vehicle; the target body region is a joining region on the surface of the vehicle body, which is used to form at least two vehicle components of the vehicle body; In an embodiment of the present application, the body of the vehicle is assembled by splicing at least one component of the vehicle.
[0024] Reference Figure 2 , which shows a schematic diagram of a laser line scan 3D camera provided in an embodiment of the present application. In this embodiment of the present application, the laser line scan 3D camera is primarily composed of a laser projector, a high-precision CCD (charge coupled device) camera, and a laser controller. The laser controller can control the laser projector to project a whole laser beam onto the surface of an object, resulting in a linear laser beam appearing on the surface. The high-precision CCD camera can then be controlled to capture the object, acquiring a laser brightness image of the object's surface and obtaining a surface profile image of the object.
[0025] Reference Figure 3 , shows a schematic diagram of a vehicle assembly inspection system provided in an embodiment of the present application. The vehicle assembly inspection system primarily consists of a robot, a 3D camera, a PLC (Programmable Logic Controller) control system, an industrial computer, and a positioning camera. The 3D camera is a laser line scan 3D camera used to capture surface contour images of the vehicle body; the industrial computer is responsible for image acquisition, image processing, and image storage, and also displays and records gap and flushness inspection results in real time; the 3D camera is mounted on the robot; and the PLC control system controls the robot and 3D camera.
[0026] The vehicle assembly inspection system uses a positioning camera to capture vehicle images and then sends them to an industrial computer. The industrial computer then sends the images to a programmable logic controller (PLC). The PLC processes the images, determines the vehicle location to be inspected, and sends this location to a robot. The robot then moves to the area surrounding the location. The PLC then controls a laser line scan 3D camera mounted on the robot to capture the vehicle's surface contour image at that location.
[0027] In an embodiment of the present application, a vehicle assembly inspection system can be used to control a laser projector in a laser line scan 3D camera to project a linear laser onto at least one target vehicle body region. The target vehicle body region refers to the joining area on the vehicle body surface where at least two vehicle components that form the vehicle body are joined.
[0028] Step 102: Capture a laser image of the target vehicle body area; the laser image displays a linear laser located in the target vehicle body area; the linear laser includes a laser gap located at a splicing position of the vehicle components; the linear laser includes at least two laser points; the linear laser includes at least one laser line to be processed surrounding the laser gap; the laser line to be processed includes a curved laser near the laser gap and a linear laser away from the laser gap; In an embodiment of the present application, after projecting a linear laser onto at least one target body area of a vehicle, the vehicle assembly inspection system can be used to control a high-precision CCD camera in a laser line scan 3D camera to capture a laser image of the target body area.
[0029] Reference Figure 4 , shows a schematic diagram of a laser image of a target vehicle area provided in an embodiment of the present application.
[0030] The target vehicle body area is the joint between the fuel tank cap and other vehicle components. Laser images were collected at four test locations. Laser images from any test location show a laser line located in the target vehicle body area. The laser line includes gaps where the vehicle components meet; the laser lines outside the joints are horizontal. The laser line consists of at least two laser points, which continuously form a complete laser line.
[0031] In this embodiment of the present application, a laser line is displayed on the laser image at the detection position. The laser line includes a laser gap located at the joint of the vehicle components. Based on this laser gap, the laser line can be divided into at least one laser line to be processed. In other words, the laser line includes at least one laser line to be processed surrounding the laser gap.
[0032] Reference Figure 5 , shows a schematic diagram of the division of a linear laser provided in an embodiment of the present application.
[0033] The image detection range can be set based on the captured laser image. Figure 5 The rectangular box in the image is the set image detection range.
[0034] In the image detection range, you can follow Figure 5 Determine the position of the laser gap in the direction indicated by the arrow. Starting from the leftmost laser point in the image detection range, from left to right, determine the vertical distance between each laser point and the preset horizontal line, that is, obtain the height of the laser point. Since the height of the laser point at the laser gap is much smaller than the height of the laser point outside the laser gap, the position of the gap centerline can be determined based on the vertical distance between each laser point and the preset horizontal line, and the position of the laser gap can be determined. Based on the laser gap, the linear laser can be divided into two lasers to be processed. Each laser to be processed includes a curved laser close to the laser gap and a straight laser away from the laser gap.
[0035] Step 103, fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser; In the embodiments of the present application, the laser points included in a linear laser are linear laser points, and the laser points included in a curved laser are curved laser points. For any laser beam to be processed, a linear fit can be performed on at least one linear laser point included in the linear laser beam of the laser beam to be processed to obtain a target straight line corresponding to the linear laser beam.
[0036] In some embodiments of the present application, one side of the linear laser is connected to one side of the curved laser; and fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser includes: Adding the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; Determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point on a line perpendicular to a preset horizontal line; For any of the remaining laser points, if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold, the remaining laser point is added to the set of laser points for the straight line to be fitted; The laser points in the to-be-fitted straight line laser point set are used as the to-be-fitted straight line laser points, and the to-be-fitted straight line laser points are fitted to obtain the target straight line.
[0037] Reference Figure 5For any laser beam to be processed, one side of the linear laser beam of the laser beam to be processed is connected to one side of the curved laser beam. In this embodiment of the present application, when performing line fitting on the linear laser points of the linear laser beam, the starting laser point on the side of the linear laser beam that is not connected to the curved laser beam can be added to the set of linear laser points to be fitted.
[0038] Then, a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point on a vertical line perpendicular to a preset horizontal line is determined one by one, that is, a height difference between any remaining laser point except the starting laser point and the starting laser point is determined one by one.
[0039] For any remaining laser point, if the first distance corresponding to the remaining laser point is not greater than the first preset distance threshold, it means that the remaining laser point is a laser point near the height of the starting laser point, and the remaining laser point and the starting laser point belong to the same linear laser to be processed. The remaining laser point is added to the set of linear laser points to be fitted.
[0040] In this embodiment, a laser point in the set of laser points to be fitted is used as the laser point to be fitted. A least squares method is then used to perform line fitting on at least one of the laser points to be fitted, yielding a target line corresponding to the linear laser. The target line can be represented by y = kx + b, where k is the slope of the target line and b is the intercept of the target line.
[0041] Specifically, a two-dimensional coordinate system can be established on the plane where the laser image is located, and the coordinate information (x i ,y i ); where x i is the horizontal coordinate of the laser point on the straight line to be fitted, y i is the ordinate of the laser point to be fitted, i = 1, 2, ..., n, where n is the total number of laser points to be fitted. Then, k and b are determined by solving the following two equations to obtain the initial line corresponding to the linear laser.
[0042]
[0043]
[0044] in, is the average value of the horizontal coordinates of all laser points on the straight line to be fitted, is the average value of the ordinates of all laser points on the straight line to be fitted.
[0045] Next, the initial line needs to be checked for accuracy to determine whether it meets the preset accuracy requirements. If so, the initial line is used as the target line. If not, the laser points for the line to be fitted are re-determined, and the least squares method is used to repeatedly fit at least one of the laser points until the target line that meets the preset accuracy requirements is obtained.
[0046] The accuracy check of the initial line is performed by calculating the vertical distance between any laser point on the line to be fitted and the initial line. If the vertical distances between all laser points on the line to be fitted and the initial line are less than a fourth preset distance threshold, the initial line is confirmed to meet the preset accuracy condition. The fourth preset distance threshold is set based on the actual plane tolerance of the target vehicle body area. The formula for calculating the vertical distance between the laser point on the line to be fitted and the initial line is:
[0047] Among them, x0 and y0 are the horizontal and vertical coordinates of the laser point to be fitted.
[0048] The step of re-determining the laser points of the straight line to be fitted is as follows: among the laser points of the straight line to be fitted, the laser points whose vertical distance to the initial straight line is greater than the fifth preset distance threshold are no longer used as the laser points of the straight line to be fitted, that is, the laser points far from the initial straight line are deleted, and the laser points close to the initial straight line are retained.
[0049] Reference Figure 6 , showing a schematic diagram of a target straight line provided in an embodiment of the present application. Figure 6 The two target straight lines corresponding to the lasers to be processed are shown in FIG.
[0050] Step 104, fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; In the embodiment of the present application, for any laser beam to be processed, the curved laser points and the straight laser points of the laser beam to be processed can be fitted to obtain a target rectangle corresponding to the laser beam to be processed.
[0051] In some embodiments of the present application, fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed includes: Using the curve laser point as the curve laser point to be fitted; Fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; Determining the angle difference between the target straight line and any long side of the initial rectangle; If the angle difference is less than a preset angle threshold, the initial rectangle is used as the target rectangle; If the angle difference is not less than the preset angle threshold, the laser point of the curve to be fitted is re-determined, and the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted is repeated until the target rectangle is obtained.
[0052] Specifically, for any laser beam to be processed, when performing straight line fitting on the laser beam to be processed, a straight line laser point to be fitted that can fit the target straight line is determined. Then, all the curve laser points of the laser beam to be processed are used as the curve laser points to be fitted, and the curve laser points to be fitted and the straight line laser points to be fitted are fitted to obtain the initial rectangle corresponding to the laser beam to be processed.
[0053] Next, the accuracy of the initial rectangle is checked: the angle difference between the target line and any long side of the initial rectangle is calculated. If the angle difference is less than the preset angle threshold, the initial rectangle meets the accuracy requirement and the initial rectangle is used as the target rectangle. If the angle difference is not less than the preset angle threshold, the initial rectangle does not meet the accuracy requirement, the laser points of the curve to be fitted are re-determined, and the steps of fitting the laser points of the curve to be fitted and the laser points of the line to be fitted are repeated until the target rectangle is obtained.
[0054] Reference Figure 7 , shows a schematic diagram of a target rectangle provided in an embodiment of the present application. Figure 7 The target rectangles corresponding to the two lasers to be processed are shown in FIG.
[0055] In some embodiments of the present application, fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed includes: Determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; Determining coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determining a covariance matrix of the at least one point using the coordinate information; Performing eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle and the coordinates of the center point of the initial rectangle in the coordinate system; The initial rectangle is determined based on at least one of the length, the width, the rotation angle, and the center point coordinates.
[0056] In an embodiment of the present application, for any laser to be processed, the step of fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted includes: using a convex hull algorithm to determine the minimum convex polygon including all the laser points of the curve to be fitted and all the laser points of the straight line to be fitted, and the minimum convex polygon is the target convex polygon.
[0057] Then, determine the coordinate information (x i ,y i ), where x i is the horizontal coordinate of any point in the target convex polygon, y i is the ordinate of any point in the target convex polygon, i=1,2,…,n, and n is the total number of points in the target convex polygon. Then, the covariance matrix of the points in the target convex polygon can be determined using the following formula:
[0058]
[0059]
[0060]
[0061] Where C is the covariance matrix, is the average value of the horizontal coordinates of the points in the target convex polygon, is the average of the ordinates of the points in the target convex polygon.
[0062] Next, perform eigendecomposition on the covariance matrix to determine the eigenvalues λ and corresponding eigenvectors v of the covariance matrix. The eigenvalues and eigenvectors satisfy the following equations:
[0063] For the covariance matrix C, two eigenvalues λ1 and λ2, and corresponding eigenvectors v1 and v2 can be determined, and λ1 is not less than λ2.
[0064] In the embodiment of the present application, ( ) is the coordinate of the center point of the initial rectangle in the two-dimensional coordinate system, λ1 is the length of the initial rectangle, and λ2 is the width of the initial rectangle; through the feature vector v 1, The rotation angle of the initial rectangle can be calculated. The eigenvector v1 points to the long side of the rectangle. If , then the calculation formula for the rotation angle is , θ is the rotation angle.
[0065] In an embodiment of the present application, based on at least one of the length, width, rotation angle and center point coordinates of the initial rectangle, the four vertex coordinates of the initial rectangle can be determined, and the position of the initial rectangle in the two-dimensional coordinate system can be determined using the four vertex coordinates.
[0066] In some embodiments of the present application, re-determining the laser point of the curve to be fitted includes: For any curved laser point of the laser to be processed, determining a second distance between the curved laser point and the laser gap; If the second distance is not greater than a third preset distance threshold, the curve laser point is used as the curve laser point to be fitted.
[0067] In this embodiment of the present application, the step of re-determining the curve laser point to be fitted is as follows: for any curve laser point of the laser to be processed, a second distance between the curve laser point and the laser gap is calculated. If the second distance is not greater than a third preset distance threshold, the curve laser point is used as the curve laser point to be fitted. In other words, curve laser points far from the laser gap are removed.
[0068] Step 105 : Based on the target straight line and the target rectangle, determine the gap between the at least two vehicle components according to a preset gap determination strategy, and / or determine the flushness between the at least two vehicle components according to a preset flushness determination strategy.
[0069] In an embodiment of the present application, a target line and a target rectangle are used to determine the gap between at least two vehicle components according to a preset gap determination strategy, and / or to determine the flushness between at least two vehicle components according to a preset flushness determination strategy. If the target vehicle body region includes two vehicle components, the surface of the target vehicle body region actually has two sections—a left side and a right side. Flush detection measures the height difference between the left side and the right side, while gap detection measures the vertical distance from the end position of the left side to the starting position of the right side.
[0070] In some embodiments of the present application, the vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on a surface of the first vehicle component and a second laser to be processed located on a surface of the second vehicle component; and determining the flushness between the at least two vehicle components according to a preset flushness determination strategy includes: Determining a vertical distance between a laser point of a line to be fitted by the first laser to be processed and a target line of the second laser to be processed; Based on the perpendicular distance, a flush difference between the first vehicle component and the second vehicle component is determined.
[0071] In the embodiment of the present application, the vehicle components in the target vehicle body area include a first vehicle component and a second vehicle component. The laser to be processed includes a first laser to be processed located on the surface of the first vehicle component and a second laser to be processed located on the surface of the second vehicle component.
[0072] Calculate the vertical distance between any laser point on the line to be fitted of the first laser beam and the target line of the second laser beam. Then, calculate the average of the vertical distances between all laser points on the line to be fitted of the first laser beam and the target line of the second laser beam, and use this average as the flushness between the first and second vehicle components.
[0073] In some embodiments of the present application, determining the gap between the at least two vehicle components according to a preset gap determination strategy includes: taking the wide side of the target rectangle of the first laser to be processed, which is close to the laser gap, as the first wide side; using the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; determining a vertical distance between any curved laser point of the first laser to be processed and the first wide side; If the vertical distance between the curved laser point and the first wide side is less than a second preset distance threshold, determining the vertical distance between the curved laser point and the second wide side; A gap between the first vehicle component and the second vehicle component is determined based on a perpendicular distance between the curvilinear laser point and the second broadside.
[0074] In an embodiment of the present application, when calculating the gap between the first vehicle component and the second vehicle component, the wide side of the target rectangle of the first laser to be processed close to the laser gap is used as the first wide side, and the wide side of the target rectangle of the second laser to be processed close to the laser gap is used as the second wide side.
[0075] Then, the vertical distance between any curved laser point of the first laser beam to be processed and the first wide side is calculated. For any curved laser point, if the vertical distance between the curved laser point and the first wide side is less than a second preset distance threshold, the curved laser point is used as the curved laser point to be calculated.
[0076] The vertical distance between the laser point on the curve to be calculated and the second broadside is calculated, and the average of the vertical distances between all laser points on the curve to be calculated and the second broadside is used as the clearance between the first vehicle component and the second vehicle component. It should be noted that a formula for the straight line on which the second broadside lies can be determined; using this formula and the coordinate information of the laser point on the curve to be calculated, the vertical distance between the laser point on the curve to be calculated and the second broadside is calculated.
[0077] In an embodiment of the present application, a linear laser is projected onto at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the body; a laser image of the target body area is collected; a linear laser located in the target body area is displayed on the laser image; the linear laser includes a laser gap located at the splicing position of the vehicle components; the linear laser includes at least two laser points; the linear laser includes at least one laser to be processed around the laser gap; the laser to be processed includes a curved laser close to the laser gap and a straight laser away from the laser gap; the straight laser points of the straight laser are fitted to obtain a target straight line corresponding to the straight laser; the curved laser points and the straight laser points of the curved laser are fitted to obtain a target rectangle corresponding to the laser to be processed; based on the target straight line and the target rectangle, the gap between the at least two vehicle components is determined according to a preset gap determination strategy, and / or the face difference between the at least two vehicle components is determined according to a preset face difference determination strategy. For the detection of gaps and flushness between vehicle components, a linear laser is projected onto the surface of the vehicle component. By performing straight line fitting and rectangle fitting on the laser to be processed in the laser image, a target straight line and a target rectangle of the laser to be processed are obtained. Based on the target straight line and the target rectangle, the gap between at least two vehicle components is determined according to a preset gap determination strategy, and / or the flushness between at least two vehicle components is determined according to a preset flushness determination strategy. This achieves high-accuracy detection of gaps and flushness, and realizes flexible detection of gaps and flushness between vehicle components of different shapes and sizes.
[0078] Reference Figure 8 , shows a flowchart of the steps of another vehicle assembly detection method provided in an embodiment of the present application, which may specifically include the following steps: Step 801, start.
[0079] Step 802, moving to the inspection position: the PLC control system controls the robot to move to any position of the vehicle body to be inspected.
[0080] Step 803 , the 3D camera acquires actual data: the robot moves to the position of the vehicle body to be inspected, and triggers the laser line scanning 3D camera to acquire a laser image of the vehicle body surface.
[0081] Step 804, calculate the gap and flushness: use the vision software to process the laser image, calculate the gap and flushness of the current vehicle body position, and trigger the robot to move to another vehicle body position to be inspected until all vehicle body positions to be inspected are inspected.
[0082] Step 805, end.
[0083] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0084] Reference Figure 9 , shows a structural block diagram of a vehicle assembly detection device provided in an embodiment of the present application, which may specifically include the following modules: Projection module 901 is used to project a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; Acquisition module 902 is configured to acquire a laser image of the target vehicle body area; the laser image displays a linear laser located in the target vehicle body area; the linear laser includes a laser gap located at a splicing location of the vehicle components; the linear laser includes at least two laser points; the linear laser includes at least one laser line to be processed surrounding the laser gap; the laser line to be processed includes a curved laser near the laser gap and a linear laser away from the laser gap; A straight line fitting module 903 is used to fit the straight line laser points of the straight laser to obtain a target straight line corresponding to the straight laser; A rectangle fitting module 904 is used to fit the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; The flushness determination module 905 is configured to determine the gap between the at least two vehicle components based on the target straight line and the target rectangle according to a preset gap determination strategy, and / or determine the flushness between the at least two vehicle components according to a preset flushness determination strategy.
[0085] In an optional embodiment of the present application, one side of the linear laser is connected to one side of the curved laser; and the straight line fitting module includes: A first adding submodule is used to add the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; a first distance determination submodule, configured to determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point, perpendicular to a preset horizontal line; a second adding submodule, configured to, for any of the remaining laser points, add the remaining laser point to the set of laser points for the straight line to be fitted if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold; The straight line fitting submodule is used to use the laser points in the set of straight line laser points to be fitted as the straight line laser points to be fitted, and to fit the straight line laser points to be fitted to obtain the target straight line.
[0086] In an optional embodiment of the present application, the rectangle fitting module includes: The laser point of the curve to be fitted is used as a submodule, which is used to use the laser point of the curve as the laser point of the curve to be fitted; A rectangle fitting submodule is used to fit the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; An angle difference determination submodule, used to determine the angle difference between the target straight line and any long side of the initial rectangle; The target rectangle is used as a submodule, and is used to use the initial rectangle as the target rectangle if the angle difference is less than a preset angle threshold; The redetermining submodule is used to redetermine the laser point of the curve to be fitted if the angle difference is not less than the preset angle threshold, and repeatedly perform the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted until the target rectangle is obtained.
[0087] In an optional embodiment of the present application, the rectangle fitting submodule includes: a target convex polygon determining unit, configured to determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; a covariance matrix determining unit, configured to determine coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determine a covariance matrix of the at least one point using the coordinate information; an eigendecomposition unit, configured to perform eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle, and the coordinates of the center point of the initial rectangle in the coordinate system; An initial rectangle determining unit is configured to determine the initial rectangle based on at least one of the length, the width, the rotation angle, and the center point coordinates.
[0088] In an optional embodiment of the present application, the vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on a surface of the first vehicle component and a second laser to be processed located on a surface of the second vehicle component; and the flushness determination module includes: A first vertical distance determination submodule, configured to determine a vertical distance between a laser point of a line to be fitted by the first laser beam to be processed and a target line of the second laser beam to be processed; The flushness determination submodule is configured to determine a flushness between the first vehicle component and the second vehicle component based on the vertical distance.
[0089] In an optional embodiment of the present application, the flushness determination module includes: The first wide side is used as a submodule, for taking the wide side of the target rectangle of the first laser to be processed close to the laser gap as the first wide side; The second wide side is used as a submodule, for taking the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; a second vertical distance determination submodule, configured to determine a vertical distance between any curved laser point of the first laser to be processed and the first wide side; a third vertical distance determination submodule, configured to determine a vertical distance between the curved laser point and the second broadside if the vertical distance between the curved laser point and the first broadside is less than a second preset distance threshold; The gap determination submodule is configured to determine a gap between the first vehicle component and the second vehicle component based on a vertical distance between the curved laser point and the second broadside.
[0090] In an optional embodiment of the present application, the re-determining submodule includes: a second distance determining unit, configured to determine, for any curved laser point of the laser to be processed, a second distance between the curved laser point and the laser gap; The laser point of the curve to be fitted is used as a unit, and is used to take the laser point of the curve as the laser point of the curve to be fitted if the second distance is not greater than a third preset distance threshold.
[0091] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0092] In addition, the present invention also provides an electronic device, such as Figure 10As shown, it includes a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004. Memory 1003, used for storing computer programs; The processor 1001 is configured to execute the program stored in the memory 1003 by performing the following steps: Projecting a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; Acquiring a laser image of the target vehicle body area; displaying a linear laser located in the target vehicle body area on the laser image; the linear laser including a laser gap located at a splicing position of the vehicle parts; the linear laser including at least two laser points; the linear laser including at least one laser line to be processed surrounding the laser gap; the laser line to be processed including a curved laser close to the laser gap and a linear laser away from the laser gap; Fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser; Fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; Based on the target straight line and the target rectangle, the gap between the at least two vehicle components is determined according to a preset gap determination strategy, and / or the flushness between the at least two vehicle components is determined according to a preset flushness determination strategy.
[0093] In an optional embodiment of the present application, one side of the linear laser is connected to one side of the curved laser; and fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser includes: Adding the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; Determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point on a line perpendicular to a preset horizontal line; For any of the remaining laser points, if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold, the remaining laser point is added to the set of laser points for the straight line to be fitted; The laser points in the to-be-fitted straight line laser point set are used as the to-be-fitted straight line laser points, and the to-be-fitted straight line laser points are fitted to obtain the target straight line.
[0094] In an optional embodiment of the present application, fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed includes: Using the curve laser point as the curve laser point to be fitted; Fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; Determining the angle difference between the target straight line and any long side of the initial rectangle; If the angle difference is less than a preset angle threshold, the initial rectangle is used as the target rectangle; If the angle difference is not less than the preset angle threshold, the laser point of the curve to be fitted is re-determined, and the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted is repeated until the target rectangle is obtained.
[0095] In an optional embodiment of the present application, fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed includes: Determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; Determining coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determining a covariance matrix of the at least one point using the coordinate information; Performing eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle and the coordinates of the center point of the initial rectangle in the coordinate system; The initial rectangle is determined based on at least one of the length, the width, the rotation angle, and the center point coordinates.
[0096] In an optional embodiment of the present application, the vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on a surface of the first vehicle component and a second laser to be processed located on a surface of the second vehicle component; and determining the flushness between the at least two vehicle components according to a preset flushness determination strategy includes: Determining a vertical distance between a laser point of a line to be fitted by the first laser to be processed and a target line of the second laser to be processed; Based on the perpendicular distance, a flush difference between the first vehicle component and the second vehicle component is determined.
[0097] In an optional embodiment of the present application, determining the gap between the at least two vehicle components according to a preset gap determination strategy includes: taking the wide side of the target rectangle of the first laser to be processed, which is close to the laser gap, as the first wide side; using the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; determining a vertical distance between any curved laser point of the first laser to be processed and the first wide side; If the vertical distance between the curved laser point and the first wide side is less than a second preset distance threshold, determining the vertical distance between the curved laser point and the second wide side; A gap between the first vehicle component and the second vehicle component is determined based on a perpendicular distance between the curvilinear laser point and the second broadside.
[0098] In an optional embodiment of the present application, the re-determining the laser point of the curve to be fitted includes: For any curved laser point of the laser to be processed, determining a second distance between the curved laser point and the laser gap; If the second distance is not greater than a third preset distance threshold, the curve laser point is used as the curve laser point to be fitted.
[0099] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0100] The communication interface is used for communication between the above terminal and other devices.
[0101] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0102] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0103] like Figure 11 As shown, in another embodiment provided by the present application, a computer-readable storage medium 1101 is further provided, in which instructions are stored. When the computer-readable storage medium 1101 is executed on a computer, the computer executes the vehicle assembly detection method described in the above embodiment.
[0104] In another embodiment provided by the present application, a computer program product including instructions is further provided. When the computer program product is run on a computer, the computer is enabled to execute the vehicle assembly detection method described in the above embodiment.
[0105] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, hard disk, tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0106] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0107] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0108] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the scope of protection of the present application.
Claims
1. A vehicle assembly detection method, characterized in that: include: Projecting a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; Acquiring a laser image of the target vehicle body area; displaying a linear laser located in the target vehicle body area on the laser image; the linear laser including a laser gap located at a splicing position of the vehicle parts; the linear laser including at least two laser points; the linear laser including at least one laser line to be processed surrounding the laser gap; the laser line to be processed including a curved laser close to the laser gap and a linear laser away from the laser gap; Fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser; Fitting the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; Based on the target straight line and the target rectangle, the gap between the at least two vehicle components is determined according to a preset gap determination strategy, and / or the flushness between the at least two vehicle components is determined according to a preset flushness determination strategy.
2. The method according to claim 1, characterized in that One side of the linear laser is connected to one side of the curved laser; and fitting the linear laser points of the linear laser to obtain a target straight line corresponding to the linear laser includes: Adding the starting laser point on the side of the linear laser that is not connected to the curved laser to the preset set of linear laser points to be fitted; Determine a first distance between any remaining laser point in the linear laser except the starting laser point and the starting laser point on a line perpendicular to a preset horizontal line; For any of the remaining laser points, if the first distance corresponding to the remaining laser point is not greater than a first preset distance threshold, the remaining laser point is added to the set of laser points for the straight line to be fitted; The laser points in the to-be-fitted straight line laser point set are used as the to-be-fitted straight line laser points, and the to-be-fitted straight line laser points are fitted to obtain the target straight line.
3. The method according to claim 2, characterized in that The fitting of the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed includes: Using the curve laser point as the curve laser point to be fitted; Fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed; Determining the angle difference between the target straight line and any long side of the initial rectangle; If the angle difference is less than a preset angle threshold, the initial rectangle is used as the target rectangle; If the angle difference is not less than the preset angle threshold, the laser point of the curve to be fitted is re-determined, and the step of fitting the laser point of the curve to be fitted and the laser point of the straight line to be fitted is repeated until the target rectangle is obtained.
4. The method according to claim 3, characterized in that The step of fitting the laser points of the curve to be fitted and the laser points of the straight line to be fitted to obtain an initial rectangle corresponding to the laser to be processed includes: Determine a target convex polygon including the laser points of the curve to be fitted and the laser points of the straight line to be fitted; Determining coordinate information of at least one point included in the target convex polygon in a preset coordinate system, and determining a covariance matrix of the at least one point using the coordinate information; Performing eigendecomposition on the covariance matrix to obtain at least one of the length, width, rotation angle of the initial rectangle and the coordinates of the center point of the initial rectangle in the coordinate system; The initial rectangle is determined based on at least one of the length, the width, the rotation angle, and the center point coordinates.
5. The method according to claim 2, characterized in that The vehicle component includes a first vehicle component and a second vehicle component; the laser to be processed includes a first laser to be processed located on the surface of the first vehicle component and a second laser to be processed located on the surface of the second vehicle component; The determining the flushness between the at least two vehicle components according to a preset flushness determination strategy includes: Determining a vertical distance between a laser point of a line to be fitted by the first laser to be processed and a target line of the second laser to be processed; Based on the perpendicular distance, a flush difference between the first vehicle component and the second vehicle component is determined.
6. The method according to claim 5, characterized in that The determining the gap between the at least two vehicle components according to a preset gap determination strategy includes: taking the wide side of the target rectangle of the first laser to be processed, which is close to the laser gap, as the first wide side; using the wide side of the target rectangle of the second laser to be processed, which is close to the laser gap, as the second wide side; determining a vertical distance between any curved laser point of the first laser to be processed and the first wide side; If the vertical distance between the curved laser point and the first wide side is less than a second preset distance threshold, determining the vertical distance between the curved laser point and the second wide side; A gap between the first vehicle component and the second vehicle component is determined based on a perpendicular distance between the curvilinear laser point and the second broadside.
7. The method according to claim 3, characterized in that The re-determining the laser point of the curve to be fitted includes: For any curved laser point of the laser to be processed, determining a second distance between the curved laser point and the laser gap; If the second distance is not greater than a third preset distance threshold, the curve laser point is used as the curve laser point to be fitted.
8. A vehicle assembly detection device, characterized in that: include: A projection module is used to project a linear laser on at least one target body area of a preset vehicle; the target body area is a splicing area on the body surface of the vehicle, which is used to form at least two vehicle components of the vehicle body; an acquisition module configured to acquire a laser image of the target vehicle body area; the laser image displaying a linear laser located in the target vehicle body area; the linear laser including a laser gap located at a splicing position of the vehicle components; the linear laser including at least two laser points; the linear laser including at least one laser line to be processed surrounding the laser gap; the laser line to be processed including a curved laser close to the laser gap and a linear laser away from the laser gap; a straight line fitting module, configured to fit the straight line laser points of the linear laser to obtain a target straight line corresponding to the linear laser; a rectangle fitting module, configured to fit the curved laser points of the curved laser and the straight laser points to obtain a target rectangle corresponding to the laser to be processed; A flushness determination module is configured to determine the gap between the at least two vehicle components based on the target straight line and the target rectangle according to a preset gap determination strategy, and / or determine the flushness between the at least two vehicle components according to a preset flushness determination strategy.
9. An electronic device, characterized in that: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is configured to implement the method according to any one of claims 1 to 7 when executing a program stored in the memory.
10. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.