spyrit.core.warp

This module contains classes that are used to warp images according to a deformation field. Let \(t_0 \in \mathbb{R}_+\), \(f(t_0, x, y): \mathbb{R}^2 \mapsto \mathbb{R}^2\) be a reference scene and \(u(t, x, y): \mathbb{R}^3 \mapsto \mathbb{R}^2\) be a deformation field. These classes compute the moving scene:

\[f(t, x, y) = f(t_0, u(t, x, y))\]

Note

These classes rely on backward mapping to perform the warping.

Note

These classes stores the deformation field \(u\).

Classes

AffineDeformationField(func, time_vector, ...)

Stores and applies affine deformation fields defined by transformation matrices.

DeformationField(field)

Stores a discrete deformation field \(u\) of shape \((n\_frames,h,w,2)\).

ElasticDeformation(alpha, sigma, img_shape, ...)

Generates and stores a random elastic deformation where each pixel is sampled from an uniform distribution and then smoothed in space and time.