pycvcam.ZernikeDistortion._inverse_transform#

ZernikeDistortion._inverse_transform(distorted_points, *, dx=False, dp=False, **kwargs)[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 obtained by an iterative algorithm that finds the points \(\vec{x}_n\).

See also

The initial guess is setted to \(\vec{x}_{n} = \vec{x}_{d} - U(\vec{x}_{d})`\), where \(U(\vec{x}_{d})\) is the distortion field applied to the distorted 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 image_points is (n_points, 2) before calling this method.

The jacobians with respect to the distortion parameters and the distorted points are always None, since it is an iterative algorithm.

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

  • **kwargs (dict, optional) – Additional keyword arguments to pass to the iterative algorithm. Not used in this implementation.

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]) – Always None, since the jacobian with respect to the distorted points is not computed by an iterative algorithm.

  • jacobian_dp (Optional[numpy.ndarray]) – Always None, since the jacobian with respect to the distortion parameters is not computed by an iterative algorithm.

Return type:

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