当前位置: 首页 > news >正文

PCL setCameraPosition 参数讲解

       

setCameraPosition 的原型如下void setCameraPosition (double pos_x, double pos_y, double pos_z,double view_x, double view_y, double view_z,double up_x, double up_y, double up_z, int viewport = 0);pos_x pos_y pos_z为相机所在的位置view_x view_y  view_z 是焦点所在的位置up_x  up_y  up_z 的那个坐标轴朝上,若朝上则为1,若朝下为-1

cloudcompare 中正视的的坐标显示如下图,Z轴朝上(up_x=0 up_y=0 up_z=1)而Y轴背离 所以相机位置 pos_y为负值.

如果坐标系看起来不直观,建议拿个盒子画好正视的坐标系 .

以下是切换自动计算相机位置、焦点位置、相机朝向的计算函数

#define    PCL_FACEVIEW      1  //正视
#define    PCL_DOWNVIEW      2  //仰视
#define    PCL_LEFTVIEW      3  //左视
#define    PCL_RIGHTVIEW     4  //右视
#define    PCL_TOPVIEW       5  //俯视
#define    PCL_BACKVIEW      6  //后视void getCameraParam(int viewPos,PointT minIn,PointT maxIn,PointT &cameraPosOut,PointT &focusPosOut,PointT &upPosOut){switch (viewPos) {case PCL_FACEVIEW     : //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=0;cameraPosOut.y=-300;cameraPosOut.z=0;upPosOut.x=0;upPosOut.y=0;upPosOut.z=1;}break;case PCL_DOWNVIEW     :   //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=0;cameraPosOut.y=0;cameraPosOut.z=-300;upPosOut.x=0;upPosOut.y=1;upPosOut.z=0;}break;case PCL_LEFTVIEW     :  //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=-300.0;cameraPosOut.y=0;cameraPosOut.z=0;upPosOut.x=0;upPosOut.y=0;upPosOut.z=1;}break;case PCL_RIGHTVIEW    :  //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=300;cameraPosOut.y=0;cameraPosOut.z=0;upPosOut.x=0;upPosOut.y=0;upPosOut.z=1;}break;case     PCL_TOPVIEW: //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=0;cameraPosOut.y=0;cameraPosOut.z=300;upPosOut.x=0;upPosOut.y=1;upPosOut.z=0;}break;case     PCL_BACKVIEW:    //OK{focusPosOut.x=0;focusPosOut.y=0;focusPosOut.z=0;cameraPosOut.x=0;cameraPosOut.y=300.0;cameraPosOut.z=0;upPosOut.x=0;upPosOut.y=0;upPosOut.z=1.0;}break;}}

http://www.lryc.cn/news/214465.html

相关文章:

  • 有关YOLOV5在测试时,图片大小被调整的问题
  • 【机器学习】四、计算学习理论
  • spring解决后端显示时区的问题
  • 大模型冷思考:企业“可控”价值创造空间还有多少?
  • ctfshow-web入门37-52
  • 前端项目部署后,需要刷新页面才能看到更新内容
  • android 13 write javaBean error at *** 错误
  • Only fullscreen opaque activities can request orientation
  • 前端实验(一)单页面应用的创建
  • 数字人小灿:始于火山语音,发于 B 端百业
  • 蓝桥杯刷题
  • Go Metrics SDK Tag 校验性能优化实践
  • 二叉树问题——前/中/后/层遍历问题(递归与栈)
  • Vue3问题:如何实现级联菜单的数据懒加载?
  • STM32-电源管理(实现低功耗)
  • vue 自己捣鼓周日程日历组件
  • 【力扣】2127. (分类讨论 + 拓扑排序)参加会议的最多员工数
  • Flutter——最详细(Map)使用教程
  • vue的入门第一课
  • 已解决:conda找不到对应版本的cudnn如何解决?
  • 大语言模型的学习路线和开源模型的学习材料《二》
  • Flask-SQLAlchemy事件钩子介绍
  • C++——list
  • 【Linux】第九站:make和makefile
  • 一文了解什么是WebSocket
  • redis是什么
  • 基于深度学习的人脸专注度检测计算系统 - opencv python cnn 计算机竞赛
  • 跨境电商的新引擎:崛起的网红经济
  • P2006 赵神牛的游戏 python解法
  • Unity的碰撞检测(六)