open3d c++ 点云ICP配准

本文介绍了使用C++编程语言,在open3d库的支持下,进行点云数据的ICP(Iterative Closest Point)配准过程。通过运行代码,得到了fitness值为0.134659,inlier RMSE为0.0079732,correspondence_set大小为26411,显示出配准的初步效果。

使用C++运行open3d,进行ICP配准测试

 

#include <opencv2/opencv.hpp>
#include <iostream>
#include <Eigen/Dense>
#include <iostream>
#include <memory>
#include "Open3D/Registration/GlobalOptimization.h"
#include "Open3D/Registration/PoseGraph.h"
#include "Open3D/Registration/ColoredICP.h"
#include "Open3D/Open3D.h"
#include "Open3D/Registration/FastGlobalRegistration.h"


using namespace open3d;
using namespace std;
using namespace registration;
using namespace geometry;
using namespace cv;

void main()
{

	open3d::geometry::PointCloud source, target;
	open3d::io::ReadPointCloud("C:/Users/chili1080/Desktop/Augmented ICL-NUIM Dataset-jyx/livingroom1-fragments-ply/cloud_bin_0.ply", source);
	open3d::io::ReadPointCloud("C:/Users/chili1080/Desktop/Augmented ICL-NUIM Dataset-jyx/livingroom1-fragments-ply/cloud_bin_1.ply", target);

	Eigen::Vector3d color_source(1, 0.706, 0);
	Eigen::Vector3d color_target(0, 0.651, 0.929);

	source.PaintUniformColor(color_source);
	target.PaintUniformColor(color_target);

	double th = 0.02;
	open3d::registration::RegistrationResult res = open3d::registration::RegistrationICP(source, target, th, Eigen::Matrix4d::Identity(), 
		TransformationEstimationPointToPoint(false), ICPConvergenceCriteria(1e-6, 1e-6, 300));
	//显示配准结果  fitness 算法对这次配准的打分
	//inlier_rmse 表示的是 root of covariance, 也就是所有匹配点之间的距离的总和除以所有点的数量的平方根
	//correspondence_size 代表配准后吻合的点云的数量
	cout << "fitness: "<<res.fitness_<<" inlier rmse:"<<res.inlier_rmse_<<" correspondence_set size:"<<res.correspondence_set_.size()<<endl;

	cout << "done here";
}

fitness: 0.134659 inlier rmse:0.0079732 correspondence_set size:26411
done here

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值