Retinal image computation software

/*************************************************************************************
 These programs are free software; you can redistribute them and/or modify
 them under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 *************************************************************************************/





Decompose the input image into wavelengths (for each (x,y) pixel):

\begin{displaymath}\begin{array}{cc} Image[\lambda, x, y] = & Im_{R}[x,y] \times... (1)

where $ Im_{R}$, $ Im_{G}$ and $ Im_{B}$ represents the percentage of the R, G, B guns for each pixel, $ W_{R}$, $ W_{G}$, $ W_{B}$ are weighting parameters :
$\displaystyle W_{R} = \frac{Y_{R}}{\sum_{\lambda}\left( V\left( \lambda \right) \times SPD_{R}\right) }$ (2)

$\displaystyle W_{G} = \frac{Y_{G}}{\sum_{\lambda}\left( V\left( \lambda \right) \times SPD_{G}\right) }$ (3)

$\displaystyle W_{B} = \frac{Y_{B}}{\sum_{\lambda}\left( V\left( \lambda \right) \times SPD_{B}\right) }$ (4)

and $ SPD_{R}$, $ SPD_{G}$ and $ SPD_{B}$ are the spectral power distribution of the Red, Green and Blue guns.




Compute the PSFs for each wavelength:

$\displaystyle PF \left( \lambda \right) = AT \times \exp \left( \frac{i2 \pi W}{\lambda} \right)$ (5)

$\displaystyle ASF \left( \lambda \right) = ifft\left( PF \left( \lambda \right)\right)$ (6)

$\displaystyle OTF \left( \lambda \right) = fft\left( PSF \left( \lambda \right)\right)$ (3)

$\displaystyle RI \left( \lambda \right) = I\left( \lambda \right) \otimes PSF\left( \lambda \right)$ (4)

$\displaystyle PSF \left( \lambda \right) = Mod \left( ASF \left( \lambda \right... (5)

$\displaystyle PTF\left( \lambda \right) = Phase \left( OTF \left( \lambda \right) \right)$ (7)

$\displaystyle MTF\left( \lambda \right) = Modulus \left( OTF \left( \lambda \right) \right)$ (8)


PF Pupil function
AT Amplitude Transmittance (Stiles Crawford effect)
W Wave aberration = f(Pupil diameter)
ASF Amplitude Spread Function
OTF Optical Transfer Function
RI Retinal Image
I Displayed image (CRT)



Default Parameters :  
Pupil Diameter 3 mm,
Focus Wavelength 570 nm,
Zernike order 15,
Pupil shift X, Pupil Shift Y 0mm,
Wavelengths 400:10:750,
Displayed image size 512 pixels,
Pupil function size 256.





Judd specs computation:


XYZ xyz

Judd Specs Matrix:


 xR
 yR
 YR 
 xG
 yG
 YG=100.0
 xB
 yB
 YB






/***************************************************************************
-------------------
Last modification : march 10th 2005
Florent Autrusseau
email : Florent.Autrusseau@univ-nantes.fr
-------------------
 ***************************************************************************/