---
title: Offline Framework for 3D Global Relocalization
url: https://www.emergentmind.com/topics/offline-framework
type: topic
---

# Offline Framework for 3D Global Relocalization

In "Offline-Online Hierarchical 3D Global Relocalization With Synthetic LiDAR Sensing and Descriptor-Space Retrieval" [2605.07741], the offline framework is the preprocessing component of an offline-online hierarchical architecture for 3D global relocalization. It converts a dense prior point-cloud map into a coarse 3D occupancy grid, uniformly samples feasible robot positions in the grid, simulates a synthetic LiDAR scan at each sample, computes a compact geometric descriptor, and stores $\langle \text{position}, \text{descriptor} \rangle$ pairs in an indexed database. By precomputing sampling, ray casting, descriptor creation, and indexing once, the method decouples the search space and reduces online relocalization to lightweight descriptor encoding, a few nearest-neighbor lookups, and local ICP refinements. Real-world experiments report an average relocalization time of 3 s, an average localization accuracy of 8 cm in 3D environments, and an order-of-magnitude improvement in computational efficiency while delivering comparable relocalization accuracy [2605.07741].

## 1. Architectural role and decoupling principle

The overall structure is explicitly split into an offline phase and an online phase. In the offline phase, the method converts a dense prior point-cloud map into a coarse 3D occupancy grid, uniformly samples feasible robot positions in the grid, simulates a synthetic LiDAR scan at each sample, computes a compact geometric descriptor, and stores $\langle \text{position}, \text{descriptor} \rangle$ pairs in an indexed database. In the online phase, it accumulates $K_f$ recent LiDAR scans into a local grid, generates a synthetic scan and query descriptor, retrieves the top $K_c$ candidates by descriptor matching, and refines each candidate by GN-ICP registration to output a precise 6-DoF pose estimate [2605.07741].

The stated benefit of this decomposition is that heavy-compute tasks—sampling, ray casting, descriptor creation, and indexing—are precomputed once. Online work is therefore reduced to lightweight descriptor encoding, a few nearest-neighbor lookups of complexity $O(\log N_p)$, and local ICP refinements. Within the paper’s formulation, the offline framework is not merely data preparation; it is the mechanism that decouples a massive pose search space into an indexed set of candidate positions and descriptor-space retrieval operations.

## 2. Grid map representation and synthetic LiDAR sensing

The offline stage begins from a grid representation. Let $\Omega \subset \mathbb{R}^3$ be the map bounding box and $r$ the grid resolution. The method defines the binary occupancy function
$$
\chi(x)=
\begin{cases}
1, & \text{if cell at } x \text{ is occupied},\\
0, & \text{otherwise},
\end{cases}
$$
and the free-space set
$$
F=\{x \mid \chi(x)=0\}.
$$

Synthetic LiDAR sensing is then performed over the grid. A beam set of predefined unit directions $D=\{d_\ell\}_{\ell=1\ldots K_r}$ and a maximum range $R$ are fixed. For each sampled position $p_i \in F$ and for each beam $d_\ell$, the method traces the ray
$$
x(\lambda)=p_i+\lambda d_\ell,\qquad \lambda\in[0,R],
$$
in steps of $r$. It stops at the first $\lambda^\*$ such that $\chi(x(\lambda^\*))=1$, following a first-return model. The hit point $x^\*$ is recorded; if no hit occurs within $R$, that beam is dropped. All valid returns form a synthetic point set in the map frame,
$$
P_i^M=\{x_\ell^\* \mid \ell=1\ldots K_r,\ \text{hit occurred}\}.
$$

To align the synthetic scan with the real sensor frame, the method fixes a reference orientation $R_0 \in SO(3)$ to match the real sensor’s roll and pitch. For each $x \in P_i^M$ it computes
$$
x^L = R_0^\top (x-p_i),
$$
and forms the LiDAR-frame synthetic scan $P_i^L=\{x^L\}$ [2605.07741].

This construction makes the offline database sensor-aware: the stored descriptors are derived from simulated observations at feasible robot positions rather than from arbitrary subsamples of the map.

## 3. Descriptor construction and representation

At each candidate pose, the method constructs a Scan Context descriptor $I_i \in \mathbb{R}^{N_r \times N_s}$. The descriptor uses $N_r$ concentric rings, $N_s$ angular sectors, and a maximum range $L_{\max}$. Bin $(u,v)$ spans radius
$$
\left[\frac{u-1}{N_r}L_{\max},\ \frac{u}{N_r}L_{\max}\right]
$$
and angle
$$
\left[\frac{(v-1)2\pi}{N_s},\ \frac{v\,2\pi}{N_s}\right).
$$

Each point $x^L$ is assigned to its corresponding bin $B_{u,v}$. The descriptor uses max-height encoding:
$$
I_i(u,v)=\max_{p\in B_{u,v}} z(p),
$$
with empty bins set to $0$. The paper denotes the descriptor in vectorized form as
$$
d_i=\mathrm{vec}(I_i)\in\mathbb{R}^{N_r\cdot N_s}.
$$

A second representation, the ring-key, is used for indexing. The ring-key is the vector of $I_i$’s max over each ring and has size $N_r$. In the offline framework, this separation between the full descriptor and its ring-key is operationally important: the full descriptor preserves retrieval fidelity, while the ring-key provides a lower-dimensional structure for efficient nearest-neighbor search [2605.07741].

