MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _construct_rotation_matrix

Function _construct_rotation_matrix

detrsmpl/data/datasets/pipelines/transforms.py:179–196  ·  view source on GitHub ↗

Construct the in-plane rotation matrix. Args: rot (float): Rotation angle (degree). size (int): The size of the rotation matrix. Candidate Values: 2, 3. Defaults to 3. Returns: rot_mat (np.ndarray([size, size]): Rotation matrix.

(rot, size=3)

Source from the content-addressed store, hash-verified

177
178
179def _construct_rotation_matrix(rot, size=3):
180 """Construct the in-plane rotation matrix.
181
182 Args:
183 rot (float): Rotation angle (degree).
184 size (int): The size of the rotation matrix.
185 Candidate Values: 2, 3. Defaults to 3.
186 Returns:
187 rot_mat (np.ndarray([size, size]): Rotation matrix.
188 """
189 rot_mat = np.eye(size, dtype=np.float32)
190 if rot != 0:
191 rot_rad = np.deg2rad(rot)
192 sn, cs = np.sin(rot_rad), np.cos(rot_rad)
193 rot_mat[0, :2] = [cs, -sn]
194 rot_mat[1, :2] = [sn, cs]
195
196 return rot_mat
197
198
199def _flip_smpl_pose(pose):

Callers 2

_rotate_joints_3dFunction · 0.85
_rotate_smpl_poseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected