正文模板 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 62 Research on Digital Holographic 3D Reconstruction Software Ma Jing School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, Shaanxi, China e-mail: majing_majing@qq.com Fu Yanfang, Tian Penghui School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, Shaanxi, China Abstract—Digital holography has a wide range of applications in displaying the surface morphology of three-dimensional objects. There have been many studies on the physical methods and implementation methods of digital holography. One of the main problems at present is to design a stable and fast reconfiguration software. This paper analyzes the basic principle of convolution based off-axis digital holographic reconstruction, and presents the process of 3D reconstruction of off-axis digital holography. The 3D reconstruction software of digital holography is designed and developed according to the basic principle and the process of reconstruction, and the parallel operation of 3D reconstruction is realized by OpenMP. Results show that the software can help researchers conveniently realize digital holographic three-dimensional reconstruction. The reconstructed parameters can be adjusted according to the requirements, and the spectra, intensity maps, phase maps and other information required in the reconstruction process can be obtained. The software meets the needs of digital three-dimensional reconstruction. Keywords-Digital Holography; Three-dimensional Reconstruction; Parallel Computing; Software Design I. INTRODUCTION Digital holography has wide application prospects in the field of three-dimensional surface deformation measurement [1], particle field test [2], flow field measurement [3], biological sample microscopic measurement [4-5]. At present, a lot of research on the algorithms and applications of digital holography has been carried out. In the early stage, the single Fourier transform algorithm is widely used, and this algorithm can reproduce the pixel size and the reproduction distance. Now based on the Fast Fourier Transform convolution, angular and Fresnel methods for phase unwrap and numerical compensation for a lot of improvements [6-7]. In order to carry out the required reconstruction in the research of digital holography conveniently and quickly, in this paper, based on the reconstruction principle used in 3D reconstruction of digital holography, a digital holographic 3D reconstruction software is designed and developed according to the reconstruction process. II. RECONSTRUCTION PRINCIPLE The principle of digital holography is the same as that of traditional optical holography. It is divided into the recording and reproducing process of matter and light wave, which are realized by the interference principle and diffraction principle of light. Digital holographic reconstruction is to process the digital hologram to obtain the object information. For off-axis holography, we need to record the object information in the form of interference fringes by off-axis physical optical path, and use the interference principle to record the object information in the form of an image through a CCD camera to form a hologram. According to different measurement objects and recording conditions, digital holographic methods mainly include convolutional reconstruction algorithm and Fresnel diffraction integral reconstruction algorithm. The software uses a convolution method. According to convolution theory, the complex amplitude of the object light,  ,U x y can be expressed in the following formula according to the intensity of interference fringes, the intensity of reference light and the impulse response function.     1, { [ ( , )( , )] [ ( , , , )]}u x y F F H x y C x y F h x y In the formula,  ,H x y is a hologram,  ,C x y is a reference light,   , , ,h x y is a impulse response function, which is related to a specific physical optical path. The calculation method is as follows:                        2 2 2 0 2 2 2 0 exp( ( ) ( ) , , , ( ) ( ) ( , ) jk z x y h x y j z x y h x y In the formula, λ is wavelength. The block diagram of the algorithm is shown in Figure 1. H(x,y) C(x,y) X Fourier transform F(h(x,y)) X Fourier inverse transform u(x,y) Figure 1. Block diagram of convolution The complex amplitude of the object light can be obtained by the above method. The complex amplitude of the object light carries the three-dimensional information of the object. If the object fluctuates beyond the wavelength range, it needs to be unwrapped to extract the three- dimensional distribution information of the object. In the process of digital holographic reconstruction, there are usually three ways:(1) Fresnel transform diffraction 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 63 method (2) Fourier transform filter method (3) Fresnel wavelet transform method. The software uses the method (2). Fourier transform filter method directly to digital hologram Fourier transform, and then in the Fourier domain using filtering, frequency shift and other methods to remove the zero-order spectrum and the spectrum of conjugation, and then inverse Fourier transform. Phase unwrapping is to achieve an important part of 3D reconstruction of digital holography. The minimum norm method is a kind of algorithms which are widely used at present, of which there are four typical algorithms. (1) Least square method based on fast Fourier transform (2) Least square method based on discrete cosine transform (3) Least square method based on transverse shear interference (4) Preconditioned conjugate gradient method. The software uses the method (1) to unwrap the phase diagram. The least square method based on Fast Fourier Transform The basic steps are as follows: (1) The package phase  ,i j even periodic extension, get y  ,i j ; (2) calculated               , , 1, , , 1 ( ) ( ) x x y y i j i j i j i j i j , among them       , 1, , x i j i j i j ,       , , 1 , y i j i j i j ; (3) Perform a two-dimensional FFT on  ,i j to get , ˆ i j P ; (4) Find     , , ˆ ˆ /[2cos( / ) 2cos( / ) 4] i j i j F P i M j N (5) Perform the two-dimensional IFFT transform on , ˆ i j F to obtain the true phase value  , ˆ i j after the period extension, take    , , ˆ 4 i j i j III. SOFTWARE DESIGN A. Refactoring Process Digital holographic reconstruction software reconstruction process shown in Figure 2. The object of digital holographic processing is the hologram collected by reconstructing the hardware system. According to the different components of the reconstructed hardware system, the first need to multiply the hologram with the reference light. For the case of reference light for plane light, this step can be omitted. After getting the spectrum, You will find the spectral distribution of the information contained in the spectrum near the center of the positive and negative level, the strongest in the image center of the zero-level there is no object information. Therefore, the need for frequency selection and frequency shift. Frequency selection is to choose a positive or negative level of the spectrum area. The frequency shift is to move the positive first-order or negative-order spectrum center to the image center. According to the need to reconstruct the hologram, frequency spectrum processing for frequency shift. Besides shifting the frequency spectrum to the center of the circle, we can see clearly that there is another advantage besides the image frequency distribution. It can separate the periodic interference signals. After the frequency-shifted image is obtained, the transfer function is multiplied with the frequency shifted image, and the product of the two is inverse Fourier transformed. The inverse transform image is a complex image. The phase contains the information of the object. In this case, the phase 0-2pi needs to be unwrapped. Holog ram Reference light X Fourier transform Spectrum diag ram Frequency shift Frequency shift after frequency shift Transfer function diag ram Inverse Fourier transform X Plural function diag ram Unwrapping Phase diag ram Unwrap the phase diag ram Object elevation data Linear transformation Figure 2. Digital holographic 3d reconstruction process After unwrapping the phase represents the actual object elevation, the phase information of the object can be obtained according to the calibration value. The reconstruction algorithm of the three dimensional digital holography is a complicated and time-consuming process. In addition, in the process of reconstruction, the user is generally required to select the appropriate spectrum area and set the reconfiguration parameters such as the reconfiguration distance and wavelength. Therefore, in the design of software, multi-threaded design ideas. Work interface using interface thread, reconstruction algorithm for worker threads. 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 64 B. Parallel processing algorithm In the process of 3D reconstruction of digital holography, a lot of image processing is needed. Parallel processing algorithm is needed to improve the speed of operation, so as to improve the real-time performance of 3D reconstruction of digital holography. This paper uses OpenMP technology to realize parallel operation. OpenMP is led by the OpenMP Architecture Review Board and is widely accepted. t is a set of guiding compilation and processing scheme (Compiler Directive) for multi thread programming for shared memory parallel system. Because the reconstruction process of digital holography for every image needs sequential execution, it can not parallel operation of different stages of reconstruction process. The task of each process can only be processed in parallel. From the processing flow, it can be seen that the sub tasks are basically the processing of the complex number or the real image. Therefore, this paper uses the parallel processing method for the loop operation, and only needs to add the following OpenMP compilation instructions before the for statement which needs parallel operation: #pragma omp parallel for schedule(kind,[size]) Among them kind represents a pattern, and there are three patterns in all , They are static 、 dynamic and guided。The static mode for each thread to allocate size cycle tasks, according to the number of threads to complete the task allotment. If the size value is too large, it may cause some heavy kernel tasks, and some kernels do not have the task. In dynamic mode, the size cycle task is also assigned to each kernel on the surface, but the allocation process is dynamic. Which kernel is idle to give it a size distribution cycle tasks. In guided mode, each kernel is assigned tasks in descending order, allocating more tasks first, and then gradually reducing the tasks, the minimum task size cycle. If no size is specified in all the above modes, the default value is 1. In order to detect the running speed of parallel algorithm and all kinds of parallel operation modes, the running time of software is tested on desktop equipped with AMD Phenom II X6 1055T six core processor. The resolution of the hologram is 1024x768. The 400 reconstruction of holograms is done during the test, and the mean and variance of the reconstructed time are calculated, as shown in Table 1. TABLE I. RECONFIGURATION TIME FOR DIFFERENT PARALLEL MODES Parallel mode Times Variance None 0.369 0.0075 Static,2 0.236 0.0080 Dynamic,2 0.233 0.0055 Guided,2 0.233 0.0051 Static,8 0.242 0.0160 Dynamic,8 0.236 0.0075 Guided,8 0.238 0.0057 From the above test results, we can see that when the parallel processing algorithm is not adopted, the average time of each reconstruction is 0.369s, which is about 1.56 times parallel algorithm. For different parallel algorithm patterns, the average reconfiguration time is almost the same and the variance has small difference. IV. PROCESSING RESULTS Based on the above reconstruction algorithm, the 3D reconstruction software of digital holography is developed by using C++ language. In order to verify the effect of the software, a part of the hologram is reconstructed. As shown in Figure 3, the main parameters of the microlens array hologram are as follows: wavelength(532nm), Pixel size(4.65um), Sample refractive index(1.461), Reconstruction distance(0mm) Figure 3. Microlens array hologram The reconfiguration of the hologram is based on the above reconfiguration parameters, and the result of the reconfiguration is shown in Figure 4. Figure 4. Reconstructed image of microlens array Figure 5 shows a hologram of a cross object with a wavelength of 632.8nm, a pixel size of 4.65um, and a reconfiguration distance of 105.9mm. 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 65 Figure 5. Cross structure hologram The reconstructed 3D image is shown in Figure 6. Figure 6. Cross structure reconstructed image The 3D reconstruction software of digital holography can not only display the 3D reconstruction map, but also display the original phase map, frequency spectrum, intensity map, phase map and 3D reconstruction map according to the requirements. Users can set reconfiguration parameters according to needs, select positive and negative primary centers and reconstructed areas in the center of spectrum, and reconstruct results and process data can be saved in images or data. The software interface is shown in Figure 7. Figure 7. Software interface V. CONCLUSION This paper analyzes the basic principle of the reconstruction of off-axis digital holography based on convolution. According to this principle, the 3D reconstruction process of off-axis digital holography is given, and the 3D reconstruction software of digital holography is designed and developed. In order to improve the running speed of 3D reconstruction, the parallel operation of 3D reconstruction is realized by using OpenMP Technology. The various implementations of OpenMP parallel computing methods were analyzed comparatively. The results show that the average time is basically the same as the reconstruction of various parallel mode, but the variance of guided model is relatively smaller. Finally, the partial hologram is reconstructed by using this software. The result shows that the software can fulfill the requirement of 3D reconstruction of digital holography, and has good practicability. It solves the functional integration needed in digital holography reconstruction, and facilitates the process of digital holography. ACKNOWLEDGMENTS The work described in this paper was fully supported by Special scientific research project of Shaanxi Provincial Education Department(16JK1379), and Shaanxi Province New Network and Testing and Control Engineering Laboratory project. And State and Provincial Joint Engineering Laboratory of Advanced Network and Monitoring Conrrol(ANMC) fund project(GSYSJ2017011). REFERENCE [1] Kim Myung K, Parshall Daniel Phase imaging digital holography for biological microscopy. Proc of SPIE,2004,5324:94~101 [2] C. B. Lefebvre, S. Coëtmellec, D. Lebrun, et al. Application of wavelet transform to hologram analysis: three dimensional location of particles[J]. Opt. Laser Eng., 2000, 33(6): 409-421 [3] J. Desse, P. Picart, P. Tankam. Digital three-color holographic interferometry for flow analysis[J]. Opt. Express, 2008, 16(5): 5471- 5480. [4] M.K. Kim. Application of digital holography in biomedical microscopy. J.Opt. Soc.Korea, 2010, 14(2):77-89. [5] U. Schnar and W. Juptner, Digital recording and numereical reconstruction of holograms, Meas. Sci. Technol, 2002,13:R85-R101. [6] Zhang yi Zhuo, Wang da Yong, Zhao jie, Wan yu Hong, Jiang zhu Qing, Tao shi Quan. Research on practical phase unwrapping algorithm in digital holography [J]. Journal of Optics.2009.29(12): 3323-3327. [7] Zhang zhi Hui, Wang hua Ying, Liu zuo Qiang, HuangMin, Liu fei Fei, Yu Meng Jie, Zhao bao Qun. Phase Unwrapping Algrithms Based on Fast Four Transform. Laser & Optoeelectronics Progress, 2012, 120902(49):120902-1~7.