c++下使用open3d进行GeneralizedICP配准
#include <string>
#include <Eigen>
#include <Open3D/Open3D.h>
using namespace open3d;
using namespace std;
void VisualizeRegistration(const open3d::geometry::PointCloud& source,
const open3d::geometry::PointCloud& target,
const Eigen::Matrix4d& Transformation) {
std::shared_ptr<geometry::PointCloud> source_transformed_ptr(
new geometry::PointCloud);
std::shared_ptr<geometry::PointCloud> target_ptr(new geometry::PointCloud);
*source_transformed_ptr = source;
*target_ptr = target;
source_transformed_ptr->Transform(Transformation);
visualization::DrawGeometries({ source_transformed_ptr, target_ptr },
"Registration result");
}
int main(int argc, char* argv[]) {
//读取点云
std::shared_ptr<geometry::PointCloud> target(new geometry::PointCloud);
open3d::io::ReadPointCloud("C:/Users/a/Desktop/1.ply", *tar