pydistort.NoDistortion#

class pydistort.NoDistortion[source]#

Class to represent the empty distortion model where the distorted_points are equal to the normalized_points.

The NoDistortionmodel is used when there is no distortion in the camera.

property Nparams: int#

Returns the number of parameters for the no distortion model, which is always 0.

_abc_impl = <_abc._abc_data object>#
_inverse_transform(distorted_points: ndarray, *, dx=True, dp=True) Tuple[ndarray, ndarray | None, ndarray | None][source]#

The inverse transform for the no distortion model is the same as the transform, since the distorted points are equal to the normalized points.

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

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

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

Returns:

  • normalized_points (numpy.ndarray) – The points in normalized coordinates, which are equal to the distorted points. Shape (Npoints, 2).

  • jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the normalized points with respect to the distorted points. Shape (Npoints, 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 if dp is True, otherwise None. Shape (Npoints, 2, Nparams) if dp is True, otherwise None.

_transform(normalized_points: ndarray, *, dx=True, dp=True) Tuple[ndarray, ndarray | None, ndarray | None][source]#

Where no distortion is applied, the normalized points are returned as distorted points.

The jacobians for the distortion parameters is an empty array, as there are no parameters to compute the jacobian for. The jacobian for the normalized points is set to the identity matrix, as the distorted points are equal to the normalized points.

Warning

This method is not designed to be used directly for the transformation of points. No checks are performed on the input points, so it is the user’s responsibility to ensure that the input points are valid.

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

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

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

Returns:

  • distorted_points (numpy.ndarray) – The points in distorted coordinates, which are equal to the normalized points. Shape (Npoints, 2).

  • jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the distorted points with respect to the normalized points. Shape (Npoints, 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 if dp is True, otherwise None. Shape (Npoints, 2, Nparams) if dp is True, otherwise None.

is_set() bool[source]#

Returns True, indicating that the no distortion model is always set.

property parameters: None#

Here always returns None since there are no parameters for the no distortion model. It cannot be set, as there are no parameters to set.