Export: exporting with intensity for laser scans

This commit is contained in:
matlabbe
2019-02-06 18:46:37 -05:00
parent c8cd745f81
commit 6fc884b575
6 changed files with 228 additions and 90 deletions

View File

@@ -2485,6 +2485,12 @@ pcl::PointXYZRGB laserScanToPointRGB(const LaserScan & laserScan, int index, uns
output.g = (unsigned char)((ptrInt[indexRGB] >> 8) & 0xFF);
output.r = (unsigned char)((ptrInt[indexRGB] >> 16) & 0xFF);
}
else if(laserScan.hasIntensity())
{
// based on Velodyne/SICK specification of intensity 0-100
int indexIntensity = laserScan.getIntensityOffset();
output.b = output.g = output.r = (unsigned char)ptr[indexIntensity];
}
else
{
output.r = r;
@@ -2539,6 +2545,12 @@ pcl::PointXYZRGBNormal laserScanToPointRGBNormal(const LaserScan & laserScan, in
output.g = (unsigned char)((ptrInt[indexRGB] >> 8) & 0xFF);
output.r = (unsigned char)((ptrInt[indexRGB] >> 16) & 0xFF);
}
else if(laserScan.hasIntensity())
{
// based on Velodyne/SICK specification of intensity 0-100
int indexIntensity = laserScan.getIntensityOffset();
output.b = output.g = output.r = (unsigned char)ptr[indexIntensity];
}
else
{
output.r = r;

View File

@@ -792,6 +792,10 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr removeNaNFromPointCloud(const pcl::PointC
{
return removeNaNFromPointCloudImpl<pcl::PointXYZRGB>(cloud);
}
pcl::PointCloud<pcl::PointXYZI>::Ptr removeNaNFromPointCloud(const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud)
{
return removeNaNFromPointCloudImpl<pcl::PointXYZI>(cloud);
}
template<typename PointT>
typename pcl::PointCloud<PointT>::Ptr removeNaNNormalsFromPointCloudImpl(
@@ -812,6 +816,11 @@ pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr removeNaNNormalsFromPointCloud(
{
return removeNaNNormalsFromPointCloudImpl<pcl::PointXYZRGBNormal>(cloud);
}
pcl::PointCloud<pcl::PointXYZINormal>::Ptr removeNaNNormalsFromPointCloud(
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud)
{
return removeNaNNormalsFromPointCloudImpl<pcl::PointXYZINormal>(cloud);
}
pcl::IndicesPtr radiusFiltering(const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud, float radiusSearch, int minNeighborsInRadius)