In an era where deep learning seems to be the answer to every computer vision problem, researchers from the University of Waterloo are making a bold statement: sometimes, "old school" is better. Their paper, "In Defense of Classical Image Processing: Fast Depth Completion on the CPU," demonstrates that a carefully designed sequence of basic image processing operations can outperform state-of-the-art neural networks on the challenging KITTI depth completion benchmark.
TL;DR
This paper presents a simple, hand-crafted algorithm for depth completion that runs at 90 Hz on a standard CPU—outperforming complex deep learning models that require power-hungry GPUs. By using basic morphological operations and clever depth inversion, the authors achieved the #1 rank on the KITTI test server at the time of submission without needing a single byte of training data.
What Problem Does This Paper Address?
Autonomous vehicles and robots rely heavily on LiDAR (Light Detection and Ranging) sensors to "see" the world in 3D. However, LiDAR sensors are inherently sparse; when you project their laser points onto a 2D image plane, you get a "Swiss cheese" effect where most pixels have no depth information.
Perception tasks like 3D object detection and SLAM (Simultaneous Localization and Mapping) work much better with dense depth maps. The challenge is "depth completion": filling in the gaps to create a continuous depth image. While the research community has pivoted almost entirely toward Deep Neural Networks (DNNs) to solve this, DNNs are computationally expensive, prone to overfitting, and often act as "black boxes" that are difficult to debug or deploy on low-power embedded systems.
Methods
The authors propose a non-guided algorithm (meaning it uses only the sparse LiDAR data, ignoring the RGB image) consisting of an 8-step pipeline of classical operations:
- Depth Inversion: Standard OpenCV operations often overwrite lower pixel values with higher ones. In depth maps, closer objects have lower values (e.g., 5m vs 50m). To ensure closer objects are preserved during dilation, the authors invert the depth: $D_{inverted} = 100.0 - D_{input}$.
- Custom Kernel Dilation: They use a $5 \times 5$ diamond-shaped kernel to fill empty pixels nearest to valid ones.
- Small Hole Closure: A morphological "close" operation connects nearby patches to form object edges.
- Small Hole Fill: A $7 \times 7$ full kernel dilation fills remaining small gaps.
- Extension to Top of Frame: Since LiDAR sensors usually don't cover the top of the image, they extrapolate the highest valid points upward to account for tall objects like trees or buildings.
- Large Hole Fill: A $31 \times 31$ kernel fills any remaining large voids.
- Median and Gaussian Blur: A $5 \times 5$ median blur removes outliers (salt-and-pepper noise), followed by a Gaussian blur to smooth local planes.
- Depth Inversion: The final step reverts the values back to the original scale.
The choice of kernel shape was a key design decision. The authors tested several shapes, finding that the diamond kernel provided the best balance of edge preservation and gap filling.
Datasets
The algorithm was evaluated on the KITTI Depth Completion Benchmark, which consists of approximately 93,000 semi-dense depth maps. The authors used the provided validation set of 1,000 images for hyperparameter tuning and submitted their final results to the KITTI test server for official ranking against other published methods.
Key Insights and Ideas
- Classical Robustness: Because the algorithm is not data-driven, it is inherently robust against overfitting. It doesn't care if the scene is a highway or a residential street; it simply follows geometric rules.
- The Power of Inversion: The simple trick of inverting depth values allows standard morphological operators (which typically favor "bright" or high values) to correctly prioritize closer objects, which is critical for safety in robotics.
- Hardware Efficiency: By avoiding GPUs, the algorithm leaves those resources free for other tasks (like object detection) or allows for cheaper, lower-power hardware in embedded applications.
- Simplicity as a Baseline: The authors argue that high-capacity models should only be used after we fully understand the problem through classical lenses. Their results suggest many current DNNs for depth completion might be over-engineered.
Key Results
The results were striking. The proposed algorithm, dubbed IP-Basic, outperformed the leading CNN-based methods of the time:
- Accuracy: It achieved an RMSE (Root Mean Squared Error) of 1288.46 mm, beating the runner-up CNN method (NN+CNN) by over 131 mm.
- Speed: It runs at 90 Hz (approx. 11ms per frame) on a standard Intel Core i7-7700K CPU. In contrast, the competing CNN methods required high-end GPUs to reach similar or slower frame rates.
- Qualitative Superiority: As seen in Figure 4, the algorithm produces significantly lower errors for distant pixels compared to Sparse CNN approaches.
Limitations and Future Work
While highly effective, the algorithm is non-guided, meaning it doesn't use the RGB image. In scenarios where LiDAR is extremely sparse, information from the camera (like color boundaries) could help refine object edges more accurately than simple dilation.
The authors also noted a trade-off in blurring: while Gaussian blur minimizes RMSE (the metric used for ranking), a Bilateral blur is often better for practical robotics because it preserves sharp object boundaries more effectively, even if it scores slightly lower on global error metrics. Future work could involve adaptive kernel selection based on local image features.
Summary updated