MCPcopy Index your code
hub / github.com/DNA-Rendering/DNA-Rendering / getWorld2View2

Function getWorld2View2

scripts/3DGS/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 getProjectionMatrix(znear, zfar, fovX, fovY):
52 tanHalfFovY = math.tan((fovY / 2))

Callers 2

getNerfppNormFunction · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected