torchbp.ops.resample module

torchbp.ops.resample.resample_2d_knab(img, shift_r, shift_az, order=6, oversample=1.5)[source]

Resample a 2D image using Knab interpolation with a per-pixel shift field.

The Knab kernel uses a Kaiser-Bessel window matched to the signal oversampling ratio, giving better accuracy than Lanczos when the oversampling is known.

Each output pixel (i, j) reads from the input at (i + shift_r[i, j], j + shift_az[i, j]).

Parameters:
  • img (Tensor) – Input image. Shape [Nr, Naz] or [nbatch, Nr, Naz]. Supports complex64 and float32.

  • shift_r (Tensor float32 [Nr, Naz]) – Per-pixel shift in the first (range) dimension.

  • shift_az (Tensor float32 [Nr, Naz]) – Per-pixel shift in the second (azimuth) dimension.

  • order (int) – Kernel order (2–8). Default 6.

  • oversample (float) – Signal oversampling ratio. Default 1.5.

Returns:

Resampled image, same shape and dtype as img.

Return type:

Tensor

torchbp.ops.resample.resample_2d_lanczos(img, shift_r, shift_az, order=6)[source]

Resample a 2D image using Lanczos interpolation with a per-pixel shift field.

Each output pixel (i, j) reads from the input at (i + shift_r[i, j], j + shift_az[i, j]) using a Lanczos kernel of the given order.

Parameters:
  • img (Tensor) – Input image. Shape [Nr, Naz] or [nbatch, Nr, Naz]. Supports complex64 and float32.

  • shift_r (Tensor float32 [Nr, Naz]) – Per-pixel shift in the first (range) dimension.

  • shift_az (Tensor float32 [Nr, Naz]) – Per-pixel shift in the second (azimuth) dimension.

  • order (int) – Lanczos kernel order (2–8). Default 6.

Returns:

Resampled image, same shape and dtype as img.

Return type:

Tensor