pycvcam.NoExtrinsic#

class NoExtrinsic(parameters=None, constants=None)[source]#

Bases: Extrinsic

Subclass of the pycvcam.core.Extrinsic class that represents a no extrinsic model.

Note

This class represents the extrinsic transformation, which is the first step of the process from the world_points to the image_points.

The NoExtrinsic model is a special case of the extrinsic transformation where no extrinsic transformations are applied.

Lets consider world_points in the global coordinate system \(\vec{X}_w = (X_w, Y_w, Z_w)\), the corresponding normalized_points in the camera normalized coordinate system are given by \(\vec{x}_n = (X_w, Y_w)\). Simply ignoring the z-coordinate, which is always set to 1 for the normalization plane.

Parameters:
  • parameters (None)

  • constants (None)

_abc_impl = <_abc._abc_data object>#
_compute_rays(normalized_points)[source]#

Computes the rays from the camera to the scene for the no extrinsic model in the world coordinate system.

The ray structure is as follows:

  • The first 3 elements are the origin of the ray in the world coordinate system (the normalized points with z=1)

  • The last 3 elements are the direction of the ray in the world coordinate system, which is always (0, 0, 1) for the no extrinsic model. The direction vector is normalized.

Parameters:

normalized_points (numpy.ndarray) – The normalized points in the camera coordinate system. Shape (n_points, 2).

Returns:

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

Return type:

numpy.ndarray

_constants#
_inverse_transform(normalized_points, *, dx=False, dp=False)[source]#

Compute the inverse transformation from the normalized_points to the world_points.

Lets consider normalized_points in the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the corresponding world_points in the global coordinate system are given by \(\vec{X}_w = (x_n, y_n, 1)\). Simply adding a z-coordinate of 1 for the normalization plane.

The jacobians with respect to the extrinsic parameters is an empty array with shape (n_points, 2, 0), as there are no parameters to compute the jacobian for. The jacobian with respect to the normalized points is set to the identity matrix (for x and y), as the normalized points are equal to the world points.

Warning

This method is not intended to be used directly, but rather through the pycvcam.core.Transform.transform() method. Please ensure, the shape of the input normalized_points is (n_points, 2) before calling this method.

Parameters:
  • normalized_points (numpy.ndarray) – The normalized points in camera normalized coordinates to be transformed. Shape (n_points, 2).

  • dx (bool, optional) – If True, the jacobian with respect to the normalized points is computed. Default is False

  • dp (bool, optional) – If True, the jacobian with respect to the extrinsic parameters is computed. Default is False

Returns:

  • world_points (numpy.ndarray) – The world 3D points in global coordinates, which are equal to the normalized points with z=1. Shape (n_points, 3).

  • jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the world 3D points with respect to the normalized points. Shape (n_points, 3, 2) if dx is True, otherwise None.

  • jacobian_dp (Optional[numpy.ndarray]) – The jacobian of the world 3D points with respect to the extrinsic parameters. Shape (n_points, 3, 0) if dp is True, otherwise None.

Return type:

Tuple[ndarray, ndarray | None, ndarray | None]

_parameters#
_transform(world_points, *, dx=False, dp=False)[source]#

Compute the transformation from the world_points to the normalized_points.

Lets consider world_points in the global coordinate system \(\vec{X}_w = (X_w, Y_w, Z_w)\), the corresponding normalized_points in the camera normalized coordinate system are given by \(\vec{x}_n = (X_w, Y_w)\). Simply ignoring the z-coordinate, which is always set to 1 for the normalization plane.

The jacobians with respect to the extrinsic parameters is an empty array with shape (n_points, 2, 0), as there are no parameters to compute the jacobian for. The jacobian with respect to the world points is set to the identity matrix (for x and y) and zero for z, as the world points are equal to the normalized points.

Warning

This method is not intended to be used directly, but rather through the pycvcam.core.Transform.transform() method. Please ensure, the shape of the input world_points is (n_points, 3) before calling this method.

Parameters:
  • world_points (numpy.ndarray) – The world points in global coordinates to be transformed. Shape (n_points, 3).

  • dx (bool, optional) – If True, the jacobian with respect to the world points is computed. Default is False

  • dp (bool, optional) – If True, the jacobian with respect to the extrinsic parameters is computed. Default is False

Returns:

  • normalized_points (numpy.ndarray) – The normalized points in camera normalized coordinates, which are equal to the x and y componants of the world points. Shape (n_points, 2).

  • jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the normalized points with respect to the world points. Shape (n_points, 2, 3) if dx is True, otherwise None.

  • jacobian_dp (Optional[numpy.ndarray]) – The jacobian of the normalized points with respect to the extrinsic parameters. Shape (n_points, 2, 0) if dp is True, otherwise None.

Return type:

Tuple[ndarray, ndarray | None, ndarray | None]

property constants: None#

Always returns None, as there are no constants for the no extrinsic model.

is_set()[source]#

Always returns True, as the no extrinsic model is always set and does not require any parameters or constants.

Return type:

bool

property parameters: None#

Always returns None, as there are no parameters for the no extrinsic model.