OpenARK安装教程
1. CMake安装
下载地址:https://cmake.org/download/
Ps:安装时注意添加PATH to all user
2. PCL1.8安装(不安装在C盘)
安装博客:https://blog.csdn.net/qq_32408773/article/details/82961178
Ps:
- 安装博客中的libboost的版本号需要根据具体的安装路径修改VS链接器中输入的lib名称。
- PCL安装过程中注意PATH,同时对于弹出的OpenNI2安装在PCL/3rdParty/OpenNI2路径下面。
//测试代码:
#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>);
// Fill in the cloud data
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);
}
3. OpenCV3.3.0+OpenCV_contrib3.3.0配置:
https://www.cnblogs.com/jliangqiu2016/p/5597501.html
https://www.cnblogs.com/chenhuanting/p/10515891.html
https://blog.csdn.net/leilonghit/article/details/81460704
https://blog.csdn.net/hshqing/article/details/79317489
如果嫌麻烦的话可以不需要配置OpenCV_Contrib模块,只需要解压OpenCV。
//测试代码:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{
Mat img = imread("F:\\1.jpeg");
namedWindow("图片");
imshow("图片", img);
waitKey(6000);
return 0;
}
4. IntelRealSense 安装
博客:https://blog.csdn.net/Liyatao1/article/details/83345953
下载地址:https://github.com/IntelRealSense/librealsense/releases
5. openark-deps-vc14-win64安装
下载地址:
https://github.com/sxyu/OpenARK-Deps/releases/download/0.0.1/openark-deps-vc14-win64.exe.
安装目录随意
6. Glog报错
解决方案:https://www.2cto.com/kf/201604/502148.html
7. VS配置
VC++目录
1). 包含目录
2). 库目录
C/C++__常规
1). 附加库目录
链接器/输入
1). Debug:
realsense2.lib
opencv_world330d.lib
vtknetcdf_c++-gd.lib
pcl_common_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_ply_debug.lib
pcl_io_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
libboost_atomic-vc140-mt-gd-1_64.lib
libboost_bzip2-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_fiber-vc140-mt-gd-1_64.lib
libboost_filesystem-vc140-mt-gd-1_64.lib
libboost_graph-vc140-mt-gd-1_64.lib
libboost_graph_parallel-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_numpy3-vc140-mt-gd-1_64.lib
libboost_numpy-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_python3-vc140-mt-gd-1_64.lib
libboost_python-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_type_erasure-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
libboost_zlib-vc140-mt-gd-1_64.lib
flann-gd.lib
flann_cpp-gd.lib
flann_cpp_s-gd.lib
flann_s-gd.lib
2).Release
realsense2.lib
opencv_world330.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
OpenNI2.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
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
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
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
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
vtkzlib-8.0.lib
qhull_p.lib
qhull_r.lib
qhull.lib
qhullcpp.lib
qhullstatic.lib
qhullstatic_r.lib
flann.lib
flann_cpp.lib
flann_cpp_s.lib
flann_s.lib
VS项目/头文件与源文件
SDL检查设置为“否”
预处理器设置
_SCL_SECURE_NO_WARNINGS
GLOG_NO_ABBREVIATED_SEVERITIES
8. HandDemo.cpp运行查看
总结:OpenARK对于距离的要求很严格,同时对电脑要求也有一定要求(不是很极端),但就测试性能而言远不如MediaPipe(2D)来的直接,即使MediaPipe的Z轴信息是算出来的。