if (i == 0)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = featurebox[n].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test00.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 1)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test11.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 2)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test22.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 3)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test33.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 4)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test44.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 5)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test55.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 6)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test66.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 7)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test77.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 8)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test88.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 9)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = curIndexGrad[i].size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < featurebox[n].size() * (i + 1) * 0.1; j++)//computer the grad's Ex 0.1 point
{
int p0 = get<1>(featurebox[n][j]);
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test99.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 1)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test11.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 2)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width * cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test22.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 3)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test33.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 4)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test44.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 5)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test55.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 6)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test66.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 7)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test77.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 8)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test88.pcd", cloud1); //将点云保存到PCD文件中
}
if (i == 9)
{
pcl::PointCloud<pcl::PointXYZ> cloud1;
cloud1.width = V.size(); //设置点云宽度
cloud1.height = 1; //设置点云高度
cloud1.is_dense = false; //非密集型
cloud1.points.resize(cloud1.width* cloud1.height); //变形,无序
for (size_t j = 0; j < V.size(); j++)//computer the grad's Ex 0.1 point
{
int p0 = V[j];
cloud1.points[j].x = cloud->points[p0].x;
cloud1.points[j].y = cloud->points[p0].y;
cloud1.points[j].z = cloud->points[p0].z;
}
//保存到PCD文件
pcl::io::savePCDFileASCII("test99.pcd", cloud1); //将点云保存到PCD文件中
}