TransformMasked Class#
Note
See the main pycvcam.Transform documentation for more details on how to use transformations.
TransformMasked Class#
- class TransformMasked(transform, mask)[source]#
A class representing a reduced-parameter version of a transformation where some parameters are fixed to constant values.
Consider a transformation \(T\) with \(n\) parameters. In some applications, only some of these parameters are relevant, while others are fixed to constant values. In this case, it is more convenient to work with a reduced-parameter version of the transformation where the irrelevant parameters are masked out and replaced by constants.
Important
Note that modifying the parameters or constants of the individual transformations after creating the masked transformation will affect the behavior of the masked transformation, since the masked transformation does not create independent copies of the parameters and constants.
Moreover, modifying the parameters or constants of the masked transformation will modify the parameters and constants of the original transformation, since they are shared.
Warning
If the number of parameters of the original transformation changes, the masked transformation will become broken since the mask will no longer be compatible with the original transformation.
- Parameters:
transform (
Transform) – The original transformation from which the masked representation is derived.mask (ArrayLike) – A boolean array of shape (n,) where n is the number of parameters of the original transformation. True values indicate the parameters to be included in the masked transformation, while False values indicate the parameters to be fixed to constants.
Accessing sub-Transform object#
The following attributes and methods are available for accessing the individual Transform object that make up a TransformMasked
[Get] The original transformation from which the masked representation is derived. |
Modified methods of TransformMasked objects#
The following methods are modified for TransformMasked objects to handle the composition of multiple transformations:
Create a copy of the TransformMasked object by copying the base transformations and the mask. |
|
Create a TransformMasked object from a dictionary. |
|
Serialize the transformation masked to a dictionary. |
|
String representation of the Transform class. |
Performing transformations with TransformMasked objects#
|
Apply the masked transformation to a set of input points. |
|
Apply the inverse of the masked transformation to a set of input points. |