ORB-SLAM

On this page 7

ORB-SLAM is a feature-based visual SLAM system that estimates the pose of a moving camera and builds a sparse 3D map of keypoints in real time, using ORB features for tracking, mapping, relocalization and loop closure. In robotics perception, it is one of the most widely studied open-source reference systems for simultaneous localization and mapping with cameras alone or with an added inertial sensor.

The family began with the monocular system published in 2015 by researchers at the University of Zaragoza, followed by ORB-SLAM2 for monocular, stereo and RGB-D cameras and ORB-SLAM3 with visual-inertial fusion and multi-map support. Its central design choice is to use one feature type for every task, which keeps the pipeline coherent, fast and reusable across sessions.

How ORB-SLAM tracks and maps with three parallel threads

ORB-SLAM splits the work into three concurrent threads so that frame-rate tracking never waits for slower optimization. The tracking thread localizes every incoming frame, the local mapping thread refines recent geometry, and the loop closing thread detects revisited places and removes accumulated drift.

Tracking extracts ORB keypoints, predicts the pose with a constant-velocity motion model, matches features against nearby map points and refines the pose with motion-only bundle adjustment. It then decides whether the frame should become a keyframe, which is the only kind of frame stored in the map.

Local mapping triangulates new points from the latest keyframe and its neighbors, runs local bundle adjustment over a window of covisible keyframes and culls redundant data. A keyframe is typically discarded when about 90% of its map points are already observed by at least three other keyframes, which keeps the map compact during long sessions.

The table below summarizes what each thread does and how often it runs.

ThreadMain taskTypical rateKey output
TrackingPose estimation per frameEvery frame, often 20-30 HzCamera pose and keyframe decision
Local mappingTriangulation and local optimizationPer new keyframeRefined local map
Loop closingPlace recognition and drift correctionPer keyframe, query onlyCorrected pose graph
Full bundle adjustmentGlobal refinement after a loopOccasional, in ORB-SLAM2 and laterGlobally consistent map
Threads of the ORB-SLAM pipeline

Why ORB features and the covisibility graph matter

ORB (Oriented FAST and Rotated BRIEF) combines the FAST corner detector with an orientation estimate and a 256-bit binary descriptor that is compared by Hamming distance. Binary matching is far cheaper than floating-point descriptors such as SIFT, which allows real-time operation on a CPU without a GPU.

Keypoints are extracted over an image pyramid, commonly 8 levels with a scale factor of 1.2, to tolerate changes in viewing distance. Typical budgets are about 1,000 features for VGA images and about 2,000 for wide automotive stereo frames, distributed over a grid so that features cover the whole image.

The map is organized as a covisibility graph, where keyframes are linked when they share enough map points. A sparser essential graph keeps only the spanning tree, strong covisibility edges and loop edges, which makes pose graph optimization fast after a loop is closed. Place recognition relies on a bag of binary words built with the DBoW2 library.

The following table lists the parameters that most influence accuracy and speed.

ParameterCommon valueEffect of increasing it
Features per frame1,000-2,000More robust tracking, higher CPU load
Pyramid levels8Better scale invariance, more extraction time
Scale factor1.2Coarser levels, fewer matches across distance
FAST threshold20, falling back to 7Fewer but stronger corners
Camera frame rate20-30 fpsSmaller motion between frames, easier matching
Key configuration parameters

ORB-SLAM versions and sensor configurations

Each release of ORB-SLAM extended the sensor set while keeping the same feature-based core. The choice of version therefore depends mainly on which cameras and inertial sensors a robot carries.

VersionSupported sensorsNotable additionsScale observability
ORB-SLAMMonocularAutomatic initialization, Sim(3) loop closureUnknown, drifts
ORB-SLAM2Monocular, stereo, RGB-DLocalization-only mode, full bundle adjustmentMetric with stereo or depth
ORB-SLAM3Adds IMU, pinhole and fisheyeAtlas multi-map system, maximum a posteriori IMU initializationMetric with IMU or stereo
Comparison of ORB-SLAM releases

Monocular operation cannot observe absolute scale, so the system initializes by computing a homography and a fundamental matrix in parallel and selecting the model that better explains the motion. Loop closure in monocular mode therefore estimates a Sim(3) similarity transform, correcting both pose and scale drift.

ORB-SLAM3 introduced the Atlas, a set of disconnected maps. When tracking is lost, a new map starts, and later map merging joins it to an earlier one once a common place is recognized, which greatly improves robustness in long or interrupted runs.

ORB-SLAM is a specific implementation of visual SLAM, whereas pure visual odometry estimates motion without maintaining a reusable map or closing loops. Direct methods and LiDAR pipelines take different routes to the same localization problem.

ApproachInput usedMap typeMain strengthMain weakness
ORB-SLAMSparse keypointsSparse, reusableLoop closure and relocalizationFails in low texture
Visual odometryKeypoints or pixelsNone or local onlyLow latency, simpleUnbounded drift
Direct methodsPixel intensitiesSemi-denseWorks on weak edgesSensitive to exposure changes
LiDAR odometryRange scansDense point cloudLighting independentCostly sensor, geometric degeneracy
ORB-SLAM against neighboring approaches

In practice, ORB-SLAM often serves as the localization backbone, while separate modules such as semantic mapping or an OctoMap occupancy grid build the dense representations that planners need. The sparse ORB map alone is not suitable for obstacle avoidance.

Limitations and common failure modes

ORB-SLAM assumes a mostly static, textured scene, and most failures follow from violating that assumption. Knowing the symptoms helps engineers decide whether to tune parameters, add sensors or choose another method.

SymptomLikely causePractical remedy
Tracking lost in corridorsLow texture, few keypointsLower FAST threshold, add IMU or depth
Map scale changesMonocular scale driftUse stereo, RGB-D or inertial mode
Ghost points in crowdsMoving objects treated as staticMask dynamic regions before tracking
Initialization failsPure rotation or small baselineTranslate the camera sideways at start
Pose jumpsMotion blur or rolling shutterShorter exposure, global shutter camera
Typical problems and remedies

Accuracy also depends on careful camera calibration: errors in intrinsics or in the camera to IMU transform appear directly as trajectory error. The code is released under the GPLv3 license, which matters for commercial products that would need to publish derived source code or negotiate a separate license.

The short version

ORB-SLAM lets a robot work out where it is and what its surroundings look like using only a camera, sometimes helped by a motion sensor. It picks out thousands of small, distinctive spots in each image. These may be corners of furniture or edges of posters. It follows them as the camera moves.

By watching how those spots shift, it calculates the camera path. It also places each spot in 3D space. When the robot returns to a familiar place, it recognizes the scene and corrects the small errors that built up. A hiker does the same after reaching a known landmark and fixing the position marked on a paper map.

Where it makes a difference

A research team building an indoor inspection drone for a warehouse without GPS mounts a global shutter stereo camera and an IMU, then runs ORB-SLAM3 in stereo-inertial mode on an onboard computer. The drone flies a 400-meter loop along storage racks at about 1.5 meters per second, with 1,200 features extracted per frame at 30 frames per second.

Before the loop closes, accumulated drift reaches roughly half a meter. When the drone passes the starting aisle again, the bag-of-words query recognizes the place, pose graph optimization redistributes the error, and the final position error falls to a few centimeters. The team saves the map and reuses it in localization-only mode, so later flights start already aligned with the stored rack positions.