eigen::Affine3d 转换

平移eigen::vector3d和四元数Eigen::Quaterniond 转 eigen::Affine3d

复制代码
Eigen::Vector3d t = Eigen::Vector3d::Zero();
Eigen::Quaterniond q = Eigen::Quaterniond ::Identity();

Eigen::Affine3d affine3d = t * q.toRotationMatrix();

Eigen::Matrix4d 转 eigen::Affine3d

复制代码
Eigen::Matrix4d mat = Eigen::Matrix4d::Identity();
Eigen::Affine3d transform = Eigen::Affine3d::Identity();
transform.matrix() = mat; 

这里主要是用于点云加速,pcl自带的点云变换包含指令集优化,如下:

复制代码
 template <typename PointT, typename Scalar> inline PointT
 transformPoint (const PointT &point, const Eigen::Transform<Scalar, 3, Eigen::Affine> &transform)
 {
   PointT ret = point;
   pcl::detail::Transformer<Scalar> tf (transform.matrix ());
   tf.se3 (point.data, ret.data);
   return (ret);
 }

Point Cloud Library (PCL): pcl/common/impl/transforms.hpp Source File

相关推荐
青岛少儿编程-王老师1 天前
CCF编程能力等级认证GESP—C++7级—20250927
数据结构·c++·算法
mjx65301 天前
PyTorch快速入门
linux
Miki Makimura1 天前
Reactor 模式实现:从 epoll 到高并发调试
运维·服务器·c++·学习
·心猿意码·1 天前
C++Lambda 表达式与函数对象
开发语言·c++
DeeplyMind1 天前
AMD KFD的BO设计分析系列6-1: VRAM BO的显存分配分析
linux·驱动开发·amdgpu·rocm·kfd
我言秋日胜春朝★1 天前
【Linux网络编程】多路转接reactor——ET模式的epoll
linux·服务器·网络
Hell_Yrz1 天前
Golang信号处理实战
linux
四桑.1 天前
uniapp运行微信小程序uni为什么是undefined
linux
小龙报1 天前
《彻底理解C语言指针全攻略(3)》
c语言·开发语言·windows·git·创业创新·学习方法·visual studio
用户31187945592181 天前
perl-Test-Simple-1.302195-5.fc39.noarch.rpm 怎么安装?Fedora 39 安装步骤讲解
linux