## 4. Descriptor database and indexed retrieval space

The offline database is
$$
DB=\{(p_i,d_i)\}_{i=1\ldots N_p}.
$$
Each entry couples a feasible sampled position with the descriptor generated from the synthetic LiDAR scan at that position.

Indexing is performed by building a KD-tree over the ring-key subvector of each $d_i$. The KD-tree supports exact or approximate nearest-neighbor queries under $\ell_2$ in $O(\log N_p)$. Given a query descriptor $d_q$, retrieval first finds nearest ring-keys and then evaluates the full Scan Context distance by circularly shifting descriptor columns:
$$
\mathrm{dist}(I_q,I_m)=\min_{k=0\ldots N_s-1}\left\|I_q-\mathrm{roll}(I_m,k)\right\|_2.
$$

The associated complexities are explicit. KD-tree build complexity is
$$
O(N_p\cdot \log N_p),
$$
and query complexity is
$$
O(\log N_p + C\cdot N_r\cdot N_s),
$$
where $C$ is the number of ring-key neighbors examined [2605.07741].

The indexing scheme therefore converts map-scale candidate generation into descriptor-space retrieval. A plausible implication is that the offline framework’s main contribution is not only candidate enumeration, but the construction of a search structure in which coarse pose hypotheses can be recovered without searching the full 6-DoF map space online.

## 5. Offline preprocessing algorithm, complexity, and storage

The offline preprocessing procedure is given in the paper as an explicit algorithm:

```text
Algorithm OfflinePreprocess
Input: global point cloud G, grid resolution r,
       sampling steps M_max, beam set D, R,
       descriptor dims (N_r,N_s,L_max)
Output: indexed database DB

1.  M ← voxelize(G; r)                      // O(|G|)
2.  S ← ∅                                   // sample set
3.  while not EarlyStop(S) and |S|<N_target do
4.    p_new ← SampleRRT(M)                  // O(1) + neighbor-check
5.    if Accept(p_new; S,M)                 // Eq.(1–3) total O(log|S|+K_r·(R/r))
6.       insert p_new into S
7.  end while
8.  for each p_i∈S                          // N_p ≈ |S|
9.    P_i^M ← RayCastFirstReturn(M,p_i,D,R) // O(K_r·(R/r)) per pose
10.   P_i^L ← TransformToLiDAR(P_i^M,R₀,p_i) // O(|P_i^M|)
11.   I_i ← ComputeScanContext(P_i^L; N_r,N_s,L_max) // O(|P_i^L| + N_r·N_s)
12.   d_i ← vec(I_i)
13.   store (p_i,d_i) in DB
14. Build KD-tree over ring-keys of {d_i}   // O(N_p·log N_p)
return indexed DB
```

The sampling loop has complexity
$$
O(M_{\max}\cdot[\mathrm{cost\ Accept}]) \approx O\!\left(M_{\max}\cdot\left(\log N_p + K_r\cdot (R/r)\right)\right).
$$
Ray casting plus descriptor construction across all samples has complexity
$$
O\!\left(N_p\cdot K_r\cdot (R/r) + N_p\cdot N_r\cdot N_s\right),
$$
and KD-tree construction is
$$
O(N_p\cdot \log N_p).
$$
The overall offline complexity is summarized as
$$
O\!\left(M_{\max}\cdot K_r\cdot (R/r) + N_p\cdot\left(K_r\cdot (R/r) + N_r\cdot N_s + \log N_p\right)\right).
$$

Storage demands are also stated explicitly. Positions require $N_p \cdot 3$ floats. Descriptors require $N_p \cdot (N_r\cdot N_s)$ floats. KD-tree overhead is approximately $O(N_p)$. The paper gives the example
$$
N_p=10\,000,\quad N_r=20,\quad N_s=60,
$$
for which the descriptor matrix is about $12\,000\,000$ floats, approximately $48$ MB, plus about $120$ KB for positions [2605.07741].

## 6. Runtime implications and relocalization significance

The paper summarizes the offline framework as turning a massive 6-DoF search in point-cloud space into a one-time grid-based ray-casting pass plus a descriptor-space indexing structure. At run time, one only needs to voxelize a small local patch, encode it in $O(N_r\cdot N_s)$, perform $O(\log N_p)$ lookups, and launch a handful of local ICP refinements with $K_c \ll N_p$ [2605.07741].

Within the full system, this means that the offline framework does not itself return the final pose. The online phase still performs global retrieval for a coarse pose estimate and then point cloud registration for a precise 6-DoF estimate. The offline framework’s role is to make that online stage computationally tractable in large-scale maps by precomputing the candidate positions and their descriptor indices.

The reported experimental outcome is that this decoupling enables second-level relocalization in very large environments: the method achieves an average relocalization time of 3 s and an average localization accuracy of 8 cm, with an order-of-magnitude improvement in computational efficiency while delivering comparable relocalization accuracy [2605.07741]. In that sense, the offline framework is the enabling substrate of the hierarchical relocalization pipeline rather than an auxiliary preprocessing convenience.

Source: https://www.emergentmind.com/topics/offline-framework