A method, device, equipment and storage medium for calibrating external parameters of multiple laser radars
By extracting ground data in lidar point cloud data and performing optimization matching point matching processing, the problem of low external parameter calibration accuracy in intelligent driving vehicles is solved, and efficient and accurate external parameter calibration is achieved.
Patent Information
- Application Number
- CN202111211484.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-10-18
AI Technical Summary
In the prior art, when multiple lidar devices are used in intelligent driving vehicles, the collected environmental data is offset due to different positions, and the existing calibration methods are not accurate and have low efficiency.
By obtaining point cloud data collected by different lidars, the ground data is extracted and the ground plane is fitted to obtain coarse calibration results, and then the set external parameters are optimized based on the matching points to achieve accurate target calibration.
It improves the accuracy and efficiency of lidar external parameter calibration, and does not require manual measurement of parameters or special calibration objects, simplifies calibration operations and reduces costs.
Smart Images

Figure CN113888649B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser radar technology, and in particular to a multi-laser radar external parameter calibration method, device, equipment and storage medium. Background Art
[0002] In recent years, with the rapid development of intelligent driving technology, lidar has the characteristics of high precision, large ranging range, and no influence of light. It has been widely used in environmental perception fields such as obstacle detection, real-time positioning and map construction of intelligent driving vehicles.
[0003] In order to enhance the perception of the surrounding environment, considering the scanning range and field of view of the LiDAR, multiple LiDAR devices will be configured on a smart driving car. But this also raises new problems: due to the different positions of each LiDAR device, there will be a certain degree of offset between the environmental data collected by each LiDAR device. Therefore, accurate calibration of the external parameters between each LiDAR device is an essential task for using multiple LiDAR devices to provide a wider field of view for vehicle perception and positioning. By calibrating the external parameters of each LiDAR device, the point cloud data of multiple LiDARs can be unified into the same coordinate system, so that the intelligent driving system can grasp more comprehensive information about the surrounding environment.
[0004] Common calibration methods in the prior art mainly include traditional manual calibration and calibration object measurement methods. Among them, traditional manual calibration uses manual measurement or instrument measurement to measure the transformation relationship between the laser radar coordinate system and the reference coordinate system. Although this method is simple in principle, it has high requirements on the operator's operation precision and the accuracy of the measuring instrument. Therefore, its scalability is not high, and the calibration accuracy is unstable and will vary with the operator's level. The calibration object measurement method determines the external parameters of the laser radar device by matching specific calibration objects. This method also has certain disadvantages. Since the reflectivity of laser radar for objects of different colors and materials is different, it is difficult to find control points. At the same time, a lot of manpower is required in the process of moving control points. The accuracy of its calibration also depends on the parameters between other sensors and control points. Therefore, this calibration method has low calibration efficiency and low accuracy. Summary of the invention
[0005] In view of the above-mentioned problems in the prior art, the object of the present invention is to provide a multi-lidar extrinsic parameter calibration method, device, equipment and storage medium, which can improve the accuracy and efficiency of the lidar extrinsic parameter calibration.
[0006] In order to solve the above problems, the present invention provides a multi-laser radar extrinsic parameter calibration method, comprising:
[0007] Acquire two point cloud data, where the two point cloud data are collected by different laser radars;
[0008] Extracting ground data from each point cloud data respectively, fitting a ground plane using the ground data so that the fitted target ground plane coincides with the reference ground plane, and obtaining a rough calibration result of each laser radar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference;
[0009] The data points in the two point cloud data are matched to obtain a matching point pair set, and the rough calibration results of each laser radar are optimized based on the matching point pair set to obtain the target calibration results of each laser radar relative to the reference coordinate system.
[0010] Furthermore, extracting ground data from each point cloud data includes:
[0011] For each point cloud data, determine a first target ground point set from the point cloud data, perform an iterative extraction process to obtain a second target ground point set, and use the second target ground point set as ground data corresponding to the point cloud data;
[0012] Wherein, the iterative extraction process includes:
[0013] Step 11, performing principal component analysis on the first target ground point set to determine the target ground;
[0014] Step 12, selecting a ground point set whose distance to the target ground is less than a first preset threshold from the first target ground point set as a second target ground point set;
[0015] Step 13, determine whether the current number of iterations is greater than or equal to the preset number; if not, use the second target ground point set as the new first target ground point set and return to step 11; if so, output the second target ground point set.
[0016] Furthermore, the fitting of the ground plane using the ground data so that the fitted target ground plane coincides with the reference ground plane, and obtaining the rough calibration results of each laser radar relative to the reference coordinate system includes:
[0017] For each point cloud data, respectively, an iterative calculation process is performed using the ground data corresponding to the point cloud data to obtain one or more target transformation matrices, and a rough calibration result of the laser radar corresponding to the point cloud data is calculated according to the one or more target transformation matrices;
[0018] The iterative calculation process includes:
[0019] Step 21, using the RANSAC algorithm to fit the ground data to obtain the target ground plane;
[0020] Step 22, calculating a target transformation matrix using the normal vector of the target ground plane and the normal vector of the reference ground plane;
[0021] Step 23, determine the distance between the normal vector of the target ground plane and the normal vector of the reference ground plane, and determine whether the distance is less than a second preset threshold; if not, use the target transformation matrix to transform each ground point in the ground data to obtain new ground data, and return to step 21; if so, output one or more target transformation matrices obtained during the iterative calculation process.
[0022] Furthermore, the matching of the data points in the two point cloud data to obtain a matching point pair set, and optimizing the rough calibration results of each laser radar based on the matching point pair set to obtain the target calibration results of each laser radar relative to the reference coordinate system include:
[0023] Constructing a first KD tree based on the rough calibration result;
[0024] Based on the first KD tree, the data points in the two point cloud data are matched to obtain a first matching point pair set, and based on the first matching point pair set, the external parameters θ, x and y in the rough calibration results of each laser radar are optimized to obtain a precise calibration result of each laser radar;
[0025] Constructing a second KD tree based on the precise calibration result;
[0026] Based on the second KD tree, the data points in the two point cloud data are matched to obtain a second matching point pair set. Based on the second matching point pair set, the external parameters α, β and z in the precise calibration results of each laser radar are optimized to obtain the target calibration results of each laser radar.
[0027] Further, the data points in the two point cloud data are matched based on the first KD tree to obtain a first matching point pair set, and the external parameters θ, x and y in the rough calibration results of each laser radar are optimized based on the first matching point pair set to obtain the precise calibration results of each laser radar, including:
[0028] For each data point in the first point cloud data of the two point cloud data, determine two first matching points corresponding thereto based on the first KD tree to obtain a first sub-matching point pair set, wherein the two first matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point;
[0029] For each data point in the second point cloud data of the two point cloud data, determine two second matching points corresponding thereto based on the first KD tree to obtain a second sub-matching point pair set, wherein the two second matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point;
[0030] Based on the first sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the second point cloud data are optimized to obtain a corresponding fine calibration result;
[0031] Based on the second sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding fine calibration result.
[0032] Furthermore, the data points in the two point cloud data are matched based on the second KD tree to obtain a second matching point pair set, and the external parameters α, β and z in the precise calibration results of each laser radar are optimized based on the second matching point pair set to obtain the target calibration results of each laser radar, including:
[0033] For each data point in the first point cloud data of the two point cloud data, determine two third matching points corresponding thereto based on the second KD tree to obtain a third sub-matching point pair set, wherein the two third matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point;
[0034] For each data point in the second point cloud data of the two point cloud data, determine two fourth matching points corresponding thereto based on the second KD tree to obtain a fourth sub-matching point pair set, wherein the two fourth matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point;
[0035] Optimizing the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the second point cloud data based on the third sub-matching point pair set to obtain a corresponding target calibration result;
[0036] Based on the fourth sub-matching point pair set, the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding target calibration result.
[0037] Furthermore, the method further comprises:
[0038] The transformation matrix between the coordinate systems of each laser radar is determined according to the target calibration results of each laser radar.
[0039] Another aspect of the present invention provides a multi-laser radar extrinsic parameter calibration device, comprising:
[0040] An acquisition module, used for acquiring two point cloud data, wherein the two point cloud data are acquired by different laser radars;
[0041] A coarse calibration module is used to extract ground data from each point cloud data, fit a ground plane using the ground data, so that the fitted target ground plane coincides with the reference ground plane, and obtain a coarse calibration result of each laser radar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference;
[0042] The optimization module is used to match the data points in the two point cloud data to obtain a matching point pair set, and optimize the rough calibration results of each laser radar based on the matching point pair set to obtain the target calibration results of each laser radar relative to the reference coordinate system.
[0043] On the other hand, the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the multi-lidar external parameter calibration method as described above.
[0044] On the other hand, the present invention provides a computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or the at least one program is loaded and executed by a processor to implement the multi-lidar external parameter calibration method as described above.
[0045] Due to the above technical solution, the present invention has the following beneficial effects:
[0046] According to the multi-lidar external parameter calibration method of the embodiment of the present invention, the ground data in the point cloud data collected by each laser radar is extracted respectively, and the ground plane is fitted using the ground data so that the fitted target ground plane coincides with the reference ground plane to obtain the corresponding rough calibration result, and then the point cloud data collected by different laser radars are paired, and each external parameter in the rough calibration result is optimized using the matching point pair set to obtain the final target calibration result. This method can improve the accuracy of laser radar external parameter calibration, and does not require manual measurement of parameters, does not require special calibration objects, and has simple calibration operations, which improves the efficiency of calibration and reduces the calibration cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 is a flow chart of a multi-lidar extrinsic parameter calibration method provided by an embodiment of the present invention;
[0049] Figure 2 is a schematic diagram of a visual calibration interface provided by an embodiment of the present invention;
[0050] Figure 3 is a schematic diagram of a calibration effect corresponding to a rough calibration result provided by an embodiment of the present invention;
[0051] Figure 4 is a flow chart of a multi-lidar extrinsic parameter calibration method provided by another embodiment of the present invention;
[0052] Figure 5 is a schematic diagram of the distance from a data point to a line connecting two corresponding matching points provided by an embodiment of the present invention;
[0053] Figure 6 is a schematic diagram of a calibration effect corresponding to a precise calibration result provided by an embodiment of the present invention;
[0054] Figure 7 It is a structural schematic diagram of a multi-lidar extrinsic parameter calibration device provided by an embodiment of the present invention;
[0055] Figure 8 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0058] Reference Manual Attached Figure 1 , which shows a process of a multi-lidar external parameter calibration method provided by an embodiment of the present invention, specifically as follows Figure 1 As shown, the method may include the following steps:
[0059] S110: Acquire two point cloud data, where the two point cloud data are collected by different laser radars.
[0060] In an embodiment of the present invention, the two point cloud data may include multiple frames of point cloud data, and the two point cloud data are point cloud data collected by two different laser radars. The fields of view of the two different laser radars may overlap at least partially, and there may be appropriate objects protruding from the ground in the overlapping area. The more and smoother the objects protruding from the ground, the higher the calibration accuracy using the method provided in the embodiment of the present invention. The two different laser radars may be set at different positions of the same device, for example, at two diagonal corners of a smart driving car.
[0061] S120: Extract ground data from each point cloud data respectively, and use the ground data to fit the ground plane so that the fitted target ground plane coincides with the reference ground plane, thereby obtaining a rough calibration result of each lidar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference.
[0062] In the embodiment of the present invention, a flat ground may be used as a reference ground plane, and a ground coordinate system may be used as a reference coordinate system. Specifically, extracting ground data from each point cloud data may include:
[0063] For each point cloud data, determine a first target ground point set from the point cloud data, perform an iterative extraction process to obtain a second target ground point set, and use the second target ground point set as ground data corresponding to the point cloud data;
[0064] Wherein, the iterative extraction process includes:
[0065] Step 11, performing principal component analysis on the first target ground point set to determine the target ground;
[0066] Step 12, selecting a ground point set whose distance to the target ground is less than a first preset threshold from the first target ground point set as a second target ground point set;
[0067] Step 13, determine whether the current number of iterations is greater than or equal to the preset number; if not, use the second target ground point set as the new first target ground point set and return to step 11; if so, output the second target ground point set.
[0068] Specifically, after obtaining the two point cloud data, each point cloud data can be preprocessed respectively, and the data points with too small height in the z direction can be removed by a straight-through filter, and then the first N points with the lowest height in the z direction in the preprocessed point cloud data are obtained, and the average value of the height in the z direction of these N points is calculated, and finally the data points in the preprocessed point cloud data whose difference between the height in the z direction and the average value is less than the third preset threshold are determined as the target ground points, thereby obtaining the first target ground point set. Among them, the value of N and the third preset threshold can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0069] Specifically, in step 11, the variance and average value of each target ground point in the first target ground point set can be calculated, and the variance can be subjected to singular value decomposition (SVD), and the eigenvector with the smallest eigenvalue is selected as the normal vector of the target ground, which is recorded as n=(A, B, C) T , then the equation of the target ground is:
[0070] Ax+By+Cz+D=0 (1)
[0071] Wherein, -D represents the vertical distance between the target ground and the origin of the reference coordinate system.
[0072] Specifically, in step 12, the first preset threshold may be set according to actual needs, and the first preset threshold may be the same as or different from the third preset threshold, which is not limited in this embodiment of the present invention.
[0073] In practical applications, the value of -d can be calculated according to equation (1), the normal vector of the target ground and the average value of each target ground point. The calculation formula is as follows:
[0074]
[0075] in, is the coordinate of the average value of each target ground point. The target threshold of this iteration process can be determined according to the first preset threshold:
[0076] th_dis_d=ground_distance_threshold-d (3)
[0077] Wherein, ground_distance_threshold represents the first preset threshold. After obtaining the target threshold, the -D value corresponding to each target ground point in the first target ground point set can be calculated according to the equation of the target ground, and if the -D value is less than the target threshold, it is considered that the distance between the corresponding target ground point and the target ground is less than the first preset threshold.
[0078] Specifically, in step 13, the preset number of times can be set according to actual needs. When the current number of iterations is greater than or equal to the preset number of times, the iterative extraction process ends and the second target ground point set is output.
[0079] The embodiment of the present invention uses a method for extracting ground points through multiple iterations to gradually filter out real ground data, thereby improving the accuracy of the fitted target ground plane and improving the efficiency of laser radar external parameter calibration.
[0080] In the embodiment of the present invention, fitting a ground plane using the ground data so that the fitted target ground plane coincides with the reference ground plane, and obtaining a rough calibration result of each laser radar relative to the reference coordinate system may include:
[0081] For each point cloud data, respectively, an iterative calculation process is performed using the ground data corresponding to the point cloud data to obtain one or more target transformation matrices, and a rough calibration result of the laser radar corresponding to the point cloud data is calculated according to the one or more target transformation matrices;
[0082] The iterative calculation process includes:
[0083] Step 21, using the RANSAC algorithm to fit the ground data to obtain the target ground plane;
[0084] Step 22, calculating a target transformation matrix using the normal vector of the target ground plane and the normal vector of the reference ground plane;
[0085] Step 23, determine the distance between the normal vector of the target ground plane and the normal vector of the reference ground plane, and determine whether the distance is less than a second preset threshold; if not, use the target transformation matrix to transform each ground point in the ground data to obtain new ground data, and return to step 21; if so, output one or more target transformation matrices obtained during the iterative calculation process.
[0086] Specifically, after the ground data corresponding to the two point cloud data are respectively extracted, the ground data corresponding to each point cloud data can be used for rough calibration to obtain rough calibration results of the two laser radars respectively.
[0087] Specifically, in step 21, the process of the RANSAC algorithm includes the following steps:
[0088] ① Randomly select M points from the ground data.
[0089] ② The fitted plane is obtained by solving the following least squares problem: solve the parameters A, B, C, D of the plane equation so that the sum of the squares of the distances from the M points to the plane is minimized, that is, the objective function to be solved is:
[0090]
[0091] ③ Filter ground points whose distance from the plane is less than a fourth preset threshold from the ground data, and record the number of ground points that meet the condition.
[0092] ④ When the number of ground points whose distance to the plane is less than the fourth preset threshold is greater than the first preset number, the fitted plane is used as the target ground plane; otherwise, repeat the above steps ① to ④.
[0093] Among them, the fourth preset threshold and the first preset number can be set according to actual needs. The fourth preset threshold can be the same as the first preset threshold or the third preset threshold, or can be different. The embodiment of the present invention does not limit this.
[0094] Specifically, in step 22, the rotation of the roll angle and pitch angle of the laser radar can be calculated by equation (5), and the rotation matrix of the laser radar can be updated by equation (6):
[0095]
[0096] global_trans=trans×global_trans (6)
[0097] Among them, global_trans represents the rotation matrix of the lidar. global_trans is a 3×3 matrix. The calculation formulas of angle and rotate_axis are as follows:
[0098] angle=acos(n ground ,n std )
[0099] rotate_axis=n ground ×n std =[rotate X ,rotate Y ,rotate Z ] T
[0100] Among them, n ground is the normal vector of the target ground plane, n std is the normal vector (0, 0, 1) of the reference ground plane. In addition, the value of the external parameter z can be calculated based on the distance from the point to the plane. The calculation formula is as follows:
[0101]
[0102] Among them, x, y, z are the coordinate origin (0, 0, 0). According to the rotation matrix and the value of the external parameter z, the target transformation matrix for the roll angle, pitch angle and z direction in the laser radar external parameter can be obtained as follows:
[0103]
[0104] It should be noted that the initial value of the rotation matrix global_trans of the laser radar can be calculated according to the preset initial extrinsic parameter value, and the initial extrinsic parameter value can be set through the user interface or set to the initial extrinsic parameter default value.
[0105] In a possible embodiment, the method may further include the step of obtaining initial extrinsic parameter values of two different laser radars. Specifically, a visual calibration interface may be provided to the user, through which the user may input, select or reset the initial extrinsic parameter values of two different laser radars. By providing the user with a visual calibration interface, the user only needs to click a control to trigger the extrinsic parameter calibration to achieve automatic calibration. The calibration operation is simple, and no manual measurement of parameters or special calibration objects are required, so the labor cost is low.
[0106] For example, Figure 2As shown, the user can set the initial extrinsic parameter values of the six degrees of freedom of the two lidars through the bidirectional adjustment boxes in the Velodyne First and Velodyne Second parts of the visual calibration interface, set the position of the smart driving car body through the Vehicle Box part of the visual calibration interface, restore the extrinsic parameters of the two lidars to the initial default values through the reset button, trigger the automatic calibration process through the calibration button, save the extrinsic parameter calibration results to the lidar extrinsic parameter configuration file through the save button, and choose whether to calibrate the extrinsic parameters of the two degrees of freedom x and y during calibration through the claxy double check box.
[0107] Specifically, in step S23, the Euclidean distance or cosine similarity between the normal vector of the target ground plane and the normal vector of the reference ground plane can be calculated as the distance between the two. The second preset threshold can be set according to actual needs. The second preset threshold may be the same as the first preset threshold, the third preset threshold or the fourth preset threshold, or may be different. The embodiment of the present invention does not limit this.
[0108] The embodiment of the present invention adopts the RANSAC algorithm to fit the ground plane, which can improve the accuracy of fitting the target ground plane and further improve the efficiency of laser radar external parameter calibration.
[0109] In an embodiment of the present invention, after obtaining the one or more target transformation matrices, the target average matrix of the one or more target transformation matrices can be calculated using the RANSAC algorithm, wherein the model fitting part uses the Geodesic L2-Mean algorithm to calculate the average matrix, and finally the target average matrix of the one or more target transformation matrices is used to calculate the rough calibration result of the lidar.
[0110] Specifically, the algorithm flow is as follows:
[0111] ① Randomly select S transformation matrices from the one or more target transformation matrices.
[0112] ② Use the Geodesic L2-Mean algorithm to find the average matrix of the S transformation matrices. The pseudo code of the algorithm is as follows:
[0113]
[0114] ③ Select the target transformation matrix whose distance from the average value matrix is less than the fifth preset threshold from the one or more target transformation matrices, and record the number of target transformation matrices that meet the conditions. The pseudo code is as follows:
[0115]
[0116] ④ When the number of target transformation matrices whose distance from the average value matrix is less than the fifth preset threshold is greater than the second preset number, based on the Geodesic L2-Mean algorithm, the average value matrix of the target transformation matrices whose distance from the average value matrix is less than the fifth preset threshold is calculated as the target average value matrix of the one or more target transformation matrices; otherwise, repeat the above steps ① to ④.
[0117] Among them, the fifth preset threshold and the second preset number can be set according to actual needs. The fifth preset threshold may be the same as or different from the first preset threshold, the second preset threshold, the third preset threshold or the fourth preset threshold. The second preset number may be the same as or different from the first preset number. The embodiment of the present invention does not limit this.
[0118] Specifically, the target average matrix of the one or more target transformation matrices can be used to calculate the external parameters α, β and z of the three degrees of freedom of the laser radar roll angle, pitch angle and z direction. According to the values of the external parameters α, β and z and the initial external parameter values of the three degrees of freedom of the laser radar heading angle, x direction and y direction, the rough calibration result of the laser radar corresponding to the point cloud data can be determined. At this time, the following can be obtained: Figure 3 The calibration effect is shown.
[0119] The embodiment of the present invention obtains one or more target transformation matrices by performing one or more iterative calculation processes, and then calculates an average value matrix based on the one or more target transformation matrices as the transformation matrix for laser illumination, thereby obtaining a rough calibration result of the laser radar, which can improve the accuracy of the laser radar external parameter calibration.
[0120] S130: Matching the data points in the two point cloud data to obtain a matching point pair set, optimizing the rough calibration results of each laser radar based on the matching point pair set, and obtaining the target calibration results of each laser radar relative to the reference coordinate system.
[0121] In an embodiment of the present invention, based on the KD tree algorithm, the external parameters θ, x and y, and the external parameters α, β and z of each laser radar can be optimized in turn to obtain the target calibration results of each laser radar relative to the reference coordinate system.
[0122] Specifically, Figure 4 As shown, matching the data points in the two point cloud data to obtain a matching point pair set, optimizing the rough calibration results of each laser radar based on the matching point pair set, and obtaining the target calibration results of each laser radar relative to the reference coordinate system may include:
[0123] S131: Construct a first KD tree based on the rough calibration result.
[0124] In an embodiment of the present invention, the first KD tree can be constructed using preset multi-frame point cloud data, wherein the preset multi-frame point cloud data includes the point cloud data collected by the two different laser radars, and the preset multi-frame point cloud data includes the two point cloud data acquired in step S110, wherein the number of frames of point cloud data for constructing the first KD tree can be set according to actual needs, and the embodiment of the present invention does not limit this. Specifically, the rough calibration results of each laser radar can be used to perform coordinate transformation on the data points of the corresponding point cloud data in the multi-frame point cloud data, and the first KD tree can be constructed using the data points after the coordinate transformation. The method for constructing the KD tree is a prior art, and the embodiment of the present invention will not be repeated here.
[0125] S132: Based on the first KD tree, the data points in the two point cloud data are matched to obtain a first matching point pair set, and based on the first matching point pair set, the external parameters θ, x and y in the rough calibration results of each laser radar are optimized to obtain a precise calibration result of each laser radar.
[0126] Specifically, the step S132 may include:
[0127] For each data point in the first point cloud data of the two point cloud data, determine two first matching points corresponding thereto based on the first KD tree to obtain a first sub-matching point pair set, wherein the two first matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point;
[0128] For each data point in the second point cloud data of the two point cloud data, determine two second matching points corresponding thereto based on the first KD tree to obtain a second sub-matching point pair set, wherein the two second matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point;
[0129] Based on the first sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the second point cloud data are optimized to obtain a corresponding fine calibration result;
[0130] Based on the second sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding fine calibration result.
[0131] Specifically, each matching point pair in the first sub-matching point pair set consists of a data point in the first point cloud data and two data points in the second point cloud data, and each matching point pair in the second sub-matching point pair set consists of a data point in the second point cloud data and two data points in the first point cloud data.
[0132] In a possible embodiment, after obtaining the first sub-matching point pair set and the second sub-matching point pair set, it is also possible to determine whether the correct match is achieved by the distance between the points. Specifically, for a certain data point, if the distances from the two data points that match the data point to the data point are both less than a first preset distance threshold, the three points are considered to be correctly matched, otherwise they are considered to be incorrectly matched, and the incorrectly matched data points can be re-matched. The first preset distance threshold can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0133] Specifically, the laser radar corresponding to the first point cloud data may be recorded as the first laser radar, and the laser radar corresponding to the second point cloud data may be recorded as the second laser radar. After obtaining the first sub-matching point pair set and the second sub-matching point pair set, the external parameters θ, x, and y in the rough calibration result of the second laser radar may be optimized based on the first sub-matching point pair set, and the external parameters θ, x, and y in the rough calibration result of the first laser radar may be optimized based on the second sub-matching point pair set.
[0134] Specifically, Figure 5 As shown in the figure, in the process of optimizing the external parameters θ, x and y, the actual surface in the point cloud data can be approximated by a piecewise linear method, and the distance from the data point to the line connecting the two corresponding matching points is used to simulate the distance from the data point to the surface. A least squares optimization objective function with the heading angle, x direction and y direction as optimization parameters can be constructed, and the optimization goal is to minimize the distance from the point to the line.
[0135] Exemplarily, the objective function for optimizing the external parameters θ, x and y in the rough calibration result of the second laser radar is shown in formula (9), and the optimization variables are the rotation angle θ of the heading angle and the translation amounts in the x and y directions.
[0136]
[0137]
[0138] Among them, T A represents the transformation matrix corresponding to the first laser radar, T B Represents the transformation matrix corresponding to the second laser radar, R ij(i=1,2,3,j=1,2,3) is the rotation part in the transformation matrix, and z is the z-direction component of the translation part in the transformation matrix.
[0139] In the embodiment of the present invention, after obtaining the optimized extrinsic parameters θ, x and y of each laser radar, the extrinsic parameters α, β and z in the rough calibration result are added to obtain the precise calibration result of each laser radar.
[0140] For example, by finding matching points to optimize the solution of external parameters θ, x and y, we can obtain Figure 6 The calibration effect is shown.
[0141] In an embodiment of the present invention, the step S131 and the step S132 can be iteratively executed N times to obtain a better optimization effect. Specifically, when the number of iterations is greater than 1 and less than or equal to N, the fine calibration result obtained by the previous optimization is used as a new rough calibration result, and the step S131 and the step S132 are repeatedly executed. When the number of iterations is N, the result obtained by the optimization is used as the final fine calibration result. Among them, the number of iterations N can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0142] In a possible embodiment, the step S132 may only include the process of optimizing the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the second point cloud data, or only include the process of optimizing the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the first point cloud data. In this case, it is only necessary to repeat the steps S131 and S132 multiple times to obtain the precise calibration results of each laser radar. In this process, the calibration results of each laser radar can be optimized successively or alternately.
[0143] In an embodiment of the present invention, before performing step S133, the data points in the two point cloud data can be transformed respectively using the precise calibration results of each laser radar, and the ground data in each transformed point cloud data can be extracted respectively, and the ground plane can be fitted to determine the normal vector of the fitted target ground plane, and the distance between the normal vector and the normal vector of the reference ground plane is less than the second preset threshold as a restriction condition in the process of optimizing the external parameters α, β and z. By limiting the normal vector of the fitted target ground plane to a certain range of the normal vector of the reference ground plane, the efficiency of optimizing the external parameters α, β and z of each laser radar can be improved, that is, the efficiency of calibrating the external parameters of the laser radar can be improved.
[0144] S133: Construct a second KD tree based on the precise calibration result.
[0145] In an embodiment of the present invention, the second KD tree can be constructed using preset multi-frame point cloud data, wherein the preset multi-frame point cloud data includes the point cloud data collected by the two different lidars, and the preset multi-frame point cloud data includes the two point cloud data acquired in step S110, wherein the number of frames of point cloud data for constructing the second KD tree can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0146] Specifically, the precise calibration results of each laser radar can be used to perform coordinate transformation on the data points of the corresponding point cloud data in the multi-frame point cloud data, and the second KD tree can be constructed using the data points after coordinate transformation. The method for constructing the KD tree is a prior art and will not be described in detail in the embodiments of the present invention.
[0147] It should be noted that the multi-frame point cloud data used to construct the first KD tree and the multi-frame point cloud data used to construct the second KD tree may be the same or different, and the embodiment of the present invention does not limit this.
[0148] S134: Based on the second KD tree, the data points in the two point cloud data are matched to obtain a second matching point pair set, and based on the second matching point pair set, the external parameters α, β and z in the precise calibration results of each laser radar are optimized to obtain the target calibration results of each laser radar.
[0149] Specifically, step S134 may include:
[0150] For each data point in the first point cloud data of the two point cloud data, determine two third matching points corresponding thereto based on the second KD tree to obtain a third sub-matching point pair set, wherein the two third matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point;
[0151] For each data point in the second point cloud data of the two point cloud data, determine two fourth matching points corresponding thereto based on the second KD tree to obtain a fourth sub-matching point pair set, wherein the two fourth matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point;
[0152] Optimizing the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the second point cloud data based on the third sub-matching point pair set to obtain a corresponding target calibration result;
[0153] Based on the fourth sub-matching point pair set, the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding target calibration result.
[0154] Specifically, each matching point pair in the third sub-matching point pair set consists of a data point in the first point cloud data and two data points in the second point cloud data, and each matching point pair in the fourth sub-matching point pair set consists of a data point in the second point cloud data and two data points in the first point cloud data.
[0155] In a possible embodiment, after obtaining the third sub-matching point pair set and the fourth sub-matching point pair set, it is also possible to determine whether the correct match is achieved by the distance between the points. Specifically, for a certain data point, if the distances from the two data points that match the data point to the data point are both less than the second preset distance threshold, the three points are considered to be correctly matched, otherwise they are considered to be incorrectly matched, and the incorrectly matched data points can be re-matched. The second preset distance threshold can be set according to actual needs, and the second preset distance threshold can be the same as the first preset distance threshold, or it can be different, and the embodiment of the present invention does not limit this.
[0156] Specifically, the laser radar corresponding to the first point cloud data may be recorded as the first laser radar, and the laser radar corresponding to the second point cloud data may be recorded as the second laser radar. After obtaining the third sub-matching point pair set and the fourth sub-matching point pair set, the external parameters α, β and z in the rough calibration result of the second laser radar may be optimized based on the third sub-matching point pair set, and the external parameters α, β and z in the rough calibration result of the first laser radar may be optimized based on the fourth sub-matching point pair set.
[0157] Similar to the process of optimizing external parameters θ, x and y, in the process of optimizing external parameters α, β and z, the actual surface in the point cloud data can be approximated by a piecewise linear method, and the distance from the data point to the line connecting the two corresponding matching points can be used to simulate the distance from the data point to the surface. A least squares optimization objective function with roll angle, pitch angle and z direction as optimization parameters can be constructed, and the optimization goal is to minimize the distance from the point to the line.
[0158] Exemplarily, the objective function for optimizing the external parameters α, β and z in the precise calibration result of the second laser radar is shown in formula (10), and the optimization variables are the rotation angle α of the roll angle, the rotation angle β of the pitch angle and the translation in the z direction.
[0159]
[0160]
[0161] Among them, T A represents the transformation matrix corresponding to the first laser radar, T B Represents the transformation matrix corresponding to the second laser radar, R ij(i=1,2,3,j=1,2,3) is the rotation part in the transformation matrix, and x′, y′, z′ are the x, y, and z direction components of the translation part in the transformation matrix.
[0162] In the embodiment of the present invention, after obtaining the optimized external parameters α, β and z of each laser radar, the external parameters θ, x and y in the precise calibration result are added to obtain the target calibration result of each laser radar.
[0163] In an embodiment of the present invention, the step S133 and step S134 can be iteratively executed N times to obtain a better optimization effect. Specifically, when the number of iterations is greater than 1 and less than or equal to N, the target calibration result obtained by the previous optimization is used as a new precise calibration result, and the step S133 and step S134 are repeatedly executed. When the number of iterations is N, the result obtained by the optimization is used as the final target calibration result. Among them, the number of iterations N can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0164] In a possible embodiment, the step S134 may only include the process of optimizing the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the second point cloud data, or only include the process of optimizing the external parameters α, β and z in the rough calibration result of the laser radar corresponding to the first point cloud data. In this case, it is only necessary to repeat the steps S133 and S134 multiple times to obtain the target calibration results of each laser radar. In this process, the calibration results of each laser radar can be optimized successively or alternately.
[0165] The embodiment of the present invention uses the KD tree to match the data points in the two point cloud data to obtain a set of matching point pairs, which can shorten the time for data point matching, thereby shortening the time for parameter calibration and further improving the efficiency of lidar parameter calibration.
[0166] In the embodiment of the present invention, after obtaining the target calibration results of each laser radar, the target calibration results can be saved in a radar external parameter configuration file under a default path.
[0167] In a possible embodiment, the method may further include:
[0168] The transformation matrix between the coordinate systems of each laser radar is determined according to the target calibration results of each laser radar. The specific calculation method is a prior art and will not be described in detail in the embodiment of the present invention.
[0169] In a possible embodiment, when it is necessary to calibrate the external parameters of multiple laser radars, they can be calibrated pairwise according to the above-mentioned multi-lidar external parameter calibration method, so that the data of multiple laser radars can be unified into the same coordinate system.
[0170] In summary, according to the multi-lidar external parameter calibration method of the embodiment of the present invention, by respectively extracting the ground data from the point cloud data collected by each laser radar, using the ground data to fit the ground plane, so that the fitted target ground plane coincides with the reference ground plane, to obtain the corresponding rough calibration result, and then pairing based on the point cloud data collected by different laser radars, using the obtained matching point pair set to optimize each external parameter in the rough calibration result, to obtain the final target calibration result. This method can improve the accuracy of laser radar external parameter calibration, and does not require manual measurement of parameters, does not require special calibration objects, and has simple calibration operations, which improves the efficiency of calibration and reduces the calibration cost.
[0171] Reference Manual Attached Figure 7 , which shows the structure of a multi-laser radar external parameter calibration device 700 provided by an embodiment of the present invention. Figure 7 As shown, the device 700 may include:
[0172] An acquisition module 710 is used to acquire two point cloud data, where the two point cloud data are acquired by different laser radars;
[0173] A coarse calibration module 720 is used to extract ground data from each point cloud data, fit a ground plane using the ground data, so that the fitted target ground plane coincides with the reference ground plane, and obtain a coarse calibration result of each laser radar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference;
[0174] The optimization module 730 is used to match the data points in the two point cloud data to obtain a matching point pair set, and optimize the rough calibration results of each laser radar based on the matching point pair set to obtain the target calibration results of each laser radar relative to the reference coordinate system.
[0175] In a possible embodiment, the optimization module 730 may include:
[0176] A first construction unit, configured to construct a first KD tree based on the rough calibration result;
[0177] A first optimization unit is used to match the data points in the two point cloud data based on the first KD tree to obtain a first matching point pair set, and optimize the external parameters θ, x and y in the rough calibration results of each laser radar based on the first matching point pair set to obtain a precise calibration result of each laser radar;
[0178] A second construction unit, configured to construct a second KD tree based on the precise calibration result;
[0179] The second optimization unit is used to match the data points in the two point cloud data based on the second KD tree to obtain a second matching point pair set, and optimize the external parameters α, β and z in the precise calibration results of each laser radar based on the second matching point pair set to obtain the target calibration results of each laser radar.
[0180] In a possible embodiment, the device 700 may further include:
[0181] The transformation matrix determination module is used to determine the transformation matrix between the coordinate systems of each laser radar according to the target calibration results of each laser radar.
[0182] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept, and the specific implementation process is detailed in the corresponding method embodiment, which will not be repeated here.
[0183] An embodiment of the present invention also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the multi-lidar external parameter calibration method provided in the above method embodiment.
[0184] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0185] In a specific embodiment, Figure 8 The hardware structure diagram of an electronic device for implementing the multi-laser radar extrinsic calibration method provided in an embodiment of the present invention is shown. The electronic device may be a computer terminal, a mobile terminal or other device. The electronic device may also participate in or include the multi-laser radar extrinsic calibration device provided in an embodiment of the present invention. Figure 8As shown, the electronic device 800 may include a memory 810 of one or more computer-readable storage media, a processor 820 of one or more processing cores, an input unit 830, a display unit 840, a radio frequency (RF) circuit 850, a wireless fidelity (WiFi) module 860, and a power supply 870. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device 800, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0186] The memory 810 can be used to store software programs and modules, and the processor 820 executes various functional applications and data processing by running or executing the software programs and modules stored in the memory 810, and calling the data stored in the memory 810. The memory 810 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 810 may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 810 may also include a memory controller to provide the processor 820 with access to the memory 810.
[0187] The processor 820 is the control center of the electronic device 800. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 810, and calling data stored in the memory 810, it executes various functions of the electronic device 800 and processes data, thereby monitoring the electronic device 800 as a whole. The processor 820 can be a central processing unit, or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0188] The input unit 830 may be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 830 may include a touch-sensitive surface 831 and other input devices 832. Specifically, the touch-sensitive surface 831 may include but is not limited to a touch pad or a touch screen, and the other input devices 832 may include but are not limited to one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc.
[0189] The display unit 840 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 840 may include a display panel 841, which can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0190] The RF circuit 850 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 820 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 850 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 850 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0191] WiFi is a short-range wireless transmission technology. The electronic device 800 can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 860. It provides users with wireless broadband Internet access. Figure 8 A WiFi module 860 is shown, but it is understandable that it is not an essential component of the electronic device 800 and can be omitted as needed without changing the essence of the invention.
[0192] The electronic device 800 also includes a power supply 870 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 820 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 870 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0193] It should be noted that, although not shown, the electronic device 800 may also include a Bluetooth module, etc., which will not be described in detail here.
[0194] An embodiment of the present invention also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a multi-lidar external parameter calibration method. The at least one instruction or the at least one program is loaded and executed by the processor to implement the multi-lidar external parameter calibration method provided by the above method embodiment.
[0195] Optionally, in an embodiment of the present invention, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0196] An embodiment of the present invention further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the multi-lidar extrinsic parameter calibration method provided in the above various optional implementation examples.
[0197] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0198] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, 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.
[0199] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0200] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for calibrating external parameters of multiple laser radars, characterized in that: include: Acquire two point cloud data, where the two point cloud data are collected by different laser radars; Extracting ground data from each point cloud data respectively, fitting a ground plane using the ground data so that the fitted target ground plane coincides with the reference ground plane, and obtaining a rough calibration result of each laser radar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference; Constructing a first KD tree based on the rough calibration result; Based on the first KD tree, the data points in the two point cloud data are matched to obtain a first matching point pair set, and based on the first matching point pair set, the external parameters θ, x and y in the rough calibration results of each laser radar are optimized to obtain the precise calibration results of each laser radar; wherein the external parameters θ, x and y are the external parameters of the three degrees of freedom of the laser radar heading angle, x direction and y direction; Constructing a second KD tree based on the precise calibration result; Based on the second KD tree, the data points in the two point cloud data are matched to obtain a second matching point pair set, and based on the second matching point pair set, the external parameters α, β and z in the precise calibration results of each laser radar are optimized to obtain the target calibration results of each laser radar; wherein the external parameters α, β and z are the external parameters of the three degrees of freedom of the laser radar roll angle, pitch angle and z direction; The first KD tree is used to match the data points in the two point cloud data to obtain a first matching point pair set, and the external parameters θ, x and y in the rough calibration results of each laser radar are optimized based on the first matching point pair set to obtain the precise calibration results of each laser radar, including: For each data point in the first point cloud data of the two point cloud data, determine two first matching points corresponding thereto based on the first KD tree to obtain a first sub-matching point pair set, wherein the two first matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point; For each data point in the second point cloud data of the two point cloud data, determine two second matching points corresponding thereto based on the first KD tree to obtain a second sub-matching point pair set, wherein the two second matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point; Based on the first sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the second point cloud data are optimized to obtain a corresponding fine calibration result; Based on the second sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain a corresponding fine calibration result; The second matching point pair set is obtained by matching the data points in the two point cloud data based on the second KD tree, and the external parameters α, β and z in the precise calibration results of each laser radar are optimized based on the second matching point pair set to obtain the target calibration results of each laser radar, including: For each data point in the first point cloud data of the two point cloud data, determine two third matching points corresponding thereto based on the second KD tree to obtain a third sub-matching point pair set, wherein the two third matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point; For each data point in the second point cloud data of the two point cloud data, determine two fourth matching points corresponding thereto based on the second KD tree to obtain a fourth sub-matching point pair set, wherein the two fourth matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point; Optimizing the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the second point cloud data based on the third sub-matching point pair set to obtain a corresponding target calibration result; Based on the fourth sub-matching point pair set, the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding target calibration result.
2. The method according to claim 1, characterized in that The extracting of ground data from each point cloud data comprises: For each point cloud data, determine a first target ground point set from the point cloud data, perform an iterative extraction process to obtain a second target ground point set, and use the second target ground point set as ground data corresponding to the point cloud data; Wherein, the iterative extraction process includes: Step 11, performing principal component analysis on the first target ground point set to determine the target ground; Step 12, selecting a ground point set whose distance to the target ground is less than a first preset threshold from the first target ground point set as a second target ground point set; Step 13, determine whether the current number of iterations is greater than or equal to the preset number; if not, use the second target ground point set as the new first target ground point set and return to step 11; if so, output the second target ground point set.
3. The method according to claim 1, characterized in that The step of fitting a ground plane using the ground data so that the fitted target ground plane coincides with the reference ground plane, and obtaining a rough calibration result of each laser radar relative to the reference coordinate system includes: For each point cloud data, respectively, an iterative calculation process is performed using the ground data corresponding to the point cloud data to obtain one or more target transformation matrices, and a rough calibration result of the laser radar corresponding to the point cloud data is calculated according to the one or more target transformation matrices; The iterative calculation process includes: Step 21, using the RANSAC algorithm to fit the ground data to obtain the target ground plane; Step 22, calculating a target transformation matrix using the normal vector of the target ground plane and the normal vector of the reference ground plane; Step 23, determine the distance between the normal vector of the target ground plane and the normal vector of the reference ground plane, and determine whether the distance is less than a second preset threshold; if not, use the target transformation matrix to transform each ground point in the ground data to obtain new ground data, and return to step 21; if so, output one or more target transformation matrices obtained during the iterative calculation process.
4. The method according to claim 1, characterized in that: The method further comprises: The transformation matrix between the coordinate systems of each laser radar is determined according to the target calibration results of each laser radar.
5. A multi-laser radar external parameter calibration device, characterized in that: include: An acquisition module, used for acquiring two point cloud data, wherein the two point cloud data are acquired by different laser radars; A coarse calibration module is used to extract ground data from each point cloud data, fit a ground plane using the ground data, so that the fitted target ground plane coincides with the reference ground plane, and obtain a coarse calibration result of each laser radar relative to a reference coordinate system, wherein the reference coordinate system is a coordinate system with the reference ground plane as a horizontal reference; An optimization module, configured to construct a first KD tree based on the rough calibration result; Based on the first KD tree, the data points in the two point cloud data are matched to obtain a first matching point pair set, and based on the first matching point pair set, the external parameters θ, x and y in the rough calibration results of each laser radar are optimized to obtain the precise calibration results of each laser radar; wherein the external parameters θ, x and y are the external parameters of the three degrees of freedom of the laser radar heading angle, x direction and y direction; based on the precise calibration results, a second KD tree is constructed; based on the second KD tree, the data points in the two point cloud data are matched to obtain a second matching point pair set, and based on the second matching point pair set, the external parameters α, β and z in the precise calibration results of each laser radar are optimized to obtain the target calibration results of each laser radar; wherein the external parameters α, β and z are the external parameters of the three degrees of freedom of the laser radar roll angle, pitch angle and z direction; The first KD tree is used to match the data points in the two point cloud data to obtain a first matching point pair set, and the external parameters θ, x and y in the rough calibration results of each laser radar are optimized based on the first matching point pair set to obtain the precise calibration results of each laser radar, including: For each data point in the first point cloud data of the two point cloud data, determine two first matching points corresponding thereto based on the first KD tree to obtain a first sub-matching point pair set, wherein the two first matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point; For each data point in the second point cloud data of the two point cloud data, determine two second matching points corresponding thereto based on the first KD tree to obtain a second sub-matching point pair set, wherein the two second matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point; Based on the first sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the second point cloud data are optimized to obtain a corresponding fine calibration result; Based on the second sub-matching point pair set, the external parameters θ, x and y in the rough calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain a corresponding fine calibration result; The second matching point pair set is obtained by matching the data points in the two point cloud data based on the second KD tree, and the external parameters α, β and z in the precise calibration results of each laser radar are optimized based on the second matching point pair set to obtain the target calibration results of each laser radar, including: For each data point in the first point cloud data of the two point cloud data, determine two third matching points corresponding thereto based on the second KD tree to obtain a third sub-matching point pair set, wherein the two third matching points are two data points in the second point cloud data of the two point cloud data that are closest to the data point; For each data point in the second point cloud data of the two point cloud data, determine two fourth matching points corresponding thereto based on the second KD tree to obtain a fourth sub-matching point pair set, wherein the two fourth matching points are two data points in the first point cloud data of the two point cloud data that are closest to the data point; Optimizing the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the second point cloud data based on the third sub-matching point pair set to obtain a corresponding target calibration result; Based on the fourth sub-matching point pair set, the external parameters α, β and z in the precise calibration result of the laser radar corresponding to the first point cloud data are optimized to obtain the corresponding target calibration result.
6. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the multi-lidar external parameter calibration method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the multi-lidar external parameter calibration method as described in any one of claims 1-4.
Citation Information
Patent Citations
External parameter calibration method, device and apparatus for laser radar and binocular camera
CN109920011A
Fusion calibration method of three-dimensional laser radar and binocular visible light sensor
CN110349221A