Automatic calibration method and device of laser radar and camera based on attention mechanism
Through the cross-modal attention target association network and cascade particle swarm optimization algorithm based on the attention mechanism, automatic calibration of lidar and cameras is realized, which solves the problem of relying on specific calibration objects and manual participation in the existing technology, and achieves Automatic calibration and high-precision pose matching in natural scenes.
Patent Information
- Application Number
- CN202210577412.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-05-25
AI Technical Summary
Existing lidar and camera automatic calibration technologies are difficult to achieve online automatic calibration without specific calibration objects, and often rely on manual participation or rely too much on the geometric shape of specific calibration objects a priori, making them unable to be fully automated.
Using an attention mechanism-based method, the RGB image and lidar point cloud are encoded through a pre-trained cross-modal attention target association network to generate perspective attention maps and target features, combined with the cascade particle swarm optimization algorithm to automatically match the camera and the relative attitude of lidar.
It achieves automatic extraction of cross-modal feature correlations from natural scenes without relying on initial parameters and specific calibration objects, and obtains high-precision relative attitude calibration results, reducing manual participation and interference from targets outside non-overlapping perspectives.
Smart Images

Figure CN114862968B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of laser radar and camera calibration, and in particular to a laser radar and camera automatic calibration method, apparatus, computer equipment and storage medium based on an attention mechanism. Background Art
[0002] The task of calibrating the relative posture of the lidar and the camera is to calculate the relative posture of the two through the calibration algorithm, that is, the relative rotation matrix and translation matrix. To realize the calibration task of the lidar and the camera, the most important thing is to find the corresponding features in the radar data and the camera image, and then solve the relative posture through optimization algorithms such as Epnp. The problem behind the automatic calibration of the lidar and the camera is the problem of cross-membrane state matching. For humans, it is easy to find the corresponding scenes, targets, and edges in the lidar-camera data that has not been calibrated. For example, the manual calibration method relies on the cross-modal matching ability of humans to find the corresponding feature association and realize the calibration. This calibration method is time-consuming and labor-intensive, has high requirements for the calibration scene, and cannot be calibrated online. The basis for realizing automatic calibration is to automatically find the corresponding features from the natural environment. Since the features of the two modal data (point cloud, RGB image) are quite different, some calibration algorithms reduce the difficulty of the algorithm to automatically match the relevant features of the radar and the camera by designing calibration objects of specific shapes (such as circular, cube or diamond calibration plates), but this method has high requirements for the calibration scene. In order to reduce the difficulty of finding corresponding features, some algorithms that do not rely on specific calibration objects require a rough prior of the lidar and camera postures, limit the range of searching for corresponding features (that is, roughly align the perspectives of the lidar and camera first), and then make a correction to the prior posture based on detailed information such as edges. This method cannot be called completely automatic calibration because the prior posture requires human participation to obtain.
[0003] However, existing methods often use auxiliary algorithms to find corresponding feature associations by designing specific calibration reference objects such as diamond plates and spherical calibration objects. However, this method is relatively complicated and requires real-time human participation, and the calibration objects must be carried with you. Therefore, automatic calibration algorithms have been proposed, but the current automatic calibration algorithms still encounter two problems: algorithms that do not rely on specific calibration objects require initial parameters, and algorithms that rely on specific calibration objects do not require human participation, but are too dependent on the geometric shape prior of specific calibration objects, so online calibration cannot be achieved, and cross-modal feature associations cannot be automatically extracted from natural scenes. Summary of the invention
[0004] Based on this, it is necessary to provide a lidar and camera automatic calibration method, device, computer equipment and storage medium based on an attention mechanism that can realize automatic calibration of lidar and camera in response to the above technical problems.
[0005] A laser radar and camera automatic calibration method based on an attention mechanism, the method comprising:
[0006] Get the RGB image and lidar point cloud taken by the camera;
[0007] Input the RGB image and LiDAR point cloud into the pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and LiDAR point cloud;
[0008] The viewpoint attention map is obtained by calculating the scene features of the lidar point cloud and the scene features of the RGB image;
[0009] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain an initial feature set;
[0010] Use the pre-trained cross-modal attention target association network to encode the graph structure of the initial feature set to obtain the target feature set;
[0011] The viewpoint attention map and the target feature set are subjected to target association attention to obtain the result of cross-modal target matching;
[0012] The cascade particle swarm optimization algorithm is used to optimize the results of cross-modal target matching to obtain the relative posture; the relative posture is the result of automatic calibration.
[0013] In one embodiment, the loss function of the pre-trained cross-modal attention target association network is Among them, P ij represents the association probability between the i-th point cloud target and the j-th image target predicted by the model, P ij gt represents the probability of manual annotation, m represents the number of 3D objects in the point cloud, and n represents the number of objects in the image.
[0014] In one embodiment, a viewpoint attention map is obtained by calculating according to scene features of a lidar point cloud and scene features of an RGB image, including:
[0015] According to the scene features of the LiDAR point cloud and the RGB image, the view attention map is calculated as A = softmax(conv(S R ,S I )),A∈R 1×32×4×16 , where S R Represents the scene features of the lidar point cloud, S IIt represents the scene features of the RGB image, softmax represents the soft maximum algorithm, and conv represents the convolution operation.
[0016] In one of the embodiments, the initial feature set includes initial features of the LiDAR point cloud and initial features of the RGB image;
[0017] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain the initial feature set, including:
[0018] Perform bilinear interpolation sampling on the target feature map of the laser radar point cloud to obtain the initial feature of the laser radar point cloud as X I =Bilinear(F I ,O I ),X I ∈R N×32 , where F I Represents the target feature map of the LiDAR point cloud, N represents the number of targets in the image, 32 represents the feature dimension, O I Represents the target of the laser radar point cloud; Bilinear represents the bilinear interpolation operation;
[0019] Perform bilinear interpolation sampling on the target feature map of the RGB image, and obtain the initial feature of the RGB image as X R =Bilinear(F R ,O R ),X R ∈R M×32 , where F R represents the target feature map of the RGB image, M represents the number of targets in the point cloud, 32 represents the feature dimension, O R A target representing an RGB image.
[0020] In one embodiment, a pre-trained cross-modal attention target association network is used to perform graph structure encoding on the initial feature set to obtain a target feature set, including:
[0021] The pre-trained cross-modal attention target association network is used to encode the graph structure of the initial feature set, and the target feature set is obtained as
[0022]
[0023] Among them, X represents the initial feature set, w(X) represents the attention calculation unit, k represents the number of attention calculation units, mlp represents the multi-layer nonlinear perceptron, and cat represents the combination of features.
[0024] In one embodiment, the viewpoint attention map and the target feature set are subjected to target association attention to obtain a result of cross-modal target matching, including:
[0025] The confidence that the target of the LiDAR point cloud exists in the overlapping field of view of the RGB image and the LiDAR point cloud is calculated based on the view attention map;
[0026] Target association attention is performed based on the confidence and target feature set to obtain the result of cross-modal target matching.
[0027] In one embodiment, target association attention is performed according to the confidence and the target feature set to obtain a result of cross-modal target matching, including:
[0028] According to the confidence and target feature set, the target association attention is performed, and the result of cross-modal target matching is P = softmax ((X R X I T )·P R ), where P R represents confidence, and T represents transposition operation.
[0029] A laser radar and camera automatic calibration device based on an attention mechanism, the device comprising:
[0030] The encoding module is used to obtain the RGB image and the LiDAR point cloud taken by the camera; the RGB image and the LiDAR point cloud are input into the pre-trained cross-modal attention target association network for encoding to obtain the scene features and target feature maps corresponding to the RGB image and the LiDAR point cloud;
[0031] The overlapping view calculation module is used to calculate the scene features of the lidar point cloud and the scene features of the RGB image to obtain the view attention map;
[0032] The sampling module is used to perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain an initial feature set;
[0033] A graph structure encoding module is used to use a pre-trained cross-modal attention target association network to perform graph structure encoding on the initial feature set to obtain a target feature set;
[0034] The cross-modal target matching module is used to associate the viewpoint attention map with the target feature set to obtain the cross-modal target matching result;
[0035] The result optimization module is used to optimize the results of cross-modal target matching using a cascade particle swarm optimization algorithm to obtain a relative posture; the relative posture is the result of automatic calibration.
[0036] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0037] Get the RGB image and lidar point cloud taken by the camera;
[0038] Input the RGB image and LiDAR point cloud into the pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and LiDAR point cloud;
[0039] The viewpoint attention map is obtained by calculating the scene features of the lidar point cloud and the scene features of the RGB image;
[0040] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain an initial feature set;
[0041] Use the pre-trained cross-modal attention target association network to encode the graph structure of the initial feature set to obtain the target feature set;
[0042] The viewpoint attention map and the target feature set are subjected to target association attention to obtain the result of cross-modal target matching;
[0043] The cascade particle swarm optimization algorithm is used to optimize the results of cross-modal target matching to obtain the relative posture; the relative posture is the result of automatic calibration.
[0044] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0045] Get the RGB image and lidar point cloud taken by the camera;
[0046] Input the RGB image and LiDAR point cloud into the pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and LiDAR point cloud;
[0047] The viewpoint attention map is obtained by calculating the scene features of the lidar point cloud and the scene features of the RGB image;
[0048] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain an initial feature set;
[0049] Use the pre-trained cross-modal attention target association network to encode the graph structure of the initial feature set to obtain the target feature set;
[0050] The viewpoint attention map and the target feature set are subjected to target association attention to obtain the result of cross-modal target matching;
[0051] The cascade particle swarm optimization algorithm is used to optimize the results of cross-modal target matching to obtain the relative posture; the relative posture is the result of automatic calibration.
[0052] The above-mentioned automatic calibration method, device, computer equipment and storage medium of the laser radar and camera based on the attention mechanism first input the RGB image and the laser radar point cloud into a pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and the laser radar point cloud. The trained cross-modal attention target association network includes an encoding module and a graph structure encoding module. The scene features of the laser radar point cloud and the scene features of the RGB image are calculated to obtain a perspective attention map. The overlapping perspectives of the camera and the laser radar can be obtained through the perspective attention map; then the target feature map of the laser radar point cloud and the target feature map of the RGB image are bilinearly interpolated and sampled to obtain an initial feature set, and then the initial feature set is graph-structured encoded to obtain target features that integrate the contextual information of the target and the surrounding environment. Finally, the perspective attention map and the target feature set are subjected to target association attention to obtain the result of cross-modal target matching. The present invention can automatically find the overlapping perspectives of the camera and the lidar, reduce the interference of targets outside the non-overlapping perspectives, and can encode the features of targets in the image and point cloud according to the context information in combination with the graph structure encoding module. The present invention combines the perspective overlap prediction and the similarity measurement of the target features, and obtains the ability of cross-modal target matching without relying on the initial parameters. It is optimized in combination with the cascade particle swarm optimization algorithm, and finally the relative posture of the lidar and the camera is automatically obtained. No human intervention is required throughout the process, and it matches natural targets without the need for specially designed calibration objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A schematic diagram of a flow chart of a laser radar and camera automatic calibration method based on an attention mechanism in one embodiment;
[0054] Figure 2 A flowchart of a pre-trained cross-modal attention target association network in one embodiment;
[0055] Figure 3 A schematic diagram of a calibration result in one embodiment;
[0056] Figure 4 is a schematic diagram of a target feature set in one embodiment;
[0057] Figure 5 is a schematic diagram of a result of cross-modal target matching in one embodiment;
[0058] Figure 6 It is a structural block diagram of a laser radar and camera automatic calibration device based on an attention mechanism in one embodiment;
[0059] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In one embodiment, Figure 1 As shown, a laser radar and camera automatic calibration method based on an attention mechanism is provided, comprising the following steps:
[0062] Step 102, obtain the RGB image and the LiDAR point cloud taken by the camera; input the RGB image and the LiDAR point cloud into a pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and the LiDAR point cloud.
[0063] The pre-trained cross-modal attention target association network includes a convolutional neural network encoding module, a graph structure encoding module and a target association attention module.
[0064] The convolutional neural network encoding module is used to encode RGB images and lidar point clouds to obtain scene features and target feature maps.
[0065] The graph structure encoding module is used to perform graph structure encoding on the initial features after sampling the target feature graph to obtain the target features that integrate the contextual relationship of the target and environment information.
[0066] The target-associated attention module is used to perform target-associated attention on the viewpoint attention map and the target feature set to obtain the result of cross-modal target matching. The workflow diagram of the pre-trained cross-modal attention target-associated network is as follows: Figure 2 As shown in the figure, ATOP represents the pre-trained cross-modal attention target association network.
[0067] Step 104, calculate according to the scene features of the lidar point cloud and the scene features of the RGB image to obtain a view attention map.
[0068] The view attention map represents the overlapping viewpoints of the RGB image and the LiDAR point cloud, and the matching target areas found from the overlapping viewpoints.
[0069] Step 106, bilinear interpolation sampling is performed on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set.
[0070] The features of each natural target (such as people, vehicles, and other non-specially designed calibration objects) in both the LiDAR point cloud and the RGB image data obtained by interpolation sampling are the initial feature set. The initial feature set includes the initial features of the LiDAR point cloud and the initial features of the RGB image.
[0071] Step 108, using a pre-trained cross-modal attention target association network to perform graph structure encoding on the initial feature set to obtain a target feature set.
[0072] The features in the initial feature set do not fully consider the contextual connection between the target and the surrounding environment. The present invention introduces a graph structure encoding module to encode the initial feature set, thereby obtaining enhanced target features after combining contextual information.
[0073] Step 110, target association attention is performed on the view attention map and the target feature set to obtain a cross-modal target matching result.
[0074] The overlapping perspectives of RGB images and lidar point clouds can be obtained from the perspective attention map. The features of each natural target in both lidar point clouds and RGB images can be obtained from the target feature set. The two are associated with each other to obtain cross-modal target matching. Cross-modal feature associations are automatically extracted from natural scenes, and the association between lidar data and image data is established. No initial parameters or manually designed calibration objects are required.
[0075] Step 112, using a cascade particle swarm optimization algorithm to optimize the result of cross-modal target matching to obtain a relative posture; the relative posture is an automatic calibration result.
[0076] Due to the influence of target detection errors, the center and vertices of objects in RGB images often have large deviations from the center and vertices of objects in the lidar point cloud. This error will seriously interfere with the optimization results. The present invention uses a two-stage cascaded particle swarm optimization algorithm (Cascaded-PSO): Point-PSO and Pose-PSO to optimize the results of cross-modal target matching and obtain accurate relative poses. The relative poses are the automatic calibration results, such as Figure 3 As shown, the points in the figure are the results of projecting the point cloud onto the image plane based on the calibration results.
[0077] In the above-mentioned automatic calibration method of lidar and camera based on attention mechanism, the RGB image and lidar point cloud are first input into a pre-trained cross-modal attention target association network for encoding to obtain scene features and target feature maps corresponding to the RGB image and lidar point cloud. The trained cross-modal attention target association network includes an encoding module and a graph structure encoding module. The scene features of the lidar point cloud and the scene features of the RGB image are calculated to obtain a viewpoint attention map. The overlapping viewpoints of the camera and lidar can be obtained through the viewpoint attention map; then the target feature map of the lidar point cloud and the target feature map of the RGB image are bilinearly interpolated and sampled to obtain an initial feature set, and then the initial feature set is graph-structured encoded to obtain target features that integrate the contextual information of the target and the surrounding environment. Finally, the viewpoint attention map and the target feature set are subjected to target association attention to obtain the result of cross-modal target matching. The present invention can automatically find the overlapping perspectives of the camera and the lidar, reduce the interference of targets outside the non-overlapping perspectives, and can encode the features of targets in the image and point cloud according to the context information in combination with the graph structure encoding module. The present invention combines the perspective overlap prediction and the similarity measurement of the target features, and obtains the ability of cross-modal target matching without relying on the initial parameters. It is optimized by combining the cascade particle swarm optimization algorithm, and finally automatically obtains the relative posture of the lidar and the camera. No human intervention is required throughout the process, and it matches natural targets without the need for specially designed calibration objects.
[0078] In one embodiment, the loss function of the pre-trained cross-modal attention target association network is Among them, P ij represents the association probability between the i-th point cloud target and the j-th image target predicted by the model, P ij gt represents the probability of manual annotation, m represents the number of 3D objects in the point cloud, and n represents the number of objects in the image.
[0079] In one embodiment, a viewpoint attention map is obtained by calculating according to scene features of a lidar point cloud and scene features of an RGB image, including:
[0080] According to the scene features of the LiDAR point cloud and the RGB image, the view attention map is calculated as A = soft max (conv (S R , S I )), A∈R 1×32×4×16 , where S R Represents the scene features of the lidar point cloud, S I It represents the scene features of the RGB image, soft max represents the soft maximum algorithm, and conv represents the convolution operation.
[0081] In one of the embodiments, the initial feature set includes initial features of the LiDAR point cloud and initial features of the RGB image;
[0082] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain the initial feature set, including:
[0083] Perform bilinear interpolation sampling on the target feature map of the laser radar point cloud to obtain the initial feature of the laser radar point cloud as X I =Bilinear(F I , O I ), X I ∈R N×32 , where F I Represents the target feature map of the LiDAR point cloud, N represents the number of targets in the image, 32 represents the feature dimension, O J Represents the target of the lidar point cloud. Bilinear represents the bilinear interpolation operation;
[0084] Perform bilinear interpolation sampling on the target feature map of the RGB image, and obtain the initial feature of the RGB image as X R =Bilinear(F R , O R ), X R ∈R M×32 , where F R represents the target feature map of the RGB image, M represents the number of targets in the point cloud, 32 represents the feature dimension, O R A target representing an RGB image.
[0085] The pre-trained cross-modal attention target association network includes two convolutional neural network encoding modules, each of which encodes two features, one of which is the feature map of the target {F I , F R}, and another is scene features {S I , S R}. Define the target contained in the laser radar point cloud and RGB image as O I and O R , each target is represented by the center of the target, then the initial features of the target can be sampled from the feature map {F I , F R} to obtain:
[0086] X I =Bilinear(F I , O I ), X I ∈R N×32
[0087] X R =Bilinear(F R , O R ), X R ∈R M×32
[0088] In the above formula, N represents the number of targets in the RGB image, M represents the number of targets in the LiDAR point cloud, and 32 represents the feature dimension. Since the viewing angles of the RGB image and the LiDAR point cloud are quite different, if the three-dimensional target matching the image target is directly searched from the entire LiDAR viewing angle, the matching accuracy will often be interfered by the targets outside the overlapping viewing angle. Since the viewing angle of the LiDAR point cloud is much larger than the image viewing angle, the present invention calculates the viewing angle attention map and finds the viewing angle corresponding to the image from the feature map of the LiDAR point cloud. The present invention divides the features of the LiDAR point cloud into 64 equal parts to obtain the local scene description of the LiDAR point cloud: S R ∈R 1×32×4×16 , the view attention map is calculated by the following formula:
[0089] A=soft max(conv(S R , S I )), A∈R 1×32×4×16
[0090] P R =Bilinear(A,O R )
[0091] The present invention uses the view attention map A to force the network to focus the matching efforts on the overlapping fields of view. The training of A is implicit in the training of cross-modal target matching. R Represents the laser radar point cloud target O R Confidence in the overlapped field of view between the RGB image and the LiDAR point cloud.
[0092] In one embodiment, a pre-trained cross-modal attention target association network is used to perform graph structure encoding on the initial feature set to obtain a target feature set, including:
[0093] The pre-trained cross-modal attention target association network is used to encode the graph structure of the initial feature set, and the target feature set is obtained as
[0094]
[0095] Among them, X represents the initial feature set, w(X) represents the attention calculation unit, k represents the number of attention calculation units, mlp represents the multi-layer nonlinear perceptron, and cat represents the combination of features.
[0096] In one embodiment, the viewpoint attention map and the target feature set are subjected to target association attention to obtain a result of cross-modal target matching, including:
[0097] The confidence that the target of the LiDAR point cloud exists in the overlapping field of view of the RGB image and the LiDAR point cloud is calculated based on the view attention map;
[0098] Target association attention is performed based on the confidence and target feature set to obtain the result of cross-modal target matching.
[0099] In one embodiment, target association attention is performed according to the confidence and the target feature set to obtain a result of cross-modal target matching, including:
[0100] According to the confidence and target feature set, target association attention is performed, and the result of cross-modal target matching is P = soft max ((X R X I T )·P R ), where P R represents confidence, and T represents the transposition operation.
[0101] The initial features in the initial feature set do not fully consider the contextual relationship. The present invention sets a graph structure encoding module in the cross-modal attention target association network and performs graph structure convolution on the initial features, so that the initial features can integrate the contextual relationship between the target and the surrounding environment to obtain the target features, such as Figure 4 As shown in the figure, the cross mark is the target feature, and the graph structure encoding module is based on the multi-head attention mechanism design (MHSA). A basic attention calculation unit is defined as:
[0102]
[0103] Among them (W Q , W K , W V ) are the three weights to be learned, and d is the feature dimension.
[0104] Based on the target feature (X I , X R ) and the attention map A to perform target association attention and obtain the result of cross-modal target matching, which is calculated as P = softmax((X R X I T )·P R ),like Figure 5 As shown, it is the result of cross-modal target matching. The upper left corner of the figure is the perspective attention map, the lower left corner is the distance projection map of the laser point cloud, and the right side is the visible light image.
[0105] In one embodiment, the method (ATOP) of the present invention is verified on the NUDT dataset and the KITTI public dataset. In the optimization stage, the average rotation angle error (RRE) obtained after Point-PSO initialization is (0.507 and 0.260 degrees) on NUDT and KITTI, and the average translation error (RTE) is (112 and 144 mm). After Pose-PSO, the error is reduced to (0.037 and 0.040 degrees) and (30 mm and 24 mm). Compared with the existing automatic calibration algorithms such as Calibnet and DeepI2P, as shown in Table 1, the present invention achieves higher calibration accuracy without the need for initial parameters.
[0106] Table 1
[0107]
[0108] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0109] In one embodiment, Figure 6 As shown, a laser radar and camera automatic calibration device based on an attention mechanism is provided, including: an encoding module 602, an overlapping view calculation module 604, a sampling module 606, a graph structure encoding module 608, a cross-modal target matching module 610 and a result optimization module 612, wherein:
[0110] The encoding module 602 is used to obtain the RGB image and the LiDAR point cloud taken by the camera; input the RGB image and the LiDAR point cloud into the pre-trained cross-modal attention target association network for encoding, and obtain the scene features and target feature maps corresponding to the RGB image and the LiDAR point cloud;
[0111] Overlapping view calculation module 604, used to calculate according to the scene features of the laser radar point cloud and the scene features of the RGB image to obtain a view attention map;
[0112] The sampling module 606 is used to perform bilinear interpolation sampling on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set;
[0113] A graph structure encoding module 608 is used to perform graph structure encoding on the initial feature set using a pre-trained cross-modal attention target association network to obtain a target feature set;
[0114] A cross-modal target matching module 610 is used to perform target association attention on the viewpoint attention map and the target feature set to obtain a cross-modal target matching result;
[0115] The result optimization module 612 is used to optimize the result of cross-modal target matching by using a cascade particle swarm optimization algorithm to obtain a relative posture; the relative posture is an automatic calibration result.
[0116] In one embodiment, the loss function of the pre-trained cross-modal attention target association network is Among them, P ij represents the association probability between the i-th point cloud target and the j-th image target predicted by the model, P ij gt represents the probability of manual annotation, m represents the number of 3D objects in the point cloud, and n represents the number of objects in the image.
[0117] In one embodiment, the overlapping view calculation module 604 is further used to calculate according to the scene features of the laser radar point cloud and the scene features of the RGB image to obtain a view attention map, including:
[0118] According to the scene features of the LiDAR point cloud and the RGB image, the view attention map is calculated as A = softmax(conv(S R ,S I )),A∈R 1×32×4×16 , where S R Represents the scene features of the lidar point cloud, S I It represents the scene features of the RGB image, softmax represents the soft maximum algorithm, and conv represents the convolution operation.
[0119] In one embodiment, the sampling module 606 is further configured to include the initial feature set including the initial features of the laser radar point cloud and the initial features of the RGB image;
[0120] Perform bilinear interpolation sampling on the target feature map of the lidar point cloud and the target feature map of the RGB image to obtain the initial feature set, including:
[0121] Perform bilinear interpolation sampling on the target feature map of the laser radar point cloud to obtain the initial feature of the laser radar point cloud as XI =Bilinear(F I ,O I ),X I ∈R N×32 , where F I Represents the target feature map of the LiDAR point cloud, N represents the number of targets in the image, 32 represents the feature dimension, O I Represents the target of the laser radar point cloud; Bilinear represents the bilinear interpolation operation;
[0122] Perform bilinear interpolation sampling on the target feature map of the RGB image, and obtain the initial feature of the RGB image as X R =Bilinear(F R ,O R ),X R ∈R M×32 , where F R represents the target feature map of the RGB image, M represents the number of targets in the point cloud, 32 represents the feature dimension, O R A target representing an RGB image.
[0123] In one embodiment, the graph structure encoding module 608 is further used to use a pre-trained cross-modal attention target association network to perform graph structure encoding on the initial feature set to obtain a target feature set, including:
[0124] The pre-trained cross-modal attention target association network is used to encode the graph structure of the initial feature set, and the target feature set is obtained as
[0125]
[0126] Among them, X represents the initial feature set, w(X) represents the attention calculation unit, k represents the number of attention calculation units, mlp represents the multi-layer nonlinear perceptron, and cat represents the combination of features.
[0127] In one embodiment, the cross-modal target matching module 610 is further used to perform target association attention on the viewpoint attention map and the target feature set to obtain a result of cross-modal target matching, including:
[0128] The confidence that the target of the LiDAR point cloud exists in the overlapping field of view of the RGB image and the LiDAR point cloud is calculated based on the view attention map;
[0129] Target association attention is performed based on the confidence and target feature set to obtain the result of cross-modal target matching.
[0130] In one embodiment, the cross-modal target matching module 610 is further configured to perform target association attention according to the confidence and the target feature set to obtain a result of the cross-modal target matching, including:
[0131] According to the confidence and target feature set, the target association attention is performed, and the result of cross-modal target matching is P = softmax ((X R X I T )·P R ), where P R represents confidence, and T represents transposition operation.
[0132] For the specific definition of a laser radar and camera automatic calibration device based on an attention mechanism, please refer to the definition of a laser radar and camera automatic calibration method based on an attention mechanism above, which will not be repeated here. Each module in the above-mentioned laser radar and camera automatic calibration device based on an attention mechanism can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0133] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a laser radar and camera automatic calibration method based on an attention mechanism is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0134] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0135] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0136] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0138] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An automatic calibration method for LiDAR and camera based on attention mechanism, It is characterized in that The method comprises: Get the RGB image and lidar point cloud taken by the camera; Input the RGB image and the LiDAR point cloud into a pre-trained cross-modal attention target association network for encoding, and obtain scene features and target feature maps corresponding to the RGB image and the LiDAR point cloud; Calculate the scene features of the laser radar point cloud and the scene features of the RGB image to obtain a viewpoint attention map, Performing bilinear interpolation sampling on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set; Using the pre-trained cross-modal attention target association network to perform graph structure encoding on the initial feature set to obtain a target feature set; Performing target association attention on the view attention map and the target feature set to obtain a cross-modal target matching result; The result of the cross-modal target matching is optimized by using a cascade particle swarm optimization algorithm to obtain a relative posture; the relative posture is an automatic calibration result; The view attention map is obtained by calculating according to the scene features of the laser radar point cloud and the scene features of the RGB image, including: The view attention map is calculated based on the scene features of the laser radar point cloud and the scene features of the RGB image, and is A=softmax(conv(S R ,S I )),A∈R 1×32×4×16 , where S R Represents the scene features of the lidar point cloud, S I Represents the scene features of the RGB image, softmax represents the soft maximum algorithm, and conv represents the convolution operation; The initial feature set includes initial features of the laser radar point cloud and initial features of the RGB image; Perform bilinear interpolation sampling on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set, including: The target feature map of the laser radar point cloud is sampled by bilinear interpolation to obtain the initial feature of the laser radar point cloud as X I =Bilinear(F I ,O I ),X I ∈R N×32 , where F I Represents the target feature map of the LiDAR point cloud, N represents the number of targets in the image, 32 represents the feature dimension, O I Represents the target of the laser radar point cloud; Bilinear represents the bilinear interpolation operation; The target feature map of the RGB image is sampled by bilinear interpolation to obtain the initial feature of the RGB image as X R =Bilinear(F R ,O R ),X R ∈R M×32 , where F R represents the target feature map of the RGB image, M represents the number of targets in the point cloud, 32 represents the feature dimension, O R Represents the target of RGB image; The initial feature set is encoded with a graph structure using the pre-trained cross-modal attention target association network to obtain a target feature set, including: The pre-trained cross-modal attention target association network is used to encode the initial feature set into a graph structure, and the target feature set is obtained as follows: Among them, X represents the initial feature set, w(X) represents the attention calculation unit, k represents the number of attention calculation units, mlp represents the multi-layer nonlinear perceptron, and cat represents the combination of features.
2. The method according to claim 1, It is characterized in that The loss function of the pre-trained cross-modal attention target association network is Among them, P ij represents the association probability between the i-th point cloud target and the j-th image target predicted by the model, P ij gt represents the probability of manual annotation, m represents the number of 3D objects in the point cloud, and n represents the number of objects in the image.
3. The method according to claim 1, It is characterized in that The view attention map and the target feature set are subjected to target association attention to obtain a result of cross-modal target matching, including: The confidence that the target of the LiDAR point cloud exists in the overlapping field of view of the RGB image and the LiDAR point cloud is calculated according to the view attention map; Target association attention is performed according to the confidence and the target feature set to obtain a cross-modal target matching result.
4. The method according to claim 3, It is characterized in that Performing target association attention according to the confidence and the target feature set to obtain a result of cross-modal target matching, including: According to the confidence and the target feature set, target association attention is performed, and the result of cross-modal target matching is obtained as P=softmax((X R X I T )·P R ), where P R represents confidence, and T represents the transposition operation.
5. An automatic calibration device for lidar and camera based on attention mechanism, It is characterized in that The device comprises: An encoding module is used to obtain an RGB image and a LiDAR point cloud taken by a camera; the RGB image and the LiDAR point cloud are input into a pre-trained cross-modal attention target association network for encoding to obtain scene features and target feature maps corresponding to the RGB image and the LiDAR point cloud; The overlapping view calculation module is used to calculate according to the scene features of the laser radar point cloud and the scene features of the RGB image to obtain a view attention map, including: The view attention map is calculated based on the scene features of the laser radar point cloud and the scene features of the RGB image, and is A=softmax(conv(S R ,S I )),A∈R 1×32×4×16 , where S R Represents the scene features of the lidar point cloud, S I Represents the scene features of the RGB image, softmax represents the soft maximum algorithm, and conv represents the convolution operation; A sampling module, used for performing bilinear interpolation sampling on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set; the initial feature set includes the initial features of the laser radar point cloud and the initial features of the RGB image; Perform bilinear interpolation sampling on the target feature map of the laser radar point cloud and the target feature map of the RGB image to obtain an initial feature set, including: The target feature map of the laser radar point cloud is sampled by bilinear interpolation to obtain the initial feature of the laser radar point cloud as X I =Bilinear(F I ,O I ),X I ∈R N×32 , where F I Represents the target feature map of the LiDAR point cloud, N represents the number of targets in the image, 32 represents the feature dimension, O I Represents the target of the laser radar point cloud; Bilinear represents the bilinear interpolation operation; The target feature map of the RGB image is sampled by bilinear interpolation to obtain the initial feature of the RGB image as X R =Bilinear(F R ,O R ),X R ∈R M×32 , where F R represents the target feature map of the RGB image, M represents the number of targets in the point cloud, 32 represents the feature dimension, O R Represents the target of RGB image A graph structure encoding module, used to perform graph structure encoding on the initial feature set using the pre-trained cross-modal attention target association network to obtain a target feature set, including: The pre-trained cross-modal attention target association network is used to encode the initial feature set into a graph structure, and the target feature set is obtained as follows: Among them, X represents the initial feature set, w(X) represents the attention calculation unit, k represents the number of attention calculation units, mlp represents the multi-layer nonlinear perceptron, and cat represents the combination of features; A cross-modal target matching module, used for performing target association attention on the view attention map and the target feature set to obtain a cross-modal target matching result; The result optimization module is used to optimize the result of the cross-modal target matching by using a cascade particle swarm optimization algorithm to obtain a relative posture; the relative posture is an automatic calibration result.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Laser radar and camera joint calibration method and device, server and computer readable storage medium
CN114076937A
Accurate calibration method for laser radar and visible light camera
CN114078163A
