pycvcam.OrthographicExtrinsic._transform#

OrthographicExtrinsic._transform(world_points, *, dx=False, dp=False)[source]#

Compute the transformation from 3D world points to 2D normalized camera points.

The transformation consists of a change of reference frame followed by perspective normalization:

  1. Transform world to camera coordinates:

\[\vec{X}_c = R \cdot \vec{X}_w + T\]
  1. Normalize camera coordinates:

\[\vec{x}_n = (X_c, Y_c)\]

where:

  • \(\vec{X}_w\) : 3D point in the world coordinate system.

  • \(\vec{X}_c\) : 3D point in the camera coordinate system.

  • \(R\) : 3×3 rotation matrix.

  • \(T\) : 3×1 translation vector.

  • \(\vec{x}_n\) : normalized 2D point in the camera plane.

Warning

This method is intended to be used internally by pycvcam.Transform.transform(). Ensure world_points has shape (n_points, 3) before calling.

Parameters:
  • world_points (numpy.ndarray) – Input 3D points in world coordinates. Shape (n_points, 3).

  • dx (bool, optional) – If True, compute the Jacobian with respect to the input 3D points. Default is False.

  • dp (bool, optional) – If True, compute the Jacobian with respect to the extrinsic parameters. Default is False.

Returns:

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

  • jacobian_dx (Optional[numpy.ndarray]) – Jacobian of normalized points with respect to world points. Shape (n_points, 2, 3) if dx is True, else None.

  • jacobian_dp (Optional[numpy.ndarray]) – Jacobian of normalized points with respect to extrinsic parameters. Shape (n_points, 2, 6) if dp is True, else None.

Return type:

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

Jacobians#

  • dx: Jacobian of normalized points with respect to world points. Shape (n_points, 2, 3).

  • dp: Jacobian of normalized points with respect to extrinsic parameters (rotation vector + translation vector). Shape (n_points, 2, 6).