MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / quat2rot

Function quat2rot

utils/readgt_TUM.py:8–14  ·  view source on GitHub ↗
(qw, qx, qy, qz)

Source from the content-addressed store, hash-verified

6
7# The reconstructed pose of an image is specified as the projection from world to the camera coordinate
8def quat2rot(qw, qx, qy, qz):
9 R = np.array([
10 [1 - 2 * (qy**2 + qz**2), 2 * (qx * qy - qz * qw), 2 * (qx * qz + qy * qw)],
11 [2 * (qx * qy + qz * qw), 1 - 2 * (qx**2 + qz**2), 2 * (qy * qz - qx * qw)],
12 [2 * (qx * qz - qy * qw), 2 * (qy * qz + qx * qw), 1 - 2 * (qx**2 + qy**2)]
13 ])
14 return R
15
16def load_tum_gt(dataset_path):
17

Callers 1

load_tum_gtFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected