2.2. distoptica.apply_coord_transform_right_inverse

apply_coord_transform_right_inverse(q_x=((0.5,),), q_y=((0.5,),), coord_transform_params=None, device=None, least_squares_alg_params=None, skip_validation_and_conversion=False)[source]

Apply the right inverse of a coordinate transformation to a set of coordinates of points in a distorted image.

The current Python function applies the right inverse of a coordinate transformation to a set of fractional coordinates of points in a distorted image. For a discussion on fractional coordinates of points in distorted images, see the summary documentation for the class distoptica.DistortionModel. For a discussion on right inverses of coordinate transformations, see the summary documentation for the classes distoptica.DistortionModel, distoptica.CoordTransformParams, and distoptica.StandardCoordTransformParams.

Parameters:
q_xtorch.Tensor (float, ndim=2), optional

The set of fractional horizontal coordinates of the points in the distorted image, for which to apply the right inverse of the coordinate transformation.

q_ytorch.Tensor (float, shape=``q_x.shape``), optional

The set of fractional vertical coordinates of the points in the distorted image, for which to apply the right inverse of the coordinate transformation.

coord_transform_paramsdistoptica.CoordTransformParams, optional

The parameters defining the coordinate transformation, of which the right inverse is to be applied.

devicetorch.device | None, optional

This parameter specifies the device to be used to perform computationally intensive calls to PyTorch functions. If device is of the type torch.device, then device represents the device to be used. If device is set to None and a GPU device is available, then a GPU device is to be used. Otherwise, the CPU is used.

least_squares_alg_paramsdistoptica.LeastSquaresAlgParams | None, optional

If least_squares_alg_params is set to None, then the parameters of the least-squares algorithm to be used to apply the right inverse of the coordinate transformation are those specified by distoptica.LeastSquaresAlgParams(). Otherwise, least_squares_alg_params specifies the parameters of the least-squares algorithm to be used.

skip_validation_and_conversionbool, optional

If skip_validation_and_conversion is set to False, then validations and conversions are performed on the above parameters.

Otherwise, if skip_validation_and_conversion is set to True, no validations and conversions are performed on the above parameters. This option is desired primarily when the user wants to avoid potentially expensive validation and/or conversion operations.

Returns:
u_xtorch.Tensor (float, shape=``q_x.shape``)

The set of fractional horizontal coordinates resulting from the application of the right inverse to the coordinate transformation. For every row index i and column index j`, the coordinate pair ``(q_x[i, j], q_y[i, j]) maps to the horizontal coordinate u_x[i, j] via the corresponding component of the right inverse of the coordinate transformation.

u_ytorch.Tensor (float, shape=``q_y.shape``)

The set of fractional vertical coordinates resulting from the application of the right inverse to the coordinate transformation. For every row index i and column index j`, the coordinate pair ``(q_x[i, j], q_y[i, j]) maps to the vertical coordinate u_y[i, j] via the corresponding component of the right inverse of the coordinate transformation.

convergence_maptorch.Tensor (bool, shape=``q_x.shape``)

The convergence map of the iterative algorithm used to apply the right inverse of the coordinate transformation. For every row index i and column index j`, ``convergence_map[i, j] evaluates to False if the iterative algorithm used to calculate u_x and u_y does not converge within the error tolerance for the elements u_x[i, j] and u_y[i, j], and evaluates to True otherwise.