pycvcam.Cv2Extrinsic._transform#
- Cv2Extrinsic._transform(world_points, *, dx=False, dp=False)[source]#
Compute the transformation from the
world_pointsto thenormalized_points.Lets consider
world_pointsin the global coordinate system \(\vec{X}_w = (X_w, Y_w, Z_w)\), the correspondingnormalized_pointsin the camera normalized coordinate system are given \(\vec{x}_n\) can be optained by :\[\vec{X}_c = R \cdot \vec{X}_w + T\]\[\vec{x}_n = \frac{\vec{X}_c}{Z_c}\]where \(R\) is the rotation matrix, \(T\) is the translation vector, and \(Z_c\) is the depth of the point in the camera coordinate system.
The jacobians with respect to the extrinsic parameters is an array with shape (n_points, 2, 6), where the last dimension contains the jacobian with respect to the rotation vector and translation vector. The jacobian with respect to the world points is an array with shape (n_points, 2, 3).
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 inputworld_pointsis (n_points, 3) before calling this method.- Parameters:
world_points (numpy.ndarray) – Array of world 3dpoints to be transformed with shape (n_points, 3).
dx (bool, optional) – If True, the Jacobian of the normalized points with respect to the input 3D world points is computed. Default is False. The output will be a 2D array of shape (n_points, 2, 3).
dp (bool, optional) – If True, the Jacobian of the normalized points with respect to the pose parameters is computed. Default is False. The output will be a 2D array of shape (n_points, 2, 6).
- Returns:
normalized_points (numpy.ndarray) – The normalized points in camera normalized coordinates. Shape (n_points, 2).
jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the normalized points with respect to the world points. Shape (n_points, 2, 3) if dx is True, otherwise None.
jacobian_dp (Optional[numpy.ndarray]) – The jacobian of the normalized points with respect to the extrinsic parameters. Shape (n_points, 2, 6) if dp is True, otherwise None.
- Return type: