pycvcam.NoDistortion#
- class NoDistortion(parameters=None, constants=None)[source]#
Bases:
DistortionSubclass of the
pycvcam.core.Distortionclass that represents a no distortion model.Note
This class represents the distortion transformation, which is the middle step of the process from the
world_pointsto theimage_points.The
NoDistortionmodel is a special case of the distortion transformation where no distortion transformations are applied.Lets consider
normalized_pointsin the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the correspondingdistorted_pointsin 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_pointsto thenormalized_points.Lets consider
distorted_pointsin the camera normalized coordinate system \(\vec{x}_d = (x_d, y_d)\), the correspondingnormalized_pointsin 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 inputdistorted_pointsis (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:
- _parameters#
- _transform(normalized_points, *, dx=False, dp=False)[source]#
Compute the transformation from the
normalized_pointsto thedistorted_points.Lets consider
normalized_pointsin the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the correspondingdistorted_pointsin 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 inputnormalized_pointsis (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:
- property constants: None#
Always returns None, as there are no constants for the no distortion model.