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

Function render_path_spiral

dataset_loaders/load_7Scenes.py:199–208  ·  view source on GitHub ↗
(c2w, up, rads, focal, zdelta, zrate, rots, N)

Source from the content-addressed store, hash-verified

197 return poses_centered, pose_avg #np.linalg.inv(pose_avg_homo)
198
199def render_path_spiral(c2w, up, rads, focal, zdelta, zrate, rots, N):
200 render_poses = []
201 rads = np.array(list(rads) + [1.])
202 hwf = c2w[:,4:5] # it's empty here...
203
204 for theta in np.linspace(0., 2. * np.pi * rots, N+1)[:-1]:
205 c = np.dot(c2w[:3,:4], np.array([np.cos(theta), -np.sin(theta), -np.sin(theta*zrate), 1.]) * rads)
206 z = normalize(c - np.dot(c2w[:3,:4], np.array([0,0,-focal, 1.])))
207 render_poses.append(np.concatenate([viewmatrix(z, up, c), hwf], 1))
208 return render_poses
209
210def generate_render_pose(poses, bds):
211 idx = np.random.choice(poses.shape[0])

Callers 1

generate_render_poseFunction · 0.70

Calls 2

normalizeFunction · 0.70
viewmatrixFunction · 0.70

Tested by

no test coverage detected