MCPcopy Index your code
hub / github.com/LeapLabTHU/ActiveNeRF / viewmatrix

Function viewmatrix

load_llff.py:128–134  ·  view source on GitHub ↗
(z, up, pos)

Source from the content-addressed store, hash-verified

126 return x / np.linalg.norm(x)
127
128def viewmatrix(z, up, pos):
129 vec2 = normalize(z)
130 vec1_avg = up
131 vec0 = normalize(np.cross(vec1_avg, vec2))
132 vec1 = normalize(np.cross(vec2, vec0))
133 m = np.stack([vec0, vec1, vec2, pos], 1)
134 return m
135
136def ptstocam(pts, c2w):
137 tt = np.matmul(c2w[:3,:3].T, (pts-c2w[:3,3])[...,np.newaxis])[...,0]

Callers 2

poses_avgFunction · 0.85
render_path_spiralFunction · 0.85

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected