A Lidar calibration method and device for autonomous driving vehicles
By processing the image and point cloud data of the autonomous vehicle's camera and Lidar, and calculating internal and external parameters, the problem of sensor calibration is solved, accurate processing of sensor data is achieved and driving safety is improved.
Patent Information
- Application Number
- CN202010894839.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-08-31
AI Technical Summary
In autonomous vehicles, how to conveniently and accurately calibrate the internal parameters of sensors and the external parameters between sensors is a challenging problem, especially in multi-sensor solutions, especially the calibration of multi-camera and lidar, which affects the safety of the vehicle. travel.
Provide a Lidar calibration method, by acquiring camera images and Lidar point cloud data, calculating the internal and external parameters of the camera, detecting and matching feature points, determining key frames, performing depth estimation, constructing a nonlinear least squares optimization function, and optimizing Get the external parameters of multi-camera module to Lidar.
It achieves accurate processing of autonomous vehicle sensor data, improves driving safety, reduces calibration costs and time, avoids manual participation and external object assistance, and improves the accuracy and convenience of calibration.
Smart Images

Figure CN114119763B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a Lidar calibration method and device for an autonomous driving vehicle. Background Art
[0002] In the multi-sensor solution of autonomous driving, how to conveniently and accurately calibrate the intrinsic parameters of the sensors and the extrinsic parameters between sensors has always been a challenging problem.
[0003] For example, when an autonomous driving vehicle is equipped with multiple cameras and Lidar (Light Detection And Ranging), it is necessary to calibrate the multi-camera module composed of multiple cameras to the external parameters of the Lidar, so that the data collected by each sensor can be accurately processed to ensure the safe driving of the vehicle. Therefore, a Lidar calibration method is urgently needed. Summary of the invention
[0004] The present invention provides a lidar calibration method and device for an autonomous driving vehicle, so as to perform lidar calibration on the autonomous driving vehicle. The specific technical solution is as follows.
[0005] In a first aspect, an embodiment of the present invention provides a Lidar calibration method for an autonomous driving vehicle, wherein the autonomous driving vehicle is equipped with multiple cameras, and the method includes:
[0006] Obtain camera images captured by each of the cameras and the capture time corresponding to each of the camera images; calculate the intrinsic parameters of each of the cameras and the extrinsic parameters of each of the other cameras relative to the main camera according to each of the camera images; the main camera is any one of the cameras;
[0007] Detecting and matching feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera to obtain the target pose of each camera image;
[0008] For the target camera images captured by each camera, the distance and angle interval between each target camera image and the previous frame target camera image are determined according to the capture time and target posture of each target camera image, and when the distance between any target camera image and the previous frame target camera image is greater than a preset distance threshold, and the angle interval is greater than a preset angle threshold, the camera images captured by each camera at the target camera image capture time are determined as key frames;
[0009] For each key frame, determine the gradient points in the key frame whose gradient values are greater than the preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target pose of the key frame to obtain the local 3D point information corresponding to the key frame; and according to the acquisition time of each key frame and the local 3D point information corresponding to each key frame, obtain the 3D point set corresponding to each acquisition time by statistics;
[0010] Acquire Lidar point cloud data, identify key Lidar point cloud data corresponding to the timestamp and the acquisition time of each key frame in the Lidar point cloud data; and project the key Lidar point cloud data into a two-dimensional space according to the Lidar measurement model, and perform bilinear interpolation to obtain each Lidar depth map;
[0011] According to the three-dimensional point sets corresponding to the respective acquisition moments and the respective Lidar depth maps, a nonlinear least squares optimization function of the external parameters of the multi-camera module composed of the multiple cameras to the Lidar is constructed, and the optimization function is optimized to obtain the external parameters of the multi-camera module to the Lidar.
[0012] Optionally, the step of constructing a nonlinear least squares optimization function of external parameters from a multi-camera module composed of the multiple cameras to Lidar according to the three-dimensional point sets corresponding to the respective acquisition moments and the Lidar depth maps, and optimizing the optimization function to obtain external parameters from the multi-camera module to Lidar includes:
[0013] The external parameters of the multi-camera module to Lidar are calculated according to the following formula To optimize:
[0014]
[0015] π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u,v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖p c ‖ represents a three-dimensional point p c The modulus of (x,y,z).
[0016] Optionally, the step of calculating the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera according to the camera images includes:
[0017] Synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition time of any two camera images in each image set is less than a preset time threshold;
[0018] For each of the camera images, extract key points in the camera image, and determine a global descriptor of the camera image based on the extracted key points;
[0019] Obtain a pre-constructed feature map, wherein the feature map includes multiple frames of images, each of which includes key points and corresponding descriptors; for each camera image, retrieve an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image in the feature map as a matching image corresponding to the camera image;
[0020] Matching the key points in each of the camera images and the corresponding matching images, and for each camera image, randomly sampling a preset number of pairs of key points in the camera image and the corresponding matching image, and calculating the pose of the camera image relative to the feature map based on the sampled key points;
[0021] Determine a main camera among the cameras, and for each other camera, calculate the number of inliers corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and determine the pose with the highest number of inliers as the initial pose of the target camera image corresponding to the camera;
[0022] Calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image captured by the main camera in each image set; and for each of the other cameras, calculate the initial extrinsic parameters of the camera relative to the main camera according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image;
[0023] According to the coordinate systems of the main cameras and the initial external parameters of the other cameras relative to the main camera, the preset optimization function is optimized to obtain the internal parameters of the cameras and the external parameters of the other cameras relative to the main camera.
[0024] Optionally, the step of calculating the main camera coordinate system corresponding to each image set according to the pose of the camera image captured by the main camera in each image set; and for each of the other cameras, calculating the initial extrinsic parameters of the camera relative to the main camera according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image includes:
[0025] For each image set, determining a main camera coordinate system corresponding to the image set as the position and posture of the camera image captured by the main camera in the image set;
[0026] For each other camera, the initial external parameter of the camera relative to the main camera is determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
[0027] Optionally, the step of optimizing a preset optimization function according to the coordinate system of each of the main cameras and the initial external parameters of each of the other cameras relative to the main camera to obtain the internal parameters of each of the cameras and the external parameters of each of the other cameras relative to the main camera includes:
[0028] The internal parameters of each camera are optimized according to the following formula:
[0029]
[0030] represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determine the camera's projection model;
[0031] For each of the other cameras, the external parameters of the camera relative to the main camera are optimized according to the following formula:
[0032]
[0033] represents the coordinate system of the main camera h at time j, Represents the external parameters of camera i relative to the main camera h.
[0034] In a second aspect, an embodiment of the present invention provides a Lidar calibration device for an autonomous driving vehicle, wherein the autonomous driving vehicle is equipped with multiple cameras, and the device includes:
[0035] A camera calibration module, used to obtain camera images collected by each of the cameras and the collection time corresponding to each of the camera images; calculate the intrinsic parameters of each of the cameras and the extrinsic parameters of each other camera relative to the main camera according to each of the camera images; the main camera is any camera among the cameras;
[0036] A target pose determination module, used to detect and match feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera, so as to obtain the target pose of each camera image;
[0037] A key frame determination module is used to determine the distance and angle interval between each target camera image and the previous target camera image according to the acquisition time and target posture of each target camera image acquired by each camera, and when the distance between any target camera image and the previous target camera image is greater than a preset distance threshold and the angle interval is greater than a preset angle threshold, the camera images acquired by each camera at the target camera image acquisition time are determined as key frames;
[0038] The depth estimation module is used to determine, for each key frame, the gradient points in the key frame whose gradient values are greater than a preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target posture of the key frame to obtain the local 3D point information corresponding to the key frame; and according to the acquisition time of each key frame and the local 3D point information corresponding to each key frame, obtain the 3D point set corresponding to each acquisition time by statistics;
[0039] A data projection module is used to obtain Lidar point cloud data, identify key Lidar point cloud data corresponding to the timestamp and the acquisition time of each key frame in the Lidar point cloud data; and according to the Lidar measurement model, project the key Lidar point cloud data into a two-dimensional space, and perform bilinear interpolation to obtain each Lidar depth map;
[0040] The extrinsic parameter calibration module is used to construct a nonlinear least squares optimization function of the extrinsic parameters of the multi-camera module composed of the multiple cameras to the Lidar according to the three-dimensional point set corresponding to each acquisition time and the Lidar depth map, and optimize the optimization function to obtain the extrinsic parameters of the multi-camera module to the Lidar.
[0041] Optionally, the external parameter calibration module is specifically used to:
[0042] The external parameters of the multi-camera module to Lidar are calculated according to the following formula To optimize:
[0043]
[0044] π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u,v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖pc ‖ represents a three-dimensional point p c The modulus of (x,y,z).
[0045] Optionally, the camera calibration module includes:
[0046] An image synchronization submodule, used to synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition time of any two camera images in each image set is less than a preset time threshold;
[0047] A descriptor determination submodule, used for extracting key points in each camera image, and determining a global descriptor of the camera image according to the extracted key points;
[0048] The image matching submodule is used to obtain a pre-constructed feature map, wherein the feature map includes multiple frames of images, each of which includes key points and corresponding descriptors; for each camera image, an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image is retrieved from the feature map as a matching image corresponding to the camera image;
[0049] A posture calculation submodule is used to match the key points in each of the camera images and the corresponding matching images, and for each camera image, randomly sample a preset number of pairs of key points in the camera image and the corresponding matching image, and calculate the posture of the camera image relative to the feature map based on the sampled key points;
[0050] an initial pose determination submodule, for determining a main camera among the cameras, and for each other camera, calculating the number of inliers corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and determining the pose with the highest number of inliers as the initial pose of the target camera image corresponding to the camera;
[0051] The initial extrinsic parameter calculation submodule is used to calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image collected by the main camera in each image set; and for each of the other cameras, according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image, calculate the initial extrinsic parameter of the camera relative to the main camera;
[0052] The camera calibration submodule is used to optimize the preset optimization function according to the coordinate system of each main camera and the initial external parameters of each other camera relative to the main camera, so as to obtain the intrinsic parameters of each camera and the external parameters of each other camera relative to the main camera.
[0053] Optionally, the initial external parameter calculation submodule is specifically used to:
[0054] For each image set, determining a main camera coordinate system corresponding to the image set as the position and posture of the camera image captured by the main camera in the image set;
[0055] For each other camera, the initial external parameter of the camera relative to the main camera is determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
[0056] Optionally, the camera calibration submodule is specifically used for:
[0057] The internal parameters of each camera are optimized according to the following formula:
[0058]
[0059] represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determine the camera's projection model;
[0060] For each of the other cameras, the external parameters of the camera relative to the main camera are optimized according to the following formula:
[0061]
[0062] represents the coordinate system of the main camera h at time j, Represents the external parameters of camera i relative to the main camera h.
[0063] From the above content, it can be known that the Lidar calibration method and device for autonomous driving vehicles provided by the embodiment of the present invention can calibrate the multi-camera module, obtain the intrinsic parameters of each camera and the external parameters of each other camera relative to the main camera, and then perform three-dimensional reconstruction on the images of each camera based on the calibrated camera intrinsic parameters and external parameters to obtain each three-dimensional point set, and the Lidar point cloud data can be projected into a two-dimensional space to obtain a Lidar depth map, so that a nonlinear least squares optimization function of the external parameters of the multi-camera module composed of multiple cameras to the Lidar can be constructed according to the three-dimensional point set and the Lidar depth map, and the function is optimized to obtain the external parameters of the multi-camera module to the Lidar, so that during the driving process of the autonomous driving vehicle, the data collected by each sensor can be accurately processed, thereby ensuring the safety of the driving of the autonomous driving vehicle. Of course, implementing any product or method of the present invention does not necessarily require all of the advantages described above to be achieved at the same time.
[0064] The innovative features of the embodiments of the present invention include:
[0065] 1. It is able to calibrate multiple camera modules, obtain the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera, and then perform three-dimensional reconstruction of each camera image based on the calibrated camera intrinsic parameters and extrinsic parameters to obtain each three-dimensional point set. In addition, the Lidar point cloud data can be projected into a two-dimensional space to obtain a Lidar depth map. Therefore, a nonlinear least squares optimization function of the extrinsic parameters of the multi-camera module composed of multiple cameras to the Lidar can be constructed based on the three-dimensional point set and the Lidar depth map. The function is optimized to obtain the extrinsic parameters of the multi-camera module to the Lidar. Therefore, during the driving process of the autonomous driving vehicle, the data collected by each sensor can be accurately processed, thereby ensuring the safety of the autonomous driving vehicle.
[0066] 2. The pose of the camera image collected by each camera can be determined based on the pre-constructed feature map. Since the feature map is fixed, the pose of each camera image can reflect the positional relationship between the cameras. Therefore, the internal parameters of each camera and the external parameters of each camera relative to the main camera can be calculated based on the pose of each camera image. The entire calibration method does not require human participation or the assistance of any external objects. The results are objective and accurate, thereby improving the accuracy of camera calibration. Moreover, when calibrating the camera based on the feature map, it is only necessary to pre-construct the feature map, and there is no need to build a fixed site such as a calibration site, thereby reducing capital investment and saving the cost of camera calibration. In addition, compared with building a calibration site for camera calibration, the solution of the embodiment of the present invention can perform camera calibration when the autonomous driving vehicle travels to any area, thereby improving the convenience of camera calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work.
[0068] Figure 1 A schematic diagram of a flow chart of a Lidar calibration method for an autonomous driving vehicle provided in an embodiment of the present invention;
[0069] Figure 2 Another schematic diagram of a flow chart of a Lidar calibration method for an autonomous driving vehicle provided in an embodiment of the present invention;
[0070] Figure 3 A schematic diagram of the structure of a Lidar calibration device for an autonomous driving vehicle provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.
[0072] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present invention and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0073] The embodiment of the present invention discloses a lidar calibration method and device for an autonomous driving vehicle, which can perform lidar calibration on the autonomous driving vehicle. The embodiment of the present invention is described in detail below.
[0074] Figure 1 A flow chart of a Lidar calibration method for an autonomous driving vehicle provided in an embodiment of the present invention is provided. The method is applied to an autonomous driving vehicle, the autonomous driving vehicle is equipped with multiple cameras, and the method specifically includes the following steps.
[0075] S110: Obtain camera images captured by each camera and the capture time corresponding to each camera image; calculate the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera according to each camera image; the main camera is any camera among the cameras.
[0076] In the embodiment of the present invention, when performing Lidar calibration, the data input is the camera images collected by each camera and the Lidar point cloud data collected by the Lidar, and the data output is the external parameters from the multi-camera module to the Lidar. Among them, each camera image is marked with a corresponding timestamp, that is, the acquisition time of each camera image, and the Lidar point cloud data is also marked with a corresponding timestamp.
[0077] After acquiring the images of each camera, any one of the cameras can be determined to be the main camera. In addition, the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera can be calculated based on the images of each camera. For example, any known method can be used to calculate the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera based on the images of each camera, which is not limited in the embodiment of the present invention.
[0078] S120: Detect and match feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera to obtain the target pose of each camera image.
[0079] In one implementation, the intrinsic parameters of each camera, the extrinsic parameters of each other camera relative to the main camera, and the images of each camera can be input into a multi-camera visual odometer system, which calculates the target pose of each frame of the camera image by detecting and matching visual feature points.
[0080] S130: For the target camera images captured by each camera, determine the distance and angle interval between each target camera image and the target camera image of the previous frame according to the capture time and target posture of each target camera image, and when the distance between any target camera image and the target camera image of the previous frame is greater than a preset distance threshold and the angle interval is greater than a preset angle threshold, determine the camera images captured by each camera at the target camera image capture time as key frames.
[0081] In one implementation, after calculating the target pose of each camera image frame, the multi-camera visual odometer system can select frames with sufficiently large distance and angle intervals in all camera images as key frames. The above-mentioned preset distance threshold and preset angle threshold can be determined according to actual conditions, and the embodiment of the present invention does not limit this.
[0082] For camera images captured by different cameras at the same time, when any camera image is determined to be a key frame, the camera images captured by all cameras at that time can be determined as key frames.
[0083] S140: For each key frame, determine the gradient points in the key frame whose gradient values are greater than a preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target posture of the key frame to obtain the local three-dimensional point information corresponding to the key frame, and based on the acquisition time of each key frame and the local three-dimensional point information corresponding to each key frame, obtain the three-dimensional point set corresponding to each acquisition time.
[0084] In one implementation, the target pose and camera image of the key frame can be input into a visual real-time dense reconstruction system, which selects points with gradients in the image for depth estimation and outputs visual 3D point information for each frame, which can be called local 3D point information.
[0085] It can be understood that there are key frames with the same acquisition time. Therefore, in the embodiment of the present invention, after obtaining the local 3D point information of each key frame, the local 3D point information of each key frame can be counted to obtain the 3D point set corresponding to each acquisition time. For example, the 3D point set at the i-th time can be called {V i}.
[0086] S150: Obtain lidar point cloud data, and identify key lidar point cloud data whose timestamps correspond to the acquisition time of each key frame in the lidar point cloud data, and project the key lidar point cloud data into a two-dimensional space according to the lidar measurement model, and perform bilinear interpolation to obtain each lidar depth map.
[0087] In one implementation, the key Lidar point cloud data corresponding to the above key frames in time can be found through the timestamp information, and the Lidar measurement model π l (·):R 3 →R 2 It is known that this mapping can project the point cloud data in the three-dimensional space into the two-dimensional space, and then through bilinear interpolation, finally obtain the Lidar depth map. The Lidar depth map at the i-th moment can be called {I i}.
[0088] S160: constructing a nonlinear least squares optimization function of external parameters from a multi-camera module composed of multiple cameras to Lidar according to the three-dimensional point set corresponding to each acquisition time and each Lidar depth map, and optimizing the optimization function to obtain external parameters from the multi-camera module to Lidar.
[0089] After completing the above preprocessing of the camera image and Lidar data, the visual and Lidar data corresponding to each frame are determined: {V i} and {I i}, and the parameters to be calibrated are the external parameters from the multi-camera module to the Lidar By {V i} and {I i} Perform association based on distance information and build a The nonlinear least squares problem can be optimized to obtain the external parameters of the multi-camera module to Lidar
[0090] In one implementation, the external parameters of the multi-camera module to the Lidar can be calculated according to the following formula: To optimize:
[0091]
[0092] π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u,v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖p c ‖ represents a three-dimensional point p c The modulus of (x,y,z).
[0093] From the above content, it can be seen that the Lidar calibration method for autonomous driving vehicles provided in an embodiment of the present invention can calibrate a multi-camera module, obtain the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera, and then perform three-dimensional reconstruction of each camera image based on the calibrated camera intrinsic parameters and extrinsic parameters to obtain each three-dimensional point set, and the Lidar point cloud data can be projected into a two-dimensional space to obtain a Lidar depth map, so that a nonlinear least squares optimization function of the extrinsic parameters from a multi-camera module composed of multiple cameras to the Lidar can be constructed according to the three-dimensional point set and the Lidar depth map, and the function is optimized to obtain the extrinsic parameters from the multi-camera module to the Lidar, so that during the driving process of the autonomous driving vehicle, the data collected by each sensor can be accurately processed, thereby ensuring the safety of the driving of the autonomous driving vehicle.
[0094] In one implementation of the present invention, Figure 2 As shown, the process of calibrating a multi-camera module may include the following steps:
[0095] S210: Synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition times of any two camera images in each image set is less than a preset time threshold.
[0096] In the embodiment of the present invention, each camera can be synchronized in advance, and each camera can be set to have the same image acquisition cycle to ensure that each camera acquires images at the same time. However, in practical applications, due to differences in the clock crystals of each camera, the time when each camera acquires the camera image is not exactly the same. In addition, when calibrating the camera, only by comparing the camera images acquired by each camera at the same time can the positional relationship between the cameras be determined, and then the internal parameters of each camera and the external parameters between the cameras can be calibrated to obtain.
[0097] Therefore, after acquiring each camera image, each camera image can be synchronized to obtain each image set. In other words, the camera images acquired at the same time can be determined to accurately perform camera calibration.
[0098] For example, when cameras A, B, C, D, and E are installed in an autonomous driving vehicle, and camera images 1, 2, 3, 4, 5, and 6 are acquired by camera A; camera images 7, 8, 9, 10, 11, and 12 are acquired by camera B; camera images 13, 14, 15, 16, 17, and 18 are acquired by camera C; camera images 19, 20, 21, 22, 23, and 24 are acquired by camera D; and camera images 25, 26, 27, 28, 29, and 30 are acquired by camera E, after synchronizing the camera images, the following image sets can be obtained respectively:
[0099] 1. {1, 7, 13, 19, 25}
[0100] II. {2, 8, 14, 20, 26}
[0101] III. {3, 9, 15, 21, 27}
[0102] IV. {4, 10, 16, 22, 28}
[0103] 5. {5, 11, 17, 23, 29}
[0104] VI. {6, 12, 18, 24, 30}.
[0105] S220: For each camera image, extract key points in the camera image, and determine a global descriptor of the camera image according to the extracted key points.
[0106] For example, a SIFT (Scale-invariant feature transform) algorithm may be used to extract key points in each camera image, and a bag-of-words algorithm may be used to determine a global descriptor BoW of each camera image based on the extracted key points.
[0107] S230: Obtain a pre-constructed feature map, where the feature map includes multiple frames of images, each image including key points and corresponding descriptors; for each camera image, retrieve an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image in the feature map as a matching image corresponding to the camera image.
[0108] In the embodiment of the present invention, in order to improve the accuracy of camera calibration, a feature map can be pre-constructed to calibrate the camera according to the feature map. The feature map can be a high-precision map to ensure the accuracy of camera calibration.
[0109] In other words, the feature map can be used as a reference to calibrate the camera, avoiding the need for manual operation to affect the accuracy of camera calibration when using external objects such as calibration plates. Among them, the key points of the feature map can be selected from image feature points with scale invariance, such as SIFT. Any key point of each frame image in the feature map corresponds to a local descriptor, and the local descriptors of each key point constitute the global descriptor of the image.
[0110] S240: Match the key points in each camera image and the corresponding matching image, and for each camera image, randomly sample a preset number of pairs of key points in the camera image and the corresponding matching image, and calculate the pose of the camera image relative to the feature map based on the sampled key points.
[0111] The key points in each camera image and the corresponding matching image are matched, that is, for the key points in each camera image, the three-dimensional points corresponding to the key points are searched in the matching image, and an association relationship is established between the matched key points.
[0112] After key point matching, the pose of each camera image relative to the feature map can be calculated based on the camera image and the matching image. For example, when the pose of each camera image relative to the feature map in the embodiment of the present invention is a 4*4 matrix, at least 5 pairs of key points can be randomly sampled in the camera image and the corresponding matching image for each camera image, and the equation of the pose of the camera image relative to the feature map constructed can be solved based on the coordinates of the key points obtained by sampling to obtain the pose of the camera image relative to the feature map.
[0113] S250: Determine the main camera among the cameras, and for each other camera, calculate the number of inner points corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of the key points in each camera image collected by the camera and the corresponding matching image, and determine the pose with the highest number of inner points as the initial pose of the target camera image corresponding to the camera.
[0114] In the embodiment of the present invention, for each camera image captured by each camera, the position and posture of the camera image relative to the feature map can be calculated. However, the accuracy of the position and posture of each camera image relative to the feature map in different image sets is not completely the same.
[0115] In one implementation, any camera may be determined as the main camera. After the main camera is determined, the number of inliers corresponding to each pose may be calculated for each other camera according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and the pose with the highest number of inliers may be determined as the initial pose of the target camera image corresponding to the camera.
[0116] Specifically, for the pose of any camera image of any other camera relative to the feature map, the reprojection error corresponding to each key point can be calculated based on the pose and the coordinates of the key points in each camera image and the corresponding matching image collected by the camera, and the key points with errors within a preset range are considered to be inliers. The number of inliers corresponding to the pose of each camera image is counted, and the camera image with the largest number of inliers is the target camera image, and the pose of the camera image is the initial pose of the camera.
[0117] S260: Calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image captured by the main camera in each image set; and for each other camera, calculate the initial external parameters of the camera relative to the main camera according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image.
[0118] In one implementation, for each image set, the main camera coordinate system corresponding to the image set can be determined as the pose of the camera image captured by the main camera in the image set. For each other camera, the initial external parameter of the camera relative to the main camera can be determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
[0119] For example, at any moment, the pose of the camera image captured by the i-th camera obtained by the locator is The 0th camera is the main camera, and the coordinate system of the main camera is: The initial external parameter between the i-th camera and the main camera is
[0120] S270: Optimizing a preset optimization function according to the coordinate systems of each main camera and the initial external parameters of each other camera relative to the main camera to obtain the internal parameters of each camera and the external parameters of each other camera relative to the main camera.
[0121] In one implementation, the intrinsic parameters of each camera may be optimized according to the following formula (1):
[0122]
[0123] represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determines the projection model of the camera.
[0124] For each other camera, the external parameters of the camera relative to the main camera can be optimized according to the following formula (2):
[0125]
[0126] represents the coordinate system of the main camera h at time j, that is, the coordinate transformation from the world system to the main camera h. Represents the external parameters of camera i relative to the main camera h.
[0127] When optimizing using formula (1), what is optimized are the intrinsic parameters of all cameras and the position and posture of any camera i at time j. When optimizing by formula (2), what is optimized is the external parameters of each camera relative to the main camera and the position and posture of the main camera at time j.
[0128] In practical applications, the intrinsic parameters of each camera and the external parameters of each camera relative to the main camera can be continuously optimized during the driving process of the autonomous driving vehicle. Specifically, during the driving process of the autonomous driving vehicle, each camera continuously acquires camera images, and the intrinsic parameters of each camera and the external parameters of each camera relative to the main camera are continuously optimized based on the camera images acquired by each camera. When the number of logarithms of the simultaneously restored poses of each camera and the main camera reaches a threshold, data acquisition ends, and optimization is performed based on the acquired data.
[0129] Specifically, when optimizing the camera intrinsic parameters and the external parameters of each camera relative to the main camera, for any camera, the initial value of the external parameters of the camera relative to the main camera can be calculated through the pose of the camera and the pose of the main camera at the same time. The pose of the camera can be obtained by multiplying the pose of the main camera by the external parameters of the camera. Therefore, the above two formulas can be converted to each other. In other words, the optimization result of formula (1) can be passed to formula (2) for optimization. After optimization by formula (2), the optimization result can be passed to formula (1) for optimization again. This iterative cycle is repeated until the energy function does not decrease or the number of iterations exceeds the threshold. The optimization ends and the current optimization result is used as the final result.
[0130] As can be seen from the above content, this embodiment can determine the pose of the camera image collected by each camera based on the pre-constructed feature map. Since the feature map is fixed, the pose of each camera image can reflect the positional relationship between each camera. Therefore, the internal parameters of each camera and the external parameters of each camera relative to the main camera can be calculated based on the pose of each camera image. The entire calibration method does not require human participation or the assistance of any external objects. The results are objective and accurate, thereby improving the accuracy of camera calibration. Moreover, when calibrating the camera based on the feature map, it is only necessary to pre-construct the feature map, and there is no need to build a fixed site such as a calibration site, thereby reducing capital investment and saving the cost of camera calibration. In addition, compared with building a calibration site for camera calibration, the solution of the embodiment of the present invention can perform camera calibration when the autonomous driving vehicle travels to any area, thereby improving the convenience of camera calibration.
[0131] As another implementation of the embodiment of the present invention, the process of calibrating a multi-camera module may include the following steps:
[0132] S1: Synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition times of any two camera images in each image set is less than a preset time threshold.
[0133] S2: Extract feature points from each camera image, and perform feature matching on every two camera images based on the extracted feature points to obtain image matching pairs.
[0134] For example, the SIFT (Scale-invariant feature transform) algorithm can be used to extract feature points in each camera image. When performing feature matching on each pair of camera images, the epipolar geometry can be calculated for each image matching pair, the fundamental matrix or essential matrix can be estimated, and the matching pair can be optimized and improved through the Random Sample Consensus (RANSAC) algorithm.
[0135] S3: Reconstruct the scene according to each image matching pair to obtain the position and posture of each camera image and the 3D point coordinates of the world system corresponding to the feature points included in each camera image.
[0136] For example, you can first initialize and select two frames of camera images for the first bundle adjustment (Bundle Adjustment, BA), then cyclically add new camera images for new BA optimization, and finally until all camera images are added to the BA optimization, at this time you will get the poses of all camera images and the visual point cloud map of the scene, that is, the 3D point coordinates of the world system corresponding to the feature points included in each camera image.
[0137] S4: Determine the main camera among the cameras, and calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image collected by the main camera in each image set; for each other camera, calculate the restored pose of the camera in each main camera coordinate system according to the pose of the camera image collected by the camera in each image set and the main camera coordinate system corresponding to each image set, and calculate the initial extrinsic parameters of the camera relative to the main camera according to each restored pose.
[0138] In one implementation, any camera may be determined as the main camera. After the main camera is determined, for each image set, the main camera coordinate system corresponding to the image set may be determined as the pose of the camera image captured by the main camera in the image set; for each other camera, the restored pose of the camera in any main camera coordinate system may be determined as the product of the pose of the camera image captured by the camera in the image set corresponding to the main camera coordinate system and the inverse of the main camera coordinate system.
[0139] For example, when the camera image captured by the i-th camera in any image set is obtained through the locator, the pose is The 0th camera is the main camera, and the coordinate system of the main camera is: The restored pose of the i-th camera in the main camera coordinate system
[0140] After determining the main camera coordinate system corresponding to each image set and the restored pose of each other camera in the main camera coordinate system, the initial external parameter of each other camera relative to the main camera can be determined as the average value of the restored pose of the camera in each main camera coordinate system. Calculating the external parameter estimation of each other camera relative to the main camera through multiple image sets can improve the accuracy of the calculation results.
[0141] S5: Optimize the preset optimization function according to the coordinate system of the main camera, the initial external parameters of each other camera relative to the main camera, and the 3D point coordinates of each feature point in the world system to obtain the intrinsic parameters of each camera and the external parameters of each other camera relative to the main camera.
[0142] In one implementation, the intrinsic parameters of each camera and the extrinsic parameters of each camera relative to the main camera may be optimized according to the following formula:
[0143]
[0144] represents the coordinate system of the main camera h at time j, represents the external parameter of camera i relative to the main camera h, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determines the projection model of the camera.
[0145] When optimizing using the above formula, what is optimized are the intrinsic parameters of all cameras, the extrinsic parameters of each camera relative to the main camera, and the coordinate system of the main camera at time j. And the coordinates of each 3D point p w .
[0146] In practical applications, the intrinsic parameters of each camera and the external parameters of each camera relative to the main camera can be continuously optimized during the driving process of the autonomous driving vehicle. Specifically, during the driving process of the autonomous driving vehicle, each camera continuously acquires camera images, and the intrinsic parameters of each camera and the external parameters of each camera relative to the main camera are continuously optimized based on the camera images acquired by each camera. When the number of logarithms of the simultaneously restored poses of each camera and the main camera reaches a threshold, data acquisition ends, and optimization is performed based on the acquired data.
[0147] As can be seen from the above content, this embodiment can reconstruct the scene based on the camera images collected by each camera, obtain the pose of each camera image and the 3D point coordinates corresponding to the feature points included in each camera image, and the scene reconstruction result can reflect the positional relationship between the cameras, so that the internal parameters of each camera and the external parameters of each camera relative to the main camera can be calculated based on the scene reconstruction result. The entire calibration method does not require human participation or the assistance of any external objects, and the results are objective and accurate, thereby improving the accuracy of camera calibration. In addition, the camera calibration process in this embodiment does not require the construction of a fixed site such as a calibration field, thereby reducing capital investment and saving the cost of camera calibration. In addition, compared with the construction of a calibration field for camera calibration, the solution of the embodiment of the present invention can perform camera calibration when the autonomous driving vehicle travels to any area, thereby improving the convenience of camera calibration.
[0148] As an implementation manner of the embodiment of the present invention, after the camera is calibrated, the wheel speed may be calibrated based on the camera intrinsic parameters obtained through the calibration and the extrinsic parameters of each camera relative to the main camera.
[0149] The input data of wheel speed calibration includes the relative pose output by the odometer and the inter-frame estimation of the wheel speed pulse output. Among them, the odometer input is a multi-camera image, and the odometer obtains the pose of each camera image relative to the first frame camera image, thereby calculating the relative pose between each frame. The wheel speed encoder outputs the number of pulses, and the inter-frame pose of the wheel is obtained by integration.
[0150] Specifically, the relative pose between adjacent main camera images can be calculated based on each camera image, the internal parameters of each camera, and the external parameters of each other camera relative to the main camera; for each frame of the main camera image, the time between the acquisition time of the main camera image and the acquisition time of the previous frame of the main camera image is determined as the integration time; the pulse output by the wheel speed encoder is obtained, and the pulse is integrated for each integration time in turn according to the input wheel radius to obtain the pose between each frame of the unmanned vehicle; according to the relative pose between each adjacent main camera image and the pose between each frame, the initial value of the external parameter of the multi-camera module composed of multiple cameras relative to the wheel speed is estimated; the initial value of the external parameter includes: pitch angle, roll angle, yaw angle, scale, lateral translation and longitudinal translation; the wheel radius is optimized to obtain the optimized wheel radius; according to the optimized wheel radius, the pulse is integrated for each integration time in turn to obtain the optimized pose between the unmanned vehicle to each frame; according to the relative pose between each adjacent main camera image and the optimized pose between each frame, the external parameter of the multi-camera module relative to the wheel speed is calculated.
[0151] When calibrating the wheel speed, the entire multi-camera module can be regarded as a rigid body to estimate the pose of the entire multi-camera module at different times. Specifically, each camera image, each camera's internal parameters, and each other camera's external parameters relative to the main camera can be input into the odometer, and the odometer obtains the pose of each camera image relative to the first frame camera image, thereby calculating the relative pose between adjacent main camera images.
[0152] When determining the integration time, for example, when the acquisition time of any frame of the main camera image is 2020.3.20.12:31, and the acquisition time of the previous frame of the main camera image is 2020.3.20.12:33, it can be determined that the integration time determined according to the main camera image is 2020.3.20.12:31-2020.3.20.12:33.
[0153] After performing the above calculations for each main camera image, n-1 integration times can be obtained, where n is the total number of main camera images. For example, when there are 5 main camera images 0, 1, 2, 3, and 4, the integration times obtained are 0-1, 1-2, 2-3, and 3-4, for a total of 4 integration times. When calculating the inter-frame pose, the input wheel radius can be the factory wheel radius obtained by manual measurement.
[0154] In the embodiment of the present invention, the x-axis direction can be defined as the lateral direction of the vehicle, and the rotation of the vehicle body around the x-axis is the pitch angle pitch; the y-axis direction is the longitudinal direction of the vehicle, and the rotation around the y-axis is the roll angle roll; the z-axis is the height, and the rotation around the z-axis is the yaw angle yaw.
[0155] In an embodiment of the present invention, the wheel speed can be calibrated based on the hand-eye calibration algorithm. The hand-eye calibration algorithm is an algorithm that aligns two trajectories and solves the conversion relationship between the two. In the wheel speed calibration, the two trajectories are the camera trajectory and the wheel speed trajectory. The camera trajectory is output by the odometer and is the posture at each moment. The wheel speed trajectory is obtained by pulse integration. By calculating the difference between the postures of each frame, the relative posture we need is obtained.
[0156] In one implementation, a rotation component can be identified in each inter-frame pose, and the yaw angle corresponding to the inter-frame pose can be obtained by decomposing the rotation component through Euler angles, and the angular velocity can be calculated based on the yaw angle; the inter-frame pose with an angular velocity greater than a preset threshold is taken as the target inter-frame pose, and the relative pose at the moment corresponding to the inter-frame pose is taken as the target relative pose; the pitch angle and the roll angle are solved, and based on the target inter-frame pose and the target relative pose, the preliminary result of the external parameters from the camera system to the wheel speed system is obtained through singular value decomposition SVD. Multiply the relative position of each target by As the updated target relative pose, SVD decomposition is performed again to obtain the external parameters from the camera system to the wheel speed system. When the change value of the external parameter result is less than the preset change threshold, the yaw angle, scale, lateral translation and longitudinal translation are obtained.
[0157] For example, is the external parameter to be estimated, i.e., the conversion of the multi-camera module relative to the wheel speed, is the wheel frame-to-frame pose, is the relative position of the odometer, and the three satisfy Through two trajectories, many groups can be obtained To construct a healthy problem to solve, take out The rotation part of the wheel is decomposed by Euler angle to get the yaw angle yaw of the wheel during this period, divided by the time interval to get the angular velocity. The angular velocity is considered to be sufficient for excitation and is used to solve the external parameters. So far, multiple groups are screened out. In order to ensure the calibration effect, the vehicle is required to turn as much as possible during the calibration process to ensure sufficient motion excitation. Due to the unobservability of the wheels to the height, the vehicle should avoid going up and down slopes during calibration.
[0158] Different algorithms can be used to calculate the pitch angle and roll angle. In one implementation, the Lidar point cloud within the image acquisition time range of each main camera can be obtained, and the Lidar point cloud can be plane-fitted to obtain the ground plane normal vector v in the Lidar system. l , obtain the external parameters of the Lidar system and the camera system, and calculate v based on the external parameters of the Lidar system and the camera system l The ground plane normal vector v in the camera frame c , calculate v c The ground plane normal vector v in the wheel speed system o angles to obtain the pitch and roll angles.
[0159] In another implementation, the posture of each main camera image relative to the first frame main camera image can be plane fitted to obtain the ground plane normal vector calculation v in the camera system. c , calculate v c The ground plane normal vector v in the wheel speed system o angles to obtain the pitch and roll angles.
[0160] In another implementation, the rotation component can be identified in the relative pose between each adjacent main camera image and the pose between each frame, and a relationship including the pitch angle and the roll angle is constructed based on the identified rotation component, and the relationship is decomposed by SVD to obtain the pitch angle and the roll angle. The above relationship can be:
[0161] In the process of solving the initial value of the extrinsic parameter, part of the error comes from the wheel radius. Therefore, after the linear solution, a nonlinear optimization problem is constructed. The optimization variables are the extrinsic parameters of the multi-camera module relative to the wheel speed and the wheel radius.
[0162] For example, the wheel radius r can be optimized by the following formula:
[0163]
[0164] Represents the external parameters of the multi-camera module relative to the wheel speed, express The rotation component of express The translation component of Represents the translation component of the pose matrix between frames, Represents the translation component of each relative pose matrix, s represents the scale, and I represents the identity matrix.
[0165] After optimizing the wheel radius, re-integrate the wheel speed pulse and repeat the above steps to calculate the external parameters of the multi-camera module relative to the wheel speed.
[0166] In this embodiment, after the multi-camera module is calibrated, the wheel speed can also be calibrated based on the camera internal parameters and external parameters obtained by the calibration to obtain the external parameters of the multi-camera module relative to the wheel speed, so that during the driving process of the autonomous driving vehicle, the data collected by each sensor can be accurately processed, thereby ensuring the safety of the autonomous driving vehicle. In the inter-frame pose, a larger angular velocity indicates sufficient excitation. In the wheel speed calibration process, the inter-frame pose with a larger angular velocity and the relative pose at the corresponding moment of the selected inter-frame pose are selected to calculate the external parameters of the multi-camera module relative to the wheel speed, which can improve the accuracy of the external parameter calibration. When calibrating the wheel speed, the wheel radius measured manually will have errors, thereby affecting the accuracy of the inter-frame pose. Therefore, after obtaining the initial value of the external parameter, the wheel radius is optimized, and the external parameters of the multi-camera module relative to the wheel speed are calculated based on the optimized wheel radius, which can improve the accuracy of the external parameter calculation.
[0167] As an implementation method of an embodiment of the present invention, after the camera, Lidar and wheel speed are calibrated, the calculated external parameters of each camera relative to the main camera, as well as the external parameters of the multi-camera module to the Lidar, can be converted into the wheel speed system.
[0168] Specifically, for each other camera, the product of the external parameter of the camera relative to the main camera and the inverse matrix of the external parameter of the multi-camera module relative to the wheel speed can be determined as the external parameter of the camera in the wheel speed system. The product of the external parameter of the multi-camera module to the Lidar and the inverse matrix of the external parameter of the multi-camera module relative to the wheel speed can be determined as the external parameter of the Lidar in the wheel speed system.
[0169] When calibrating the camera, the calculated camera extrinsics are all based on the main camera as the reference system. In the unmanned vehicle system, we need to use the vehicle system, that is, the wheel speed system, as the reference system. Therefore, the extrinsic parameters of each camera in the main camera reference system can be converted to the wheel speed system. This can improve the accuracy of data processing when processing the data collected by each sensor in the subsequent process.
[0170] When calibrating Lidar, the calculated external parameters are based on the main camera as the reference system. In the unmanned vehicle system, we need to use the vehicle system, that is, the wheel speed system, as the reference system. Therefore, the external parameters of Lidar in the main camera reference system can be converted to the wheel speed system, which can improve the accuracy of data processing when processing the data collected by each sensor in the subsequent process.
[0171] like Figure 3 As shown, it shows a structural schematic diagram of a Lidar calibration device for an autonomous driving vehicle provided by an embodiment of the present invention, wherein the autonomous driving vehicle is equipped with multiple cameras, and the device includes:
[0172] The camera calibration module 310 is used to obtain the camera images collected by each of the cameras and the collection time corresponding to each of the camera images; calculate the intrinsic parameters of each of the cameras and the extrinsic parameters of each other camera relative to the main camera according to each of the camera images; the main camera is any camera among the cameras;
[0173] The target pose determination module 320 is used to detect and match feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera to obtain the target pose of each camera image;
[0174] The key frame determination module 330 is used to determine the distance and angle interval between each target camera image and the previous target camera image according to the acquisition time and target posture of each target camera image for the target camera image acquired by each camera, and when the distance between any target camera image and the previous target camera image is greater than a preset distance threshold and the angle interval is greater than a preset angle threshold, the camera images acquired by each camera at the target camera image acquisition time are determined as key frames;
[0175] The depth estimation module 340 is used to determine, for each key frame, a gradient point in the key frame whose gradient value is greater than a preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target pose of the key frame to obtain local 3D point information corresponding to the key frame; and obtain a set of 3D points corresponding to each acquisition time according to the acquisition time of each key frame and the local 3D point information corresponding to each key frame;
[0176] The data projection module 350 is used to obtain Lidar point cloud data, identify key Lidar point cloud data corresponding to the timestamp and the acquisition time of each key frame in the Lidar point cloud data; and project the key Lidar point cloud data into a two-dimensional space according to the Lidar measurement model, and perform bilinear interpolation to obtain each Lidar depth map;
[0177] The extrinsic parameter calibration module 360 is used to construct a nonlinear least squares optimization function of the extrinsic parameters of the multi-camera module composed of the multiple cameras to the Lidar according to the three-dimensional point set corresponding to each acquisition time and the Lidar depth map, and optimize the optimization function to obtain the extrinsic parameters of the multi-camera module to the Lidar.
[0178] Optionally, the external parameter calibration module 360 is specifically used to:
[0179] The external parameters of the multi-camera module to Lidar are calculated according to the following formula To optimize:
[0180]
[0181] π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u,v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖p c ‖ represents a three-dimensional point p c The modulus of (x,y,z).
[0182] Optionally, the camera calibration module includes:
[0183] An image synchronization submodule, used to synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition time of any two camera images in each image set is less than a preset time threshold;
[0184] A descriptor determination submodule, used for extracting key points in each camera image, and determining a global descriptor of the camera image according to the extracted key points;
[0185] The image matching submodule is used to obtain a pre-constructed feature map, wherein the feature map includes multiple frames of images, each of which includes key points and corresponding descriptors; for each camera image, an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image is retrieved from the feature map as a matching image corresponding to the camera image;
[0186] A posture calculation submodule is used to match the key points in each of the camera images and the corresponding matching images, and for each camera image, randomly sample a preset number of pairs of key points in the camera image and the corresponding matching image, and calculate the posture of the camera image relative to the feature map based on the sampled key points;
[0187] an initial pose determination submodule, for determining a main camera among the cameras, and for each other camera, calculating the number of inliers corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and determining the pose with the highest number of inliers as the initial pose of the target camera image corresponding to the camera;
[0188] The initial extrinsic parameter calculation submodule is used to calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image collected by the main camera in each image set; and for each of the other cameras, according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image, calculate the initial extrinsic parameter of the camera relative to the main camera;
[0189] The camera calibration submodule is used to optimize the preset optimization function according to the coordinate system of each main camera and the initial external parameters of each other camera relative to the main camera, so as to obtain the intrinsic parameters of each camera and the external parameters of each other camera relative to the main camera.
[0190] Optionally, the initial external parameter calculation submodule is specifically used to:
[0191] For each image set, determining a main camera coordinate system corresponding to the image set as the position and posture of the camera image captured by the main camera in the image set;
[0192] For each other camera, the initial external parameter of the camera relative to the main camera is determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
[0193] Optionally, the camera calibration submodule is specifically used for:
[0194] The internal parameters of each camera are optimized according to the following formula:
[0195]
[0196] represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determine the camera's projection model;
[0197] For each of the other cameras, the external parameters of the camera relative to the main camera are optimized according to the following formula:
[0198]
[0199] represents the coordinate system of the main camera h at time j, Represents the external parameters of camera i relative to the main camera h.
[0200] From the above content, it can be seen that the Lidar calibration device for an autonomous driving vehicle provided in an embodiment of the present invention can calibrate a multi-camera module, obtain the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera, and then perform three-dimensional reconstruction of each camera image based on the calibrated camera intrinsic parameters and extrinsic parameters to obtain each three-dimensional point set, and the Lidar point cloud data can be projected into a two-dimensional space to obtain a Lidar depth map, so that a nonlinear least squares optimization function of the extrinsic parameters from a multi-camera module composed of multiple cameras to the Lidar can be constructed according to the three-dimensional point set and the Lidar depth map, and the function is optimized to obtain the extrinsic parameters from the multi-camera module to the Lidar, so that during the driving process of the autonomous driving vehicle, the data collected by each sensor can be accurately processed, thereby ensuring the safety of the driving of the autonomous driving vehicle.
[0201] The above device embodiment corresponds to the method embodiment and has the same technical effect as the method embodiment. For specific description, please refer to the method embodiment. The device embodiment is obtained based on the method embodiment. For specific description, please refer to the method embodiment part, which will not be repeated here.
[0202] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0203] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A Lidar calibration method for an autonomous driving vehicle, characterized in that: The autonomous driving vehicle is equipped with a plurality of cameras, and the method comprises: Obtain camera images captured by each of the cameras and the capture time corresponding to each of the camera images; calculate the intrinsic parameters of each of the cameras and the extrinsic parameters of each of the other cameras relative to the main camera according to each of the camera images; the main camera is any one of the cameras; Detecting and matching feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera to obtain the target pose of each camera image; For the target camera images captured by each camera, the distance and angle interval between each target camera image and the previous frame target camera image are determined according to the capture time and target posture of each target camera image, and when the distance between any target camera image and the previous frame target camera image is greater than a preset distance threshold, and the angle interval is greater than a preset angle threshold, the camera images captured by each camera at the target camera image capture time are determined as key frames; For each key frame, determine the gradient points in the key frame whose gradient values are greater than the preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target pose of the key frame to obtain the local 3D point information corresponding to the key frame; and according to the acquisition time of each key frame and the local 3D point information corresponding to each key frame, obtain the 3D point set corresponding to each acquisition time by statistics; Acquire Lidar point cloud data, identify key Lidar point cloud data corresponding to the timestamp and the acquisition time of each key frame in the Lidar point cloud data; and project the key Lidar point cloud data into a two-dimensional space according to the Lidar measurement model, and perform bilinear interpolation to obtain each Lidar depth map; According to the three-dimensional point sets corresponding to the respective acquisition moments and the respective lidar depth maps, a nonlinear least squares optimization function for external parameters from a multi-camera module composed of the plurality of cameras to the lidar is constructed, and the optimization function is optimized to obtain external parameters from the multi-camera module to the lidar; The step of calculating the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera according to the camera images includes: Synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition time of any two camera images in each image set is less than a preset time threshold; For each of the camera images, extract key points in the camera image, and determine a global descriptor of the camera image based on the extracted key points; Obtain a pre-constructed feature map, wherein the feature map includes multiple frames of images, each of which includes key points and corresponding descriptors; for each camera image, retrieve an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image in the feature map as a matching image corresponding to the camera image; Matching the key points in each of the camera images and the corresponding matching images, and for each camera image, randomly sampling a preset number of pairs of key points in the camera image and the corresponding matching image, and calculating the pose of the camera image relative to the feature map based on the sampled key points; Determine a main camera among the cameras, and for each other camera, calculate the number of inliers corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and determine the pose with the highest number of inliers as the initial pose of the target camera image corresponding to the camera; Calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image captured by the main camera in each image set; and for each of the other cameras, calculate the initial extrinsic parameters of the camera relative to the main camera according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image; According to the coordinate system of each main camera and the initial external parameters of each other camera relative to the main camera, a preset optimization function is optimized to obtain the internal parameters of each camera and the external parameters of each other camera relative to the main camera; The step of optimizing a preset optimization function according to the coordinate system of each main camera and the initial external parameters of each other camera relative to the main camera to obtain the internal parameters of each camera and the external parameters of each other camera relative to the main camera includes: The internal parameters of each camera are optimized according to the following formula: represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determine the camera's projection model; For each of the other cameras, the external parameters of the camera relative to the main camera are optimized according to the following formula: represents the coordinate system of the main camera h at time j, Represents the external parameters of camera i relative to the main camera h.
2. The method according to claim 1, characterized in that The step of constructing a nonlinear least squares optimization function for the external parameters of the multi-camera module composed of the multiple cameras to the Lidar according to the three-dimensional point set corresponding to each acquisition time and the Lidar depth map, and optimizing the optimization function to obtain the external parameters of the multi-camera module to the Lidar includes: The external parameters of the multi-camera module to Lidar are calculated according to the following formula To optimize: π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u, v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖p c ‖ represents a three-dimensional point p c The modulus of (x, y, z).
3. The method according to claim 1 or 2, characterized in that: The step of calculating the main camera coordinate system corresponding to each image set according to the pose of the camera image collected by the main camera in each image set; and for each of the other cameras, calculating the initial external parameters of the camera relative to the main camera according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image comprises: For each image set, determining a main camera coordinate system corresponding to the image set as the position and posture of the camera image captured by the main camera in the image set; For each other camera, the initial external parameter of the camera relative to the main camera is determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
4. A Lidar calibration device for an autonomous driving vehicle, used to implement the Lidar calibration method according to claim 1, characterized in that: The autonomous driving vehicle is equipped with a plurality of cameras, and the device comprises: A camera calibration module, used to obtain camera images collected by each of the cameras and the collection time corresponding to each of the camera images; calculate the intrinsic parameters of each of the cameras and the extrinsic parameters of each other camera relative to the main camera according to each of the camera images; the main camera is any camera among the cameras; A target pose determination module, used to detect and match feature points of each camera image according to the intrinsic parameters of each camera and the extrinsic parameters of each other camera relative to the main camera, so as to obtain the target pose of each camera image; A key frame determination module is used to determine the distance and angle interval between each target camera image and the previous target camera image according to the acquisition time and target posture of each target camera image acquired by each camera, and when the distance between any target camera image and the previous target camera image is greater than a preset distance threshold and the angle interval is greater than a preset angle threshold, the camera images acquired by each camera at the target camera image acquisition time are determined as key frames; The depth estimation module is used to determine, for each key frame, the gradient points in the key frame whose gradient values are greater than a preset gradient threshold, and perform depth estimation on each gradient point in the key frame according to the target posture of the key frame to obtain the local 3D point information corresponding to the key frame; and according to the acquisition time of each key frame and the local 3D point information corresponding to each key frame, obtain the 3D point set corresponding to each acquisition time by statistics; A data projection module is used to obtain Lidar point cloud data, identify key Lidar point cloud data corresponding to the timestamp and the acquisition time of each key frame in the Lidar point cloud data; and according to the Lidar measurement model, project the key Lidar point cloud data into a two-dimensional space, and perform bilinear interpolation to obtain each Lidar depth map; The extrinsic parameter calibration module is used to construct a nonlinear least squares optimization function of the extrinsic parameters of the multi-camera module composed of the multiple cameras to the Lidar according to the three-dimensional point set corresponding to each acquisition time and the Lidar depth map, and optimize the optimization function to obtain the extrinsic parameters of the multi-camera module to the Lidar.
5. The device according to claim 4, characterized in that The external parameter calibration module is specifically used for: The external parameters of the multi-camera module to Lidar are calculated according to the following formula To optimize: π l (·) represents the Lidar measurement model, I i (x) represents the value of the Lidar depth map corresponding to time i at the two-dimensional coordinate x(u, v), p c represents the three-dimensional point coordinates under the camera system, Vi represents the three-dimensional point set corresponding to time i, ‖p c ‖ represents a three-dimensional point p c The modulus of (x, y, z).
6. The device according to claim 4 or 5, characterized in that The camera calibration module comprises: An image synchronization submodule, used to synchronize the camera images according to the acquisition time of each camera image to obtain each image set; each image set contains a camera image acquired by each camera, and the difference between the acquisition time of any two camera images in each image set is less than a preset time threshold; A descriptor determination submodule, used for extracting key points in each camera image, and determining a global descriptor of the camera image according to the extracted key points; The image matching submodule is used to obtain a pre-constructed feature map, wherein the feature map includes multiple frames of images, each of which includes key points and corresponding descriptors; for each camera image, an image corresponding to a descriptor having the highest similarity to a global descriptor of the camera image is retrieved from the feature map as a matching image corresponding to the camera image; A posture calculation submodule is used to match the key points in each of the camera images and the corresponding matching images, and for each camera image, randomly sample a preset number of pairs of key points in the camera image and the corresponding matching image, and calculate the posture of the camera image relative to the feature map based on the sampled key points; an initial pose determination submodule, for determining a main camera among the cameras, and for each other camera, calculating the number of inliers corresponding to each pose according to the pose of each camera image collected by the camera relative to the feature map, and the coordinates of key points in each camera image collected by the camera and the corresponding matching image, and determining the pose with the highest number of inliers as the initial pose of the target camera image corresponding to the camera; The initial extrinsic parameter calculation submodule is used to calculate the main camera coordinate system corresponding to each image set according to the pose of the camera image collected by the main camera in each image set; and for each of the other cameras, according to the initial pose of the target camera image corresponding to the camera and the main camera coordinate system of the same image set as the target camera image, calculate the initial extrinsic parameter of the camera relative to the main camera; The camera calibration submodule is used to optimize the preset optimization function according to the coordinate system of each main camera and the initial external parameters of each other camera relative to the main camera, so as to obtain the intrinsic parameters of each camera and the external parameters of each other camera relative to the main camera.
7. The device according to claim 6, characterized in that The initial external parameter calculation submodule is specifically used for: For each image set, determining a main camera coordinate system corresponding to the image set as the position and posture of the camera image captured by the main camera in the image set; For each other camera, the initial external parameter of the camera relative to the main camera is determined as the initial pose of the target camera image corresponding to the camera multiplied by the inverse of the main camera coordinate system of the same image set as the target camera image.
8. The device according to claim 7, characterized in that The camera calibration submodule is specifically used for: The internal parameters of each camera are optimized according to the following formula: represents the coordinate transformation from the world system to camera i at time j, θ i represents the internal parameter of camera i, I represents the set of all cameras, J represents the set of all acquisition moments, and p w is the coordinate of the 3D point in the world system, u is the coordinate of the pixel in the camera image that matches the 3D point, is the camera internal parameter θ i Determine the camera's projection model; For each of the other cameras, the external parameters of the camera relative to the main camera are optimized according to the following formula: represents the coordinate system of the main camera h at time j, Represents the external parameters of camera i relative to the main camera h.
Citation Information
Patent Citations
Manufacturing method of multi-feature fusion map facing autonomous vehicle
CN109341706A
A laser radar and vision combined calibration method
CN109949372A
Camera calibration method applied to automatic driving automobile
CN110827358A
Unmanned vehicle positioning method and system
CN111505662A
Digital retina-based photographing device positioning method
WO2020155616A1
