PCL开发——备忘1
来源:互联网 发布:系统更新软件 编辑:程序博客网 时间:2024/06/11 13:12
1. QString to String
Qt打开文件保存文件时用到。
QString filename = "bunny.pcd";string name = filename.toUtf8().constData();
2. pcl::PointIndices与pcl::PointIndices::Ptr相互转换
2.1 pcl::PointIndices转换成pcl::PointIndices::Ptr来源:
颜色区域增长分割算法用的是pcl::PointIndices
vector <pcl::PointIndices> clusters;pcl::RegionGrowingRGB<PointT> reg;reg.extract (clusters);
提取索引用的是pcl::PointIndices::Ptr
pcl::PointCloud<PointT>::Ptr cloud (new pcl::PointCloud<PointT>);//存放滤波结果pcl::ExtractIndices<PointT> extract; pcl::PointIndices::Ptr tem (new pcl::PointIndices(clusters[0]));//定义指向clusters[0]的指针extract.setIndices (tem); extract.filter (*cloud);
2.2 pcl::PointIndices::Ptr转换成pcl::PointIndices
pcl::PointIndices::Ptr tem1 (new pcl::PointIndices);pcl::PointIndices tem2;*tem1 = tem2;(tem2 = *tem1)
3. 输出pcd点云的fields属性
cout<<"There are"<<cloud->width*cloud->height<<"data points(" << pcl::getFieldsList (*cloud)<<").";
4. addCubes
一共有三种方式添加立方体:
addCube (const pcl::ModelCoefficients &coefficients, const std::string &id="cube", int viewport=0);addCube (const Eigen::Vector3f &translation, const Eigen::Quaternionf &rotation, double width, double height, double depth, const std::string &id="cube", int viewport=0);addCube (float x_min, float x_max, float y_min, float y_max, float z_min, float z_max, double r=1.0, double g=1.0, double b=1.0, const std::string &id="cube", int viewport=0);
//对于第三种,如果min>max,不能画出立方体。缺颜色也不行 viewer->addCube(min.x, max.x, min.y, max.y, min.z, max.z, a[i], b[i], c[i], ss.str(), v2);
5. pcl常用小知识(别人总结的)
- 时间计算
- 如何实现类似pcl::PointCloud::Ptr和pcl::PointCloud的两个类相互转换?
- 如何查找点云的x,y,z的极值?
- 如果知道需要保存点的索引,如何从原点云中拷贝点到新点云?
- 如何从点云里删除和添加点?
- 如何对点云进行全局或局部变换
- 链接两个点云字段(两点云大小必须相同)
- 如何从点云中删除无效点
- 将xyzrgb格式转换为xyz格式的点云
- flann kdtree 查询k近邻
- 关于ply文件
- 计算点的索引
- 计算质心
- 从网格提取顶点(将网格转化为点)
参考
pcl::addCube
pcl常用小知识(segmentfault)
阅读全文
0 0
- PCL开发——备忘1
- PCL备忘
- PCL学习笔记(1) win8 64bit系统 + VS208——搭建PCL开发环境
- PCL安装备忘
- PCL安装调试备忘
- 学习PCL之——PCL安装指南(一)
- PCL——配置问题
- 开发环境备忘-1
- 如何在ROS中使用PCL—数据格式(1)
- PCL点云超体素分割——supervoxelclustering调试
- PCL—综述—三维图像处理
- PCL系列——读入PCD格式文件
- PCL系列——平面模型分割
- Macbook配置PCL——使用homebrew
- PCL—综述—三维图像处理
- PCL——泊松表面重建
- PCL 记录时间长度 — TicToc 类
- PCL—1.7.2-vc2013-win32分享
- android 控件 折叠toolbar-CollapsingToolbarLayout
- 汇编第十四节-端口
- python时间序列分析
- html+css定位
- 1~100含9的数字及次数
- PCL开发——备忘1
- Hibernate merge()
- JSP页面加载顺序
- Werkzeug 的 wsgi-app 说明
- T和Class<T>以及Class<?>的理解
- 关于负载均衡的一些总结
- SpringBoot(四)
- ANSⅡ码排序
- hadoop多节点集群安装配置