xpunwrap.algorithms.algo_ls_poisson

xpunwrap.algorithms.algo_ls_poisson(phase_wrapped: ndarray, restore_plane: bool = False) ndarray[source]

Batched 2D phase unwrapping using a least-squares Poisson solver.

Parameters:
  • phase_wrapped (xp.ndarray) – Wrapped phase, shape (H, W) or (N, H, W), values in [-pi, pi).

  • restore_plane (bool, optional) – If True, add back the mean wrapped gradient plane. Default False.

Returns:

phase_unwrapped – Unwrapped phase, same shape as input.

Return type:

xp.ndarray

Notes

The FFT Poisson solver assumes periodic boundary conditions: the input domain is treated as if its left/right and top/bottom edges connect. No zero-padding is applied before the FFT. If the wrapped phase is not periodic at the boundaries, the solver may produce artifacts (ringing or slope errors) near the domain edges. For non-periodic data consider cropping the region of interest away from the edges or using algo_ls_weighted(), which can suppress discontinuous boundary regions via its border-weight mask.

References