pycvcam.core.Rays#

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

Bases: object

A class to represent a collection of rays in 3D space.

This class is returned by the compute_rays method of the pycvcam.core.Extrinsic class, which computes the rays in the world coordinate system for the given normalized points.

The rays are storred in a numpy array with shape (…, 6), where the last dimension represents the x, y, and z coordinates of the origin and the dx, dy, and dz components of the direction of the ray.

To view on the rays are available:

  • origins: The origins of the rays in the world coordinate system with shape (…, 3).

  • directions: The directions of the rays in the world coordinate system with shape (…, 3).

Note

If transpose is set to True during the transformation, the output rays will have shape (6, …) instead of (…, 6). Same for the origins and directions (i.e., shape (3, …) instead of (…, 3) respectively).

Parameters:
rays#

The rays in the world coordinate system. Shape (…, 6).

Type:

numpy.ndarray

transpose#

If True, the output rays will have shape (6, …) instead of (…, 6). True if set during the transformation, otherwise False.

Type:

bool, optional

property directions: ndarray#

Returns the directions of the rays in the world coordinate system.

Returns:

The directions of the rays in the world coordinate system. Shape (…, 3).

Return type:

numpy.ndarray

property origins: ndarray#

Returns the origins of the rays in the world coordinate system.

Returns:

The origins of the rays in the world coordinate system. Shape (…, 3).

Return type:

numpy.ndarray