MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / rotation_angle_batch

Function rotation_angle_batch

benchmark/utils/image_ranking.py:17–26  ·  view source on GitHub ↗
(R1, R2)

Source from the content-addressed store, hash-verified

15
16
17def rotation_angle_batch(R1, R2):
18 R1_t = np.transpose(R1, (0, 2, 1))[:, np.newaxis, :, :]
19 R2_b = R2[np.newaxis, :, :, :]
20 R_mult = np.matmul(R1_t, R2_b)
21 trace_vals = R_mult[..., 0, 0] + R_mult[..., 1, 1] + R_mult[..., 2, 2]
22 val = (trace_vals - 1) / 2
23 val = np.clip(val, -1.0, 1.0)
24 angle_rad = np.arccos(val)
25 angle_deg = np.degrees(angle_rad)
26 return angle_deg / 180.0
27
28
29def extrinsic_distance_batch(extrinsics, lambda_t=1.0):

Callers 1

extrinsic_distance_batchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected