pyfli.sp_analysis.solvers#

Implement linear and total-variation reconstructors for four-dimensional SPAD data.

This module belongs to pyfli.sp_analysis and is part of PyFLI single-pixel camera basis generation, acquisition simulation, and reconstruction solvers. Public API includes classes LinearReconstructor and TVReconstructor.

Classes

LinearReconstructor(h, w, t, lam[, ...])

Run the linear reconstructor routine.

TVReconstructor(h, w, t, lam[, ...])

Solve four-dimensional SPAD reconstruction with isotropic total-variation regularization.

class LinearReconstructor(h, w, t, lam, differential=True, n_workers=None)[source]#

Bases: BaseReconstructor

Run the linear reconstructor routine. the lightweight baseline solver for single-pixel camera data.

Parameters:
  • h (np.ndarray) – Image height or spatial dimension used by reconstruction solvers.

  • w (np.ndarray) – Image width or spatial dimension used by reconstruction solvers.

  • t (np.ndarray) – Temporal sample axis used by reconstruction solvers.

  • lam (np.ndarray) – Wavelength or spectral axis used by reconstruction solvers.

  • differential (bool) – Whether the sensing basis uses differential pattern pairs.

  • n_workers (int | None) – Number of worker processes or threads used by parallel solvers.

reconstruct_slice(y_slice, A)[source]#

Reconstruct slice.

Parameters:
  • y_slice (np.ndarray) – Single measurement slice reconstructed by the solver.

  • A (np.ndarray) – Lower bound or left separator value used by the helper.

Returns:

Object produced by reconstruct slice.

Return type:

Any

class TVReconstructor(h, w, t, lam, differential=True, alpha=1.0, maxiter=500, n_workers=None)[source]#

Bases: BaseReconstructor

Solve four-dimensional SPAD reconstruction with isotropic total-variation regularization. It is intended for Gaussian-noise measurements where spatial smoothness is useful.

Parameters:
  • h (np.ndarray) – Image height or spatial dimension used by reconstruction solvers.

  • w (np.ndarray) – Image width or spatial dimension used by reconstruction solvers.

  • t (np.ndarray) – Temporal sample axis used by reconstruction solvers.

  • lam (np.ndarray) – Wavelength or spectral axis used by reconstruction solvers.

  • differential (bool) – Whether the sensing basis uses differential pattern pairs.

  • alpha (float) – Regularization strength or statistical threshold value, depending on context.

  • maxiter (int) – Maximum number of optimization iterations.

  • n_workers (int | None) – Number of worker processes or threads used by parallel solvers.

reconstruct_slice(y_slice, A)[source]#

Reconstruct slice.

Parameters:
  • y_slice (np.ndarray) – Single measurement slice reconstructed by the solver.

  • A (np.ndarray) – Lower bound or left separator value used by the helper.

Returns:

Object produced by reconstruct slice.

Return type:

Any