Inverse of LinearDepth?

The LinearDepth tfx maps a depth texture value to linear depth using the projection matrix

How do I do this in reverse? Ie take a linearised depth texture and turn it into a typical depth map.

I ask this because I want to use the kinect depth and colour textures with the ColorAndDepth node to add 3d objects into the (full colour frame of the) kinect image

Reverse tp.43 and to tp.44 if I remeber function correctly… I think what it does is converts depth from raw format to 0-1 range I maybe wrong…
otherwise you can check some map range function…

Thanks Antokhio

Got it…

To get linear we do -

float ld=tP._43/(d-tP._33);

so to get nonlinear we do -

float d=(tP._43/ld) + tP._33;

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.