-
大小: 2.42MB文件類型: .7z金幣: 1下載: 0 次發(fā)布日期: 2023-09-20
- 語言: 其他
- 標(biāo)簽: PCL??點(diǎn)云拼接??
資源簡介
PCL1.8.0和VS2013用于點(diǎn)云的拼接,是已經(jīng)編輯好的資源,點(diǎn)擊.sln文件可以直接進(jìn)行運(yùn)行。如果其他版本的PCL或者VS,那么可以把里面的union.cpp添加到工程就可以直接運(yùn)行了
代碼片段和文件信息
#include?
#include?
#include?
using?namespace?std;??//?可以加入?std?的命名空間
int
main(int?argc?char**?argv)
{
string?ReviseName;
cout?<“是否已經(jīng)修改輸出文件的名稱和K值?請(qǐng)輸入Y或N。“?< cin?>>?ReviseName;
if?(ReviseName?!=?“Y“)
{
return?(-1);//跳出整個(gè)程序
}
pcl::PointCloud::Ptr?cloud(new?pcl::PointCloud); //?總點(diǎn)
pcl::PointCloud::Ptr?cloud1(new?pcl::PointCloud); //?點(diǎn)云1
pcl::PCDReader?reader;
reader.read(“part01_mainLeft.pcd“?*cloud1);//讀取pcd文件,用指針傳遞給cloud。
pcl::PointCloud::Ptr?cloud2(new?pcl::PointCloud); //?點(diǎn)云2
reader.read(“Scatter0.pcd“?*cloud2);//讀取pcd文件,用指針傳遞給cloud。
//拷貝點(diǎn)云數(shù)據(jù)
*cloud?=?*cloud1;
*cloud?+=?*cloud2;
//輸出時(shí)所用離群點(diǎn)的名字
string?name_out1?=?“part01Left_“;???//因?yàn)閟tring變量自身就帶著隱含的雙引號(hào)了,所以不用特意加雙引號(hào)
string?name_out2?=?“Scatter0.pcd“;
string?name_out?=?name_out1;?name_out?+=?name_out2;?
//cout?<
pcl::PCDWriter?writer;
writer.write(name_out?*cloud?false);//濾波后內(nèi)點(diǎn)(主體點(diǎn))
return(0);
}
評(píng)論
共有 條評(píng)論