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)
| 177 | |
| 178 | |
| 179 | def _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 | |
| 199 | def _flip_smpl_pose(pose): |
no outgoing calls
no test coverage detected