Parameter calibration method for cameras and radars, operating machinery and new energy vehicles
Through point cloud densification and feature matching models, the problem of large external parameter errors in radar and camera calibration is solved, more accurate rotation and translation parameter calibration is achieved, and the accuracy and convenience of data fusion are improved.
Patent Information
- Application Number
- CN202410836506.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-26
AI Technical Summary
In existing radar and camera calibration methods, external parameter calibration errors are large, resulting in inaccurate data fusion.
By acquiring the three-dimensional sparse point cloud collected by the radar and the two-dimensional image collected by the camera, point cloud densification processing and feature matching are performed, and the pre-built target feature matching model is used to fit the initial feature matching pair set to determine the relationship between the radar and the camera. Rotation and translation parameters.
It achieves target-free calibration, reduces the impact of noise, improves the accuracy and convenience of rotation and translation parameters, and avoids the limitations of traditional calibration methods.
Smart Images

Figure CN118379367B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of parameter calibration, and specifically to a parameter calibration method for cameras and radars, operating machinery and new energy vehicles. Background Art
[0002] In the fields of autonomous driving and 3D reconstruction of operating machinery, it has become a trend to fuse complementary data from radar and camera to achieve more accurate perception, which makes external calibration between radar and camera essential. Usually, in order to align the radar and camera in space to achieve correct data fusion, the external parameters between radar and camera, namely the rotation matrix and translation vector, need to be determined during the calibration process. Traditional radar and camera calibration methods usually rely on explicit targets or manual intervention, which can easily lead to large errors in the calibrated external parameters. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a parameter calibration method for cameras and radars, working machinery and new energy vehicles, so as to solve the problem of large external parameter errors in existing radar and camera calibration methods.
[0004] In order to achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a parameter calibration method for a camera and a radar, and the parameter calibration method includes:
[0005] Obtain 3D sparse point clouds collected by radar and 2D images collected by camera;
[0006] Fill the three-dimensional sparse point cloud to obtain a dense point cloud map;
[0007] Through the pre-built target feature matching model, feature matching is performed on the point cloud dense map and the two-dimensional image to obtain an initial feature matching pair set;
[0008] Fitting an initial set of feature matching pairs to determine the rotation and translation parameters between the radar and the camera;
[0009] Among them, fitting the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera includes:
[0010] Based on the linear regression model, the predicted coordinates of the image feature points corresponding to the coordinates of the point cloud feature points in the point cloud dense map in the initial feature matching pair set are determined;
[0011] According to the distance between the predicted coordinates of the image feature points and the coordinates of the image feature points that match the coordinates of the point cloud feature points, the linear regression model is updated to obtain rotation and translation parameters, wherein the rotation and translation parameters are the linear regression parameters of the updated linear regression model.
[0012] In an embodiment of the present application, construction of a target feature matching model includes: obtaining an initial feature matching model and model training data; decomposing the model training data into a low-rank matrix to adjust the initial feature matching model through the low-rank matrix, thereby constructing a target feature matching model.
[0013] In an embodiment of the present application, construction of the target feature matching model also includes: for each node in the initial feature matching model, determining the attention weight between each node and its adjacent nodes; based on the attention weight, performing weighted summation on the features of the adjacent nodes to obtain the aggregated features of each node.
[0014] In an embodiment of the present application, based on a linear regression model, according to the point cloud feature point coordinates of the point cloud dense map in the initial feature matching pair set, determining the image feature point prediction coordinates corresponding to the point cloud feature point coordinates includes: denoising the initial feature matching pair set by a preset denoising algorithm to obtain a target feature matching pair set; for the point cloud feature point coordinates of the point cloud dense map in the target feature matching pair set, determining the corresponding image feature point prediction coordinates by a linear regression model according to the coordinates of each point cloud feature point.
[0015] In an embodiment of the present application, the linear regression model is updated according to the distance between the predicted coordinates of the image feature points and the image feature point coordinates that match the point cloud feature point coordinates to obtain rotation and translation parameters, including: determining the distance between the predicted coordinates of each image feature point and the coordinates of each image feature point in the target feature matching pair set; updating the linear regression model according to the distance through a back propagation algorithm, and re-determining the predicted coordinates of the image feature points through the updated linear regression model to determine the minimum distance between the predicted coordinates of each image feature point and the image feature point coordinates; and determining the linear regression parameters of the linear regression model corresponding to the minimum distance as the rotation and translation parameters.
[0016] In an embodiment of the present application, the parameter calibration method also includes: performing position transformation on the coordinates of each image feature point according to the rotation and translation parameters to determine the predicted coordinates of the point cloud feature points corresponding to each image feature point coordinate; judging whether there is point cloud data at each point cloud feature point predicted coordinate; in the case that there is no point cloud data at any point cloud feature point predicted coordinate, determining the coordinates of the point cloud data with the smallest distance from any point cloud feature point predicted coordinate; determining the coordinates of the point cloud data with the smallest distance as the point cloud feature point coordinates corresponding to any point cloud feature point predicted coordinate, and returning to execute the step of determining the image feature point predicted coordinates corresponding to the point cloud feature point coordinates based on the linear regression model according to the point cloud feature point coordinates of the point cloud dense graph in the initial feature matching pair set, so as to update the rotation and translation parameters.
[0017] In an embodiment of the present application, after the three-dimensional sparse point cloud is filled to obtain a point cloud dense map, the parameter calibration method also includes: evenly dividing the point cloud dense map into multiple sub-dense point clouds according to preset segmentation parameters; accumulating and summing each sub-dense point cloud according to a preset grayscale level to determine the grayscale distribution function of each preset grayscale level in each sub-dense point cloud; performing grayscale mapping on each sub-dense point cloud according to the grayscale distribution function to obtain multiple processed sub-dense point clouds; and merging multiple processed sub-dense point clouds to obtain a point cloud dense map with enhanced contrast.
[0018] In an embodiment of the present application, after the point cloud dense image is evenly divided into multiple sub-dense point clouds according to preset segmentation parameters, the parameter calibration method also includes: determining the grayscale histogram corresponding to each sub-dense point cloud through a histogram algorithm; obtaining the grayscale threshold of the grayscale histogram; judging whether the number of pixels corresponding to each grayscale level in each grayscale histogram is greater than the grayscale threshold; determining the target cropping pixels when the number of pixels corresponding to any grayscale level is greater than the grayscale threshold; and evenly distributing the target cropping pixels to each preset grayscale level.
[0019] In an embodiment of the present application, filling processing is performed on a three-dimensional sparse point cloud to obtain a dense point cloud map, including: obtaining intrinsic parameters and extrinsic parameters of a preset virtual camera; mapping the three-dimensional sparse point cloud to a virtual camera coordinate system corresponding to the preset virtual camera according to the intrinsic parameters and extrinsic parameters of the preset virtual camera to obtain depth information; generating a depth map according to the depth information; processing the depth map by a bilinear interpolation algorithm to obtain a target depth map; mapping the target depth map according to the intrinsic parameters of the preset virtual camera to obtain a dense point cloud map.
[0020] A second aspect of an embodiment of the present application provides a processor configured to execute the above-mentioned parameter calibration method for cameras and radars.
[0021] A third aspect of an embodiment of the present application provides an operating machine, including: a radar; a camera; and a processor.
[0022] A fourth aspect of an embodiment of the present application provides a new energy vehicle, including: a vehicle body; a radar; a camera; and a processor.
[0023] The above technical solution obtains the three-dimensional sparse point cloud collected by the radar and the two-dimensional image collected by the camera, and then fills the three-dimensional sparse point cloud to obtain a dense point cloud map, and then performs feature matching on the dense point cloud map and the two-dimensional image through a pre-constructed target feature matching model to obtain an initial feature matching pair set, and finally fits the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera. The present application performs feature matching on the dense point cloud map and the two-dimensional image through a target feature matching model, and then fits the initial feature matching pair set obtained after feature matching to determine the rotation and translation parameters between the radar and the camera, which can improve the accuracy of the rotation and translation parameter calibration of the camera and radar.
[0024] In summary, compared with the prior art, the technical solution provided by this application has the following advantages:
[0025] (1) This application uses a target feature matching model to perform feature matching on a dense point cloud map and a two-dimensional image, thereby achieving target-free calibration of cameras and radars, avoiding the limitations of the calibration plate used in traditional calibration methods, and improving the accuracy of rotation and translation parameters.
[0026] (2) This application can enhance the details of the point cloud dense map and suppress background light and shadow by increasing the contrast of the point cloud dense map, thereby improving the visual effect of the point cloud dense map and further improving the quality of feature point annotation of the point cloud dense map.
[0027] (3) This application performs denoising on the initial feature matching pair set, which can reduce the impact of noise data on rotation and translation parameters.
[0028] (4) A depth map is generated based on the external parameters, internal parameters and three-dimensional sparse point cloud of the preset virtual camera, and the empty values of the depth map are filled by a bilinear interpolation algorithm, so that the three-dimensional sparse point cloud can be converted into a dense point cloud map, which can improve the feature point annotation quality of the target feature matching model.
[0029] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0031] Figure 1 A schematic diagram of a process flow of a parameter calibration method for a camera and a radar according to an embodiment of the present application is schematically shown;
[0032] Figure 2A framework diagram of a target feature matching model according to an embodiment of the present application is schematically shown;
[0033] Figure 3 The structural block diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0035] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0036] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0037] Figure 1 The following is a schematic diagram of a process flow of a parameter calibration method for a camera and a radar according to an embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a parameter calibration method for a camera and a radar, and the parameter calibration method is applied to a processor as an example for explanation. The parameter calibration method may include the following steps:
[0038] Step S101: Acquire a three-dimensional sparse point cloud collected by a radar and a two-dimensional image collected by a camera.
[0039] Step S102: Filling the three-dimensional sparse point cloud to obtain a dense point cloud map.
[0040] Step S103: Perform feature matching on the point cloud dense map and the two-dimensional image using a pre-built target feature matching model to obtain an initial feature matching pair set.
[0041] Step S104: Fitting an initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera; wherein fitting the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera includes: based on a linear regression model, according to the point cloud feature point coordinates of the point cloud dense map in the initial feature matching pair set, determining the image feature point prediction coordinates corresponding to the point cloud feature point coordinates; according to the distance between the image feature point prediction coordinates and the image feature point coordinates matching the point cloud feature point coordinates, updating the linear regression model to obtain the rotation and translation parameters, wherein the rotation and translation parameters are the linear regression parameters of the updated linear regression model.
[0042] The parameter calibration method for cameras and radars provided in the embodiments of the present application can be applied to the processor of a work machine. The work machine can be an engineering machine, an agricultural machine, or a work robot, etc. The power source of the work machine can be a new energy battery (such as a lithium battery or a hydrogen fuel cell, etc.), or a fuel engine, or a hybrid power or mains electricity, etc. In some application scenarios, the parameter calibration method for cameras and radars can be applied to the processor of a new energy vehicle, and the new energy vehicle can be a new energy crane, an aerial work vehicle, a pump truck, a high-lift jet fire truck, a sanitation vehicle, or a new energy vehicle, etc.
[0043] The operating machinery or new energy vehicle is equipped with a camera and a radar. The camera can collect a two-dimensional image of the operating scene, and the radar can collect a three-dimensional sparse point cloud of the operating scene. The two-dimensional image can be an image in RGB format, that is, it includes a red channel. r , Green Channel g and blue channel b In this way, the processor can obtain the 3D sparse point cloud collected by the radar and the 2D image collected by the camera. There are gaps in the 3D sparse point cloud. In order to improve the processing effect of the subsequent feature matching process, the processor can fill the 3D sparse point cloud to obtain a dense point cloud map. The dense point cloud map can include 3D distance information, that is, distance information x , y and z. In addition, the processor can pre-construct a target feature matching model, so as to determine the feature points of the point cloud dense map and the feature points of the two-dimensional image respectively through the pre-constructed target feature matching model, and then match the feature points of the point cloud dense map and the feature points of the two-dimensional image through a similarity algorithm, for example, a cosine similarity algorithm can be used to obtain an initial feature matching pair set. After determining the initial feature matching pair set through the target feature matching model, the processor can fit the initial feature matching pair set based on a linear regression model. The initial feature matching pair set includes the point cloud feature point coordinates of the point cloud dense map and the image feature point coordinates of the two-dimensional image, and there is a corresponding relationship between the point cloud feature point coordinates and the image feature point coordinates. In this way, the processor can determine the predicted coordinates of the image feature points corresponding to the point cloud feature point coordinates based on the linear regression model, and then update the linear regression model according to the distance between the predicted coordinates of the image feature points and the image feature point coordinates matching the point cloud feature point coordinates, so as to determine the rotation and translation parameters between the camera and the radar according to the linear regression parameters of the updated linear regression model. In addition, when updating the linear regression model, the processor may also obtain a preset number of iterations or a preset iteration duration, so as to reach the preset number of iterations or the preset iteration duration as a termination condition for updating the linear regression model.
[0044] The above technical solution obtains the three-dimensional sparse point cloud collected by the radar and the two-dimensional image collected by the camera, and then fills the three-dimensional sparse point cloud to obtain a dense point cloud map, and then performs feature matching on the dense point cloud map and the two-dimensional image through a pre-built target feature matching model to obtain an initial feature matching pair set, and finally fits the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera. The present application performs feature matching on the dense point cloud map and the two-dimensional image through a target feature matching model, and then fits the initial feature matching pair set obtained after feature matching to determine the rotation and translation parameters between the radar and the camera, which reduces manual calibration intervention, reduces or avoids the limitations and dependence brought by the calibration plate, and can adaptively meet the calibration requirements under different scenarios and conditions, which can improve the accuracy and convenience of the rotation and translation parameter calibration of the camera and radar.
[0045] In an embodiment of the present application, filling processing is performed on a three-dimensional sparse point cloud to obtain a dense point cloud map, including: obtaining intrinsic parameters and extrinsic parameters of a preset virtual camera; mapping the three-dimensional sparse point cloud to a virtual camera coordinate system corresponding to the preset virtual camera according to the intrinsic parameters and extrinsic parameters of the preset virtual camera to obtain depth information; generating a depth map according to the depth information; processing the depth map by a bilinear interpolation algorithm to obtain a target depth map; mapping the target depth map according to the intrinsic parameters of the preset virtual camera to obtain a dense point cloud map.
[0046] The three-dimensional sparse point cloud is sparse, so in order to improve the processing effect of the subsequent feature matching process, the processor can fill the three-dimensional sparse point cloud to obtain a dense point cloud map. Specifically, the processor can set a preset virtual camera at the radar installation position, and obtain the intrinsic and extrinsic parameters of the preset virtual camera through the Gaussian initialization method. Among them, the internal parameters include focal length, optical center, and distortion parameters, etc., which can be used to determine the imaging characteristics of the preset virtual camera. The external parameters include the translation vector and rotation matrix of the preset virtual camera, which are used to determine the position and orientation of the preset virtual camera in the world coordinate system. Subsequently, according to the internal and external parameters of the preset virtual camera, the processor can map the three-dimensional sparse point cloud to the virtual camera coordinate system corresponding to the preset virtual camera through the perspective projection formula, thereby determining the depth information, and then generating a depth map with depth information. Among them, the perspective projection formula satisfies the formula:
[0047] ;
[0048] in, is the position in the virtual camera coordinate system, As internal reference, is the rotation matrix, is the translation vector, It is the three-dimensional sparse point cloud coordinate in the radar coordinate system corresponding to the radar.
[0049] Due to the sparsity of the three-dimensional sparse point cloud, the generated depth map is also sparse, so the processor can process the depth map through a bilinear interpolation algorithm to obtain a target depth map. Furthermore, the processor can obtain a point cloud dense map based on the target depth map and the intrinsic parameter mapping of the preset virtual camera. In addition, the processor can also verify the rationality of the intrinsic and extrinsic parameters of the preset virtual camera based on the coloring effect of the point cloud dense map. In this way, the processor can generate a point cloud dense map based on the three-dimensional sparse point cloud.
[0050] In an embodiment of the present application, after the three-dimensional sparse point cloud is filled to obtain a point cloud dense map, the parameter calibration method also includes: evenly dividing the point cloud dense map into multiple sub-dense point clouds according to preset segmentation parameters; accumulating and summing each sub-dense point cloud according to a preset grayscale level to determine the grayscale distribution function of each preset grayscale level in each sub-dense point cloud; performing grayscale mapping on each sub-dense point cloud according to the grayscale distribution function to obtain multiple processed sub-dense point clouds; and merging multiple processed sub-dense point clouds to obtain a point cloud dense map with enhanced contrast.
[0051] Specifically, after generating a dense point cloud map, in order to enhance the contrast and details of the dense point cloud map and suppress background light and shadow, thereby improving the visual effect and readability of the dense point cloud map, the processor can obtain preset segmentation parameters and evenly divide the dense point cloud map into multiple sub-dense point clouds according to the preset segmentation parameters to reduce the possibility of over-enhancement of the dense point cloud map. The preset segmentation parameters can be set according to actual conditions. The sizes of multiple sub-dense point clouds are the same. The preset grayscale level can also be set according to actual needs. Subsequently, the processor can accumulate and sum each sub-dense point cloud according to the preset grayscale level, and determine the grayscale distribution function of each preset grayscale level in each sub-dense point cloud, that is, the cumulative distribution function of the grayscale level in the sub-dense point cloud. Furthermore, the processor can perform grayscale mapping on each sub-dense point cloud according to the grayscale distribution function. The grayscale mapping satisfies the formula:
[0052] ;
[0053] in, is the cumulative distribution probability, is the gray level before mapping , Represents gray level Perform grayscale mapping. Indicates the gray level in the preset gray level , express The corresponding probability value.
[0054] After grayscale mapping of each sub-dense point cloud, the processor can obtain multiple processed sub-dense point clouds, and the grayscale distribution of the multiple processed sub-dense point clouds is more uniform than that of the multiple sub-dense point clouds before processing, and the contrast is enhanced. The processor can merge the multiple processed sub-dense point clouds to obtain a point cloud dense map with enhanced contrast.
[0055] In an embodiment of the present application, after the point cloud dense image is evenly divided into multiple sub-dense point clouds according to preset segmentation parameters, the parameter calibration method also includes: determining the grayscale histogram corresponding to each sub-dense point cloud through a histogram algorithm; obtaining the grayscale threshold of the grayscale histogram; judging whether the number of pixels corresponding to each grayscale level in each grayscale histogram is greater than the grayscale threshold; determining the target cropping pixels when the number of pixels corresponding to any grayscale level is greater than the grayscale threshold; and evenly distributing the target cropping pixels to each preset grayscale level.
[0056] Specifically, in the process of enhancing the contrast of the point cloud dense map, in order to retain local details and features, while reducing the possibility of over-enhancing noise, so that the subsequent algorithm can better adapt to the contrast differences in different areas of the point cloud dense map after contrast enhancement, and improve the quality of feature point extraction, the processor can obtain the number of pixels of each gray level in each sub-dense point cloud, thereby generating a gray histogram corresponding to each sub-dense point cloud. In this way, after obtaining the gray threshold of the gray histogram, the processor can determine whether the number of pixels corresponding to each gray level in each gray histogram is greater than the gray threshold. If the number of pixels corresponding to any gray level is greater than the gray threshold, the target cropping pixels are determined, and the target cropping pixels are evenly distributed to each preset gray level. The target cropping pixels are the part of the number of pixels corresponding to each gray level that exceeds the gray threshold. If the number of pixels corresponding to the gray level is less than or equal to the gray threshold, no cropping is required.
[0057] In an embodiment of the present application, construction of a target feature matching model includes: obtaining an initial feature matching model and model training data; decomposing the model training data into a low-rank matrix to adjust the initial feature matching model through the low-rank matrix, thereby constructing a target feature matching model.
[0058] In order to respectively mark the feature points of the point cloud dense map and the feature points of the two-dimensional image through the target feature matching model, the processor can pre-build the target feature matching model. Specifically, first, the processor can first obtain the initial feature matching model and model training data. Among them, the initial feature matching model is a pre-trained model that completes weight parameter tuning based on large image data such as Image Net, and a graph convolutional network (GCN) can be used. The model training data includes historical point cloud dense maps and historical two-dimensional images. When training the initial feature matching model, the model structure of the initial feature matching model can be adjusted by a low-rank adaptation method, that is, the model training data is decomposed into a low-rank matrix, and the initial feature matching model is adjusted by the low-rank matrix to construct a target feature matching model. In this way, the risk of model overfitting can be reduced and the model training speed can be improved.
[0059] In an embodiment of the present application, construction of the target feature matching model also includes: for each node in the initial feature matching model, determining the attention weight between each node and its adjacent nodes; based on the attention weight, performing weighted summation on the features of the adjacent nodes to obtain the aggregated features of each node.
[0060] To improve the efficiency of feature point representation, the target feature matching model can introduce an attention mechanism to achieve global aggregation as well as data-dependent local aggregation by focusing on specific elements and attributes. Figure 2The framework diagram of a target feature matching model according to an embodiment of the present application is schematically shown. The framework of the target feature matching model that introduces the attention mechanism is as follows: Figure 2 Specifically, for a node in the initial feature matching model, the processor can obtain a weight matrix and a bias matrix, and determine the node according to the weight matrix and the bias matrix. i With Node i Neighboring nodes j The attention weight between , the attention weight satisfies the formula:
[0061] ;
[0062] in, For Node i With adjacent nodes j The attention weights between is the parameter vector of the attention mechanism, is the transpose of the parameter vector of the attention mechanism, is the activation function, For Node i The characteristic representation of For adjacent nodes j The characteristic representation of is the weight matrix, is the bias matrix, the weight matrix and the bias matrix are all learnable parameter matrices.
[0063] The processor can then normalize the attention weights so that the sum of the attention weights of each node is one, thereby achieving the purpose of maintaining local attention. The normalized attention weights satisfy the formula:
[0064] ;
[0065] in, For Node i With adjacent nodes j The normalized attention weights between represents the exponential function, For Node i With adjacent nodes j The attention weights between For Node i The set of adjacent nodes includes a preset number of distance nodes i The nearest neighbor node, For Node i and the adjacent nodes in the adjacent node set k The attention weight between .
[0066] Then, the processor can i With adjacent nodes j The normalized attention weights between adjacent nodes j The features of the node are weighted summed to obtain i Aggregation features. Aggregation features satisfy the formula:
[0067] ;
[0068] in, For Node i The aggregation characteristics of is the activation function, For Node i The set of adjacent nodes of For Node i With adjacent nodes j The normalized attention weights between is the weight matrix, For adjacent nodes j The feature representation of .
[0069] In this way, the processor can determine the aggregate features of each node respectively according to the aforementioned steps, so that the target feature matching model can introduce the attention mechanism to improve the accuracy of matching the dense point cloud map with the two-dimensional image feature points.
[0070] It is understandable that for point cloud data in a three-dimensional sparse point cloud, its coordinates should be three-dimensional coordinates ( x, y, z ). After processing the three-dimensional sparse point cloud, the dense point cloud map is obtained. Each point in the dense point cloud map includes the distance information from the corresponding point cloud data to the origin of the radar coordinate system, that is, the three-dimensional array of the dense point cloud map includes the distance information x , y and z Three channels. The two-dimensional image is an RGB format image, and the three-dimensional array of the two-dimensional image includes the red channel r , Green Channel g and blue channel b These three channels. Therefore, when designing the network structure of the target feature matching model, the present application can use the same set of encoders for receiving the point cloud dense map and the two-dimensional image. Moreover, for the aforementioned features of the point cloud dense map and the two-dimensional image, the three-dimensional array of the point cloud dense map and the three-dimensional array of the two-dimensional image can be stored in the same format. In this way, when the point cloud dense map and the two-dimensional image are extracted by the target feature matching model, the target feature matching model can adaptively realize the relationship between each point in the point cloud dense map and the RGB pixel point of the two-dimensional image without introducing a point cloud spatial encoder or an image sift encoding operator.
[0071] In an embodiment of the present application, based on a linear regression model, according to the point cloud feature point coordinates of the point cloud dense map in the initial feature matching pair set, determining the image feature point prediction coordinates corresponding to the point cloud feature point coordinates includes: denoising the initial feature matching pair set by a preset denoising algorithm to obtain a target feature matching pair set; for the point cloud feature point coordinates of the point cloud dense map in the target feature matching pair set, determining the corresponding image feature point prediction coordinates by a linear regression model according to the coordinates of each point cloud feature point.
[0072] Specifically, in order to reduce the influence of abnormal feature points on the final determined rotation and translation parameters, the processor can use Gaussian distribution to denoise the initial feature matching pair set through a preset denoising algorithm to obtain a target feature matching pair set. The preset denoising algorithm can be a random sampling consistency algorithm. In this way, the processor can further determine the linear regression model based on the target feature matching pair set through a preset fitting algorithm. The linear regression model satisfies the formula:
[0073] ;
[0074] in, is the predicted coordinates of the image feature points in the first direction of the camera coordinate system corresponding to the camera, Predict the coordinates of the image feature points in the second direction of the camera coordinate system, represents the linear regression model, is the coordinate of the point cloud feature point in the third direction of the radar coordinate system corresponding to the radar, is the coordinate of the point cloud feature point in the fourth direction of the radar coordinate system, is the coordinate of the point cloud feature point in the fifth direction of the radar coordinate system.
[0075] Then, the processor can match the coordinates of each point cloud feature point in the set through the target feature, and determine the corresponding image feature point prediction coordinates through the linear regression model.
[0076] In an embodiment of the present application, the linear regression model is updated according to the distance between the predicted coordinates of the image feature points and the image feature point coordinates that match the point cloud feature point coordinates to obtain rotation and translation parameters, including: determining the distance between the predicted coordinates of each image feature point and the coordinates of each image feature point in the target feature matching pair set; updating the linear regression model according to the distance through a back propagation algorithm, and re-determining the predicted coordinates of the image feature points through the updated linear regression model to determine the minimum distance between the predicted coordinates of each image feature point and the image feature point coordinates; and determining the linear regression parameters of the linear regression model corresponding to the minimum distance as the rotation and translation parameters.
[0077] Specifically, after determining the predicted coordinates of the image feature points, the processor can further determine the distance between the predicted coordinates of each image feature point and the coordinates of each image feature point in the target feature matching pair set, wherein each image feature point coordinate corresponds to each point cloud feature point coordinate, and the distance can be a Euclidean distance. In this way, through the back propagation algorithm, the processor can update the linear regression model according to the distance, and re-determine the predicted coordinates of the image feature points through the updated linear regression model, thereby determining the minimum distance between the predicted coordinates of each image feature point and the image feature point coordinates, and determining the linear regression parameters of the linear regression model corresponding to the minimum distance as rotation and translation parameters. The rotation and translation parameters include a rotation matrix and a translation vector. Assume that the linear regression model corresponding to the minimum distance satisfies ,in is the coordinate of the image feature point, is the coordinate of the feature point of the point cloud, is the first linear regression parameter, The processor can convert the first linear regression parameter into the second linear regression parameter. Determine as the rotation matrix, and transform the second linear regression parameters In this way, the processor can determine the rotation and translation parameters of the camera and the radar, and then align the camera coordinate system corresponding to the camera with the radar coordinate system corresponding to the radar based on the rotation and translation parameters.
[0078] In an embodiment of the present application, the parameter calibration method also includes: performing position transformation on the coordinates of each image feature point according to the rotation and translation parameters to determine the predicted coordinates of the point cloud feature points corresponding to each image feature point coordinate; judging whether there is point cloud data at each point cloud feature point predicted coordinate; in the case that there is no point cloud data at any point cloud feature point predicted coordinate, determining the coordinates of the point cloud data with the smallest distance from any point cloud feature point predicted coordinate; determining the coordinates of the point cloud data with the smallest distance as the point cloud feature point coordinates corresponding to any point cloud feature point predicted coordinate, and returning to execute the step of determining the image feature point predicted coordinates corresponding to the point cloud feature point coordinates based on the linear regression model according to the point cloud feature point coordinates of the point cloud dense graph in the initial feature matching pair set, so as to update the rotation and translation parameters.
[0079] To further improve the accuracy of the rotation and translation parameters, the processor can perform position conversion on the coordinates of each image feature point according to the rotation and translation parameters obtained by the linear regression model to determine the predicted coordinates of the point cloud feature points corresponding to the coordinates of each image feature point. Since point cloud feature point predicted coordinates may not actually exist point cloud data, the processor needs to determine whether there is point cloud data at the predicted coordinates of the point cloud feature points. If point cloud data exists at the predicted coordinates of each point cloud feature point, the accuracy of the rotation and translation parameters is high and does not need to be updated. If there is no point cloud data at the predicted coordinates of any point cloud feature point, there is a deviation in the rotation and translation parameters. The processor can determine the coordinates of the point cloud data with the smallest distance from the predicted coordinates of any point cloud feature point, and determine the coordinates of the point cloud data with the smallest distance as the point cloud feature point coordinates corresponding to the predicted coordinates of any point cloud feature point. It can be understood that the point cloud feature point coordinates here refer to the point cloud feature point coordinates corresponding to the coordinates of any image feature point determined according to the coordinates of any image feature point corresponding to the predicted coordinates of any point cloud feature point. In this way, the processor can re-determine the corresponding image feature point prediction coordinates through the linear regression model based on the point cloud feature point coordinates after the updated coordinates, and update the linear regression model according to the distance between the image feature point prediction coordinates and the image feature point coordinates, thereby updating the rotation and translation parameters and improving the accuracy of the rotation and translation parameters.
[0080] Figure 3 The structure block diagram of a computer device according to an embodiment of the present application is schematically shown. Figure 3 As shown, an embodiment of the present application further provides a computer device, the computer device includes a memory 310 and a processor 320, the memory 310 stores a computer program, and the processor 320 implements the steps of the above-mentioned parameter calibration method for cameras and radars when executing the computer program.
[0081] Specifically, in an embodiment of the present application, the processor 320 can be configured to: obtain a three-dimensional sparse point cloud collected by a radar and a two-dimensional image collected by a camera; perform filling processing on the three-dimensional sparse point cloud to obtain a point cloud dense map; perform feature matching on the point cloud dense map and the two-dimensional image through a pre-built target feature matching model to obtain an initial feature matching pair set; fit the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera; wherein fitting the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera includes: based on a linear regression model, according to the point cloud feature point coordinates of the point cloud dense map in the initial feature matching pair set, determining the image feature point prediction coordinates corresponding to the point cloud feature point coordinates; according to the distance between the image feature point prediction coordinates and the image feature point coordinates matching the point cloud feature point coordinates, updating the linear regression model to obtain the rotation and translation parameters, wherein the rotation and translation parameters are the linear regression parameters of the updated linear regression model.
[0082] In one embodiment, the processor 320 is further configured to: obtain an initial feature matching model and model training data; decompose the model training data into a low-rank matrix to adjust the initial feature matching model through the low-rank matrix, thereby constructing a target feature matching model.
[0083] In one embodiment, the processor 320 is further configured to: for each node in the initial feature matching model, determine the attention weight between each node and its adjacent nodes; based on the attention weight, perform weighted summation on the features of the adjacent nodes to obtain the aggregated features of each node.
[0084] In one embodiment, the processor 320 is further configured to: denoise the initial feature matching pair set through a preset denoising algorithm to obtain a target feature matching pair set; for the point cloud feature point coordinates of the point cloud dense map in the target feature matching pair set, determine the corresponding image feature point prediction coordinates through a linear regression model based on the coordinates of each point cloud feature point.
[0085] In one embodiment, the processor 320 is further configured to: determine the distance between the predicted coordinates of each image feature point and the coordinates of each image feature point in the target feature matching pair set; update the linear regression model according to the distance through the back propagation algorithm, and re-determine the predicted coordinates of the image feature points through the updated linear regression model to determine the minimum distance between the predicted coordinates of each image feature point and the image feature point coordinates; determine the linear regression parameters of the linear regression model corresponding to the minimum distance as the rotation and translation parameters.
[0086] In one embodiment, the processor 320 is further configured to: perform position transformation on the coordinates of each image feature point according to the rotation and translation parameters to determine the predicted coordinates of the point cloud feature point corresponding to each image feature point coordinate; determine whether there is point cloud data at each point cloud feature point predicted coordinate; in the case that there is no point cloud data at any point cloud feature point predicted coordinate, determine the coordinates of the point cloud data with the smallest distance from any point cloud feature point predicted coordinate; determine the coordinates of the point cloud data with the smallest distance as the point cloud feature point coordinates corresponding to any point cloud feature point predicted coordinate, and return to execute the step of determining the image feature point predicted coordinates corresponding to the point cloud feature point coordinates based on the linear regression model according to the point cloud feature point coordinates of the point cloud dense graph in the initial feature matching pair set, so as to update the rotation and translation parameters.
[0087] In one embodiment, the processor 320 is further configured to: evenly divide the point cloud dense map into multiple sub-dense point clouds according to preset segmentation parameters; accumulate and sum each sub-dense point cloud according to a preset grayscale level to determine the grayscale distribution function of each preset grayscale level in each sub-dense point cloud; perform grayscale mapping on each sub-dense point cloud according to the grayscale distribution function to obtain multiple processed sub-dense point clouds; merge multiple processed sub-dense point clouds to obtain a point cloud dense map with enhanced contrast.
[0088] In one embodiment, the processor 320 is further configured to: determine the grayscale histogram corresponding to each sub-dense point cloud through a histogram algorithm; obtain the grayscale threshold of the grayscale histogram; determine whether the number of pixels corresponding to each grayscale level in each grayscale histogram is greater than the grayscale threshold; when the number of pixels corresponding to any grayscale level is greater than the grayscale threshold, determine the target cropping pixels; and evenly distribute the target cropping pixels to each preset grayscale level.
[0089] In one embodiment, the processor 320 is further configured to: obtain the intrinsic parameters and extrinsic parameters of a preset virtual camera; map the three-dimensional sparse point cloud to a virtual camera coordinate system corresponding to the preset virtual camera according to the intrinsic parameters and extrinsic parameters of the preset virtual camera to obtain depth information; generate a depth map according to the depth information; process the depth map by a bilinear interpolation algorithm to obtain a target depth map; map the target depth map according to the intrinsic parameters of the preset virtual camera to obtain a dense point cloud map.
[0090] The above technical solution obtains the three-dimensional sparse point cloud collected by the radar and the two-dimensional image collected by the camera, and then fills the three-dimensional sparse point cloud to obtain a dense point cloud map, and then performs feature matching on the dense point cloud map and the two-dimensional image through a pre-constructed target feature matching model to obtain an initial feature matching pair set, and finally fits the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera. The present application performs feature matching on the dense point cloud map and the two-dimensional image through a target feature matching model, and then fits the initial feature matching pair set obtained after feature matching to determine the rotation and translation parameters between the radar and the camera, which can improve the accuracy of the rotation and translation parameter calibration of the camera and radar.
[0091] An embodiment of the present application also provides a working machine, including: a radar; a camera; and a processor.
[0092] An embodiment of the present application also provides a new energy vehicle, including: a vehicle body; a radar; a camera; and a processor.
[0093] In some embodiments, a power battery, such as a lithium battery or a hydrogen fuel cell, may be provided in the vehicle body, and the input voltage of the power battery may provide power for the radar and the camera after voltage transformation.
[0094] In other implementations, the power battery may also be arranged at other locations. For example, taking the new energy vehicle as a new energy vehicle crane as an example, the power battery may be arranged on the vehicle as a counterweight, and the like.
[0095] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned parameter calibration method for cameras and radars.
[0096] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0097] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0098] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0101] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0102] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0103] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0104] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A parameter calibration method for cameras and radars, It is characterized in that The parameter calibration method comprises: Acquire the three-dimensional sparse point cloud collected by the radar and the two-dimensional image collected by the camera; Filling the three-dimensional sparse point cloud to obtain a dense point cloud map; Performing feature matching on the point cloud dense map and the two-dimensional image through a pre-built target feature matching model to obtain an initial feature matching pair set; Fitting the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera; The step of fitting the initial feature matching pair set to determine the rotation and translation parameters between the radar and the camera includes: De-noising the initial feature matching pair set using a preset de-noising algorithm to obtain a target feature matching pair set; For the point cloud feature point coordinates of the point cloud dense image in the target feature matching pair set, determining the corresponding image feature point prediction coordinates through a linear regression model according to the point cloud feature point coordinates; Determining the distance between the predicted coordinates of each of the image feature points and the coordinates of each of the image feature points in the target feature matching pair set; By using a back propagation algorithm, the linear regression model is updated according to the distance, and the predicted coordinates of the image feature points are determined again by using the updated linear regression model to determine the minimum distance between the predicted coordinates of each image feature point and the coordinates of the image feature point; The linear regression parameters of the linear regression model corresponding to the minimum distance are determined as the rotation and translation parameters.
2. The parameter calibration method according to claim 1, It is characterized in that The construction of the target feature matching model includes: Obtain an initial feature matching model and model training data; The model training data is decomposed into a low-rank matrix, so as to adjust the initial feature matching model through the low-rank matrix, thereby constructing the target feature matching model.
3. The parameter calibration method according to claim 2, It is characterized in that The construction of the target feature matching model also includes: For each node in the initial feature matching model, determining an attention weight between each node and an adjacent node of each node; Based on the attention weights, weighted summation is performed on the features of the adjacent nodes to obtain aggregate features of each of the nodes.
4. The parameter calibration method according to claim 1, It is characterized in that The parameter calibration method also includes: Performing position transformation on the coordinates of each of the image feature points according to the rotation and translation parameters to determine the predicted coordinates of the point cloud feature points corresponding to the coordinates of each of the image feature points; Determine whether point cloud data exists at the predicted coordinates of each point cloud feature point; In the case where there is no point cloud data at any of the predicted coordinates of the point cloud feature points, determining the coordinates of the point cloud data having the shortest distance from any of the predicted coordinates of the point cloud feature points; The coordinates of the point cloud data with the smallest distance are determined as the point cloud feature point coordinates corresponding to any of the point cloud feature point predicted coordinates, and the step of determining the image feature point predicted coordinates corresponding to the point cloud feature point coordinates based on the linear regression model according to the point cloud feature point coordinates of the point cloud dense image in the initial feature matching pair set is returned to update the rotation and translation parameters.
5. The parameter calibration method according to claim 1, It is characterized in that After the three-dimensional sparse point cloud is filled to obtain a dense point cloud map, the parameter calibration method further includes: Evenly dividing the point cloud dense image into a plurality of sub-dense point clouds according to preset segmentation parameters; Accumulating and summing each of the sub-dense point clouds according to a preset gray level to determine a gray level distribution function of each of the preset gray levels in each of the sub-dense point clouds; According to the grayscale distribution function, grayscale mapping is performed on each of the sub-dense point clouds to obtain a plurality of processed sub-dense point clouds; Merge the multiple processed sub-dense point clouds to obtain a point cloud dense map with enhanced contrast.
6. The parameter calibration method according to claim 5, It is characterized in that After the point cloud dense image is evenly divided into a plurality of sub-dense point clouds according to the preset segmentation parameters, the parameter calibration method further includes: Determine the grayscale histogram corresponding to each of the sub-dense point clouds by a histogram algorithm; Obtaining a grayscale threshold of the grayscale histogram; Determine whether the number of pixels corresponding to each gray level in each of the gray histograms is greater than the gray threshold; When the number of pixels corresponding to any gray level is greater than the gray threshold, determining the target cropping pixels; The target cropped pixels are evenly distributed to each of the preset gray levels.
7. The parameter calibration method according to claim 1, It is characterized in that The filling process of the three-dimensional sparse point cloud to obtain a dense point cloud map includes: Get the internal and external parameters of the preset virtual camera; Mapping the three-dimensional sparse point cloud to a virtual camera coordinate system corresponding to the preset virtual camera according to the intrinsic parameters and extrinsic parameters of the preset virtual camera to obtain depth information; generating a depth map according to the depth information; Processing the depth map by a bilinear interpolation algorithm to obtain a target depth map; The target depth map is mapped according to the internal parameters of the preset virtual camera to obtain the point cloud dense map.
8. A processor, It is characterized in that The method is configured to execute the parameter calibration method for a camera and a radar according to any one of claims 1 to 7.
9. A working machine, It is characterized in that include: radar; camera; A processor according to claim 8.
10. A new energy vehicle, It is characterized in that include: Vehicle body; radar; camera; A processor according to claim 8.
