码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • PCL点云库可视化常用函数与经验总结


    目录

    一, makeShared:使点云返回一个智能指针(深拷贝)

    二,pcl::visualization::PCLVisualizer

    viewer.setPointCloudRenderingProperties

    setPointCloudRenderingProperties() 

    Note

    三,RenderingProperties

    四, 添加文本addText、updateText

    五,点云分割

    getColoredCloud()

    六, 经验总结


    一, makeShared:使点云返回一个智能指针(深拷贝)

    1. /** \brief Copy the cloud to the heap and return a smart pointer
    2. * Note that deep copy is performed, so avoid using this function on non-empty clouds.
    3. * The changes of the returned cloud are not mirrored back to this one.
    4. * \return shared pointer to the copy of the cloud
    5. */
    6. inline Ptr
    7. makeShared () const { return Ptr (new PointCloud (*this)); }

    二,pcl::visualization::PCLVisualizer

    viewer.setPointCloudRenderingProperties

    setPointCloudRenderingProperties() 

    1. bool pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties (
    2. int property,
    3. double value,
    4. const std::string & id = "cloud",
    5. int viewport = 0
    6. )

    Set the rendering properties of a PointCloud.

    Parameters

    [in]propertythe property type
    [in]valuethe value to be set
    [in]idthe point cloud object id (default: cloud)
    [in]viewportthe view port where the Point Cloud's rendering properties should be modified (default: all)

    Note

    注意事项:

    设置属性前需要指定id,默认为“cloud”,如果没有设置“cloud”的id,或者其他id,将不起作用。

    The list of properties can be found in pcl::visualization::LookUpTableRepresentationProperties.

    三,RenderingProperties

    enum pcl::visualization::RenderingProperties

    Set of rendering properties.

    Enumerator
    PCL_VISUALIZER_POINT_SIZE 

    integer starting from 1

    PCL_VISUALIZER_OPACITY 

    Float going from 0.0 (transparent) to 1.0 (opaque)

    PCL_VISUALIZER_LINE_WIDTH 

    Integer starting from 1.

    PCL_VISUALIZER_FONT_SIZE 
    PCL_VISUALIZER_COLOR 

    3 floats (R, G, B) going from 0.0 (dark) to 1.0 (light)

    PCL_VISUALIZER_REPRESENTATION 
    PCL_VISUALIZER_IMMEDIATE_RENDERING 
    PCL_VISUALIZER_SHADING 
    PCL_VISUALIZER_LUT 

    colormap type pcl::visualization::LookUpTableRepresentationProperties

    PCL_VISUALIZER_LUT_RANGE 

    two doubles (min and max) or PCL_VISUALIZER_LUT_RANGE_AUTO

    四, 添加文本addText、updateText

    1. /** \brief Add a text to screen
    2. * \param[in] text the text to add
    3. * \param[in] xpos the X position on screen where the text should be added
    4. * \param[in] ypos the Y position on screen where the text should be added
    5. * \param[in] fontsize the fontsize of the text
    6. * \param[in] r the red color value
    7. * \param[in] g the green color value
    8. * \param[in] b the blue color value
    9. * \param[in] id the text object id (default: equal to the "text" parameter)
    10. * \param[in] viewport the view port (default: all)
    11. */
    12. bool
    13. addText (const std::string &text, int xpos, int ypos, int fontsize, double r, double g, double b,
    14. const std::string &id = "", int viewport = 0);

    五,点云分割

    getColoredCloud()

    如果云被成功分割,则函数返回彩色云。否则返回一个空指针。属于同一段的点具有相同的颜色。但是这个函数并不能保证不同的片段会有不同的颜色(这完全取决于RNG)。未在索引数组中列出的点将用红色表示。

    六, 经验总结

    在Visual Studio中使用Release模式运行速度更快,如果是为了运行程序,而不是调试,尽量选择Release模式,而不是Debug模式。

  • 相关阅读:
    力扣84 双周赛 t4 6144 和力扣305周赛t4 6138
    单点登录和JWT的介绍与使用
    《机器人学一(Robotics(1))》_台大林沛群 第 5 周【机械手臂 轨迹规划】 Quiz 5
    面试经典刷题)挑战一周刷完150道-Python版本-第2天(22个题)
    自制操作系统番外2:编程语言中函数参数的传递
    pytest框架前后置设置,以及pytest默认规则
    GAN实战笔记——第四章深度卷积生成对抗网络(DCGAN)
    41张图解 ElasticSearch 原理,你可收好了
    【学习笔记】minIO分布式文件服务系统
    游戏引擎,脚本管理模块
  • 原文地址:https://blog.csdn.net/luolaihua2018/article/details/120138813
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号