MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / depth_to_pcd

Function depth_to_pcd

lib/test_utils.py:23–30  ·  view source on GitHub ↗
(depth, u_u0, v_v0, f, invalid_value=0)

Source from the content-addressed store, hash-verified

21 return u_u0, v_v0
22
23def depth_to_pcd(depth, u_u0, v_v0, f, invalid_value=0):
24 mask_invalid = depth <= invalid_value
25 depth[mask_invalid] = 0.0
26 x = u_u0 / f * depth
27 y = v_v0 / f * depth
28 z = depth
29 pcd = np.stack([x, y, z], axis=2)
30 return pcd, ~mask_invalid
31
32def pcd_to_sparsetensor(pcd, mask_valid, voxel_size=0.01, num_points=100000):
33 pcd_valid = pcd[mask_valid]

Callers 2

refine_focal_one_stepFunction · 0.85
refine_shift_one_stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected