(cartesian_points)
| 558 | # pointcloud Lookup |
| 559 | |
| 560 | def angular_from_cartesian(cartesian_points): |
| 561 | r = np.sqrt(np.sum(cartesian_points**2, axis=1)) + 1e-10 # hack: avoid division by zero |
| 562 | theta = np.arccos(cartesian_points[:, 2] / r) |
| 563 | phi = np.arctan2(cartesian_points[:, 1], cartesian_points[:, 0]) |
| 564 | angular_points = np.stack([theta, r, phi], axis=1) |
| 565 | return angular_points |
| 566 | |
| 567 | def get_sampling_coordinates(angular_points, img_shape, z_rotate=0): |
| 568 | image_height, image_width = img_shape |
no outgoing calls
no test coverage detected