Skip to content

GPU-accelerated real-time reference-based dynamic phase retrieval G-LS3U

License

Notifications You must be signed in to change notification settings

TWANG006/G-LS3U

Repository files navigation

Research code for real-time reference-based dynamic phase retrieval G-LS3U

This repository contains the code for the real-time reference based phase retrieval aglorithm [1].

Checklist

Utils:

Utility functions written for both CPU and GPU, including fast 2D matrix I/O, host and device memory manager, etc.

AIA

Implementation of the AIA algorithm for fast and accurate phase extraction using random phase shifting [2], which is used to comptue the initial phase distribution.

- [x] Multi-core double precision 
- [x] Multi-core single precision
- [x] CUDA single precision
- [x] CUDA double precision

DPRA

Core algorithm of the real-time reference-based dynamic phase retrieval algorithm [1].

- [x] Multi-core double precision 
- [x] Multi-core single precision
- [x] CUDA single precision
- [x] CUDA double precision

  Note: The followiwng two implementations are just for testing purpose. Their performance is between the multi-core and CUDA implementaitons

- [x] Hybrid CPU and GPU, double precision
- [x] Hybrid CPU and GPU, single precision

WFT

Improved implementaiton of the parallel Windowed Fourier Transform (WFT) algorithm [3].

Windowed Fourier Filtering (WFF) algorithm (Used in the proposed G-LS3U algorithm): .

- [x] Multi-core double precision 
- [x] Multi-core single precision
- [x] CUDA single precision
- [x] CUDA double precision

Windowed Fourier Ridges (WFR) algorithm:

- [x] Multi-core double precision 
- [x] Multi-core single precision
- [x] CUDA single precision
- [x] CUDA double precision

App_DPRA

A demonstration application written for the G-LS3U algorithm. The application can take a sequence of capdtured fringe patterns and exatract the phase distributions amogn frames then build them into a video. Note: use the AIA function provided int he application's UI to calculate an initial phase distribution first before using any other functionalities.

Project dependencies

  1. Intel Math Kernel Library (MKL): using fftw3 to do fast Fourier transform (FFT) and LAPACK routine to solve linear system in parlalel on CPU.
  2. CUDA 10.2: for parallel computing on NVIDIA GPUs.
  3. CUFFT: associated with CUDA, for perform parallel FFT on GPU.
  4. Qt 5.14: for GUI and multi-media used in App_DPRA.
  5. OpenCV 3.4.1: for fast and convenient image I/O.

Note: On Windows OS using Visual Studio 2017, install these dependencies and your are all set to compile and run the programs.

Reference

[1] Chen, Y., Wang, T., & Kemao, Q. (2021) Parallel advanced iterative algorithm for phase extraction with unknown phase-shifts. Optics and Lasers in Engineering, 138, 106408.

[2] Wang, T., Kai, L., & Kemao, Q. (2017). Real-time reference-based dynamic phase retrieval algorithm for optical measurement. Applied Optics, 56(27), 7726-7733.

[3] Wang, Z., & Han, B. (2004). Advanced iterative algorithm for phase extraction of randomly phase-shifted interferograms. Optics letters, 29(14), 1671-1673.

[4] Gao, W., Huyen, N. T. T., Loi, H. S., & Kemao, Q. (2009). Real-time 2D parallel windowed Fourier transform for fringe pattern analysis using Graphics Processing Unit. Optics express, 17(25), 23147-23152.