1 Introduction

Computer-generated holography (CGH), which uses computer to encode the target object information into the hologram, reconstructs spatial arbitrary wavefront information from computer-generated holograms and expands the application of optical holographic scenes, such as beam shaping [1], optical trapping [2], holography encryption [3, 4], holography multiplexing [5, 6] and holography encoding [7, 8]. With the development of science and technology, people hope to truly recover the three-dimensional (3D) information of the object. Some novel applications include full-colour holographic display [9, 10], wavefront aberration measurement [11], 3D image encryption [12, 13] and 3D display [14, 15]. Moreover, the development of real-time 3D display [16, 17] based on CGH, as a promising technology of the future, needs to be promoted by algorithms with higher holographic coding efficiency.

The hologram algorithms for 3D scene reconstruction mainly include physically based [18, 19] and layer-based algorithms [20, 21]. However, considering that the number of primitives would be extremely large for reconstructing a complicated 3D scene by using the former method, the computational load would also be increased drastically. The target 3D scene is processed according to the spatial distance in a layer-based way to obtain a multi-layer two-dimensional (2D) image. The layer-hologram is obtained using the appropriate CGH algorithm, thereby reducing the computational pressure greatly. Therefore, the layer-based hologram algorithm is more suitable for real-time 3D display.

Currently, loading the phase-only or amplitude-only holograms that contain the information of the target object onto the spatial light modulator (SLM) for optical reconstruction is the main approach that can be used to realise holographic display [22]. Phase-only holograms are widely used because their diffraction efficiency is significantly higher than those of amplitude-only holograms. Gerchberg–Saxton (GS) [23] algorithm and its modification algorithm [24,25,26] is a classical iterative algorithm for phase-only hologram. This kind of iterative algorithm is characterised by using Fourier transform or Fresnel transform to conduct forward and inverse light wave transmissions between the hologram plane and the reconstructed image plane through iteration. With the advantage of high flexibility constraints, it can achieve an exceptionally accurate reconstructed image. On the basis of this, the non-convex optimization algorithm [27, 28] is proposed to obtain the sub-optimal solution of the hologram by introducing a custom cost function to achieve high-quality 3D scene reconstruction. To the best of our knowledge, neither GS, its improved algorithm, nor its subsequent non-convex optimisation algorithm avoids the iterative process, which will affect the generation speed of holograms seriously and make it difficult to achieve real-time 3D display.

Compared with the iterative algorithm, the characteristic of the non-iterative algorithm is that the required hologram can be obtained in the one-way calculation. A typical non-iterative algorithm is a random phase algorithm [29] that can obtain phase-only holograms by Fourier transform and phase extraction of target objects superimposed with random phases. This algorithm is simple to operate. However, the reconstructed image has obvious speckle noise. The non-random phase algorithm [30,31,32] can spread the light wave of the original image uniformly to the whole hologram and reduce speckle noise. This algorithm also needs to analyse the frequency domain distribution of the target image in advance and combine it with the error diffusion algorithm to achieve high-quality holographic coding, which is complicated to operate and not suitable for real-time 3D display.

Conjugate symmetric extension Fourier CGH algorithm [33] is based on the Fourier transform property, which means that the forward or inverse Fourier transform of the conjugate symmetric complex functions are real functions. The real function that contains the amplitude and phase information of the target object is obtained by Fourier transform after a conjugate symmetric extension of the target image. The algorithm is simple to operate and has a good reconstruction effect. However, it lacks reconstruction focus information and cannot realise 3D display.

Here, we improve the conjugate symmetric extension Fourier CGH algorithm. The real function can be obtained directly by taking the inverse Fourier transform of the target object after the conjugate symmetric extension and mapping to 0–2π linearly. By superimposing the quadratic phase term that carries the reconstruction focus information, the phase-only hologram that contains the amplitude, phase and reconstruction focus information of the target object is obtained. The conjugate symmetric extension Fourier CGH algorithm with controllable reconstruction focus, which can be used for real-time 3D display, is implemented.

2 Conjugate symmetric extension Fourier CGH algorithm with controllable reconstruction focus

The CGH algorithm proposed in this paper is mainly based on Reference [33], which means that the forward or inverse Fourier transform of the conjugate symmetric complex functions are real functions. The proposed CGH algorithm starts with a conjugate symmetric extension of the discrete complex amplitude distribution of the target object \(f_{0} (x,y)\) to obtain conjugate symmetric complex function \(f(x,y)(x = 0,1, \ldots ,X - 1;y = 0,1, \ldots ,Y - 1)\). For the convenience of discussion, \(X\) and \(Y\) are even, \(f(0,y) = f(x,0) = f\left( {\frac{X}{2},y} \right) = 0\), and the centre of symmetry is \(\left( {\frac{X}{2},\frac{Y}{2}} \right)\).

$$ f(x,y) = \left\{ {\begin{array}{*{20}c} {f_{0} (x,y)} & {\left( {x = 1,2, \ldots ,\frac{X}{2} - 1;y = 1,2, \ldots ,Y - 1} \right),} \\ {f_{0}^{ * } (X - x,Y - y)} & {\left( {x = \frac{X}{2} + 1, \ldots ,X - 1;y = 1,2, \ldots ,Y - 1} \right),} \\ {0,} & {\left( {x = 0{\text{ or }}y = 0{\text{ or }}x = \frac{X}{2}} \right).} \\ \end{array} } \right. $$
(1)

where the superscript ‘*’ represents complex conjugate.

Then, inversely Fourier-transforming [33] the complex amplitude \(f(x,y)\) obtains

$$ \begin{gathered} IFT[f(x,y)] \hfill \\ = \frac{2}{XY}\sum\limits_{x = 0}^{X - 1} {\sum\limits_{y = 0}^{Y - 1} {f(x,y)\exp \left\{ {j2\pi \left( {\frac{ux}{X} + \frac{vy}{Y}} \right)} \right\}} } \hfill \\ = \frac{2}{XY}\sum\limits_{x = 1}^{{\frac{X}{2} - 1}} {\sum\limits_{y = 1}^{Y - 1} {\left\{ {{\text{Re}} \left[ {f_{0} (x,y)} \right]\cos \left[ {2\pi \left( {\frac{ux}{X} + \frac{vy}{Y}} \right)} \right]} \right.} } \hfill \\ \left. { - {\text{Im}} \left[ {f_{0} (x,y)} \right]\sin \left[ {2\pi \left( {\frac{ux}{X} + \frac{vy}{Y}} \right)} \right]} \right\} \hfill \\ = F^{\prime } (u,v) \hfill \\ \end{gathered} $$
(2)

where \(u\) and \(v\) are the serial numbers of samples in horizontal and vertical directions, respectively; and \({\text{Re}} \left[ {f_{0} (x,y)} \right]\) and \(Im\left[ {f_{0} (x,y)} \right]\) represent the real and imaginary parts of \(f_{0} (x,y)\), respectively. The target object to be recorded \(f_{0} (x,y) = {\text{A}}(x,y)\exp \left[ {j\varphi (x,y)} \right]\), where \({\text{A}}(x,y)\) and \(\varphi (x,y)\left( {x = 1,2, \ldots ,\frac{X}{2} - 1;y = 1,2, \ldots ,Y - 1} \right)\) are its amplitude and phase distribution functions, respectively. Substitute this into Eq. (2) to obtain

$$ \begin{aligned} F^{\prime } \left( {u,\,v} \right) = & \frac{2}{XY}\sum\limits_{x = 1}^{{\frac{X}{2} - 1}} {\sum\limits_{y = 1}^{Y - 1} {\left\{ {A\left( {x,\,y} \right)\cos \left[ {2\pi \left( {\frac{ux}{X} + \frac{vy}{Y}} \right) + \varphi \left( {x,\,y} \right)} \right]} \right\}} } \\ \left( \begin{gathered} u = 0,\,1,\, \ldots ,X - 1 \hfill \\ v = 0,\,1,\, \ldots ,Y - 1 \hfill \\ \end{gathered} \right) \\ \end{aligned} $$
(3)

To obtain a phase-only hologram, the real function \(F^{\prime}(u,v)\) that contains the amplitude and phase information of the target image \(f_{0} (x,y)\) is linearly mapped to 0–2π, and the following formula can be obtained as follows:

$$ F^{\prime}_{holo} (u,v) = 2\pi \times \frac{{F^{\prime}(u,v) - \min [F^{\prime}(u,v)]}}{{\max [F^{\prime}(u,v)] - \min [F^{\prime}(u,v)]}} $$
(4)

The quadratic phase term \({\Phi }(u,v;d)\) [34], which carries the reconstruction focus information \(d\), is added to \(F^{\prime}_{holo} (u,v)\), and the remainder of 2π is calculated to obtain

$$ \begin{gathered} F_{holo} (u,v;d) \hfill \\ = \left[ {F^{\prime}_{holo} (u,v) - {\Phi }(u,v;d)} \right]\bmod 2\pi \hfill \\ = \left[ {F^{\prime}_{holo} (u,v) - \frac{{\pi \left( {u^{2} + v^{2} } \right)}}{\lambda d}} \right]\bmod 2\pi , \hfill \\ = F(u,v;d)\bmod 2\pi \hfill \\ \end{gathered} $$
(5)

where λ is the wavelength, and \(F(u,v;d)\) is the real function. Thus, the discrete real function \(F_{{{\text{holo}}}} (u,v;d)\), which records the amplitude information \({\text{A}}(x,y)\), phase information \(\varphi (x,y)\) and reconstruction focus information \(d\) of the target image \(f_{0} (x,y)\), can be obtained. By changing the value of the reconstruction focus \(d\), the target object can be reconstructed at any given distance. Of note is that the iteration between the hologram plane and the target object plane is avoided, and the hologram can be obtained by one Fourier inversion, which improves the efficiency of holographic coding significantly and can be used for real-time 3D holographic display.

3 Generation and reconstruction of holograms

3.1 Generation of holograms

Based on the proposed CGH algorithm, we set the school emblem of Shanghai University with a size of 539 × 1079 as the \({\text{A}}(x,y)\) of \(f_{0} (x,y)\) and added the uniformly distributed random number of \(\left[ { - \pi ,\pi } \right)\) as the phase factor \(\varphi (x,y)\) for holographic coding (Fig. 1). After conjugate symmetry extension, a 1080 × 1080 conjugate symmetric image \(f(x,y)\) can be obtained. The real function \(F^{\prime}_{holo} (u,v)\) is obtained by taking the inverse two-dimensional discrete Fourier transform of the conjugate symmetric complex amplitudes and mapping them to 0–2π linearly. According to Eq. (5), the quadratic phase term \({\Phi }(u,v;d = 50mm)\) that carries the reconstruction focus \(d = 50mm\) is superimposed into the real function \(F^{\prime}_{holo} (u,v)\), and the phase-only hologram \(F_{{{\text{holo}}}} (u,v;d)\) with the size of 1080 × 1080 is obtained by taking the remainder operation. The whole calculation process is run on MATLAB R2017b with the CPU (Intel(R) Core(TM) i7-7500U 2.70 GHz) and 16 GB RAM.

Fig. 1
figure 1

Holographic coding process based on the proposed CGH algorithm

3.2 Numerical reconstruction of holograms

In the numerical reconstruction, the incident beam is set as a plane light with a wavelength λ of 532 nm. According to the Fresnel diffraction principle, the diffraction images of phase-only hologram \(F_{{{\text{holo}}}}\) in the \(z\) interval of \(\left[ {30mm,70mm} \right]\) are calculated, that is, the diffraction images within \(20mm\) before and after the reconstruction focus \(d = 50mm\). The correlation coefficient (CC) is used as the criterion for evaluating the similarity between the target image \(f_{0} (x,y)\) and the diffraction image \(f_{0}^{^{\prime}} (x,y)\) at different distances. The value of CC can be calculated by using the following formula [35]:

$$ CC = \frac{{{\text{E}}\left\{ {\left[ {f_{0} - E\left( {f_{0} } \right)} \right]\left[ {f_{0}^{\prime } - E\left( {f_{0}^{\prime } } \right)} \right]} \right\}}}{{\sqrt {E\left\{ {\left[ {f_{0} - E\left( {f_{0} } \right)} \right]^{2} } \right\}E\left\{ {\left[ {f_{0}^{\prime } - E\left( {f_{0}^{\prime } } \right)} \right]^{2} } \right\}} }}, $$
(6)

where E[*] is the expectation value.

The numerical reconstruction analysis results, including the relation curve between CC value and \(z\), and Fresnel diffraction results at different distances, are shown in Fig. 2. In Fig. 2a, the red and blue curves between CC value and \(z\) are obtained based on the proposed CGH algorithm and the modified one-iteration GS algorithm [36], respectively. Figure 2b–d shows the Fresnel diffraction numerical reconstruction of the hologram obtained by the proposed CGH algorithm. Figure 2e–g shows the Fresnel diffraction numerical reconstruction of the hologram obtained by the modified GS algorithm after one iteration (including three Fourier transforms).

Fig. 2
figure 2

Numerical reconstruction analysis of planar images. a Curves of the relationship between CC value and z; bd and eg The numerical reconstruction results of hologram based on the proposed CGH algorithm and the modified one-iteration GS algorithm at z = 46 mm, 50 mm, and 53 mm, respectively

According to Fig. 2a, on either side of the focal position, the red curve is steeper than the blue curve. Within 20 mm range before and after the focus position, the CC value of the red curve is significantly lower than the CC value of the blue curve. Figure 2c, f shows the results of numerical reconstruction at the focal point, and the root mean square error (RMSE) is calculated to be 0.04 and 0.09, respectively. Therefore, the numerical reconstruction effect based on the proposed CGH algorithm is better than that based on the one-iteration modified GS algorithm.

According to the change of the red curve in Fig. 2a, when the diffraction distance \(z\) is equal to the reconstruction focus \(d\) carried in the quadratic phase term \({\Phi }(u,v;d)\), the CC value is the highest, which is 0.93. When the diffraction distance \(z\) is changed into \(d \pm {\Delta }z\), the CC value decreases significantly, and the change curve takes \(z = d\) as the axis of symmetry. According to the slope change of the curve, the change in CC value on both sides at \(z = d\) gradually becomes gentle from being steep. When the value of \({\Delta }z\) increases from \(0mm\) to \(2mm\), the CC value decreases by 0.34; when the value of \({\Delta }z\) increases from \(2mm\) to \(20mm\), the CC value only decreases by 0.13; and when the value of \({\Delta }z\) is equal to \(5mm\), the CC value is 0.52. The above analysis shows that the algorithm not only makes the diffraction image free from the constraint of the physical lens on the reconstruction focus position but is also overly sensitive to the new reconstruction focus information \(d\). Therefore, by changing the reconstruction focus \(d\), the target image can be reconstructed at any given distance accurately.

3.3 Optical reconstruction of holograms

The experimental device of optical reconstruction based on the proposed CGH algorithm is shown in Fig. 3. A solid-state laser (MGL-F-532-2 W) running at 532 nm is used as the light source that generates a fundamental Gaussian beam. Then, the expanded Gaussian beam illuminates the SLM (PLUTO-VIS-001, 1920 × 1080 pixels and pixel pitch 8 µm) by a beam expander. After the wavefront modulation of the expanded Gaussian beam by SLM, the reconstructed image of the reconstruction focus \(d = 0mm\) can be obtained in the rear focal plane of lens (f = 200 mm), that is, \(z = 0mm\). The reconstructed images of different diffraction distances are captured by moving the camera (CS165CU/M, 3.45 × 3.45 um pixel size). Through a computer, the hologram \(F_{{{\text{holo}}}} (u,v;d = 50{\text{mm}})\) in Fig. 1 was loaded onto the SLM. After optical reconstruction, the diffraction images at z = 46 mm, 50 mm and 53 mm were captured by moving the camera, and the results are shown in Fig. 4a–c. The experimental results of optical reconstruction are in good agreement with the numerical reconstruction.

Fig. 3
figure 3

Optical reconstruction device for holograms. BE Beam Expander, SLM Space Light Modulator

Fig. 4
figure 4

Experimental results of optical reconstruction of holograms. ac The optical reconstruction results of hologram at z = 46 mm, 50 mm and 53 mm, respectively

4 Generation and reconstruction of composite holograms

As shown in Fig. 5a, based on the proposed CGH algorithm, the four characters ‘S’, ‘C’, ‘I’ and ‘E’ with the size of 539 × 1079 and the reconstruction focuses of \(d_{1} = 0{\text{mm}}\), \(d_{2} = 50{\text{mm}}\), \(d_{3} = 100{\text{mm}}\) and \(d_{4} = 150{\text{mm}}\) are encoded into holograms \(F_{1} \left( {u,v;d_{1} } \right)\), \(F_{2} \left( {u,v;d_{2} } \right)\), \(F_{3} \left( {u,v;d_{3} } \right)\) and \({ }F_{4} \left( {u,v;d_{4} } \right)\), respectively. These four holograms are superimposed to obtain the phase-only composite hologram \(F_{{{\text{compos}}}} (u,v;d)\):

$$ F_{compos} \left( {u,\,v;\,d} \right) = \arg \left\{ {\sum\limits_{i = 1}^{n} {\exp \left[ {jF_{i} \left( {u,\,v;\,d_{i} } \right)} \right]} } \right\}, $$
(7)

where arg{*} is a direct phase extraction operation.

Fig. 5
figure 5

Numerical and optical reconstruction of composite hologram. a Scheme design for composite hologram. be Numerical reconstruction results based on Fresnel diffraction principle at different distances. fi Optical reconstruction results at different distances

During the numerical reconstruction, according to Fresnel diffraction principle, the diffraction images of composite hologram \(F_{{{\text{compos}}}}\) at \(z = d_{1}\), \(d_{2}\), \(d_{3}\) and \({ }d_{4}\) are calculated, as shown in Fig. 5b–e, respectively. The composite hologram \(F_{{{\text{compos}}}}\) was loaded onto SLM by computer. The camera was moved to \(z = d_{1}\), \(d_{2}\), \(d_{3}\) and \({ }d_{4}\) successively to capture diffraction images, as shown in Fig. 5f–i. According to the numerical reconstruction and optical reconstruction results of the composite hologram, different object can be focused and reconstructed at the given location. It can be seen that the proposed CGH algorithm can be used for holographic display of 3D objects in space.

5 Holographic display of 3D object

To observe the optical reconstruction of the complete 3D object smoothly, the residual visual phenomenon of human eyes and time-division multiplexing (TDM) technique [20] are combined, and the target 3D object is layered into a holographic display rapidly. The first step is to transform a 3D object into several layers of 2D images. According to the depth information of the z-axis direction, the target 3D object is processed by image stratification, and \(N\) parallel layers are obtained. \(L_{i}\) represents the \({\text{ith}}\) layer image, where \(i = 1,2 \ldots N\). The second step is to calculate the layer-hologram. The corresponding layer-hologram \(F_{i} \left( {i = 1,2 \ldots N} \right)\) for the layered image is obtained by selecting an appropriate CGH algorithm. The third step is to calculate multiple composite holograms. \(N\) layer-holograms are grouped with \(N/M\) holograms to obtain \(M\) group holograms. In each group, \(N/M\) layer holograms are superimposed according to Eq. (7) to obtain the corresponding composite hologram \(G_{j} \left( {j = 1,2 \ldots M} \right)\). The last step is to reconstruct the target object by high-speed SLM. Composite holograms \(G_{j} \left( {j = 1,2 \ldots M} \right)\) are successively loaded onto SLM by computer, and complete 3D objects can be smoothly observed by adjusting the refresh rate of SLM to meet the requirements of human visual residual phenomena.

In this paper, the aforementioned scheme is adopted to reconstruct the 3D object of ‘White Dog’ with a pixel size of 454 × 686 × 696 (Fig. 6). During the optical reconstruction, the target object is divided into 12 layers by using Adobe Photoshop, and the actual space distance span \({\Delta d}\) of each layer is set as \(0.1mm\). For each layered image, the corresponding layer-hologram \(F_{i} \left( {i = 1,2 \ldots 12} \right)\) is calculated according to the proposed CGH algorithm, in which the reconstruction focus \(d_{i} \left( {i = 1,2 \ldots 12} \right)\) carried is \(0mm + (i - 1) \times {\Delta }d\) in turn. Then, 12 layer-holograms are divided into 3 groups with 4 layers as a group. According to Eq. (7), composite hologram \(G_{j} \left( {j = 1,2,3} \right)\) is obtained, as shown in Fig. 7a–c, where the space distance span of each group is \(0.4mm\). Composite holograms \(G_{1}\), \(G_{2}\) and \(G_{3}\) are loaded onto SLM, and the camera is placed at \(z = 0mm\). The experimental results of the optical reconstruction are shown in Fig. 7d–f, respectively. The complete target 3D object can be obtained by adjusting the refresh frequency of SLM to 60 Hz (Fig. 7g). The optical reconstruction results show that the proposed CGH algorithm can be used in the holographic coding process of layer-based 3D holographic display and combined with TDM technology and high-speed SLM. It can also realise the rapid dynamic refresh of hologram and then the reconstruction of 3D object.

Fig. 6
figure 6

Holographic display scheme for 3D object

Fig. 7
figure 7

3D object reconstruction. ac Composite hologram \(G_{j} \left( {j = 1,2,3} \right)\). df Optical reconstruction results that correspond to (a)–(c). g 3D object reconstruction under high-speed hologram refresh

6 Conclusion

In this paper, we propose a conjugate symmetric extension Fourier CGH algorithm with controllable reconstruction focus based on the Fourier transform property that the forward or inverse Fourier transform of conjugate symmetric complex functions are real functions. First, complex amplitudes with conjugate symmetric distributions can be obtained by performing conjugate symmetric extension operations on the target object. Second, the real function that ranges from 0 to 2π can be obtained by taking the inverse Fourier transform of the conjugate symmetric complex function and mapping it linearly. Finally, a phase-only hologram that contains the amplitude, phase and reconstruction focus information of the target object can be obtained by superimposing the quadratic phase term carrying the reconstruction focus information and taking the remainder of 2π. Notably, the algorithm that contains only one inverse Fourier transform avoids the iterative process and improves the efficiency of holographic coding significantly.

In the numerical and optical reconstruction of single and composite holograms, the results at different distances prove that the diffraction image of the holograms obtained by the proposed CGH algorithm is sensitive to the spatial distance information and can reconstruct the image at the given reconstruction focus accurately, thereby omitting the constraints of the physical lens on the reconstruction focus. In the optical reconstruction experiment of 3D object display, the dynamic holographic display of 3D object is realised on the basis of the proposed CGH algorithm. With the rapid development of spatial light modulators, the combination of the proposed CGH algorithm with high holographic coding efficiency and SLM with higher refresh frequency can achieve real-time 3D holographic display.