pycvcam.Cv2Extrinsic._inverse_transform#
- Cv2Extrinsic._inverse_transform(normalized_points, *, dx=False, dp=False, depth=None)[source]#
Compute the transformation from the
normalized_pointsto theworld_points.Lets consider
normalized_pointsin the camera normalized coordinate system \(\vec{x}_n = (x_n, y_n)\), the correspondingworld_pointsin the global coordinate system are given \(\vec{X}_w\) can be optained by :\[\vec{X}_c = \vec{x}_n \cdot Z_c\]\[\vec{X}_w = R^{-1} \cdot (\vec{X}_c - T)\]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, 3, 6), where the last dimension contains the jacobian with respect to the rotation vector and translation vector. The jacobian with respect to the normalized points is an array with shape (n_points, 3, 2).
Warning
This method is not intended to be used directly, but rather through the
pycvcam.core.Transform.inverse_transform()method. Please ensure, the shape of the inputnormalized_pointsis (n_points, 2) before calling this method, and same for the depth parameter if provided.- Parameters:
normalized_points (numpy.ndarray) – Array of normalized points in camera normalized coordinates to be transformed with shape (n_points, 2).
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).
depth (Optional[numpy.ndarray], optional) – The depth of the points in the world coordinate system. If None, the depth is assumed to be 1.0 for all points. The shape should be (…,) if provided, and it should match the number of points in the normalized_points array.
- Returns:
world_points (numpy.ndarray) – The transformed world 3D points. It will be a 2D array of shape (n_points, 3).
jacobian_dx (Optional[numpy.ndarray]) – The jacobian of the world points with respect to the normalized points. Shape (n_points, 3, 2) if dx is True, otherwise None.
jacobian_dp (Optional[numpy.ndarray]) – The jacobian of the world points with respect to the extrinsic parameters. Shape (n_points, 3, 6) if dp is True, otherwise None.
- Return type: