(
points: Float[Tensor, "*#batch dim"],
extrinsics: Float[Tensor, "*#batch dim+1 dim+1"],
intrinsics: Float[Tensor, "*#batch dim dim"],
epsilon: float = 1e-5,
)
| 59 | |
| 60 | |
| 61 | def project( |
| 62 | points: Float[Tensor, "*#batch dim"], |
| 63 | extrinsics: Float[Tensor, "*#batch dim+1 dim+1"], |
| 64 | intrinsics: Float[Tensor, "*#batch dim dim"], |
| 65 | epsilon: float = 1e-5, |
| 66 | ) -> tuple[ |
| 67 | Float[Tensor, "*batch dim-1"], # xy coordinates |
| 68 | Bool[Tensor, " *batch"], # whether points are in front of the camera |
| 69 | ]: |
| 70 | points = homogenize_points(points) |
| 71 | points = transform_world2cam(points, extrinsics)[..., :-1] |
| 72 | in_front_of_camera = points[..., -1] >= 0 |
| 73 | return project_camera_space(points, intrinsics, epsilon=epsilon), in_front_of_camera |
| 74 | |
| 75 | |
| 76 | def unproject( |
nothing calls this directly
no test coverage detected