pysdic.PerspectiveExtrinsic.compute_rays#
- PerspectiveExtrinsic.compute_rays(normalized_points)[source]#
Compute the rays of the camera passing through the given normalized points.
For a perspective projection, all the rays start from the camera center and pass through the normalized points placed on the plane \(Z_c = 1\). Each ray is represented by its origin and its unit direction in world coordinates:
The origin is the camera center:
\[\vec{O}_w = - R^T \cdot T\]The direction is the normalized point on the plane \(Z_c = 1\) expressed in world coordinates:
\[\begin{split}\vec{d}_w = \frac{R^T \vec{X}_n}{\| R^T \vec{X}_n \|} \quad \text{with} \quad \vec{X}_n = \begin{bmatrix} x_n \\ y_n \\ 1 \end{bmatrix}\end{split}\]- Parameters:
normalized_points (ArrayLike) – Normalized points in the camera coordinate system. Shape
(..., 2).- Returns:
Rays in world coordinates with shape
(..., 6)(same batch shape as the input points), where the last dimension encodes the ray origin(x, y, z)and the unit direction(dx, dy, dz).- Return type: