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

Function viewmatrix

dataset_loaders/cambridge_scenes.py:70–76  ·  view source on GitHub ↗
(z, up, pos)

Source from the content-addressed store, hash-verified

68 return x / np.linalg.norm(x)
69
70def viewmatrix(z, up, pos):
71 vec2 = normalize(z)
72 vec1_avg = up
73 vec0 = normalize(np.cross(vec1_avg, vec2))
74 vec1 = normalize(np.cross(vec2, vec0))
75 m = np.stack([vec0, vec1, vec2, pos], 1)
76 return m
77
78def normalize_recenter_pose(poses, sc, hwf):
79 ''' 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