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 classesdistoptica.DistortionModel,distoptica.CoordTransformParams, anddistoptica.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_params
distoptica.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
deviceis of the typetorch.device, thendevicerepresents the device to be used. Ifdeviceis set toNoneand a GPU device is available, then a GPU device is to be used. Otherwise, the CPU is used.- least_squares_alg_params
distoptica.LeastSquaresAlgParams| None, optional If
least_squares_alg_paramsis set toNone, then the parameters of the least-squares algorithm to be used to apply the right inverse of the coordinate transformation are those specified bydistoptica.LeastSquaresAlgParams(). Otherwise,least_squares_alg_paramsspecifies the parameters of the least-squares algorithm to be used.- skip_validation_and_conversionbool, optional
If
skip_validation_and_conversionis set toFalse, then validations and conversions are performed on the above parameters.Otherwise, if
skip_validation_and_conversionis set toTrue, 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
iand column indexj`, the coordinate pair ``(q_x[i, j], q_y[i, j])maps to the horizontal coordinateu_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
iand column indexj`, the coordinate pair ``(q_x[i, j], q_y[i, j])maps to the vertical coordinateu_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
iand column indexj`, ``convergence_map[i, j]evaluates toFalseif the iterative algorithm used to calculateu_xandu_ydoes not converge within the error tolerance for the elementsu_x[i, j]andu_y[i, j], and evaluates toTrueotherwise.