MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / getWorld2View2

Function getWorld2View2

utils/graphics_utils.py:38–49  ·  view source on GitHub ↗
(R, t, translate=np.array([.0, .0, .0]), scale=1.0)

Source from the content-addressed store, hash-verified

36 return np.float32(Rt)
37
38def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0):
39 Rt = np.zeros((4, 4))
40 Rt[:3, :3] = R.transpose()
41 Rt[:3, 3] = t
42 Rt[3, 3] = 1.0
43
44 C2W = np.linalg.inv(Rt)
45 cam_center = C2W[:3, 3]
46 cam_center = (cam_center + translate) * scale
47 C2W[:3, 3] = cam_center
48 Rt = np.linalg.inv(C2W)
49 return np.float32(Rt)
50
51def getWorld2View2_torch(R, t, translate=torch.tensor([0.0, 0.0, 0.0]), scale=1.0):
52 translate = torch.tensor(translate, dtype=torch.float32)

Callers 3

getNerfppNormFunction · 0.90
loadCamerasFunction · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected