Abstract
The fundamental shortcoming underlying monocular-based localization and mapping solutions (SfM, Visual SLAM) is the fact that the obtained maps and motion are solved up to an unknown scale. Yet, the literature provides interesting solutions to scale estimation using cues from focus or defocus of a camera. In this paper, we take advantage of the scale offered by image focus to properly initialize Visual SLAM with a correct metric scale. We provide experiments showing the success of the proposed method and discuss its limitations.
Introduction
Monocular Visual SLAM is a cornerstone of lightweight robotics, offering a cost-effective solution for navigation and mapping. However, it suffers from a persistent "scale-blindness." Because a single camera captures 2D projections, it cannot natively distinguish between a small object nearby and a large object far away. Traditional workarounds involve external sensors like IMUs or stereo pairs, or manual distance input. This research proposes a method to recover metric scale automatically during initialization using the camera's own optical properties.
Methodology: Depth from Focus (DfF)
The core of the proposed system is the use of Depth from Focus (DfF) to anchor the SLAM scale. Unlike traditional geometric initialization that requires lateral "shaking" motion, this method utilizes longitudinal motion—moving the camera forward or backward along its optical axis toward a planar surface.
The process involves several key steps:
- Calibration: An offline phase creates a lookup table mapping focal distance to physical distance.
- Focus Measurement: As the camera moves, a Laplacian operator calculates a "focus measure" for each frame, quantifying image sharpness.
- Scale Recovery: The system identifies the frame with peak focus. By referencing the calibration table, it assigns a precise metric value to the initial keyframe, effectively "scaling" the entire map.
This module was integrated into the Parallel Tracking and Mapping (PTAM) framework, replacing the standard scale-agnostic homography initialization.
Experimental Evaluation
The system was tested in two scenarios: a constrained fixed-rig experiment and a handheld experiment. Ground truth was established using physical distance markers.
Precision and Robustness
In controlled conditions using a rail system, the initialization achieved a mean distance of 22.93 cm against a 23 cm target. The standard deviation was remarkably low at 0.2 cm. Even in handheld tests, which introduced human-induced jitter and tilt, the system remained robust with a Root Mean Square Error (RMSE) of 0.62 cm.
Computational Efficiency
One of the most significant advantages of this approach is its speed. The focus-based initialization module runs in approximately 8.5 ms, nearly 30 times faster than the standard 250 ms required for homography-based initialization in PTAM.
Discussion and Limitations
While highly effective, the method relies on a planar scene assumption. Complex depth variations can smear the focus peak, reducing accuracy. Additionally, the system is sensitive to camera tilt; if the optical axis is not perpendicular to the scene, the reported distance will be slightly inaccurate. Future work aims to extend this technique to non-planar environments and improve resilience to rotational motion during the initialization phase.
Conclusion
By treating the camera lens as a depth sensor, this research provides a fast, accurate, and computationally inexpensive way to solve the scale ambiguity problem in monocular SLAM. The use of longitudinal motion makes it particularly suitable for drones and forward-moving vehicles, offering a more natural initialization sequence than traditional methods.
Summary updated