ORB-SLAM2稠密点云重建:RGBD室内[2]

上一篇

步骤8:从rgb图和d图初始化点云,然后滤波(可选)

 

cout << "Initing...\n";
	//初始化点云
	vector<PointCloud::Ptr> pcVec;
	for (int i = 0; i < keyVec.size(); i++) {
		FRAME tframe;
		tframe.rgb = cv::imread(rgbPathVec[i]);
		tframe.depth = cv::imread(dPathVec[i], -1);
		pcVec.push_back(image2PointCloud(tframe.rgb, tframe.depth, camera));
	}

	cout << "Filtering...\n";
	//滤波
	bool bFilter = true;
	if (bFilter) {
		for (auto& pciter : pcVec) {
			PointCloud::Ptr cloud_filtered(new PointCloud());
			pcl::VoxelGrid<pcl::PointXYZRGBA> sor;
			sor.setInputCloud(pciter);
			sor.setLeafSize(0.01f, 0.01f, 0.01f);
			sor.filter(*cloud_filtered);
			pciter = cloud_filtered;

			PointCloud::Ptr cloud_filtered2(new PointCloud());
			pcl::StatisticalOutlierRemoval<pcl::PointXYZRGBA> sor2;
			sor2.setInputCloud(cloud_filtered);
			sor2.setMeanK(50);
			sor2.setStddevMulThresh(1.0);
			sor2.filter(*cloud_filtered2);

			pciter = cloud_filtered2;
		}
	}

初始化点云使用了高博的image2PointCloud函数,滤波使用了PCL官方教程上的体素滤波和离散值滤波,之前都有提过链接。

 

现在,pcVec中有了每个滤过波的关键帧的点云了。

步骤9:使用关键帧文件信息进行点云拼接
这一部分最会出坑的地方是对于输

  • 0
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 10
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值