liu_jia_pad#

deepinv.physics.functional.liu_jia_pad(x, *, padding)[source]#

Liu-Jia Padding

Real-world blurry images have decorrelated opposite boundaries unlike images synthetically blurred using circular filters. This make the use of spectral deconvolution methods (inverse filtering, Wiener filtering) impractical and prone to ringing artifacts. Liu-Jia padding [1] is a pre-processing step that pads the input image to make it have smooth circular boundaries while preserving the original spectral content as much as possible.

The implementation is adapted from the one featured in the work of Zhang et al.[2].

The padded tensor has shape \((B, C, H + 2 * ext{pad}_h, W + 2 * ext{pad}_w)\) where :math:` ext{pad}_h` and :math:` ext{pad}_w` are the vertical and horizontal padding respectively.

Note

Padding a single direction is not supported and a ValueError will be raised if only one of the two padding values is non-zero.

Parameters:
  • x (torch.Tensor) – Input image of shape (B, C, H, W)

  • padding (tuple(int, int)) – Left/right padding, and top/bottom padding (px).

Returns:

(torch.Tensor) Padded image

Return type:

Tensor


References:

Examples using liu_jia_pad:#

Spectral Methods for Non-Circular Deblurring with Liu-Jia Padding

Spectral Methods for Non-Circular Deblurring with Liu-Jia Padding