pycvcam.core.TransformComposition._inverse_transform#

TransformComposition._inverse_transform(points, *, dx=False, dp=False, list_kwargs=None)[source]#

Apply the inverse of the composed transformation to the given points.

This method applies the inverse of the individual transformations sequentially to the input points in reverse order, and computes the Jacobian matrices using the chain rule of differentiation.

Parameters:
  • points (ArrayLike) – The input points to be transformed. Shape (n_points, output_dim).

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

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

  • list_kwargs (Optional[List[Dict[str, Any]]], optional) – A list of dictionaries containing additional keyword arguments for each individual transformation. Default is None. If provided, the length of the list must be equal to the number of transformations in the composition, and each dictionary will be passed as keyword arguments to the corresponding transformation in reverse order in the sequence.

Returns:

A tuple containing:

  • transformed_points: The transformed points of shape (n_points, input_dim).

  • jacobian_dx: The Jacobian matrix with respect to the input points of shape (n_points, input_dim, output_dim) if dx is True, otherwise None.

  • jacobian_dp: The Jacobian matrix with respect to the parameters of the transformation of shape (n_points, input_dim, n_params) if dp is True, otherwise None.

Return type:

Tuple[numpy.ndarray, Optional[numpy.ndarray], Optional[numpy.ndarray]]