两点云坐标点的转化
来源:互联网 发布:cisco指定源端口ping 编辑:程序博客网 时间:2024/05/05 04:11
两点云坐标点的转化
两点云坐标点的转化,就是把一个点云从自己的坐标系变换到另一个坐标系,配准,拼接都用得到。有点类似相机和激光外参的标定(将激光坐标系转换到相机的坐标系。都是Rt变换)。
(1)基本知识
R为旋转矩阵,X为原始点,t为平移量,X'为变换后的点(目标点)
R*X+t=X' (Rt*X=X')
但是所求Rt矩阵用一个矩阵表示如下:
/* Reminder: how transformation matrices work :
|-------> This column is the translation
| 1 0 0 x | \
| 0 1 0 y | }-> The identity 3x3 matrix (no rotation) on the left
| 0 0 1 z | /
| 0 0 0 1 | -> We do not use this line (and it has to stay 0,0,0,1)
(2)举例说明
将一个点(坐标系)绕自身z轴旋转(正)M_PI/4,然后再沿着旋转后得到的x轴方向(正)平移2.5。求Rt矩阵?
方法1:
直接数学方法得到并赋值:
METHOD #1: Using a Matrix4f
This is the "manual" method, perfect to understand but error prone !
*/
Eigen::Matrix4f transform_1 = Eigen::Matrix4f::Identity();
// Define a rotation matrix (see https://en.wikipedia.org/wiki/Rotation_matrix)
float theta = M_PI/4; // The angle of rotation in radians
transform_1 (0,0) = cos (theta); //第1行第1列个元素
transform_1 (0,1) = -sin(theta); //第1行第 2 列个元素
transform_1 (1,0) = sin (theta);
transform_1 (1,1) = cos (theta);
// (row, column)
// Define a translation of 2.5 meters on the x axis.
// transform_1 (0,3) = 2.5;
transform_1 (0,3) = 0;
// Print the transformation
printf ("Method #1: using a Matrix4f\n");
std::cout << transform_1 << std::endl;
方法2:
通过程序计算矩阵:
/* METHOD #2: Using a Affine3f
This method is easier and less error prone
*/
Eigen::Affine3f transform_2 = Eigen::Affine3f::Identity();
// Define a translation of 2.5 meters on the x axis.
transform_2.translation() << 2.5, 0.0, 0.0;
// The same rotation matrix as before; theta radians arround Z axis
transform_2.rotate (Eigen::AngleAxisf (theta, Eigen::Vector3f::UnitZ()));
// Print the transformation
printf ("\nMethod #2: using an Affine3f\n");
std::cout << transform_2.matrix() << std::endl;
最后转化:
pcl::transformPointCloud (*source_cloud, *transformed_cloud, transform_2);
- 两点云坐标点的转化
- 已知两点坐标,求两点连成的直线中的某一点坐标
- 由两个点的坐标,得到过两点的方程
- 【绘制矩形】已知二维平面矩形的对角线两点坐标,如何确定四个点的坐标
- 已知两点坐标求等边三角形另一点
- 已知等边三角形两点,求第三点坐标
- 获取触摸两点的坐标
- 计算两点的坐标值
- 求最近的两点坐标
- 已知两点和直线上的某点的Y值,求某点的x坐标
- swing 两点之间直线上的任意距离点的坐标
- 已知两点坐标,求直线方程、距离其中一点距离为L的某点
- 设计一个点类,其中包含一对坐标点数据成员,一个计算两点距离的友元函数和坐标点的显示函数
- 设计平面坐标点类,计算两点之间距离、到原点距离、关于坐标轴和原点的对称点等
- 输入两点坐标,球两点间的距离
- 根据两点经纬坐标计算两点间的距离[JAVA]
- 知道两点坐标,怎么计算两点方向的方位角
- 根据百度地图两个坐标点获得两点间距离
- server error:Server is already active for display 0
- 编写你的第一个Django应用
- Keywords Search
- Maven 自动打包编译的shell脚本
- 详解 JavaScript的 call() 和 apply()
- 两点云坐标点的转化
- 光流
- GreenDao 使用介绍
- 微信官方推出的小店小程序实测
- 读《哈佛凌晨4点半》
- JS数组扁平化处理的几种方法
- C语言实现字节流与十六进制字符串的相互转换
- Android-DataBinding入门系列(一)基本介绍
- android studio反编译工具jd-inteIIij