warping.warp

Computes diffeomorphism of 2D images in pytorch

Module Contents

Functions

scalar_field_modes(n, m, dtype=torch.float64, device=’cpu’)

sqrt(1 / Energy per mode) and the modes

scalar_field(n, m, device=’cpu’)

random scalar field of size nxn made of the first m modes

deform(image, T, cut, interp=’linear’)

  1. Sample a displacement field tau: R2 -> R2, using tempertature T and cutoff cut

remap(a, dx, dy, interp)

param a

Tensor of shape […, y, x]

temperature_range(n, cut)

Define the range of allowed temperature

typical_displacement(T, cut, n)

warping.warp.scalar_field_modes(n, m, dtype=torch.float64, device='cpu')

sqrt(1 / Energy per mode) and the modes

warping.warp.scalar_field(n, m, device='cpu')

random scalar field of size nxn made of the first m modes

warping.warp.deform(image, T, cut, interp='linear')
  1. Sample a displacement field tau: R2 -> R2, using tempertature T and cutoff cut

2. Apply tau to image :param img: square image(s) […, y, x] :param T: temperature :param cut: high frequency cutoff

warping.warp.remap(a, dx, dy, interp)
Parameters
  • a – Tensor of shape […, y, x]

  • dx – Tensor of shape [y, x]

  • dy – Tensor of shape [y, x]

  • interp – interpolation method

warping.warp.temperature_range(n, cut)

Define the range of allowed temperature for given image size and cut.

warping.warp.typical_displacement(T, cut, n)