HologramDepthmap Library
Functions
GPU Modules

Functions

void cudaFFT (CUstream_st *stream, int nx, int ny, cufftDoubleComplex *in_filed, cufftDoubleComplex *output_field, int direction, bool bNormailized=false)
 Convert data from the spatial domain to the frequency domain using 2D FFT on GPU. More...
 
void cudaCropFringe (CUstream_st *stream, int nx, int ny, cufftDoubleComplex *in_field, cufftDoubleComplex *out_field, int cropx1, int cropx2, int cropy1, int cropy2)
 Crop input data according to x, y coordinates on GPU. More...
 
void cudaDepthHoloKernel (CUstream_st *stream, int pnx, int pny, cufftDoubleComplex *u_o_gpu_, unsigned char *img_src_gpu_, unsigned char *dimg_src_gpu_, double *depth_index_gpu_, int dtr, double rand_phase_val_a, double rand_phase_val_b, double carrier_phase_delay_a, double carrier_phase_delay_b, int flag_change_depth_quan, unsigned int default_depth_quan)
 Find each depth plane of the input image and apply carrier phase delay to it on GPU. More...
 
void cudaPropagation_AngularSpKernel (CUstream_st *stream_, int pnx, int pny, cufftDoubleComplex *input_d, cufftDoubleComplex *u_complex, double ppx, double ppy, double ssx, double ssy, double lambda, double params_k, double propagation_dist)
 Angular spectrum propagation method for GPU implementation. More...
 
void cudaGetFringe (CUstream_st *stream, int pnx, int pny, cufftDoubleComplex *in_field, cufftDoubleComplex *out_field, int sig_locationx, int sig_locationy, double ssx, double ssy, double ppx, double ppy, double PI)
 Encode the CGH according to a signal location parameter on the GPU. More...
 
void cudaChangeDepthQuanKernel (CUstream_st *stream_, int pnx, int pny, double *depth_index_gpu, unsigned char *dimg_src_gpu, int dtr, double d1, double d2, double params_num_of_depth, double params_far_depthmap, double params_near_depthmap)
 Quantize depth map on the GPU, only when the number of depth quantization is not the default value (i.e. FLAG_CHANGE_DEPTH_QUANTIZATION == 1 ). More...
 

Detailed Description

Function Documentation

◆ cudaChangeDepthQuanKernel()

void cudaChangeDepthQuanKernel ( CUstream_st *  stream_,
int  pnx,
int  pny,
double *  depth_index_gpu,
unsigned char *  dimg_src_gpu,
int  dtr,
double  d1,
double  d2,
double  params_num_of_depth,
double  params_far_depthmap,
double  params_near_depthmap 
)

Calculate the value of 'depth_index_gpu_'.

Parameters
stream: CUDA Stream
pnx: the number of column of the input data
pny: the number of row of the input data
depth_index_gpu: output variable
dimg_src_gpu: input depth map data
dtr: the current working depth level
d1: the starting physical point of each depth level
d2: the ending physical point of each depth level
params_num_of_depth: the number of depth level
params_far_depthmap: NEAR_OF_DEPTH_MAP at config file
params_near_depthmap: FAR_OF_DEPTH_MAP at config file
See also
change_depth_quan_GPU

◆ cudaCropFringe()

void cudaCropFringe ( CUstream_st *  stream,
int  nx,
int  ny,
cufftDoubleComplex *  in_field,
cufftDoubleComplex *  out_field,
int  cropx1,
int  cropx2,
int  cropy1,
int  cropy2 
)

call CUDA Kernel - cropFringe.

Parameters
stream: CUDA Stream
nx: the number of column of the input data
ny: the number of row of the input data
in_field: input complex data variable
output_field: output complex data variable
cropx1: the start x-coordinate to crop.
cropx2: the end x-coordinate to crop.
cropy1: the start y-coordinate to crop.
cropy2: the end y-coordinate to crop.
See also
encoding_GPU

◆ cudaDepthHoloKernel()

void cudaDepthHoloKernel ( CUstream_st *  stream,
int  pnx,
int  pny,
cufftDoubleComplex *  u_o_gpu_,
unsigned char *  img_src_gpu_,
unsigned char *  dimg_src_gpu_,
double *  depth_index_gpu_,
int  dtr,
double  rand_phase_val_a,
double  rand_phase_val_b,
double  carrier_phase_delay_a,
double  carrier_phase_delay_b,
int  flag_change_depth_quan,
unsigned int  default_depth_quan 
)

call CUDA Kernel - depth_sources_kernel.

Parameters
stream: CUDA Stream
nx: the number of column of the input data
ny: the number of row of the input data
u_o_gpu_: output variable
img_src_gpu_: input image data
dimg_src_gpu_: input depth map data
depth_index_gpu_: input quantized depth map data
dtr: current working depth level
rand_phase_val_a: the real part of the random phase value
rand_phase_val_b: the imaginary part of the random phase value
carrier_phase_delay_a: the real part of the carrier phase delay
carrier_phase_delay_b: the imaginary part of the carrier phase delay
flag_change_depth_quan: if true, change the depth quantization from the default value.
default_depth_quan: default value of the depth quantization - 256
See also
Calc_Holo_GPU

◆ cudaFFT()

void cudaFFT ( CUstream_st *  stream,
int  nx,
int  ny,
cufftDoubleComplex *  in_filed,
cufftDoubleComplex *  output_field,
int  direction,
bool  bNormailized = false 
)

call CUDA Kernel - fftShift and CUFFT Library.

Parameters
stream: CUDA Stream
nx: the number of column of the input data
ny: the number of row of the input data
in_field: input complex data variable
output_field: output complex data variable
direction: If direction == -1, forward FFT, if type == 1, inverse FFT.
bNomarlized: If bNomarlized == true, normalize the result after FFT.
See also
Propagation_AngularSpectrum_GPU, encoding_GPU

◆ cudaGetFringe()

void cudaGetFringe ( CUstream_st *  stream,
int  pnx,
int  pny,
cufftDoubleComplex *  in_field,
cufftDoubleComplex *  out_field,
int  sig_locationx,
int  sig_locationy,
double  ssx,
double  ssy,
double  ppx,
double  ppy,
double  PI 
)

The variable, u255_fringe_ has the final result.

Parameters
stream: CUDA Stream
pnx: the number of column of the input data
pny: the number of row of the input data
in_field: input data
out_field: output data
sig_locationx: signal location of x-axis, left or right half
sig_locationy: signal location of y-axis, upper or lower half
ssx: pnx * ppx
ssy: pny * ppy
ppx: pixel pitch of x-axis
ppy: pixel pitch of y-axis
PI: Pi
See also
encoding_GPU

◆ cudaPropagation_AngularSpKernel()

void cudaPropagation_AngularSpKernel ( CUstream_st *  stream_,
int  pnx,
int  pny,
cufftDoubleComplex *  input_d,
cufftDoubleComplex *  u_complex,
double  ppx,
double  ppy,
double  ssx,
double  ssy,
double  lambda,
double  params_k,
double  propagation_dist 
)

The propagation results of all depth levels are accumulated in the variable 'u_complex_gpu_'.

Parameters
stream: CUDA Stream
pnx: the number of column of the input data
pny: the number of row of the input data
input_d: input data
u_complex: output data
ppx: pixel pitch of x-axis
ppy: pixel pitch of y-axis
ssx: pnx * ppx
ssy: pny * ppy
lambda: wavelength
params_k: 2 * PI / lambda
propagation_dist: the distance from the object to the hologram plane
See also
Propagation_AngularSpectrum_GPU