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

Function compute_frustums_overlap

dataset_loaders/load_7Scenes.py:101–115  ·  view source on GitHub ↗
(pose0, pose1, sampling_frustum, K, x_res, y_res)

Source from the content-addressed store, hash-verified

99 return X0
100
101def compute_frustums_overlap(pose0, pose1, sampling_frustum, K, x_res, y_res):
102 R0 = pose0[0:3, 0:3]
103 t0 = pose0[0:3, 3]
104 R1 = pose1[0:3, 0:3]
105 t1 = pose1[0:3, 3]
106
107 R10 = np.dot(R1.T, R0)
108 t10 = np.dot(R1.T, t0 - t1)
109
110 _P = np.dot(R10, sampling_frustum.T).T + t10
111 p = np.dot(K, _P.T).T
112 pn = p[:, 2]
113 p = np.divide(p, pn[:, None])
114 res = np.apply_along_axis(is_inside_frustum, 1, p, x_res, y_res)
115 return np.sum(res) / float(res.shape[0])
116
117def perturb_rotation(c2w, theta, phi, psi=0):
118 last_row = np.tile(np.array([0, 0, 0, 1]), (1, 1)) # (N_images, 1, 4)

Callers 2

fetch_unique_view_indexFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected