PCL显示函数的例子
来源:互联网 发布:淘宝账户永久冻结解冻 编辑:程序博客网 时间:2024/06/10 07:38
/* \author Geoffrey Biggs */
#include <iostream>#include <boost/thread/thread.hpp>#include <pcl/common/common_headers.h>#include <pcl/features/normal_3d.h>#include <pcl/io/pcd_io.h>#include <pcl/visualization/pcl_visualizer.h>#include <pcl/console/parse.h>
// ————–
// —–Help—–
// ————–
void
printUsage(const char* progName)
{
std::cout << “\n\nUsage: ” << progName << ” [options]\n\n”
<< “Options:\n”
<< “——————————————-\n”
<< “-h this help\n”
<< “-s Simple visualisation example\n”
<< “-r RGB colour visualisation example\n”
<< “-c Custom colour visualisation example\n”
<< “-n Normals visualisation example\n”
<< “-a Shapes visualisation example\n”
<< “-v Viewports example\n”
<< “-i Interaction Customization example\n”
<< “\n\n”;
}
boost::shared_ptr simpleVis(pcl::PointCloud::ConstPtr cloud)
{
// ——————————————–
// —–Open 3D viewer and add point cloud—–
// ——————————————–
//创建可视化对象viewer
boost::shared_ptr viewer(new pcl::visualization::PCLVisualizer(“3D Viewer”));
//设置背景为黑色
viewer->setBackgroundColor(0, 0, 0);
//将要显示的点云添加到可视化对象中。
viewer->addPointCloud(cloud, “sample cloud”);
//渲染点云
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, “sample cloud”);
//添加坐标轴
viewer->addCoordinateSystem(1.0);
//初始化相机
viewer->initCameraParameters();
return (viewer);
}
boost::shared_ptr rgbVis(pcl::PointCloud::ConstPtr cloud)
{
// ——————————————–
// —–Open 3D viewer and add point cloud—–
// ——————————————–
boost::shared_ptr viewer(new pcl::visualization::PCLVisualizer(“3D Viewer”));
viewer->setBackgroundColor(0, 0, 0);
pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud);
viewer->addPointCloud(cloud, rgb, “sample cloud”);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, “sample cloud”);
viewer->addCoordinateSystem(1.0);
viewer->initCameraParameters();
return (viewer);
}
//
boost::shared_ptr customColourVis(pcl::PointCloud::ConstPtr cloud)
{
// ——————————————–
// —–Open 3D viewer and add point cloud—–
// ——————————————–
boost::shared_ptr viewer(new pcl::visualization::PCLVisualizer(“3D Viewer”));
viewer->setBackgroundColor(0, 0, 0);
pcl::visualization::PointCloudColorHandlerCustom single_color(cloud, 0, 255, 0);
viewer->addPointCloud(cloud, single_color, “sample cloud”);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, “sample cloud”);
viewer->addCoordinateSystem(1.0);
viewer->initCameraParameters();
return (viewer);
}
//法线显示
boost::shared_ptr normalsVis(
pcl::PointCloud::ConstPtr cloud, pcl::PointCloud::ConstPtr normals)
{
// ——————————————————–
// —–Open 3D viewer and add point cloud and normals—–
// ——————————————————–
boost::shared_ptr viewer(new pcl::visualization::PCLVisualizer(“3D Viewer”));
viewer->setBackgroundColor(0, 0, 0);
pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud);
viewer->addPointCloud(cloud, rgb, “sample cloud”);
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, “sample cloud”);
viewer->addPointCloudNormals
- PCL显示函数的例子
- PCL点云的显示
- 基于MFC单文档的PCL显示
- 把pcl的VTK显示融合到MFC
- 如何实现基于MFC对话框的PCL显示(1)
- 如何实现基于MFC对话框的PCL显示
- PCL点云的基本读取和显示
- PCL中计算点云的法向量并显示
- PCL:点云的可视化(程序中在线显示)
- PCL:点云的法线估计(并显示)
- PCL:关于pcd数据显示的一个小问题
- 用PCL刷新显示变化的点云
- 构造函数的显示调用和隐示用例子
- 显示图标的例子
- PCL环境配置失败和运行PCL自带例子
- PCL可视化显示点云
- PCL嵌入VTK/QT显示
- PCL显示点云[微记]
- 1、认识HTML
- 拥塞控制分析之RCP
- selenium 定位元素
- Hibernate
- 深入分析MySQL事务隔离级别
- PCL显示函数的例子
- H5 语音合成播报功能
- 23种设计模式之-----代理模式(Proxy Pattern)
- HDOJ 2156 分数矩阵(水题)
- 【Python】类
- Dungeon Game
- Java基础之IO流
- Java时间获取
- java入门基础-01