概述
win10+vs2015+pcl1.8.1安装配置过程:
1.下载pcl1.8.1,网址:http://unanancyowen.com/en/pcl181
界面如下图,
选择下载下面两个即可。
2.双击下载的PCL-1.8.1-AllInOne-msvc2015-win64.exe文件,选择安装路径:D:thirdLibPCLPCL-1.8.1进行安装,勾选所有选项进行安装。
期间弹出OpenNI的安装,按照提示安装即可,注意更换安装路径为D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyOpenNI2。
注意事项:在安装点击“我接收(I)”之后弹出来的对话框中一定要选择第二项AddPCL to the system PATH for all users.
3.解压与安装PCL版本对应的PDB文件(pcl-1.8.1-pdb-msvc2015-win64.zip),复制里面的文件到PCL安装路径下的bin文件夹,即:D:thirdLibPCLPCL-1.8.1PCL 1.8.1bin。
4.配置环境变量(注意配置结束后重启电脑):
“此电脑”->“属性”->“高级系统设置”->“环境变量”:
看到已自动添加变量如下:
在Path中手动添加:
%PCL_ROOT%3rdPartyFLANNbin
%PCL_ROOT%3rdPartyQhullbin
%PCL_ROOT%3rdPartyOpenNI2Tools
%PCL_ROOT%3rdPartyVTKbin
5.在vs2015中配置
注意,只需配置一次,后面的vs工程只需添加即可。
1)创建一个新的vs项目,点击“视图”->“其他窗口”->“属性管理器”。
2)在Debug | x64上右键单击,选择“添加新项目属性表”(配置Release | x64以下操作相同,注意添加库的时候添加对应的lib)。
3)设置项目属性表的名称为PCLd64PropertySheet,点击添加。(此处新建的项目属性表请另外单独保存下来,以后再在vs下建立PCL项目时直接添加该表即可,不需重复配置) 。
4)双击新建立的PCLd64PropertySheet项目属性表进行编辑。
5)点击“VC++目录”->“包含目录”,进行编辑。
添加下列路径:
D:thirdLibPCLPCL-1.8.1PCL 1.8.1includepcl-1.8
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyBoostincludeboost-1_64
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyEigeneigen3
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyFLANNinclude
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyFLANNincludeflann
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyOpenNI2Include
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyQhullinclude
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyVTKincludevtk-8.0
6)点击“VC++目录”->“库目录”,进行编辑。
添加下列路径:
D:thirdLibPCLPCL-1.8.1PCL 1.8.1lib
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyBoostlib
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyFLANNlib
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyOpenNI2Lib
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyQhulllib
D:thirdLibPCLPCL-1.8.1PCL 1.8.13rdPartyVTKlib
7)点击“链接器”->“输入”->“附加依赖项”,进行编辑,添加lib文件。
pcl_common_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_debug.lib
pcl_io_ply_debug.lib
pcl_kdtree_debug.lib
pcl_keypoints_debug.lib
pcl_ml_debug.lib
pcl_octree_debug.lib
pcl_outofcore_debug.lib
pcl_people_debug.lib
pcl_recognition_debug.lib
pcl_registration_debug.lib
pcl_sample_consensus_debug.lib
pcl_search_debug.lib
pcl_segmentation_debug.lib
pcl_stereo_debug.lib
pcl_surface_debug.lib
pcl_tracking_debug.lib
pcl_visualization_debug.lib
flann_cpp_s-gd.lib
flann_s-gd.lib
flann-gd.lib
libboost_atomic-vc140-mt-gd-1_64.lib
libboost_chrono-vc140-mt-gd-1_64.lib
libboost_container-vc140-mt-gd-1_64.lib
libboost_context-vc140-mt-gd-1_64.lib
libboost_coroutine-vc140-mt-gd-1_64.lib
libboost_date_time-vc140-mt-gd-1_64.lib
libboost_exception-vc140-mt-gd-1_64.lib
libboost_filesystem-vc140-mt-gd-1_64.lib
libboost_graph-vc140-mt-gd-1_64.lib
libboost_iostreams-vc140-mt-gd-1_64.lib
libboost_locale-vc140-mt-gd-1_64.lib
libboost_log-vc140-mt-gd-1_64.lib
libboost_log_setup-vc140-mt-gd-1_64.lib
libboost_math_c99-vc140-mt-gd-1_64.lib
libboost_math_c99f-vc140-mt-gd-1_64.lib
libboost_math_c99l-vc140-mt-gd-1_64.lib
libboost_math_tr1-vc140-mt-gd-1_64.lib
libboost_math_tr1f-vc140-mt-gd-1_64.lib
libboost_math_tr1l-vc140-mt-gd-1_64.lib
libboost_mpi-vc140-mt-gd-1_64.lib
libboost_prg_exec_monitor-vc140-mt-gd-1_64.lib
libboost_program_options-vc140-mt-gd-1_64.lib
libboost_random-vc140-mt-gd-1_64.lib
libboost_regex-vc140-mt-gd-1_64.lib
libboost_serialization-vc140-mt-gd-1_64.lib
libboost_signals-vc140-mt-gd-1_64.lib
libboost_system-vc140-mt-gd-1_64.lib
libboost_test_exec_monitor-vc140-mt-gd-1_64.lib
libboost_thread-vc140-mt-gd-1_64.lib
libboost_timer-vc140-mt-gd-1_64.lib
libboost_unit_test_framework-vc140-mt-gd-1_64.lib
libboost_wave-vc140-mt-gd-1_64.lib
libboost_wserialization-vc140-mt-gd-1_64.lib
qhull_d.lib
qhull_p_d.lib
qhull_r_d.lib
qhullcpp_d.lib
qhullstatic_d.lib
qhullstatic_r_d.lib
vtkalglib-8.0-gd.lib
vtkChartsCore-8.0-gd.lib
vtkCommonColor-8.0-gd.lib
vtkCommonComputationalGeometry-8.0-gd.lib
vtkCommonCore-8.0-gd.lib
vtkCommonDataModel-8.0-gd.lib
vtkCommonExecutionModel-8.0-gd.lib
vtkCommonMath-8.0-gd.lib
vtkCommonMisc-8.0-gd.lib
vtkCommonSystem-8.0-gd.lib
vtkCommonTransforms-8.0-gd.lib
vtkDICOMParser-8.0-gd.lib
vtkDomainsChemistry-8.0-gd.lib
vtkexoIIc-8.0-gd.lib
vtkexpat-8.0-gd.lib
vtkFiltersAMR-8.0-gd.lib
vtkFiltersCore-8.0-gd.lib
vtkFiltersExtraction-8.0-gd.lib
vtkFiltersFlowPaths-8.0-gd.lib
vtkFiltersGeneral-8.0-gd.lib
vtkFiltersGeneric-8.0-gd.lib
vtkFiltersGeometry-8.0-gd.lib
vtkFiltersHybrid-8.0-gd.lib
vtkFiltersHyperTree-8.0-gd.lib
vtkFiltersImaging-8.0-gd.lib
vtkFiltersModeling-8.0-gd.lib
vtkFiltersParallel-8.0-gd.lib
vtkFiltersParallelImaging-8.0-gd.lib
vtkFiltersProgrammable-8.0-gd.lib
vtkFiltersSelection-8.0-gd.lib
vtkFiltersSMP-8.0-gd.lib
vtkFiltersSources-8.0-gd.lib
vtkFiltersStatistics-8.0-gd.lib
vtkFiltersTexture-8.0-gd.lib
vtkFiltersVerdict-8.0-gd.lib
vtkfreetype-8.0-gd.lib
vtkGeovisCore-8.0-gd.lib
vtkhdf5-8.0-gd.lib
vtkhdf5_hl-8.0-gd.lib
vtkImagingColor-8.0-gd.lib
vtkImagingCore-8.0-gd.lib
vtkImagingFourier-8.0-gd.lib
vtkImagingGeneral-8.0-gd.lib
vtkImagingHybrid-8.0-gd.lib
vtkImagingMath-8.0-gd.lib
vtkImagingMorphological-8.0-gd.lib
vtkImagingSources-8.0-gd.lib
vtkImagingStatistics-8.0-gd.lib
vtkImagingStencil-8.0-gd.lib
vtkInfovisCore-8.0-gd.lib
vtkInfovisLayout-8.0-gd.lib
vtkInteractionImage-8.0-gd.lib
vtkInteractionStyle-8.0-gd.lib
vtkInteractionWidgets-8.0-gd.lib
vtkIOAMR-8.0-gd.lib
vtkIOCore-8.0-gd.lib
vtkIOEnSight-8.0-gd.lib
vtkIOExodus-8.0-gd.lib
vtkIOExport-8.0-gd.lib
vtkIOGeometry-8.0-gd.lib
vtkIOImage-8.0-gd.lib
vtkIOImport-8.0-gd.lib
vtkIOInfovis-8.0-gd.lib
vtkIOLegacy-8.0-gd.lib
vtkIOLSDyna-8.0-gd.lib
vtkIOMINC-8.0-gd.lib
vtkIOMovie-8.0-gd.lib
vtkIONetCDF-8.0-gd.lib
vtkIOParallel-8.0-gd.lib
vtkIOPLY-8.0-gd.lib
vtkIOSQL-8.0-gd.lib
vtkIOVideo-8.0-gd.lib
vtkIOXML-8.0-gd.lib
vtkIOXMLParser-8.0-gd.lib
vtkjpeg-8.0-gd.lib
vtkjsoncpp-8.0-gd.lib
vtklibxml2-8.0-gd.lib
vtkmetaio-8.0-gd.lib
vtkNetCDF-8.0-gd.lib
vtknetcdf_c++-gd.lib
vtkoggtheora-8.0-gd.lib
vtkParallelCore-8.0-gd.lib
vtkpng-8.0-gd.lib
vtkproj4-8.0-gd.lib
vtkRenderingAnnotation-8.0-gd.lib
vtkRenderingContext2D-8.0-gd.lib
vtkRenderingCore-8.0-gd.lib
vtkRenderingFreeType-8.0-gd.lib
vtkRenderingImage-8.0-gd.lib
vtkRenderingLabel-8.0-gd.lib
vtkRenderingLOD-8.0-gd.lib
vtkRenderingVolume-8.0-gd.lib
vtksqlite-8.0-gd.lib
vtksys-8.0-gd.lib
vtktiff-8.0-gd.lib
vtkverdict-8.0-gd.lib
vtkViewsContext2D-8.0-gd.lib
vtkViewsCore-8.0-gd.lib
vtkViewsInfovis-8.0-gd.lib
vtkzlib-8.0-gd.lib
OpenNI2.lib
以同样的方法配置Release | x64(2~7步骤),lib文件如下:
pcl_common_release.lib
pcl_features_release.lib
pcl_filters_release.lib
pcl_io_release.lib
pcl_io_ply_release.lib
pcl_kdtree_release.lib
pcl_keypoints_release.lib
pcl_ml_release.lib
pcl_octree_release.lib
pcl_outofcore_release.lib
pcl_people_release.lib
pcl_recognition_release.lib
pcl_registration_release.lib
pcl_sample_consensus_release.lib
pcl_search_release.lib
pcl_segmentation_release.lib
pcl_stereo_release.lib
pcl_surface_release.lib
pcl_tracking_release.lib
pcl_visualization_release.lib
flann_cpp_s.lib
flann_s.lib
flann.lib
libboost_atomic-vc140-mt-1_64.lib
libboost_chrono-vc140-mt-1_64.lib
libboost_container-vc140-mt-1_64.lib
libboost_context-vc140-mt-1_64.lib
libboost_coroutine-vc140-mt-1_64.lib
libboost_date_time-vc140-mt-1_64.lib
libboost_exception-vc140-mt-1_64.lib
libboost_filesystem-vc140-mt-1_64.lib
libboost_graph-vc140-mt-1_64.lib
libboost_iostreams-vc140-mt-1_64.lib
libboost_locale-vc140-mt-1_64.lib
libboost_log-vc140-mt-1_64.lib
libboost_log_setup-vc140-mt-1_64.lib
libboost_math_c99-vc140-mt-1_64.lib
libboost_math_c99f-vc140-mt-1_64.lib
libboost_math_c99l-vc140-mt-1_64.lib
libboost_math_tr1-vc140-mt-1_64.lib
libboost_math_tr1f-vc140-mt-1_64.lib
libboost_math_tr1l-vc140-mt-1_64.lib
libboost_mpi-vc140-mt-1_64.lib
libboost_prg_exec_monitor-vc140-mt-1_64.lib
libboost_program_options-vc140-mt-1_64.lib
libboost_random-vc140-mt-1_64.lib
libboost_regex-vc140-mt-1_64.lib
libboost_serialization-vc140-mt-1_64.lib
libboost_signals-vc140-mt-1_64.lib
libboost_system-vc140-mt-1_64.lib
libboost_test_exec_monitor-vc140-mt-1_64.lib
libboost_thread-vc140-mt-1_64.lib
libboost_timer-vc140-mt-1_64.lib
libboost_unit_test_framework-vc140-mt-1_64.lib
libboost_wave-vc140-mt-1_64.lib
libboost_wserialization-vc140-mt-1_64.lib
qhullstatic.lib
qhull.lib
qhull_p.lib
qhull_r.lib
qhullcpp.lib
qhullstatic_r.lib
vtkalglib-8.0.lib
vtkChartsCore-8.0.lib
vtkCommonColor-8.0.lib
vtkCommonComputationalGeometry-8.0.lib
vtkCommonCore-8.0.lib
vtkCommonDataModel-8.0.lib
vtkCommonExecutionModel-8.0.lib
vtkCommonMath-8.0.lib
vtkCommonMisc-8.0.lib
vtkCommonSystem-8.0.lib
vtkCommonTransforms-8.0.lib
vtkDICOMParser-8.0.lib
vtkDomainsChemistry-8.0.lib
vtkexoIIc-8.0.lib
vtkexpat-8.0.lib
vtkFiltersAMR-8.0.lib
vtkFiltersCore-8.0.lib
vtkFiltersExtraction-8.0.lib
vtkFiltersFlowPaths-8.0.lib
vtkFiltersGeneral-8.0.lib
vtkFiltersGeneric-8.0.lib
vtkFiltersGeometry-8.0.lib
vtkFiltersHybrid-8.0.lib
vtkFiltersHyperTree-8.0.lib
vtkFiltersImaging-8.0.lib
vtkFiltersModeling-8.0.lib
vtkFiltersParallel-8.0.lib
vtkFiltersParallelImaging-8.0.lib
vtkFiltersProgrammable-8.0.lib
vtkFiltersSelection-8.0.lib
vtkFiltersSMP-8.0.lib
vtkFiltersSources-8.0.lib
vtkFiltersStatistics-8.0.lib
vtkFiltersTexture-8.0.lib
vtkFiltersVerdict-8.0.lib
vtkfreetype-8.0.lib
vtkGeovisCore-8.0.lib
vtkhdf5-8.0.lib
vtkhdf5_hl-8.0.lib
vtkImagingColor-8.0.lib
vtkImagingCore-8.0.lib
vtkImagingFourier-8.0.lib
vtkImagingGeneral-8.0.lib
vtkImagingHybrid-8.0.lib
vtkImagingMath-8.0.lib
vtkImagingMorphological-8.0.lib
vtkImagingSources-8.0.lib
vtkImagingStatistics-8.0.lib
vtkImagingStencil-8.0.lib
vtkInfovisCore-8.0.lib
vtkInfovisLayout-8.0.lib
vtkInteractionImage-8.0.lib
vtkInteractionStyle-8.0.lib
vtkInteractionWidgets-8.0.lib
vtkIOAMR-8.0.lib
vtkIOCore-8.0.lib
vtkIOEnSight-8.0.lib
vtkIOExodus-8.0.lib
vtkIOExport-8.0.lib
vtkIOGeometry-8.0.lib
vtkIOImage-8.0.lib
vtkIOImport-8.0.lib
vtkIOInfovis-8.0.lib
vtkIOLegacy-8.0.lib
vtkIOLSDyna-8.0.lib
vtkIOMINC-8.0.lib
vtkIOMovie-8.0.lib
vtkIONetCDF-8.0.lib
vtkIOParallel-8.0.lib
vtkIOPLY-8.0.lib
vtkIOSQL-8.0.lib
vtkIOVideo-8.0.lib
vtkIOXML-8.0.lib
vtkIOXMLParser-8.0.lib
vtkjpeg-8.0.lib
vtkjsoncpp-8.0.lib
vtklibxml2-8.0.lib
vtkmetaio-8.0.lib
vtkNetCDF-8.0.lib
vtknetcdf_c++.lib
vtkoggtheora-8.0.lib
vtkParallelCore-8.0.lib
vtkpng-8.0.lib
vtkproj4-8.0.lib
vtkRenderingAnnotation-8.0.lib
vtkRenderingContext2D-8.0.lib
vtkRenderingCore-8.0.lib
vtkRenderingFreeType-8.0.lib
vtkRenderingImage-8.0.lib
vtkRenderingLabel-8.0.lib
vtkRenderingLOD-8.0.lib
vtkRenderingVolume-8.0.lib
vtksqlite-8.0.lib
vtksys-8.0.lib
vtktiff-8.0.lib
vtkverdict-8.0.lib
vtkViewsContext2D-8.0.lib
vtkViewsCore-8.0.lib
vtkViewsInfovis-8.0.lib
vtkzlib-8.0.lib
OpenNI2.lib
8)点击“视图”->“解决方案资源管理器”。回到工程编写测试程序如下:
第一个测试程序:
#include<pcl/visualization/cloud_viewer.h>
#include<iostream>
#include<pcl/io/io.h>
#include<pcl/io/pcd_io.h>
#include<pcl/io/ply_io.h>
#include<pcl/point_types.h>
int user_data;
using std::cout;
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0);
}
int main()
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
char strfilepath[256] = "bunny.pcd";
if (-1 == pcl::io::loadPCDFile(strfilepath, *cloud)) {
cout << "error input!" << endl;
return -1;
}
cout << cloud->points.size() << endl;
pcl::visualization::CloudViewer viewer("Cloud Viewer");
viewer.showCloud(cloud);
viewer.runOnVisualizationThreadOnce(viewerOneOff);
system("pause");
return 0;
}
输出显示:
第二个测试程序:
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/filters/project_inliers.h>
int main(int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_projected(new pcl::PointCloud<pcl::PointXYZ>);
cloud->width = 5;
cloud->height = 1;
cloud->points.resize(cloud->width * cloud->height);
for (size_t i = 0; i < cloud->points.size(); ++i)
{
cloud->points[i].x = 1024 * rand() / (RAND_MAX + 1.0f);
cloud->points[i].y = 1024 * rand() / (RAND_MAX + 1.0f);
cloud->points[i].z = 1024 * rand() / (RAND_MAX + 1.0f);
}
std::cerr << "Cloud before projection: " << std::endl;
for (size_t i = 0; i < cloud->points.size(); ++i)
std::cerr << " " << cloud->points[i].x << " " <<
cloud->points[i].y << " " << cloud->points[i].z << std::endl;
// Create a set of planar coefficients with X=Y=0,Z=1
pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients());
coefficients->values.resize(4);
coefficients->values[0] = coefficients->values[1] = 0;
coefficients->values[2] = 1.0;
coefficients->values[3] = 0;
// Create the filtering object
pcl::ProjectInliers<pcl::PointXYZ> proj;
proj.setModelType(pcl::SACMODEL_PLANE);
proj.setInputCloud(cloud);
proj.setModelCoefficients(coefficients);
proj.filter(*cloud_projected);
std::cerr << "Cloud after projection: " << std::endl;
for (size_t i = 0; i < cloud_projected->points.size(); ++i)
std::cerr << " " << cloud_projected->points[i].x << " " <<
cloud_projected->points[i].y << " " << cloud_projected->points[i].z << std::endl;
system("pause");
return (0);
}
输出显示:
注意,编译问题:
(1)在Debug下编译会出现大量的如下warning(Release下没有):
warning LNK4099: 未找到 PDB“.pdb”正在链接对象,如同没有调试信息一样
解决方法:“视图”->"解决方案资源管理器"->"属性"->“链接器"->"调试",在右侧的“生成调试信息”改为“否”,确定即可。
具体原因涉及到release和debug的区别,以及PDB文件,具体可百度了解。
(2)在属性目录"C/C++ "– >"预处理器"–>"预处理器定义" 加入:
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS
PCL_NO_PRECOMPILE
(3)error C4996: 'pcl::SAC_SAMPLE_SIZE': This map is deprecated and is kept only to prevent breaking existing user...
解决方法:“视图”->"解决方案资源管理器"->"属性"->"C/C++"->"SDL检查":改为否(/sdl)
说明:下次打开一个新的vs工程,如何添加保存好的属性表?
. 点击“视图”->“其他窗口”->“属性管理器”,在Debug | x64上右键单击,选择“添加现有属性表”,选择D:thirdLibPCL目录下的PCLd64PropertySheet.props;
在Release | x64上右键单击,选择“添加现有属性表”,选择D:thirdLibPCL目录下的PCLr64PropertySheet.props。
点击“视图”->“解决方案资源管理器”,回到工程即可。
最后
以上就是独特楼房为你收集整理的win10+vs2015+pcl1.8.1安装配置的全部内容,希望文章能够帮你解决win10+vs2015+pcl1.8.1安装配置所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复