Data Class Rays#

class Rays(rays, transpose=False)[source]#

Bases: object

Represents a collection of rays in 3D space.

This class is returned by the compute_rays method of pycvcam.core.Extrinsic. Each ray corresponds to a normalized camera point and is expressed in world coordinates.

The rays are stored in a NumPy array with shape (..., 6), where the last dimension encodes the ray’s origin and direction:

(…, 0:3) → origin (x, y, z) (…, 3:6) → direction (dx, dy, dz)

Parameters:
rays#

The array of rays in world coordinates. Shape (..., 6).

Type:

numpy.ndarray

transpose#

If True, the array has shape (6, ...) instead of (..., 6). This follows the transpose option passed during the transformation.

Type:

bool, optional

Notes

  • The properties origins and directions provide convenient access to the respective components of the rays.

  • When transpose=True, the returned origins and directions have shape (3, ...) instead of (..., 3).

property directions: ndarray#

The directions of the rays in world coordinates.

Returns:

Directions of the rays. Shape (..., 3) or (3, ...) if transpose=True.

Return type:

numpy.ndarray

property origins: ndarray#

The origins of the rays in world coordinates.

Returns:

Origins of the rays. Shape (..., 3) or (3, ...) if transpose=True.

Return type:

numpy.ndarray