PCL 环境搭建与例程
来源:互联网 发布:手机上网数据自动关闭 编辑:程序博客网 时间:2024/05/21 18:36
PCL 环境搭建与例程
vs版本:vs 2010
windows版本:windows 7 64位
pcl版本:1.6
PCL(Point Cloud Library)是在吸收了前人点云相关研究基础上建立起来的大型跨平台开源C++编程库,它实现了大量点云相关的通用算法和高效数据结构,涉及到点云获取、滤波、分割、配准、检索、特征提取、识别、追踪、曲面重建、可视化等。支持多种操作系统平台,可在Windows、Linux、Android、Mac OS X、部分嵌入式实时系统上运行。如果说OpenCV是2D信息获取与处理的结晶,那么PCL就在3D信息获取与处理上具有同等地位,PCL是BSD授权方式,可以免费进行商业和学术应用。 —-摘自PCL中文官网
1. 版本选择和安装
下载页面 http://pointclouds.org/downloads/
我选择的是Window版本的,windows可以选择all-in-one版本或者选择自己下载依赖,总共有boost,Eigen等库,个人建议使用all-in-one版本,这样方便管理和引入,独立下载依赖的话安装完后比较分散。我的系统是64位的windows7,但下载64位的版本安装后,无法链接lib,应该就是头文件和lib的版本不对,重新下载了32位的版本才调试成功。在已经设置了lib后,如果还无法链接,考虑头文件是否与lib匹配,可能同一个头文件在vs的引入目录中有多个目录存在,或者是lib 的版本不对,刚开始在这里浪费了很多时间。
安装过程可以选择是否加入环境变量,默认其它的依赖会安装到pcl所在的目录。
2. 配置使用
包含目录
vs 2010 的包含目录,D:\Program Files是我的安装目录,因为之前安装了64位的,所以装在了这个文件夹。
D:\Program Files\PCL 1.6.0\include\pcl-1.6D:\Program Files\PCL 1.6.0\3rdParty\VTK\include\vtk-5.8D:\Program Files\PCL 1.6.0\3rdParty\Qhull\includeD:\Program Files\PCL 1.6.0\3rdParty\OpenNID:\Program Files\PCL 1.6.0\3rdParty\FLANN\includeD:\Program Files\PCL 1.6.0\3rdParty\Eigen\includeD:\Program Files\PCL 1.6.0\3rdParty\Boost\include
库目录
D:\Program Files\PCL 1.6.0\3rdParty\VTK\lib\vtk-5.8D:\Program Files\PCL 1.6.0\3rdParty\FLANN\libD:\Program Files\PCL 1.6.0\3rdParty\Qhull\libD:\Program Files\PCL 1.6.0\3rdParty\Boost\libD:\Program Files\PCL 1.6.0\lib
lib
opengl32.libpcl_kdtree_debug.libpcl_io_debug.libpcl_search_debug.libpcl_segmentation_debug.libpcl_apps_debug.libpcl_features_debug.libpcl_filters_debug.libpcl_visualization_debug.libpcl_common_debug.libflann_cpp_s-gd.liblibboost_system-vc100-mt-gd-1_47.liblibboost_filesystem-vc100-mt-gd-1_47.liblibboost_thread-vc100-mt-gd-1_47.liblibboost_date_time-vc100-mt-gd-1_47.liblibboost_iostreams-vc100-mt-gd-1_47.libvtkalglib-gd.libvtkCharts-gd.libvtkCommon-gd.libvtkDICOMParser-gd.libvtkexoIIc-gd.libvtkexpat-gd.libvtkFiltering-gd.libvtkfreetype-gd.libvtkftgl-gd.libvtkGenericFiltering-gd.libvtkGeovis-gd.libvtkGraphics-gd.libvtkhdf5-gd.libvtkHybrid-gd.libvtkImaging-gd.libvtkInfovis-gd.libvtkIO-gd.libvtkjpeg-gd.libvtklibxml2-gd.libvtkmetaio-gd.libvtkNetCDF-gd.libvtkNetCDF_cxx-gd.libvtkpng-gd.libvtkproj4-gd.libvtkRendering-gd.libvtksqlite-gd.libvtksys-gd.libvtktiff-gd.libvtkverdict-gd.libvtkViews-gd.libvtkVolumeRendering-gd.libvtkWidgets-gd.libvtkzlib-gd.lib
3. 例程
在官网的教程里有很多例程,在本地目录D:\Program Files\PCL 1.6.0\share\doc\pcl-1.6\tutorials\sources
也包含了很多例程,这里是一个显示PCD文件的例程
#include <pcl/visualization/cloud_viewer.h>#include <iostream>#include <pcl/io/io.h>#include <pcl/io/pcd_io.h>int user_data;void viewerOneOff (pcl::visualization::PCLVisualizer& viewer){ viewer.setBackgroundColor (1.0, 0.5, 1.0); pcl::PointXYZ o; o.x = 1.0; o.y = 0; o.z = 0; viewer.addSphere (o, 0.25, "sphere", 0); std::cout << "i only run once" << std::endl;}void viewerPsycho (pcl::visualization::PCLVisualizer& viewer){ static unsigned count = 0; std::stringstream ss; ss << "Once per viewer loop: " << count++; viewer.removeShape ("text", 0); viewer.addText (ss.str(), 200, 300, "text", 0); //FIXME: possible race condition here: user_data++;}int main (){ pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::io::loadPCDFile ("cat.pcd", *cloud); pcl::visualization::CloudViewer viewer("Cloud Viewer"); //blocks until the cloud is actually rendered viewer.showCloud(cloud); //use the following functions to get access to the underlying more advanced/powerful //PCLVisualizer //This will only get called once viewer.runOnVisualizationThreadOnce (viewerOneOff); //This will get called once per visualization iteration viewer.runOnVisualizationThread (viewerPsycho); while (!viewer.wasStopped ()) { //you can also do cool processing here //FIXME: Note that this is running in a separate thread from viewerPsycho //and you should guard against race conditions yourself... user_data++; } return 0;}
可视化的使用快捷键
4. 一些参考地址
PCL的github:https://github.com/PointCloudLibrary
PCL官网:http://pointclouds.org/
PCL中文官网:http://www.pclcn.org/
PCL的一些PCD数据:https://github.com/PointCloudLibrary/data
PCL教程地址:http://pointclouds.org/documentation/tutorials/#keypoints-tutorial
PCL图书:点云库PCL学习教程
PCL官网更新缓慢,github更新较快,建议多关注PCL的github。
- PCL 环境搭建与例程
- PCL 1.7.2 + VS2013 环境搭建
- PCL可视化例程
- PCL学习笔记(1) win8 64bit系统 + VS208——搭建PCL开发环境
- Windows下从预编译包搭建PCL开发环境
- PCL例程使用CMake导入VS2013失败
- 史上最简android中使用opencv环境搭建和例程
- 【Android游戏开发之一】搭建开发环境以HelloWorld例程
- intellij idea搭建python环境,运行tensorFlow样例程序
- Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境
- 环境搭建,与入门
- 【kinect开发日志之一】开发环境配置与例程展示
- PCL环境配置迁移指南
- PCL在VS2015环境配置
- PCL(Point Clouds Library)在windows下的环境配置与使用
- PCL1.7.0+vs2010+cmake3.3.2+win7(64)编译PCL库与环境配置
- win7 64bit visual studio 2013环境 PCL 的安装与配置
- PCL学习笔记(一)PCL+VS2010环境配置
- redis
- 【脚本语言系列】关于PythonWeb服务自动化BeautifulSoup,你需要知道的事
- 使用阿里云OSS服务器进行web签名直传
- 《利用python进行数据分析》学习笔记(二)
- 短信验证码倒计时
- PCL 环境搭建与例程
- servlet — .xml
- Oracle 分组后,对组内数据进行排序
- KMP算法模板
- [区块链]Hyperledger Fabric源代码(基于v1.0 beta版本)阅读之乐扣老师解读系列 (二)Fabric模块分析
- svn命令在linux下的使用
- 虚拟机的类加载的时机
- MyBatis代码自动生成(利用命令)
- Error RawText ** must be wrapped in an explicit <Text> component 问题解决