53 #ifndef __ophPointCloud_GPU_h 54 #define __ophPointCloud_GPU_h 58 #define __DEBUG_LOG_GPU_SPEC_ 61 #include <cuda_runtime.h> 63 #define __CUDA_INTERNAL_COMPILATION__ //for CUDA Math Module 64 #include <math_constants.h> 65 #include <math_functions.h> 66 #include <math_functions_dbl_ptx3.h> 67 #include <vector_functions.h> 68 #undef __CUDA_INTERNAL_COMPILATION__ 70 #define OPH_CUDA_N_STREAM 100 71 static void HandleError(cudaError_t err,
74 if (err != cudaSuccess) {
75 printf(
"%s in %s at line %d\n", cudaGetErrorString(err),
80 #define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ )) 83 #define HANDLE_NULL( a ) {if (a == NULL) { \ 84 printf( "Host memory failed in %s at line %d\n", \ 85 __FILE__, __LINE__ ); \ 86 exit( EXIT_FAILURE );}} 115 const vec3 &scale_factor,
117 const ivec2 &pixel_number,
118 const vec2 &pixel_pitch,
128 this->scale_X = scale_factor[
_X] * ratio;
129 this->scale_Y = scale_factor[
_Y] * ratio;
130 this->scale_Z = scale_factor[
_Z];
134 this->pn_X = pixel_number[
_X];
135 this->pn_Y = pixel_number[
_Y];
138 this->pp_X = pixel_pitch[
_X];
139 this->pp_Y = pixel_pitch[
_Y];
142 this->half_ss_X = ss[
_X] / 2;
143 this->half_ss_Y = ss[
_Y] / 2;
162 const vec3 &scale_factor,
164 const ivec2 &pixel_number,
165 const vec2 &pixel_pitch,
171 :
KernelConst(
n_points,
n_colors,
n_streams, scale_factor,
offset_depth, pixel_number, pixel_pitch, ss,
k,
lambda, ratio)
176 this->det_tx =
tx / sqrt(1 -
tx *
tx);
177 this->det_ty =
ty / sqrt(1 -
ty *
ty);
186 this->det_tx =
tx / sqrt(1 -
tx *
tx);
187 this->det_ty =
ty / sqrt(1 -
ty *
ty);
201 const vec3 &scale_factor,
203 const ivec2 &pixel_number,
204 const vec2 &pixel_pitch,
210 :
KernelConst(
n_points,
n_colors,
n_streams, scale_factor,
offset_depth, pixel_number, pixel_pitch, ss,
k,
lambda, ratio)
212 this->tx =
lambda / (2 * pixel_pitch[
_X]);
213 this->ty =
lambda / (2 * pixel_pitch[
_Y]);
228 const int &nBlocks,
const int &nThreads,
const int &n_pts_per_stream,
229 double* cuda_pc_data,
double* cuda_amp_data,
230 double* cuda_dst_double,
double* cuda_dst_imag,
234 const int &nBlocks,
const int &nThreads,
const int &n_pts_per_stream,
235 double* cuda_pc_data,
double* cuda_amp_data,
236 double* cuda_dst_double,
double* cuda_dst_imag,
KernelConst_NotEncodedFrsn(GpuConst &cuda_config)
Real lambda
Wave Number = (2 * PI) / lambda;.
struct KernelConst GpuConst
double half_ss_Y
(pixel_x * nx) / 2
void cudaGenCghPointCloud_NotEncodedFrsn(const int &nBlocks, const int &nThreads, const int &n_pts_per_stream, double *cuda_pc_data, double *cuda_amp_data, double *cuda_dst_double, double *cuda_dst_imag, const GpuConstNEFR *cuda_config, const uint &iChannel)
void cudaGenCghPointCloud_NotEncodedRS(const int &nBlocks, const int &nThreads, const int &n_pts_per_stream, double *cuda_pc_data, double *cuda_amp_data, double *cuda_dst_double, double *cuda_dst_imag, const GpuConstNERS *cuda_config, const uint &iChannel, const uint &mode)
double pp_Y
Pixel pitch of SLM in x direction.
KernelConst_NotEncodedRS(GpuConst &cuda_config)
double offset_depth
Scaling factor of z coordinate of point cloud.
KernelConst(const int &n_points, const int &n_colors, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda, const Real &ratio)
double det_ty
tx / sqrt(1 - tx^2), tx = lambda / (2 * pp_X)
double pp_X
Number of pixel of SLM in y direction.
KernelConst_NotEncodedRS(const int &n_points, const int &n_colors, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda, const Real &ratio)
ty / sqrt(1 - ty^2), ty = lambda / (2 * pp_Y)
double scale_Y
Scaling factor of x coordinate of point cloud.
double scale_Z
Scaling factor of y coordinate of point cloud.
KernelConst_NotEncodedRS GpuConstNERS
KernelConst_NotEncodedFrsn GpuConstNEFR
double half_ss_X
Pixel pitch of SLM in y direction.
int n_streams
number of colors per point cloud
int pn_X
Offset value of point cloud in z direction.
int n_colors
number of point cloud
double scale_X
number of streams
int pn_Y
Number of pixel of SLM in x direction.
Real k
Pixel pitch of SLM in y direction.
double ty
tx = lambda / (2 * pp_X)
KernelConst_NotEncodedFrsn(const int &n_points, const int &n_colors, const int &n_streams, const vec3 &scale_factor, const Real &offset_depth, const ivec2 &pixel_number, const vec2 &pixel_pitch, const vec2 &ss, const Real &k, const Real &lambda, const Real &ratio)
ty = lambda / (2 * pp_Y)