码农知识堂 - 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模式。

  • 相关阅读:
    华为摄像头智能安防监控解决方案
    K8S自动化运维容器Docker集群
    springboot整合SSE
    7-21 求特殊方程的正整数解
    将折叠屏卖到5999元!但摩托罗拉razr 2022的看点不止性价比
    nuxt使用i18n进行中英文切换
    动态修改日志级别,太有用了!
    笔记本电脑 禁用/启用 自带键盘
    Faiss原理和使用总结
    2023年9月25日,历史上的今天大事件早读
  • 原文地址:https://blog.csdn.net/luolaihua2018/article/details/120138813
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号