:param rotation: (yaw, pitch, roll) in degree :return: general rotational matrix refer this: https://en.wikipedia.org/wiki/Rotation_matrix#General_rotations
(rotation)
| 1 | import numpy as np |
| 2 | |
| 3 | def getRotMatrix(rotation): |
| 4 | """ |
| 5 | :param rotation: (yaw, pitch, roll) in degree |
| 6 | :return: general rotational matrix |
| 7 | refer this: https://en.wikipedia.org/wiki/Rotation_matrix#General_rotations |
| 8 | """ |
| 9 | yaw, pitch, roll = (rotation / 180) * np.pi |
| 10 | |
| 11 | Rz = np.array([[np.cos(yaw), -np.sin(yaw), 0], |
| 12 | [np.sin(yaw), np.cos(yaw), 0], |
| 13 | [0, 0, 1]]) |
| 14 | Ry = np.array([[np.cos(pitch), 0, np.sin(pitch)], |
| 15 | [0, 1, 0], |
| 16 | [-np.sin(pitch), 0, np.cos(pitch)]]) |
| 17 | Rx = np.array([[1, 0, 0], |
| 18 | [0, np.cos(roll), -np.sin(roll)], |
| 19 | [0, np.sin(roll), np.cos(roll)]]) |
| 20 | |
| 21 | return Rz @ Ry @ Rx |
| 22 | |
| 23 | |
| 24 | def Pixel2LatLon(equirect): |
no outgoing calls
no test coverage detected