WavePSF is a tool for estimating the spatially and spectrally varying point spread function (PSF) of an imaging system and using it directly for deconvolution. It was developed to be used with imaging spectrometers / hyperspectral imaging systems, but the basic idea should also work with other imaging systems.
WavePSF implements the method described in:
The core idea is to estimate PSFs by deconvolving the input image with varying PSFs and checking whether image quality improves.
PSFs are computed from wavefronts modeled with either Zernike polynomials or a deformable mirror simulation. Starting from an initial guess, the wavefront coefficients are iteratively adjusted by an optimization algorithm until an image quality metric improves. Currently the best metric is the normalized cross-correlation with a known ground truth image.
This means a calibration measurement of a known target is required (e.g. a printed page with text), along with a digital reference of that target (e.g. the same page as an image with matching area and orientation) to serve as ground truth.
Once the PSFs are estimated, they can be used to deconvolve actual measurements of unknown targets. The estimated PSFs remain valid as long as the imaging setup (focus, aperture, sample distance, ...) stays unchanged.
The estimated PSFs can also be used for optical characterization of your system. The size tells you the spatial resolution and the shape can indicate what optical aberrations are present.
- You can download pre-built Windows binaries from the releases page
- Basic tutorial: docs/user/tutorial.md
- Example datasets: data.uni-hannover.de -> download
data_tobacco_leaf.zipfor a purposely defocused dataset with ground truth, which produces particularly impressive deconvolution results
| Dependency | Notes |
|---|---|
| Qt5 | Tested with 5.12.12, should work with other versions too. But not with Qt 6.0+ |
| ArrayFire | Tested with 3.8.2, should work with other versions too. |
| C++ compiler | C++11, MSVC is required due to ArrayFire |
- Install MSVC Build Tools with the "Desktop development with C++" workload.
- Install ArrayFire v3
- Install Qt 5, open Qt Creator and configure MSVC kit.
- Build from the command line using the Qt MSVC environment:
mkdir build
cd build
qmake ..\wavepsf.pro -spec win32-msvc CONFIG+=release
nmakeOr open wavepsf.pro in Qt Creator, select the MSVC kit, and build.
Should work, not tested yet.
GPL-3.0 License. See LICENSE for details.
