MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / getWorld2View2

Function getWorld2View2

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

Source from the content-addressed store, hash-verified

37 return np.float32(Rt)
38
39def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0):
40 Rt = np.zeros((4, 4))
41 Rt[:3, :3] = R.transpose()
42 Rt[:3, 3] = t
43 Rt[3, 3] = 1.0
44
45 C2W = np.linalg.inv(Rt)
46 cam_center = C2W[:3, 3]
47 cam_center = (cam_center + translate) * scale
48 C2W[:3, 3] = cam_center
49 Rt = np.linalg.inv(C2W)
50 return np.float32(Rt)
51
52def getProjectionMatrix(znear, zfar, fovX, fovY):
53 tanHalfFovY = math.tan((fovY / 2))

Callers 2

getNerfppNormFunction · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected