pycvcam.NoDistortion#

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

Bases: Distortion

Subclass of the pycvcam.core.Distortion class that represents a no distortion model.

Note

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

The NoDistortion model is a special case of the distortion transformation where no distortion transformations are applied.

Lets consider normalized_points in the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the corresponding distorted_points in the camera normalized coordinate system are given by \(\vec{x}_d = (x_n, y_n)\). Simply applying an identity transformation, which means that the distorted points are equal to the normalized points.

Parameters:
  • parameters (None)

  • constants (None)

_abc_impl = <_abc._abc_data object>#
_constants#
_inverse_transform(distorted_points, *, dx=False, dp=False)[source]#

Compute the inverse transformation from the distorted_points to the normalized_points.

Lets consider distorted_points in the camera normalized coordinate system \(\vec{x}_d = (x_d, y_d)\), the corresponding normalized_points in the camera normalized coordinate system are given by \(\vec{x}_n = (x_d, y_d)\). Simply applying an identity transformation, which means that the normalized points are equal to the distorted points.

The jacobians with respect to the distortion 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 distorted points is set to the identity matrix, as the distorted 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 distorted_points is (n_points, 2) before calling this method.

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

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

  • dp (bool, optional) – If True, the jacobian with respect to the distortion 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 components of the image points. Shape (n_points, 2).

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

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

Return type:

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

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

Compute the transformation from the normalized_points to the distorted_points.

Lets consider normalized_points in the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the corresponding distorted_points in the camera normalized coordinate system are given by \(\vec{x}_d = (x_n, y_n)\). Simply applying an identity transformation, which means that the distorted points are equal to the normalized points.

The jacobians with respect to the distortion 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, as the distorted 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 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 distortion parameters is computed. Default is False

Returns:

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

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

  • jacobian_dp (Optional[numpy.ndarray]) – The jacobian of the distorted points with respect to the distortion 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 distortion model.

is_set()[source]#

Always returns True, as the no distortion 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 distortion model.