darsia.BaseTransformation#
- class BaseTransformation[source]#
Bases:
ABCBase class for geometrical transformations of images.
Methods
call_array(x)Apply transformation to array.
fit(pts_src, pts_dst, **kwargs)Fit parameters of transformation.
inverse(x)Apply inverse transformation to array.
Apply inverse transformation to array.
set_dtype(pts_src, pts_dst)Set array input and output type for generalized perspective transformation.
set_parameters_as_vector(parameters)Set parameters of transformation as vector.
Attributes
Type of input for generalized perspective transformation
Type of output for generalized perspective transformation
Type of input arrays for generalized perspective transformation
Type of output arrays for generalized perspective transformation
- abstractmethod call_array(x)[source]#
Apply transformation to array.
- Parameters:
- x
np.ndarray Array to transform (type depends on input type of transformation).
- x
- Returns:
np.ndarrayTransformed array.
- abstractmethod fit(pts_src, pts_dst, **kwargs)[source]#
Fit parameters of transformation.
Required for parameter fitting through optimization.
- inverse(x)[source]#
Apply inverse transformation to array.
- Parameters:
- x
np.ndarray Array to transform (type depends on input type of transformation).
- x
- Returns:
np.ndarrayTransformed array.
- abstractmethod inverse_array(x)[source]#
Apply inverse transformation to array.
- Parameters:
- x
np.ndarray Array to transform (type depends on input type of transformation).
- x
- Returns:
np.ndarrayTransformed array.
- set_dtype(pts_src, pts_dst)[source]#
Set array input and output type for generalized perspective transformation.
- Parameters:
- pts_src
Union[darsia.Coordinate,darsia.Voxel,darsia.VoxelCenter] Source points.
- pts_dst
Union[darsia.Coordinate,darsia.Voxel,darsia.VoxelCenter] Target points.
- pts_src
- abstractmethod set_parameters_as_vector(parameters)[source]#
Set parameters of transformation as vector.
Required for parameter fitting through optimization.
- Parameters:
- parameters
np.ndarray Parameters of transformation.
- parameters
- input_array_dtype#
Type of input arrays for generalized perspective transformation
- input_dtype#
Type of input for generalized perspective transformation
- output_array_dtype#
Type of output arrays for generalized perspective transformation
- output_dtype#
Type of output for generalized perspective transformation