Covisibility graph

Introduced prominently in ORB-SLAM, the covisibility graph is a weighted undirected graph over keyframes:

The graph encodes what sees what, independent of when or where keyframes were created. Two keyframes taken minutes apart from the same viewpoint are strongly connected; two consecutive keyframes during a fast turn may barely be connected at all. This makes covisibility a far better notion of “neighbourhood” for a visual map than time or Euclidean distance.

SLAM systems query the covisibility graph constantly:

A closely related structure is the essential graph: a much sparser subgraph consisting of a spanning tree of the keyframes, augmented with high-weight covisibility edges and loop closure edges. ORB-SLAM runs pose-graph optimisation over the essential graph rather than the dense covisibility graph, getting most of the accuracy of full optimisation at a fraction of the cost.

Formal definition and maintenance

Let Pi\mathcal{P}_i be the set of map points observed by keyframe KiK_i. The covisibility weight between two keyframes is simply

wij=PiPj,w_{ij} = \left| \mathcal{P}_i \cap \mathcal{P}_j \right|,

and the graph keeps edge (i,j)(i, j) iff wijθw_{ij} \geq \theta. Nothing about this requires poses — it is pure bookkeeping over observations — which is what makes it cheap and incremental:

In practice each keyframe stores its neighbours sorted by weight, so queries like “the NN best covisible keyframes” (used to define the local BA window and to expand loop candidates) are O(1)O(1) lookups. Note the asymmetric thresholds in ORB-SLAM’s design: the covisibility graph keeps relatively weak edges (θ15\theta \approx 15 shared points) because local mapping benefits from a generous neighbourhood, while the essential graph keeps only strong ones (θ=100\theta = 100) because pose-graph optimisation wants few, reliable constraints.

Why not time or distance?

It is worth internalising the failure modes of the alternatives. Temporal windows (the last NN frames) break whenever the camera revisits a place: the old keyframes observing the same scene are excluded from local BA, so the map duplicates and drifts locally. Metric neighbourhoods (keyframes within rr metres) break with orientation — a keyframe half a metre away but facing the opposite wall shares no observations and contributes nothing but cost — and depend on pose estimates that are themselves drifting. Covisibility sidesteps both by defining neighbourhood in observation space: exactly the keyframes whose measurements constrain the same geometry, which is exactly the set local BA needs for a well-conditioned problem.

Common pitfalls

Why it matters for SLAM

The covisibility graph is the data structure that lets feature-based SLAM scale: it bounds the cost of local BA, focuses map-point search, and provides the sparse skeleton (the essential graph) for fast global correction after loop closure. Introduced in ORB-SLAM, it influenced map management in virtually every subsequent keyframe-based system, including ORB-SLAM2/3 and their many derivatives.