pycvcam.Cv2Distortion._transform_opencv#

Cv2Distortion._transform_opencv(normalized_points, *, dx=False, dp=False)[source]#

Compute the transformation from the normalized_points to the distorted_points using OpenCV’s projectPoints function.

The equation used for the transformation is given in the main documentation of the class.

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.

The jacobian with respect to the normalized points is not computed in this case (always None).

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

  • opencv (bool, optional) – If True, the distortion transformation is achieved using the OpenCV function projectPoints. If False, the distortion transformation is achieved using the internal method. Default is False.

Returns:

  • distorted_points (numpy.ndarray) – The distorted points in camera normalized coordinates. Shape (n_points, 2).

  • jacobian_dx (Optional[numpy.ndarray]) – Always None, since the jacobian with respect to the normalized points is not computed with OpenCV.

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

Return type:

tuple[ndarray, ndarray | None, ndarray | None]