This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename PointT> | |
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> | |
ProcessPointClouds<PointT>::SegmentPlane( typename pcl::PointCloud<PointT>::Ptr cloud, int maxIterations, float distanceThreshold) { | |
// Time segmentation process | |
auto startTime = std::chrono::steady_clock::now(); | |
// downsample input point cloud | |
auto cloud_ds = DownSample(cloud, 1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( !cloud->empty() ){ | |
// Create cv::Mat | |
image = cv::Mat( cloud->height, cloud->width, CV_8UC4 ); | |
// pcl::PointCloud to cv::Mat | |
#pragma omp parallel for | |
for( int y = 0; y < image.rows; y++ ) { | |
for( int x = 0; x < image.cols; x++ ) { | |
pcl::PointXYZRGBA point = cloud->at( x, y ); | |
image.at<cv::Vec4b>( y, x )[0] = point.b; |