win10下vs2015+pcl1.8.1+qt点云可视化以及界面开发

本人之前在Ubuntu下进行pcl的相关开发,pcl和相关的依赖安装和配置比较容易。现在需要在windows下使用qt进行界面的开发,在经历了一些蛋疼的问题后,终于在windows下完成了相关环境的安装和配置,现在记录下一些过程供各位参考。

 

1.VS2015和QT

vs2015和QT的配置网上有很多的教程了,各位可以自行查找,本人使用的是vs2015社区版和qt-opensource-windows-x86-msvc2015_64-5.7.1

 

2.pcl安装

本人使用PCL-1.8.1-AllInOne-msvc2015-win64安装包和pcl-1.8.1-pdb-msvc2015-win64进行安装,但是由于预编译的vtk包并没有和qt进行编译得到Qvtk控件(该控件用来在qt上进行显示点云),因此需要下载VTK-8.0(必须是该版本,因为pcl-allinone包之前编译使用的是该版本)使用CMAKE进行编译,如果进不去vtk的下载页面,我上传到了https://download.csdn.net/download/qq_27916741/10605593

 

PCL-1.8.1-AllInOne-msvc2015-win64一直下一步就好。最后会弹出安装OpenNI,将OpenNI安装在PCL安装目录下3rdParty\OpenNI2下。此时系统的环境变量里面已经有了PCL_ROOT和OPENNI2的3个路径,需要在path里面再添加

 

3.编译VTK

将下载好的VTK-8.0解压到3rdParty\下,在VTK-8.0里新建build文件夹,并清空PCL自带的VTK文件夹的内容,使用CMAKE进行相应的设置。

where is the source code  为你的VTK-8.0的路径

where to build the binaries 为VTK-8.0里build的路径

第一次点击configure,等configure完成之后勾选Grouped和Advanced,进行以下设置:

BUILD下取消勾选BUILD_TESTING

CMAKE下CMAKE_INSTALL_PREFIX设置为你清空的VTK文件夹

VTK下勾选VTK_Group_Qt,VTK_RENDERING_BACKEND设置为OpenGL(这里一定要注意,否则pcl显示框会出错)

点击Add Entry,添加CMAKE_DEBUG_POSTFIX,Value设置为-gd(用来区别debug和release版本)

再次点击configure,如无error,点击Genrate。

 

进入到build目录下,使用VS打开VTK.sln

首先Debug x64下,右键ALL_BUILD生成,再右键INSTALL生成;

然后Release x64下,右键ALL_BUILD生成,再右键INSTALL生成;

将3rdParty\VTK\plugins\designer下的QVTKWidgetPlugin.dll拷贝到QT\5.7\msvc2015_64\plugins\designer下,这样Qt里面就有了QVtk的控件了。

至此PCL在windows下的环境已经搭配好了,可以选择重启让环境变量生效。

 

4.PCL+QT demo

VS2015下新建一个QT的project,命名为pclviewer,将main.cpp,pclviewer.cpp,pclviewer.h,pclviewer.ui替换为https://github.com/PointCloudLibrary/pcl/tree/master/doc/tutorials/content/sources/qt_visualizer下的相应文件。

右击项目属性

配置为Release x64

vc++目录 --->> 包含目录添加相应的include目录,我的为

vc++目录 --->> 库目录添加相应的lib目录,我的为(注意eigen只有include目录)

最后在链接器---》附加依赖项里添加(由于是release项目,添加release的lib)

 

qtmain.lib
Qt5Core.lib
Qt5Gui.lib
Qt5OpenGL.lib
opengl32.lib
glu32.lib
Qt5Widgets.lib
pcl_common_release.lib
pcl_features_release.lib
pcl_filters_release.lib
pcl_io_ply_release.lib
pcl_io_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
libboost_atomic-vc140-mt-1_64.lib
libboost_bzip2-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_fiber-vc140-mt-1_64.lib
libboost_filesystem-vc140-mt-1_64.lib
libboost_graph-vc140-mt-1_64.lib
libboost_graph_parallel-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_numpy-vc140-mt-1_64.lib
libboost_numpy3-vc140-mt-1_64.lib
libboost_prg_exec_monitor-vc140-mt-1_64.lib
libboost_program_options-vc140-mt-1_64.lib
libboost_python-vc140-mt-1_64.lib
libboost_python3-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_type_erasure-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
libboost_zlib-vc140-mt-1_64.lib
flann.lib
flann_cpp_s.lib
flann_s.lib
flann_cpp.lib
qhullcpp.lib
qhullstatic.lib
qhullstatic_r.lib
qhull.lib
qhull_p.lib
qhull_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
vtkFiltersPoints-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
vtkFiltersTopology-8.0.lib
vtkFiltersVerdict-8.0.lib
vtkfreetype-8.0.lib
vtkGeovisCore-8.0.lib
vtkgl2ps-8.0.lib
vtkGUISupportQt-8.0.lib
vtkGUISupportQtOpenGL-8.0.lib
vtkGUISupportQtSQL-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
vtkIOExportOpenGL-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
vtkIOParallelXML-8.0.lib
vtkIOPLY-8.0.lib
vtkIOSQL-8.0.lib
vtkIOTecplotTable-8.0.lib
vtkIOVideo-8.0.lib
vtkIOXML-8.0.lib
vtkIOXMLParser-8.0.lib
vtkjpeg-8.0.lib
vtkjsoncpp-8.0.lib
vtklibharu-8.0.lib
vtklibxml2-8.0.lib
vtklz4-8.0.lib
vtkmetaio-8.0.lib
vtkNetCDF-8.0.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
vtkRenderingContextOpenGL-8.0.lib
vtkRenderingCore-8.0.lib
vtkRenderingFreeType-8.0.lib
vtkRenderingGL2PS-8.0.lib
vtkRenderingImage-8.0.lib
vtkRenderingLabel-8.0.lib
vtkRenderingLIC-8.0.lib
vtkRenderingLOD-8.0.lib
vtkRenderingOpenGL-8.0.lib
vtkRenderingQt-8.0.lib
vtkRenderingVolume-8.0.lib
vtkRenderingVolumeOpenGL-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
vtkViewsQt-8.0.lib
vtkzlib-8.0.lib
OpenNI2.lib

 

 

 

第一次运行的时候,如果出现了no override found for ‘vtkRenderWindow’

则在第一次使用vtk的头文件上(我的是point_cloud_geometry_handlers.h)添加下面代码

#include <vtkAutoInit.h> 
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle);

 

 

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页