pycvcam.Extrinsic.compute_rays#
- Extrinsic.compute_rays(normalized_points, *, transpose=False, _skip=False, **kwargs)[source]#
Compute rays originating from the camera passing through given normalized points.
In a camera model, each point in the image corresponds to a ray in 3D space. This method computes the rays in world coordinates corresponding to the provided normalized camera coordinates.
Each ray is represented by its origin (camera center) and direction in world coordinates. The output is concatenated as a single array with the last dimension of size 6: (origin_x, origin_y, origin_z, dir_x, dir_y, dir_z).
- Parameters:
normalized_points (ArrayLike) – Normalized points in the camera coordinate system. Shape (…, 2).
transpose (bool, optional) – If True, the input and output arrays are transposed to shape (2, …) for inputs and (6, …) for outputs. Default is False.
_skip (bool, optional) – If True, skip internal checks and transformations for efficiency. Default is False.
**kwargs (dict) – Additional arguments to be passed to the underlying transformation method.
- Returns:
Rays in world coordinates, with shape (…, 6), where the last dimension encodes the ray origin and direction.
- Return type:
Notes
This method relies on the subclass implementation of
_compute_raysto define how normalized points map to rays in the world frame.Useful for ray tracing, 3D reconstruction, or geometric computations involving camera rays.