Real-Time 3D Reconstruction: Meshing at Interactive Rates
Advances in spatial mapping for V2 - dense reconstruction, mesh quality, and the compute challenge of real-time 3D.
Meshing is next on my V2 list. V1's spatial mapping was good enough for plane detection, and for V2 we want realistic occlusion and physics, which takes dense, accurate meshes.
V1 Limitations
Current meshing runs at roughly 5cm voxel resolution, regenerates the full mesh every 2-3 seconds, does minimal hole filling, and produces blocky, noisy surfaces. For V2 we need 1-2cm resolution, incremental sub-second updates, intelligent hole completion, and surfaces that come out smooth and watertight, which is half of what the 640x480 depth upgrade is buying.
Reconstruction Pipeline
Depth Filtering
Raw depth has holes and noise, so we filter before integration: bilateral filtering for edge-preserving smoothing, temporal averaging to accumulate confidence, statistical outlier rejection.
TSDF Integration
The core representation is a Truncated Signed Distance Function, an implicit surface. A voxel grid stores distance to the nearest surface, new depth frames update those distances via a running average, and memory stays manageable because only near-surface voxels get stored. V1 used a dense voxel array at 5cm resolution over a limited volume; V2 moves to sparse voxel structures (octree or hash) at 1cm resolution, room-scale.
Mesh Extraction
Marching cubes pulls the triangle mesh out of the TSDF. It's a classic algorithm, well-understood and parallelizable per voxel, and mesh complexity grows with surface area rather than volume.
Mesh Simplification
Raw marching cubes output carries far too many triangles. We decimate vertices with quadric error metrics, preserve sharp edges and features, and hold to a triangle budget the renderer can live with.
GPU Acceleration
Reconstruction is embarrassingly parallel. Each depth pixel updates independent voxels, each voxel processes independently, and marching cubes runs per voxel. V1 did all of this on the CPU, slowly and at a power cost; V2 moves it to a GPU compute pipeline. Expected improvement: 10x throughput at similar power. In November I argued for a dedicated NPU so the GPU could stay reserved for graphics. The NPU half stands. The reserved half lasted five months; meshing is moving onto GPU compute.
Learned Completion
Depth sensors don't see everything. Occlusions, range limits, and specular surfaces all leave gaps, so the question becomes whether we can complete what's missing. Geometric priors help (planes extend, rooms have floors and ceilings), a neural network can predict unobserved geometry outright, and semantic reasoning fills in the rest - if it's a chair, it probably has four legs.
We're prototyping the learned version: train on complete 3D models, feed in a partial observation, get a completed mesh out. Early results are promising for common objects. Generalization to arbitrary scenes is harder.
Memory Management
Room-scale at 1cm resolution means billions of voxels if you store them densely, which we can't. So we use hierarchical structures that only subdivide where needed, LRU caching that keeps recent observations and pages out old areas, and level-of-detail that holds high resolution near the user and goes coarse far away.
The memory budget is 500MB for reconstruction. The target is a kitchen-sized space at 1cm with dynamic updates.