3D Distance Profiler — Depth Maps for Granulometry
Published:
A web-based RGB-D depth profiling system designed for analyzing mineral sample surfaces using depth camera data. Originally developed during the clay and mineral characterization work at ALGES (2017-2018), this project creates depth maps from RGB, grayscale, or HSI-paired samples, providing the 3D surface information needed for particle size (granulometry) estimation.
Business context
During hyperspectral mineral characterization campaigns, we captured not only spectral data (VNIR/SWIR) but also depth information. The goal was to complement spectral mineral identification with physical surface properties — particle size distribution, surface roughness, and texture — that directly affect processing behavior in grinding and flotation circuits.
Key Performance Indicators — Process impact
Surface characterization from depth data provides granulometric information that traditionally requires physical sieve analysis (hours of manual lab work per sample).
| KPI | Baseline (physical sieve) | With depth profiling | Impact |
|---|---|---|---|
| Characterization method | Destructive sieve analysis | Non-destructive surface imaging | Sample preservation for further analysis |
| Turnaround | Hours per sample | Minutes (image capture + processing) | Orders of magnitude faster |
| Spatial resolution | Bulk average | Per-pixel surface profile | Spatially resolved granulometry maps |
| Integration with HSI | Separate workflow | Co-registered depth + spectral data | Joint mineral-granulometry characterization |
How it works
The system implements a complete pipeline from raw depth images to quantitative surface metrics:
- Scene input: Synthetic RGB-D scene generation (5 types) or upload of real depth camera data (e.g., SICK Ranger3D conveyor-belt profiling)
- Preprocessing: Bilateral filter (edge-preserving smoothing, Tomasi & Manduchi 1998) + hole filling via nearest-neighbour interpolation
- 3D reconstruction: Depth-to-mesh conversion via pinhole camera model projection — each pixel becomes a 3D vertex, triangulated into a surface mesh
- Surface analysis: Normal estimation via finite-difference gradients, Gaussian and mean curvature computation from second-order differential geometry
- Profile extraction: 1D cross-section profiles along arbitrary lines with bilinear interpolation
- Roughness metrics: ISO 4287 standard parameters from profile statistics
n = (-∂z/∂x, -∂z/∂y, 1) / ‖(-∂z/∂x, -∂z/∂y, 1)‖
Gaussian curvature:
K = (fxx · fyy - fxy²) / (1 + fx² + fy²)²
ISO 4287 roughness (Ra):
Ra = (1/N) Σ |zi - z̄| — arithmetic mean deviation of the profile
Technical stack
- Backend: Python/FastAPI with NumPy/SciPy for computational geometry
- Frontend: Three.js (r128) for interactive 3D mesh visualization with orbit controls
- Render modes: RGB texture, depth colormap (hot, viridis, jet), wireframe, point cloud
- Export: PLY, PCD, OBJ for external processing in MeshLab/CloudCompare/Blender
- Communication: REST API with base64-encoded images and flat arrays for Three.js geometry
Connection to broader work
This project is the enabling technology for granulometry estimation from surface imaging. When combined with the HSI Mineral Classification pipeline, it allows simultaneous characterization of both what a mineral sample is (spectral composition) and how it looks physically (particle size, roughness, texture). This joint characterization is critical for geometallurgical models that predict processing behavior.
