# A Layered Method Based on Depth of Focus for Rapid Generation of Computer-Generated Holograms
## 2 The Layered Method Based on the Depth of Focus  
### Method  
In [40], it has been theoretically demonstrated that the focal depth characteristics of an LCOS imaging system exhibit the property where, within the depth of field, the diffracted light field of a point source can be approximated as a direct projection of the point source, and an expression for calculating the depth of focus has been derived:  
\[d_{h}=\frac{2\lambda d^{2}}{\left(N\Delta\right)^{2}}, \tag{1}\]  
where \(d_{h}\) represents the depth of focus, \(\lambda\) stands for the wavelength of light, \(d\) denotes the distance from the object to the hologram plane, \(N\) signifies the number of samples taken across the hologram, and \(\Delta\) represents the sampling interval. In this paper, this theory is used to approximate and simplify the algorithm for generating holograms of objects composed of polygons.  
Suppose two mutually parallel planes exist, \(L_{1}\) and \(L_{2}\), with the distance between them equal to the depth of focus \(d_{h}\). Within the space between these parallel planes lies a triangle labeled \(ABC\), as shown in Figure 1. Since the size of the triangle lies within the range determined by planes \(L_{1}\) and \(L_{2}\), any point on the triangle has a distance to plane \(L_{1}\) that is less than the depth of focus \(d_{h}\). According to the physical properties of the depth of focus mentioned above, the diffraction of the light wave from the point source \(P\) on the triangle \(ABC\) onto the plane \(L_{1}\) can be approximated as the projection of the point P onto the plane \(L_{1}\). In this way, after projecting all points on the triangle, a projection triangle \(A\)/\(B\)/\(C\)/\(C\) can be obtained on the plane \(L_{1}\), and this projected triangle can be considered as the diffraction distribution of the triangle \(ABC\) on the plane \(L_{1}\).  
We noticed that the depth of a triangle is not always less than the depth of focus, and it may also be greater than the depth of focus (the depth of a triangle is the length of the triangle along the direction of light wave spreading). In this case, we need to split the triangle into polygons with depths not exceeding the focal depth and then project these polygons onto the nearest layer, as shown in Figure 2. After the projection is complete, a tilted triangle light source can be transformed into a set of plane light sources that are planar to the hologram plane. The diffraction distribution of this set of planes in the hologram plane can be calculated by angular spectrum theory. The angular spectrum method is a common method for calculating the diffraction of light waves between two parallel planes, which can be expressed by the equation  
\[U_{H}=\mathrm{F}^{-1}\bigg{\{}\mathrm{F}\{U_{0}\}\mathrm{exp}\bigg{[}\mathrm{ j}\frac{2\pi}{\lambda}d\sqrt{1-(\lambda f_{x})^{2}-\big{(}\lambda f_{y}\big{)}^{2} }\bigg{]}\bigg{\}}, \tag{2}\]  
where, \(U_{H}\) represents the optical field on the hologram plane, \(U_{0}\) signifies the optical field on the object plane. \(\mathrm{j}\) denotes the imaginary unit, \(\lambda\) is the wavelength of light, \(d\) indicates the propagation distance, and \(f_{x}\) and \(f_{y}\) denote the coordinates in the frequency domain. Here, \(\mathrm{F}\{\}\) and \(\mathrm{F}^{-1}\{\}\) represent the Fourier transform and its inverse, respectively. Therefore, as shown in Figure 3, each layer is parallel to the hologram plane, so the propagation of the light wave from each layer to the hologram plane can be calculated using the angular spectrum method. Finally, the light waves from these layers in the hologram plane are summed to obtain the object diffraction distribution \(U_{H}\).  
Figure 1: Approximating the diffraction of a triangle as its projection in the depth-of-focus range.