2.1. distoptica.apply_coord_transform
- apply_coord_transform(u_x=((0.5,),), u_y=((0.5,),), coord_transform_params=None, device=None, skip_validation_and_conversion=False)[source]
Apply a coordinate transformation to a set of coordinates of points in an undistorted image.
The current Python function applies a coordinate transformation to a set of fractional coordinates of points in an undistorted image. For a discussion on fractional coordinates of points in undistorted images, see the summary documentation for the class
distoptica.DistortionModel. For a discussion on coordinate transformations, see the summary documentation for the classesdistoptica.DistortionModel,distoptica.CoordTransformParams, anddistoptica.StandardCoordTransformParams.- Parameters:
- u_xtorch.Tensor (float, ndim=2), optional
The set of fractional horizontal coordinates of the points in the undistorted image, for which to apply the coordinate transformation.
- u_ytorch.Tensor (float, shape=``u_x.shape``), optional
The set of fractional vertical coordinates of the points in the undistorted image, for which to apply the coordinate transformation.
- coord_transform_params
distoptica.CoordTransformParams, optional The parameters defining the coordinate transformation to apply.
- 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.- 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:
- q_xtorch.Tensor (float, shape=``u_x.shape``)
The set of fractional horizontal coordinates resulting from the application of the coordinate transformation. For every row index
iand column indexj`, the coordinate pair ``(u_x[i, j], u_y[i, j])maps to the horizontal coordinateq_x[i, j]via the corresponding component of the coordinate transformation.- q_ytorch.Tensor (float, shape=``u_y.shape``)
The set of fractional vertical coordinates resulting from the application of the coordinate transformation. For every row index
iand column indexj`, the coordinate pair ``(u_x[i, j], u_y[i, j])maps to the vertical coordinateq_y[i, j]via the corresponding component of the coordinate transformation.