PanTiltRotate#
- class deepinv.transform.projective.PanTiltRotate(n_trans=1, theta_max=180.0, theta_z_max=180.0, zoom_factor_min=0.5, shift_max=1.0, skew_max=50.0, x_stretch_factor_min=0.5, y_stretch_factor_min=0.5, padding='reflection', interpolation='bilinear', device='cpu', rng=None)[source]#
Bases:
Homography
Random 3D camera rotation image transformations using projective transformation framework.
Special case of homography which corresponds to the actions of the 3D camera rotation, or “pan+tilt+rotate” subgroup from Wang et al. “Perspective-Equivariant Imaging: an Unsupervised Framework for Multispectral Pansharpening” https://arxiv.org/abs/2403.09327
The transformations simulate panning, tilting or rotating the camera, leading to a “perspective” effect. The subgroup is isomorphic to SO(3).
See
deepinv.transform.Homography
for more details.Generates
n_trans
random transformations concatenated along the batch dimension.
- Example:
Apply a random pan+tilt+rotate transformation:
>>> from deepinv.transform.projective import PanTiltRotate >>> x = torch.randn(1, 3, 16, 16) # Random 16x16 image >>> transform = PanTiltRotate(n_trans = 1) >>> x_T = transform(x)
- Parameters:
theta_max (float) – Maximum pan+tilt angle in degrees, defaults to 180.
theta_z_max (float) – Maximum 2D z-rotation angle in degrees, defaults to 180.
padding (str) – kornia padding mode, defaults to “reflection”
interpolation (str) – kornia or PIL interpolation mode, defaults to “bilinear”
device (str) – torch device, defaults to “cpu”.
n_trans (int) – number of transformed versions generated per input image, defaults to 1.
rng (torch.Generator) – random number generator, if None, use torch.Generator(), defaults to None