# Accurate Collaborative Globally-Referenced Digital Mapping with Standard GNSS
## 4 Globally-Referenced Electro-Optical SLAM (GEOSLAM)
### Multi-Session Mapping
#### 4.3.2 Map Merging  
As mentioned before, the matching of feature points across multiple sessions is central to the idea of averaging standard GNSS errors. Once sufficiently many features are matched between the current stereo keyframes and prior map points, GEOSLAM declares a map merging event. This is akin to the well-known problem of detecting loop closure in the visual SLAM literature [60]. This section details GEOSLAM's map merging and loop closing routine. Hereafter, the terms map merging and loop closure are used interchangeably since GEOSLAM treats them identically. First, note that when detecting a map merge event, feature matching must be attempted against map points that have not been matched in the most recent keyframes. Thus, after processing the \(i\)th keyframe, a possible merge is checked for against the set of map points \(\{m\ :\ m\
otin\cup_{n\in\text{cov}(i,N)}\mathcal{M}_{n}\}\). If this bag-of-words-style feature matching succeeds, then RANSAC iterations are performed to determine whether the matches are geometrically consistent, as well as to robustly estimate the camera pose \(\left(\tilde{\mathbf{x}}_{\mathcal{C}_{i}}^{\mathcal{S}},\tilde{\mathbf{\theta}}_{ \mathcal{C}_{i}}^{\mathcal{S}}\right)\) implied by the merge event. If enough inliers are found, the map merge routine is executed. The map merging process is depicted visually in Figures 8-10. A typical merge situation is shown in Figure 8, where the platform pose at the \(i\)th keyframe is inconsistent with the prior map at the merge location. To avoid such discontinuity in the ensuing joint BA, as an initial guess GEOSLAM enforces that the \(i\)th keyframe pose be consistent with the pose implied by the visual merge matches \(\left(\tilde{\mathbf{x}}_{\mathcal{C}_{i}}^{\mathcal{S}},\tilde{\mathbf{\theta}}_{ \mathcal{C}_{i}}^{\mathcal{S}}\right)\), and that the keyframes and map points from the prior session(s) be unchanged. To this end, a pose-graph optimization [64] is performed over a large \(N_{m}\)-level covisibility window for \(K_{i}\), where the relative translations and rotations between covisible keyframes, as estimated in the current session, are provided as delta-pose measurements, while the 6-DoF poses for the terminal nodes in the covisibility window, as well as for \(K_{i}\), are held constant. In particular, let \(\mathcal{K}_{0}\) denote the set of terminal keyframes in the covisibility graph \(\text{cov}(i,N_{m})\). Furthermore, define the delta-pose pseudo-measurements  
\[\delta\mathbf{x}_{nk}^{\mathcal{S}} \triangleq\tilde{\mathbf{x}}_{\mathcal{C}_{n}}^{\mathcal{S}}-\tilde{ \mathbf{x}}_{\mathcal{C}_{k}}^{\mathcal{S}},\] \[\delta\mathbf{\theta}_{nk}^{\mathcal{S}} \triangleq\theta\bigg{(}R\left(\hat{\mathbf{\theta}}_{\mathcal{C}_{n }}^{\mathcal{S}}\right)R\left(\hat{\mathbf{\theta}}_{\mathcal{C}_{k}}^{\mathcal{S }}\right)^{T}\bigg{)},\]  
where the superscript \((\hat{\cdot})\) denotes GEOSLAM's estimate of the state before the merge event, and \(\theta(\cdot)\) denotes the angle-axis representation of the input rotation matrix.