Global motion estimation¶
- get_global_translation( ) Tuple[List[Tensor], List[Tensor]] [source]¶
This function computes the best global translation for each reference. The best translation is a 2-element vector \(\mathbf{v} = (v_x, x_y)\) which maximises the PSNR of a reference warping with the frame to code:
\[\begin{split}\mathbf{v}^\star = \arg\min = ||\mathrm{warp}(\hat{\mathbf{x}}_{ref}, \mathbf{v}) - \mathbf{x} ||_2^2, \text{ with } \begin{cases} \mathbf{x} & \text{the original image}\\ \hat{\mathbf{x}}_{ref} & \text{a reference frame} \end{cases}\end{split}\]Since they can be multiple references, we look for the best global translation for each reference.
Beside the global translation, also return the shifted reference (by the aforementioned global translation). They are required to feed an optical flow estimator afterward.
- Parameters:
- Returns:
- First element is the list of the
shifted references. Second element is the list of the global translations.
- Return type:
Tuple[List[Tensor], List[Tensor]]