简体   繁体   English

使用点云库将点云转换为世界坐标

[英]transform point cloud to world coordinate using point cloud library

I searched through all around the internet, this was suppose to be easy. 我搜索了整个互联网,这很简单。 But its getting harder to get one straight answer. 但是,越来越难以获得一个直接的答案。 I need to transform the point cloud to world coordinate system. 我需要将点云转换为世界坐标系。 Before the transformation the Z-axis(kinect sensor) will be pointing towards the object, x-axis to the bottom and Y-axis to the left. 转换之前,Z轴(kinect传感器)将指向对象,x轴指向底部,Y轴指向左侧。 or any other orientation of kinect sensor. 或kinect传感器的任何其他方向。 After the transformation, X-axis towards the object, Y-axis to the left and Z-axis to the top ie is the fixed world coordinates. 转换后,X轴指向对象,Y轴指向左侧,Z轴指向顶部,即固定的世界坐标。 Simplest way to achieve it?. 实现它的最简单方法?

This is what I tried so far. 这是我到目前为止尝试过的。 I tried to find viewpoint of the cloud, Thinking it would give me orientation wrt World coordinate system. 我试图找到云的视点,认为它将给我世界坐标系的方向。 But it takes kinect as the origin. 但是它以kinect为起源。 So I get Non-transformed Matrix. 所以我得到了非变换矩阵。 i,e Identity rotation matrix and unit translation vector. 即身份旋转矩阵和单位平移向量。

Please can anyone give me a clue?. 请任何人给我一个线索?

The kinect coordinate will be Z-axis facing object, x-axis to the bottom and y-axis to right. kinect坐标将是面向Z轴的对象,x轴指向底部,y轴指向右侧。 So this transform should work. 因此,此转换应该有效。

double thetha=M_PI/2;
Eigen::Affine3f transform_2 = Eigen::Affine3f::Identity();

// Define a translation of 2.5 meters on the x axis. //在x轴上定义2.5米的平移。

transform_2.translation() << 0.0, 0.0, 0.0;     

// The same rotation matrix as before; //与以前相同的旋转矩阵; thetha radians arround Z axis. 弧度围绕Z轴。

transform_2.rotate (Eigen::AngleAxisf (-theta, Eigen::Vector3f::UnitZ()) * Eigen::AngleAxisf (-theta, Eigen::Vector3f::UnitX()));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM