This repository is the official implementation of:
"Forward And Inverse Diffraction In Phasor Fields" (Optics Express, Vol. 33, Issue 5, 2025)
Jorge Garcia-Pueyo
·
Adolfo Muñoz
Non-line-of-sight (NLOS) imaging (bottom row) is an inverse problem that consists on reconstructing a hidden scene
This research focuses on the Phasor Fields technique (bottom row, right section), which uses a forward diffraction operator
- We relate Phasor Fields to the Reciprocity Theorem in diffraction, since both methods allow to solve the inverse problem using a forward operator. From this insight, we propose novel interpretations of the relay wall's function as either a phase conjugator or a hologram recorder, framing NLOS imaging as an inverse diffraction problem.
- We introduce "Inverse Phasor Fields", a new algorithm to reconstruct the hidden scene posing the NLOS imaging problem as an inverse diffraction problem, using the inverse diffraction operator
$\mathbf{g}^{-1}_z$ . - We present a computational metric to assess the quality and limitations of NLOS reconstruction setups, based on the diffraction operator expressed in matricial form, and we relate it to the established Rayleigh criterion.
We show a comparison of hidden object reconstructions of (up) letter4 and (bottom) NLOSletter scenes, from Liu et al. dataset, with Phasor Fields and our method, Inverse Phasor Fields.
Scenes have been illuminated with a single virtual wavelength
@article{garciapueyo2025forwardinverse,
title = {Forward and inverse diffraction in phasor fields},
author = {Jorge Garcia-Pueyo and Adolfo Mu\~{n}oz},
journal = {Opt. Express},
volume = {33},
number = {5},
pages = {11420--11441},
publisher = {Optica Publishing Group},
month = {Mar},
year = {2025},
url = {https://opg.optica.org/oe/abstract.cfm?URI=oe-33-5-11420},
doi = {10.1364/OE.553755},
}
The recommended way to run the scripts to replicate the results is:
- Set up a Python virtual environment and install dependencies.
- Download the required NLOS capture data (both real and simulated).
- Run the scripts to reconstruct the hidden scenes using Phasor Fields and Inverse Phasor Fields.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Our reconstruction algorithms are tested on:
- Real data: from Phasor Field Diffraction Based Reconstruction for Fast Non-Line-of-Sight Imaging Systems: download it from this link.
- Simulated data: generated using mitransient and y-tal. Download it from this link.You can also generate new simulations following the steps in How to simulate new scenes.
The download instructions are:
- Create a
data/
folder:
mkdir data/
- Download the real data:
wget -O data/pfdiffraction_fastnlos.zip https://biostat.wisc.edu/~compoptics/phasornlos20/archive/tdata.zip
unzip data/pfdiffraction_fastnlos.zip -d data/pfdiffraction_fastnlos
- Download the simulated data:
wget -O data/ForwardInverseDiffractionInPhasorFields_SimulatedData.zip https://nas-graphics.unizar.es/s/ifg3iN3b3qSLNao/download/ForwardInverseDiffractionInPhasorFields_SimulatedData.zip
unzip data/ForwardInverseDiffractionInPhasorFields_SimulatedData.zip -d data/simulated
This repository contains scripts to reproduce different results shown in the paper. The core functionalities for forward and inverse diffraction operators are implemented in:
utils_diffraction.py
utils_diffraction_inverse.py
utils_nlos.py
The following main scripts process the data fromdata/
and reconstruct the hidden scenes using tools from theutils_*.py
files:inverse_phasor_fields.py
inverse_phasor_fields_plotmulti.py
computational_metric.py
computational_metric_plot.py
inverse_phasor_fields.py
reconstructs hidden scenes from captured (or simulated) time-resolved data. Parameters for three different scene types are defined within:
- Lines 537-598: reconstructions with real data (replicates Figures 4, 5, and 6).
- Lines 600-618: reconstructions with simulated data of letter R scene at different depths (Figures 7, 8, and 9).
- Lines 620-637: reconstructions with simulated data of occlusions scene (Figure 10).
To run the reconstructions:
python inverse_phasor_fields.py
This script creates a results/
directory where it stores single-wavelength reconstructions using both Phasor Fields (forward diffraction) and Inverse Phasor Fields (inverse diffraction). For multiple wavelength, the inverse_phasor_fields.py
file must be run (it reads the single wavelength reconstructions and composes it to create the multiwavelength reconstruction).
computational_metric.py
computes a computational metric based on the relative rank of the forward diffraction operator, considering aperture size, wavelength, and distance (parameters in the Rayleigh criterion, as shown in Eq. 30). The results are then visualized using computational_metric_plot.py
.
To run the computational metric analysis, execute:
python computational_metric.py
python computational_metric_plot.py
This will generate a results/
folder (if it does not exist) where the computational metric results are stored as .npy
files, and the plots are saved as .pdf
files.
We provide simulated time-resolved data (impulse response function of the simulated hidden scenes) for:
- Letter R at different depths with different aperture sizes (
data/simulated/R_*m
). - An occluded scene (
data/simulated/occlusion
).
To generate new NLOS hidden scene data, use our tool y-tal by running:
tal render
For further details, visit the y-tal repository.