40 #include <pcl/gpu/utils/safe_call.hpp>
41 #include <pcl/gpu/kinfu_large_scale/device.h>
169 const MapArr& vmap_g_prev,
const MapArr& nmap_g_prev,
float distThres,
float angleThres,
191 const MapArr& vmap_g_prev,
const MapArr& nmap_g_prev,
float distThres,
float angleThres,
278 raycast (
const Intr& intr,
const Mat33& Rcurr,
const float3& tcurr,
float tranc_dist,
const float3& volume_size,
365 template<
typename NormalType>
381 struct float12 {
float x,
y,
z,
w,
normal_x,
normal_y,
normal_z,
n4,
c1,
c2,
c3,
c4; };
405 return *
reinterpret_cast<int*
>(&value) != 0x7fffffff;
411 sync () { cudaSafeCall (cudaDeviceSynchronize ()); }
414 template<
class D,
class Matx> D&
417 return (*
reinterpret_cast<D*
>(matx.data ()));
425 bindTextures(
const int *edgeBuf,
const int *triBuf,
const int *numVertsBuf);
void createNMap(const MapArr &vmap, MapArr &nmap)
Computes normal map using cross product.
void unbindTextures()
Unbinds.
void resizeNMap(const MapArr &input, MapArr &output)
Performs resize of vertex map to next pyramid level by averaging each four normals.
void estimateTransform(const MapArr &v_dst, const MapArr &n_dst, const MapArr &v_src, const PtrStepSz< short2 > &coresp, DeviceArray2D< float > &gbuf, DeviceArray< float > &mbuf, float *matrixA_host, float *vectorB_host)
(now it's extra code) Computation Ax=b for ICP iteration
void createVMap(const Intr &intr, const DepthMap &depth, MapArr &vmap)
Computes vertex map.
void integrateTsdfVolume(const PtrStepSz< ushort > &depth_raw, const Intr &intr, const float3 &volume_size, const Mat33 &Rcurr_inv, const float3 &tcurr, float tranc_dist, PtrStep< short2 > volume)
Performs Tsfg volume uptation (extra obsolete now)
void pushCloudAsSliceGPU(const PtrStep< short2 > &volume, pcl::gpu::DeviceArray< PointType > cloud_gpu, const pcl::gpu::kinfuLS::tsdf_buffer *buffer)
Loads the values of a tsdf point cloud to the tsdf volume in GPU.
void sync()
synchronizes CUDA execution
void mergePointNormal(const DeviceArray< float4 > &cloud, const DeviceArray< float8 > &normals, const DeviceArray< float12 > &output)
Merges pcl::PointXYZ and pcl::Normal to PointNormal.
void generateDepth(const Mat33 &R_inv, const float3 &t, const MapArr &vmap, DepthMap &dst)
Renders depth image from give pose.
void exctractColors(const PtrStep< uchar4 > &color_volume, const float3 &volume_size, const PtrSz< PointType > &points, uchar4 *colors)
Performs colors extraction from color volume.
void transformMaps(const MapArr &vmap_src, const MapArr &nmap_src, const Mat33 &Rmat, const float3 &tvec, MapArr &vmap_dst, MapArr &nmap_dst)
Performs affine transform of vertex and normal maps.
void generateImage(const MapArr &vmap, const MapArr &nmap, const LightSource &light, PtrStepSz< uchar3 > dst)
Renders 3D image of the scene.
void estimateCombined(const Mat33 &Rcurr, const float3 &tcurr, const MapArr &vmap_curr, const MapArr &nmap_curr, const Mat33 &Rprev_inv, const float3 &tprev, const Intr &intr, const MapArr &vmap_g_prev, const MapArr &nmap_g_prev, float distThres, float angleThres, DeviceArray2D< float > &gbuf, DeviceArray< float > &mbuf, float *matrixA_host, float *vectorB_host)
Computation Ax=b for ICP iteration.
void extractNormals(const PtrStep< short2 > &volume, const float3 &volume_size, const PtrSz< PointType > &input, NormalType *output)
Performs normals computation for given points using tsdf volume.
void convert(const MapArr &vmap, DeviceArray2D< T > &output)
Conversion from SOA to AOS.
void generateTriangles(const PtrStep< short2 > &volume, const DeviceArray2D< int > &occupied_voxels, const float3 &volume_size, DeviceArray< PointType > &output)
Generates final triangle array.
void initColorVolume(PtrStep< uchar4 > color_volume)
Initialized color volume.
void truncateDepth(DepthMap &depth, float max_distance)
Performs depth truncation.
void computeNormalsEigen(const MapArr &vmap, MapArr &nmap)
Computes normal map using Eigen/PCA approach.
void bindTextures(const int *edgeBuf, const int *triBuf, const int *numVertsBuf)
Binds marching cubes tables to texture references.
int getOccupiedVoxels(const PtrStep< short2 > &volume, DeviceArray2D< int > &occupied_voxels)
Scans tsdf volume and retrieves occupied voxels.
void resizeVMap(const MapArr &input, MapArr &output)
Performs resize of vertex map to next pyramid level by averaging each four points.
PCL_EXPORTS void clearTSDFSlice(PtrStep< short2 > volume, pcl::gpu::kinfuLS::tsdf_buffer *buffer, int shiftX, int shiftY, int shiftZ)
Function that clears the TSDF values.
PCL_EXPORTS void initVolume(PtrStep< short2 > array)
Perform tsdf volume initialization.
void bilateralFilter(const DepthMap &src, DepthMap &dst)
Performs bilateral filtering of disparity map.
int computeOffsetsAndTotalVertexes(DeviceArray2D< int > &occupied_voxels)
Computes total number of vertices for all voxels and offsets of vertices in final triangle array.
void updateColorVolume(const Intr &intr, float tranc_dist, const Mat33 &R_inv, const float3 &t, const MapArr &vmap, const PtrStepSz< uchar3 > &colors, const float3 &volume_size, PtrStep< uchar4 > color_volume, int max_weight=1)
Performs integration in color volume.
PCL_EXPORTS std::size_t extractCloud(const PtrStep< short2 > &volume, const float3 &volume_size, PtrSz< PointType > output)
Perform point cloud extraction from tsdf volume.
bool valid_host(float value)
Check for qnan (unused now)
void raycast(const Intr &intr, const Mat33 &Rcurr, const float3 &tcurr, float tranc_dist, const float3 &volume_size, const PtrStep< short2 > &volume, const pcl::gpu::kinfuLS::tsdf_buffer *buffer, MapArr &vmap, MapArr &nmap)
Generation vertex and normal maps from volume for current camera pose.
void findCoresp(const MapArr &vmap_g_curr, const MapArr &nmap_g_curr, const Mat33 &Rprev_inv, const float3 &tprev, const Intr &intr, const MapArr &vmap_g_prev, const MapArr &nmap_g_prev, float distThres, float angleThres, PtrStepSz< short2 > coresp)
(now it's extra code) Computes corespondances map
void paint3DView(const PtrStep< uchar3 > &colors, PtrStepSz< uchar3 > dst, float colors_weight=0.5f)
Paints 3D view with color map.
D & device_cast(Matx &matx)
void pyrDown(const DepthMap &src, DepthMap &dst)
Computes depth pyramid.
PCL_EXPORTS std::size_t extractSliceAsCloud(const PtrStep< short2 > &volume, const float3 &volume_size, const pcl::gpu::kinfuLS::tsdf_buffer *buffer, const int shiftX, const int shiftY, const int shiftZ, PtrSz< PointType > output_xyz, PtrSz< float > output_intensities)
Perform point cloud extraction of a slice from tsdf volume.
Camera intrinsics structure.
3x3 Matrix for device code
Structure to handle buffer addresses.