xpunwrap.algorithms.algo_ls_poisson_pg
- xpunwrap.algorithms.algo_ls_poisson_pg(phase_wrapped: ndarray, restore_plane: bool = False) ndarray[source]
Least-squares unwrapping with periodic gradient enforcement.
- 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. This algorithm explicitly enforces periodicity on the wrapped gradients (via
enforce_periodic_gradients_stack()) before solving, which reduces gradient discontinuities at domain edges compared toalgo_ls_poisson(). If the wrapped phase is not periodic at the boundaries, artifacts near the edges may still occur.References