Implement conversion from XYZ_ij to depth image.