MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / getWorld2View2

Function getWorld2View2

gaussian_renderer_dynamic/__init__.py:21–32  ·  view source on GitHub ↗
(R, t, translate=np.array([.0, .0, .0]), scale=1.0)

Source from the content-addressed store, hash-verified

19T_fixed = np.array([0., 0., 0.])
20
21def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0):
22 Rt = np.zeros((4, 4))
23 Rt[:3, :3] = R.transpose()
24 Rt[:3, 3] = t
25 Rt[3, 3] = 1.0
26
27 C2W = np.linalg.inv(Rt)
28 cam_center = C2W[:3, 3]
29 cam_center = (cam_center + translate) * scale
30 C2W[:3, 3] = cam_center
31 Rt = np.linalg.inv(C2W)
32 return np.float32(Rt)
33
34world_view_transform = torch.tensor(getWorld2View2(R_fixed, T_fixed, np.array([0.0, 0.0, 0.0]), 1.0)).transpose(0, 1)
35

Callers 1

__init__.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected