# A Lightweight High Definition Mapping Method Based on Multi-Source Data Fusion Perception
## 4 Fusion Mapping on Cloud Server
### Semantic Alignment Algorithm  
Due to the low measurement accuracy of low-cost sensors, even though the LSM data constructed using different trajectories are converted to the unified global coordinate system in the cloud, there is still a certain pose deviation, as shown in Figure 5C-c1. Therefore, it is necessary to use a semantics alignment fusion algorithm to correct the relative relationship between trajectories. The semantic alignment algorithm is the core of on-cloud fusion mapping using crowdsourced data, which will directly determine the accuracy of fusion mapping. Figure 5: The structure of the fusion mapping on-cloud algorithm. (**a**) Global pose graph optimization; (**b**) semantic alignment; (**c**) semantic aggregation. Different color line represents different trajectory. To address this issue, we propose a two-stage, multi-trajectory pose optimization algorithm, called global bundle adjustment, based on semantic GICP (GBA_SGICP), which is based on SICP and GICP improvement. In the first stage, we add semantic prior information to GICP, use different loss functions for different element types, such as ground arrows and traffic signs, and build a loss function based on the point-to-plane distance to reduce the point-cloud matching error. To make the registration position converge to a more accurate value, we use a semantic pyramid hierarchy, where the upper semantic registration result serves as the initial value of the lower registration. We refer to this improved algorithm as the semantic GICP (SGICP). Next, we use the SGICP algorithm to calculate the inter-relative pose constraint (InterRPC) between trajectories using the pairwise method. We then add the relative constraints in each trajectory to construct a graph optimization to obtain a more accurate pose, which improves the robustness of the algorithm in different scenarios and enhances the convergence speed of the algorithm [34; 35]. Figure 3 shows that the semantic alignment fusion algorithm corrects the relative relationship between trajectories, which is essential for achieving accurate fusion mapping. The SGICP algorithm solves the problem as follows:  
Assuming \(P_{s}\) is the source point cloud (point cloud to be registered), \(P_{t}\) is the target point cloud, \(P_{s}^{k}\) and \(P_{t}^{k}\) represent the source and target point clouds of the \(k\)-th layer of the pyramid, respectively, and \(\text{T}\in\text{SE}(3)\) is the required rotation translation matrix. Then,  
Figure 6: Schematic diagram of lane aggregation algorithm. (**a**) LSM lane lines, where different colors represent different lane lines; (**b**) effect picture after the first stage of clustering, where different colors represent different clusters; (**c**) effect picture after clustering in the second stage, where the same color represents one instance; and (**d**) results after vectorization. we have \(f_{SIGICP}(T)=\sum\limits_{l=1}^{L}r(T|P_{s}^{k},P_{t}^{k},\mathcal{A}(l))\), \(P_{s}^{k}=\frac{1}{2^{k-1}}P_{s}\), \(P_{t}^{k}=\frac{1}{2^{k-1}}P_{t}\), where \(\mathcal{A}(l)\) is the matching relationship of \(P_{s}^{k}\) and \(P_{t}^{k}\), and the \(K\) nearest neighbor algorithm is usually used. \[\mathbf{r}(T|P_{s}^{k},P_{t}^{k},\mathcal{A}(l))=\sum\limits_{i=1}^{n}\mathbf{w}_{i} \|P_{t}^{ki}-\mathbf{T}*P_{s}^{ki}\|_{\mathcal{C}_{i}}^{2},\,\mathbf{C}_{t}=\mathbf{C}_{i}^ {t}-T\mathbf{C}_{i}^{t}\mathbf{T}^{T} \tag{7}\]  
where \(i\) is the number of semantic point cloud pairs matched by \(\mathcal{A}(l)\), \(\mathbf{w}_{i}\) denotes the confidence weight of different semantic elements, \(P_{s}^{ki},P_{t}^{ki}\) represents the \(i\)-th matching point of the \(k\)-th layer source point cloud and target point cloud of the pyramid respectively. \(\{\mathbf{C}_{i}^{s}\}\) and \(\{\mathbf{C}_{i}^{t}\}\) denotes the covariance matrix of source point cloud and target point cloud measurements at the \(i\)th point. Optimization variables \(\mathbf{T}^{*}=\mathbf{arg}\underset{\mathbf{T}\in\mathbf{SE}(\mathbf{3})}{\mathbf{min}}\mathbf{f}_{SIGICP }(T)\).