Optics

The PyColibri optics module encompasses a collection of optical systems extensively employed in the computational imaging research for spectral, depth, phase and other imaging applications. This module facilitates the simulation of optical propagation and the design of optical elements inside the systems, offering researchers and developers a powerful toolkit for advancing imaging technologies.

Mathematically, all implemented optical systems are of the form

\[\mathbf{y} = \forwardLinear_{\learnedOptics}(\mathbf{x}) + \noise\]

where \(\mathbf{x}\in\xset\) is the input optical field, \(\mathbf{y}\in\yset\) are the acquired signal, \(\forwardLinear:\xset\mapsto \yset\) is a deterministic (linear or non-linear) optics model of the acquisition system, \(\learnedOptics\) is a set of learnable parameters characterizing the optical system, and \(\noise\) is a stochastic mapping which characterizes the noise affecting the measurements.

Spectral Imaging systems

colibri.optics.cassi.SD_CASSI

Single Disperser Coded Aperture Snapshot Spectral Imager (SD-CASSI)

colibri.optics.cassi.DD_CASSI

Dual Disperser Coded Aperture Snapshot Spectral Imager (DD-CASSI)

colibri.optics.cassi.C_CASSI

Color Coded Aperture Snapshot Spectral Imager (C-CASSI)

colibri.optics.spc.SPC

Single Pixel Camera (SPC).

colibri.optics.doe.SingleDOESpectral

Single Diffractive Optical Element for Spectral Imaging

Functional operators of the optical systems

colibri.optics.functional.forward_color_cassi

Forward operator of color coded aperture snapshot spectral imager (Color-CASSI)

colibri.optics.functional.backward_color_cassi

Backward operator of color coded aperture snapshot spectral imager (Color-CASSI)

colibri.optics.functional.forward_dd_cassi

Forward operator of dual disperser coded aperture snapshot spectral imager (DD-CASSI)

colibri.optics.functional.backward_dd_cassi

Backward operator of dual disperser coded aperture snapshot spectral imager (DD-CASSI)

colibri.optics.functional.forward_sd_cassi

Forward operator of single disperser coded aperture snapshot spectral imager (SD-CASSI)

colibri.optics.functional.backward_sd_cassi

Backward operator of single disperser coded aperture snapshot spectral imager (SD-CASSI)

colibri.optics.functional.forward_spc

Forward propagation through the Single Pixel Camera (SPC) model.

colibri.optics.functional.backward_spc

Inverse operation to reconstruct the image from measurements.

colibri.optics.functional.psf_single_doe_spectral

Calculate the point spread function (PSF) of an optical system comprising a diffractive optical element (DOE) for spectral imaging.

colibri.optics.functional.convolutional_sensing

Simulate the convolutional sensing model of an optical system, using either Fourier or spatial domain methods.

colibri.optics.functional.fourier_conv

Apply Fourier convolution theorem to simulate the effect of a linear system characterized by a point spread function (PSF).

colibri.optics.functional.signal_conv

This function applies the convolution of an image with a Point Spread Function (PSF) in the signal domain.

colibri.optics.functional.wiener_filter

This function applies the Wiener filter to an image.

colibri.optics.functional.gaussian_noise

Add Gaussian noise to an image based on a specified signal-to-noise ratio (SNR).

Functional operators of optical elements

colibri.optics.functional.prism_operator

Prism operator, shifts linearly the input tensor x in the spectral dimension.

colibri.optics.functional.circular_aperture

Create a circular aperture mask of a given radius and pixel_size of size (M, N).

colibri.optics.functional.height2phase

Convert height map to phase modulation.

colibri.optics.functional.ideal_panchromatic_sensor

Simulate the response of an ideal panchromatic sensor by averaging the spectral channels.

colibri.optics.functional.wave_number

Wavenumber

colibri.optics.functional.get_spatial_coords

Generate the spatial coordinates for wave optics simulations in a specific coordinate system.

Functional operators of light propagation

colibri.optics.functional.scalar_diffraction_propagation

Compute the optical field propagation using a scalar diffraction theory model which is given by the specific approximation selected.

colibri.optics.functional.transfer_function_angular_spectrum

The transfer function for the angular spectrum propagation can be written as follows:

colibri.optics.functional.transfer_function_fresnel

The transfer function for the Fresnel propagation can be written as follows:

colibri.optics.functional.fraunhofer_propagation

The Fraunhofer approximation of \(U_0(x',y')\) is its Fourier transform, \(\mathcal{F}\{U_0\}\) with an additional phase factor that depends on the distance of propagation, \(z\).

colibri.optics.functional.fraunhofer_inverse_propagation

The inverse Fraunhofer approximation (to reconstruct the field at the source from the field at the sensor) is given by the following equation:

state-of-the-art optical elements

colibri.optics.sota_does.conventional_lens

Code to generate a conventional lens with a given focal length and radius following the equation

colibri.optics.sota_does.spiral_doe

Code to generate a spiral DOE with a given number of spirals, radius, focal length and wavelength range.

utils

colibri.optics.functional.add_pad

Add zero padding to a tensor.

colibri.optics.functional.unpad

Unpad a tensor.

colibri.optics.functional.fft

Fast Fourier Transform of an optical field

colibri.optics.functional.ifft

Inverse Fast Fourier Transform of an optical field