PCL安装使用
一. 下载安装
http://pointclouds.org/downloads/windows.html
1. QT安装在默认路径下(否则后续会出现问题),添加环境变量QTDIR(c:\Qt\4.8.0),把bin文件夹添加到Path环境变量。
2. 编译ALL_BUILD,最终会因为pcl_io模块编译失败导致很多错误。解决方案:
把io\include\pcl\io\png_io.h文件报错地方”template <“的前四行注释掉,重新编译io模块
// PCL_DEPRECATED (template <typename T> void savePNGFile (const std::string& file_name, const pcl::PointCloud<T>& cloud),
// "pcl::io::savePNGFile<typename T> (file_name, cloud) is deprecated, please use a new generic "
// "function pcl::io::savePNGFile (file_name, cloud, field_name) with \"rgb\" as the field name."
// );
3. 不要把PCL安装在C盘,因为会出现Cmake没法创建文件夹的错误。
二. 使用
1.配置系统环境
a、(Optionl) 计算机-->属性-->高级系统设置。弹出系统属性框。高级-->环境变量。添加系统变量,PCL_ROOT,变量值:D:\Program Files\PCL 1.6.0
b、在系统变量Path后追加:
D:\Program Files\OpenNI\Bin;
D:\Program Files\PCL 1.6.0\bin;
D:\Program Files\PCL 1.6.0\3rdParty\FLANN\bin;
D:\Program Files\PCL 1.6.0\3rdParty\Qhull\bin;
2.工程配置
a、新建工程后,项目属性->VC++目录->包含目录 添加:
D:\Program Files\OpenNI\Include
D:\Program Files\OpenNI\Include\Win32
D:\Program Files\PCL 1.6.0\include\pcl-1.6
D:\Program Files\PCL 1.6.0\3rdParty\Boost\include
D:\Program Files\PCL 1.6.0\3rdParty\Eigen\include
D:\Program Files\PCL 1.6.0\3rdParty\FLANN\include
D:\Program Files\PCL 1.6.0\3rdParty\Qhull\include
D:\Program Files\PCL 1.6.0\3rdParty\VTK\include\vtk-5.8
b、项目属性->VC++目录->库目录 添加:
D:\Program Files\OpenNI\Lib
D:\Program Files\PCL 1.6.0\lib
D:\Program Files\PCL 1.6.0\3rdParty\Boost\lib
D:\Program Files\PCL 1.6.0\3rdParty\FLANN\lib
D:\Program Files\PCL 1.6.0\3rdParty\Qhull\lib
D:\Program Files\PCL 1.6.0\3rdParty\VTK\lib\vtk-5.8
c. dubug模式,链接器->输入->附加依赖项 添加
OpenNI.lib
opengl32.lib
pcl_keypoints_debug.lib
pcl_kdtree_debug.lib
pcl_io_debug.lib
pcl_search_debug.lib
pcl_segmentation_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_visualization_debug.lib
pcl_common_debug.lib
flann_cpp_s-gd.lib
libboost_system-vc100-mt-gd-1_50.lib
libboost_filesystem-vc100-mt-gd-1_50.lib
libboost_thread-vc100-mt-gd-1_50.lib
libboost_date_time-vc100-mt-gd-1_50.lib
libboost_iostreams-vc100-mt-gd-1_50.lib
vtkalglib-gd.lib
vtkCharts-gd.lib
vtkCommon-gd.lib
vtkDICOMParser-gd.lib
vtkexoIIc-gd.lib
vtkexpat-gd.lib
vtkFiltering-gd.lib
vtkfreetype-gd.lib
vtkftgl-gd.lib
vtkGenericFiltering-gd.lib
vtkGeovis-gd.lib
vtkGraphics-gd.lib
vtkhdf5-gd.lib
vtkHybrid-gd.lib
vtkImaging-gd.lib
vtkInfovis-gd.lib
vtkIO-gd.lib
vtkjpeg-gd.lib
vtklibxml2-gd.lib
vtkmetaio-gd.lib
vtkNetCDF-gd.lib
vtkNetCDF_cxx-gd.lib
vtkpng-gd.lib
vtkproj4-gd.lib
vtkRendering-gd.lib
vtksqlite-gd.lib
vtksys-gd.lib
vtktiff-gd.lib
vtkverdict-gd.lib
vtkViews-gd.lib
vtkVolumeRendering-gd.lib
vtkWidgets-gd.lib
vtkzlib-gd.lib