What it does
Two gradients, one vector per pixel, normalised to unit length. The depth is rescaled to a fixed range first, so an 8-bit and a 16-bit copy of one map give the same normals.
The graph doing the work is 1.7 KB of ONNX and it runs in this tab, so your image never leaves the browser. No depth map? Drop a photograph and it will estimate one first.
or , or
A photograph works too: its depth can be estimated in the tab.
Two gradients, one vector per pixel, normalised to unit length. The depth is rescaled to a fixed range first, so an 8-bit and a 16-bit copy of one map give the same normals.
Those are the source depth map's 8-bit steps, amplified by the derivative. Raise sigma until they go, or feed a 16-bit depth map, where the steps are 256 times smaller.
pip install depth2normal gives you the CLI, the ONNX
export and camera intrinsics for metric depth. The models on this
page come from depth2normal export.