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

Function compute_frustums_overlap

dataset_loaders/load_Cambridge.py:83–97  ·  view source on GitHub ↗
(pose0, pose1, sampling_frustum, K, x_res, y_res)

Source from the content-addressed store, hash-verified

81 return X0
82
83def compute_frustums_overlap(pose0, pose1, sampling_frustum, K, x_res, y_res):
84 R0 = pose0[0:3, 0:3]
85 t0 = pose0[0:3, 3]
86 R1 = pose1[0:3, 0:3]
87 t1 = pose1[0:3, 3]
88
89 R10 = np.dot(R1.T, R0)
90 t10 = np.dot(R1.T, t0 - t1)
91
92 _P = np.dot(R10, sampling_frustum.T).T + t10
93 p = np.dot(K, _P.T).T
94 pn = p[:, 2]
95 p = np.divide(p, pn[:, None])
96 res = np.apply_along_axis(is_inside_frustum, 1, p, x_res, y_res)
97 return np.sum(res) / float(res.shape[0])
98
99def perturb_rotation(c2w, theta, phi, psi=0):
100 last_row = np.tile(np.array([0, 0, 0, 1]), (1, 1)) # (N_images, 1, 4)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected