pycvcam.SkewIntrinsic._inverse_transform#

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

Apply the inverse of the intrinsic projection from image pixel coordinates to distorted normalized coordinates.

Let \(\vec{x}_i = (x_i, y_i)\) be a point in image coordinates. The corresponding distorted normalized camera point \(\vec{x}_d\) is obtained using the intrinsic parameters \((f_x, f_y, c_x, c_y)\):

\[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 Jacobian with respect to the distorted points has shape (n_points, 2, 2) and corresponds to

\[\frac{\partial \vec{x}_d}{\partial \vec{x}_i}\]

The Jacobian with respect to the intrinsic parameters has shape (n_points, 2, 5) and corresponds to

\[\frac{\partial \vec{x}_d}{\partial (f_x, f_y, c_x, c_y, s)}\]

Warning

This method is intended for internal use. It should normally be called through pycvcam.core.Transform.transform().

Parameters:
  • distorted_points (numpy.ndarray) – Distorted normalized camera coordinates. Shape (n_points, 2).

  • dx (bool, optional) – If True, compute the Jacobian with respect to the input points.

  • dp (bool, optional) – If True, compute the Jacobian with respect to the intrinsic parameters.

  • image_points (ndarray)

Returns:

  • image_points (numpy.ndarray) – Image coordinates computed from the intrinsic projection. Shape (n_points, 2).

  • jacobian_dx (Optional[numpy.ndarray]) – Jacobian of the image points with respect to the distorted points. Shape (n_points, 2, 2) if dx=True, otherwise None.

  • jacobian_dp (Optional[numpy.ndarray]) – Jacobian of the image points with respect to the intrinsic parameters. Shape (n_points, 2, 5) if dp=True, otherwise None.

Return type:

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