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

Function process_poses_rotmat

dataset_loaders/cambridge_scenes.py:33–45  ·  view source on GitHub ↗

processes the position + quaternion raw pose from dataset to position + rotation matrix :param poses_in: N x 7 :param rot_mat: N x 3 x 3 :return: processed poses N x 12

(poses_in, rot_mat)

Source from the content-addressed store, hash-verified

31 return q
32
33def process_poses_rotmat(poses_in, rot_mat):
34 """
35 processes the position + quaternion raw pose from dataset to position + rotation matrix
36 :param poses_in: N x 7
37 :param rot_mat: N x 3 x 3
38 :return: processed poses N x 12
39 """
40
41 poses = np.zeros((poses_in.shape[0], 3, 4))
42 poses[:,:3,:3] = rot_mat
43 poses[...,:3,3] = poses_in[:, :3]
44 poses = poses.reshape(poses_in.shape[0], 12)
45 return poses
46
47from torchvision.datasets.folder import default_loader
48def load_image(filename, loader=default_loader):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected