For the sake of my individual project, I have been investigating many libraries and try tutorial of each library, change programming language from C# to C++, and many things. Those are only for utilizing potential of Microsoft Kinect v2 with its depth camera. And after 1 month, I hope I made right decision by combinating PCL and Kinect, will bring me to the end of this project.

But, I’ll tell you that doing setup for this library was not easy, especially for Windows and Visual Studio. You have to make sure of every detail and do not ever miss any configuration in order to make it run. For me, even to start the “Hello World” Project, I spent 1 week for running it, through a lot of unfamiliar troubleshooting because c++ is new thing for me.

I made this post also as my own reminder, just in case I forget some detail. 😀 And I also send my huge gratitude for everyone who post tutorial and error troubleshooting (see the reference link at the bottom)

My Dev Environment

  • Windows 10 x64 Education License
  • Visual Studio Express 2015
  • Language C++
  • Microsoft Kinect Version 2
  • PCL 1.8.0 RC1

Installation

  • Kinect for Windows SDK 2.0
  • Point Cloud Library for Visual Studio 2015 (vc14). I was so thankful to him because He made installation of PCL for VS 2015 became easier than it should have been. You have 2 options for installing this library:
    • 1) use all-in-installer from his website. Make sure all 3rd Party are installed:
      • Boost 1.6
      • Eigen 3,
      • FLANN,
      • OpenNI2,
      • Qhull,
      • VTK 7.0
    • 2) build with your own compiler. But, if you choose 2nd option, you have to install many 3rd party separately also. And the possibility of getting error also high. My friend said that building in other OS other than Windows was easier and not complex. Follow the link above to build separately.

I have tried both options anyway. And first option was faster and easier. If the installer asking whether to add Path in the system or not, choose Yes. This was regarding Environment Variable configuration in our OS.

Configuration

1)Environment Variables

This is new things for me. So far, I never find this configuration haha or probably case by case also. To put it simply, this setting is used as startup, where you define the dependent library used by the program, such as library declaration. This is important, some of tutorial did not mention that what they wrote is this configuration. They only write the configuration variables.

How:
Go to Properties of File Explorer by Right Click it. Then Choose Advanced System Settings. And Click Environment Variables. And add New configuration as follows:

[table id=1 /]

Note: This configuration is for x64 installer, if using x86, the folder will be at Program Files (x86). Btw x64 or x86 here means the PCL installer we used, not related with our operating system. And for OpenNI configuration is optional. If you use Kinect as camera, probably you need it too.

2) VS2015 Property Setting

Before, I did not know that this setting can be saved as .prop file. So every time I start new project, I have to do this routine every time which was really wasting time haha So, this configuration is making property sheets for VS and can be used in every project. We will make 2 Files: PCL.prop and KinectSDK.prop

How:

  1. Create Empty C++ Project
  2. Show Property Manager window, by clicking View -> Other Windows -> Property Manager
  3. There will be 4 folders if you use x64. Debug and Release Folder for your solution project
  4. In the Solution name, Right Click it and Add New Project Property Sheet. And give it name.
  5. The files will be available in every folder. Choose in any folder the property sheet that we want to configure. Right Click -> Properties
  6. The most important is C/C++ and Linker Menu. Configure the property as following:

 

PCL.props

C/C++ Menu in Additional Include Directories

C:\Program Files\PCL 1.8.0\include\pcl-1.8\

C:\Program Files\PCL 1.8.0\3rdParty\VTK\include\vtk-7.0
C:\Program Files\PCL 1.8.0\3rdParty\Boost\include\boost-1_60
C:\Program Files\PCL 1.8.0\3rdParty\Qhull\include
C:\Program Files\PCL 1.8.0\3rdParty\FLANN\include
C:\Program Files\PCL 1.8.0\3rdParty\Eigen\eigen3\

Linker Menu -> General-> Additional Library Directories

C:\Program Files\PCL 1.8.0\lib
C:\Program Files\PCL 1.8.0\3rdParty\VTK\lib
C:\Program Files\PCL 1.8.0\3rdParty\Qhull\lib
C:\Program Files\PCL 1.8.0\3rdParty\FLANN\lib
C:\Program Files\PCL 1.8.0\3rdParty\Boost\lib

Linker Menu->Input-> Additional Dependencies

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_60.lib
libboost_chrono-vc140-mt-1_60.lib
libboost_container-vc140-mt-1_60.lib
libboost_context-vc140-mt-1_60.lib
libboost_coroutine-vc140-mt-1_60.lib
libboost_date_time-vc140-mt-1_60.lib
libboost_exception-vc140-mt-1_60.lib
libboost_filesystem-vc140-mt-1_60.lib
libboost_graph-vc140-mt-1_60.lib
libboost_iostreams-vc140-mt-1_60.lib
libboost_locale-vc140-mt-1_60.lib
libboost_log-vc140-mt-1_60.lib
libboost_log_setup-vc140-mt-1_60.lib
libboost_math_c99-vc140-mt-1_60.lib
libboost_math_c99f-vc140-mt-1_60.lib
libboost_math_c99l-vc140-mt-1_60.lib
libboost_math_tr1-vc140-mt-1_60.lib
libboost_math_tr1f-vc140-mt-1_60.lib
libboost_math_tr1l-vc140-mt-1_60.lib
libboost_mpi-vc140-mt-1_60.lib
libboost_prg_exec_monitor-vc140-mt-1_60.lib
libboost_program_options-vc140-mt-1_60.lib
libboost_random-vc140-mt-1_60.lib
libboost_regex-vc140-mt-1_60.lib
libboost_serialization-vc140-mt-1_60.lib
libboost_signals-vc140-mt-1_60.lib
libboost_system-vc140-mt-1_60.lib
libboost_test_exec_monitor-vc140-mt-1_60.lib
libboost_thread-vc140-mt-1_60.lib
libboost_timer-vc140-mt-1_60.lib
libboost_type_erasure-vc140-mt-1_60.lib
libboost_unit_test_framework-vc140-mt-1_60.lib
libboost_wave-vc140-mt-1_60.lib
libboost_wserialization-vc140-mt-1_60.lib
flann_cpp_s.lib
qhullstatic.lib
vtkalglib-7.0.lib
vtkChartsCore-7.0.lib
vtkCommonColor-7.0.lib
vtkCommonComputationalGeometry-7.0.lib
vtkCommonCore-7.0.lib
vtkCommonDataModel-7.0.lib
vtkCommonExecutionModel-7.0.lib
vtkCommonMath-7.0.lib
vtkCommonMisc-7.0.lib
vtkCommonSystem-7.0.lib
vtkCommonTransforms-7.0.lib
vtkDICOMParser-7.0.lib
vtkDomainsChemistry-7.0.lib
vtkexoIIc-7.0.lib
vtkexpat-7.0.lib
vtkFiltersAMR-7.0.lib
vtkFiltersCore-7.0.lib
vtkFiltersExtraction-7.0.lib
vtkFiltersFlowPaths-7.0.lib
vtkFiltersGeneral-7.0.lib
vtkFiltersGeneric-7.0.lib
vtkFiltersGeometry-7.0.lib
vtkFiltersHybrid-7.0.lib
vtkFiltersHyperTree-7.0.lib
vtkFiltersImaging-7.0.lib
vtkFiltersModeling-7.0.lib
vtkFiltersParallel-7.0.lib
vtkFiltersParallelImaging-7.0.lib
vtkFiltersProgrammable-7.0.lib
vtkFiltersSelection-7.0.lib
vtkFiltersSMP-7.0.lib
vtkFiltersSources-7.0.lib
vtkFiltersStatistics-7.0.lib
vtkFiltersTexture-7.0.lib
vtkFiltersVerdict-7.0.lib
vtkfreetype-7.0.lib
vtkGeovisCore-7.0.lib
vtkgl2ps-7.0.lib
vtkhdf5-7.0.lib
vtkhdf5_hl-7.0.lib
vtkImagingColor-7.0.lib
vtkImagingCore-7.0.lib
vtkImagingFourier-7.0.lib
vtkImagingGeneral-7.0.lib
vtkImagingHybrid-7.0.lib
vtkImagingMath-7.0.lib
vtkImagingMorphological-7.0.lib
vtkImagingSources-7.0.lib
vtkImagingStatistics-7.0.lib
vtkImagingStencil-7.0.lib
vtkInfovisCore-7.0.lib
vtkInfovisLayout-7.0.lib
vtkInteractionImage-7.0.lib
vtkInteractionStyle-7.0.lib
vtkInteractionWidgets-7.0.lib
vtkIOAMR-7.0.lib
vtkIOCore-7.0.lib
vtkIOEnSight-7.0.lib
vtkIOExodus-7.0.lib
vtkIOExport-7.0.lib
vtkIOGeometry-7.0.lib
vtkIOImage-7.0.lib
vtkIOImport-7.0.lib
vtkIOInfovis-7.0.lib
vtkIOLegacy-7.0.lib
vtkIOLSDyna-7.0.lib
vtkIOMINC-7.0.lib
vtkIOMovie-7.0.lib
vtkIONetCDF-7.0.lib
vtkIOParallel-7.0.lib
vtkIOParallelXML-7.0.lib
vtkIOPLY-7.0.lib
vtkIOSQL-7.0.lib
vtkIOVideo-7.0.lib
vtkIOXML-7.0.lib
vtkIOXMLParser-7.0.lib
vtkjpeg-7.0.lib
vtkjsoncpp-7.0.lib
vtklibxml2-7.0.lib
vtkmetaio-7.0.lib
vtkNetCDF-7.0.lib
vtkNetCDF_cxx-7.0.lib
vtkoggtheora-7.0.lib
vtkParallelCore-7.0.lib
vtkpng-7.0.lib
vtkproj4-7.0.lib
vtkRenderingAnnotation-7.0.lib
vtkRenderingContext2D-7.0.lib
vtkRenderingContextOpenGL-7.0.lib
vtkRenderingCore-7.0.lib
vtkRenderingFreeType-7.0.lib
vtkRenderingGL2PS-7.0.lib
vtkRenderingImage-7.0.lib
vtkRenderingLabel-7.0.lib
vtkRenderingLIC-7.0.lib
vtkRenderingLOD-7.0.lib
vtkRenderingOpenGL-7.0.lib
vtkRenderingVolume-7.0.lib
vtkRenderingVolumeOpenGL-7.0.lib
vtksqlite-7.0.lib
vtksys-7.0.lib
vtktiff-7.0.lib
vtkverdict-7.0.lib
vtkViewsContext2D-7.0.lib
vtkViewsCore-7.0.lib
vtkViewsInfovis-7.0.lib
vtkzlib-7.0.lib
OpenNI2.lib

Kinect SDK.prop

C/C++ Menu in Additional Include Directories

C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\inc

Linker Menu -> General-> Additional Library Directories

C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Lib\x64

Linker Menu->Input-> Additional Dependencies

kinect20.lib

If you want to use the same property sheet, just Add Existing Prop sheet in the project property manager.

Now… All the configuration and setting for PCL library and Kinect SDK Library are done! now you can start programming stuff. 😀

And if you read in PCL official website that we need to add CmakeLists.txt inside the project folder, with this config, we can skip this step. Honestly using Cmake is kind of not easy if you found many abnormal case haha

References: 1 | 2 | 3 | 4 |

Leave a Reply