pycvcam.SkewIntrinsic._inverse_transform#

SkewIntrinsic._inverse_transform(image_points, *, dx=False, dp=False)[source]#

Compute the inverse transformation from the image_points to the distorted_points.

Lets consider image_points in the image coordinate system \(\vec{x}_i = (x_i, y_i)\), the corresponding distorted_points in the camera normalized coordinate system are given by :

\[x_D = \frac{x_I - s \cdot \left(\frac{y_I - c_y}{f_y}\right) - c_x}{f_x}\]
\[y_D = \frac{y_I - c_y}{f_y}\]

The jacobians with respect to the intrinsic parameters is an array with shape (n_points, 2, 5), where the last dimension represents the parameters (fx, fy, cx, cy, s). The jacobian with respect to the image points is an array with shape (n_points, 2, 2).

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.

Parameters:
  • image_points (numpy.ndarray) – The image points in image coordinates to be transformed. Shape (n_points, 2).

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

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

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

Return type:

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