MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / viewmatrix

Function viewmatrix

dataset_loaders/seven_scenes.py:150–156  ·  view source on GitHub ↗
(z, up, pos)

Source from the content-addressed store, hash-verified

148 return x / np.linalg.norm(x)
149
150def viewmatrix(z, up, pos):
151 vec2 = normalize(z)
152 vec1_avg = up
153 vec0 = normalize(np.cross(vec1_avg, vec2))
154 vec1 = normalize(np.cross(vec2, vec0))
155 m = np.stack([vec0, vec1, vec2, pos], 1)
156 return m
157
158def normalize_recenter_pose(poses, sc, hwf):
159 ''' normalize xyz into [-1, 1], and recenter pose '''

Callers 1

normalize_recenter_poseFunction · 0.70

Calls 1

normalizeFunction · 0.70

Tested by

no test coverage detected