PCL正态分布变换(Normal Distributions Transform)进行点云配准

直接记录代码

void NormTran::run()
{
	readfile("bunny_0.asc", "bunny_1.asc");//加载目标点云数据
	//滤波

	pcl::ApproximateVoxelGrid<pcl::PointXYZ> approximate_voxel_filter;
	approximate_voxel_filter.setLeafSize(0.01, 0.01, 0.01);
	approximate_voxel_filter.setInputCloud(cloud_Source);
	approximate_voxel_filter.filter(*filtered_cloud_Source);
	std::cout << "Filtered cloud contains " << filtered_cloud_Source->size() << std::endl;
	//
	//初始化NDT对象
	pcl::NormalDistributionsTransform<pcl::PointXYZ, pcl::PointXYZ> ndt;

	//根据输入数据的尺寸设置相关参数
	ndt.setTransformationEpsilon(0.0001);//为终止条件设置最小转换差异
	ndt.setStepSize(0.1); //为more-thuente线搜索设置最大步长
	ndt.setResolution(0.01); //设置NDT网格网格结构的分辨率(voxelgridcovariance)
	ndt.setMaximumIterations(100);

	ndt.setInputSource(filtered_cloud_Source);//源点云
	ndt.setInputTarget(cloud_Target);//目标点云

	// 设置使用机器人测距法得到的粗略初始变换矩阵结果
	Eigen::AngleAxisf init_rotation(0.6931, Eigen::Vector3f::UnitZ());
	Ei
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值