论文地址:
https://arxiv.org/abs/1706.09911
代码链接:
https://github.com/atenpas/gpd
环境配置:
相关配置 | 版本 |
---|---|
GPD | 2.0 - (分支6327f20) |
Ubuntu | 16.04 64bit |
CUDA | 10.2 |
PCL | 1.9.0 |
Boost | 1.58 |
VTK | 8.2.0 |
OpenCV | 4.2.0 |
GCC | 7.5.0 |
- 安装顺序 GCC -> VTK -> Boost -> OpenCV -> PCL
- 以上配置使用Boost 1.68会报错
- VTK最好选用8.2版本,对应 PCL-1.9.0
- 最好不要用 PCL-1.11.0 与 PCL-1.12.0
重要参考:
- 在安装PCL-1.9.0 时会发生报错,需要更改源代码修正错误:
在 pcl-pcl-1.9.0/visualization/src/pcl_visualizer.cpp 中 3564 行左右更改为以下代码(主要添加 #if - #else - #endif,适配VTK8.2.0 )。
参考链接:
https://blog.csdn.net/czychen1997/article/details/107306674
for (std::size_t t = 0; t < mesh.tex_coordinates.size (); ++t)
if (t == tex_id)
for (std::size_t tc = 0; tc < mesh.tex_coordinates[t].size (); ++tc)
coordinates->InsertNextTuple2 (mesh.tex_coordinates[t][tc][0],
mesh.tex_coordinates[t][tc][1]);
else
for (std::size_t tc = 0; tc < mesh.tex_coordinates[t].size (); ++tc)
coordinates->InsertNextTuple2 (-1.0, -1.0);
#if VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 2
mapper->MapDataArrayToMultiTextureAttribute(mesh.tex_materials[tex_id].tex_name.c_str(),
this_coordinates_name.c_str(),
vtkDataObject::FIELD_ASSOCIATION_POINTS);
#else
mapper->MapDataArrayToMultiTextureAttribute(tu,
this_coordinates_name.c_str (),
vtkDataObject::FIELD_ASSOCIATION_POINTS);
this_coordinates_name.c_str(),
vtkDataObject::FIELD_ASSOCIATION_POINTS);
#endif
polydata->GetPointData ()->AddArray (coordinates);
actor->GetProperty ()->SetTexture (tu, texture);
++tex_id;
}
- 在配置GPD CMakelist.txt 时参考以下PR:
https://github.com/atenpas/gpd/pull/109/files
CMakelist.txt
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(gpd)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 14)
SET(CMAKE_AR "gcc-ar")
SET(CMAKE_RANLIB "gcc-ranlib")
SET(CMAKE_NM "gcc-nm")
# CMAKE_CXX_FLAGS
set(CMAKE_CXX_FLAGS "-O3 -march=native -mtune=intel -msse4.2 -mavx2 -mfma -flto -fopenmp -fPIC -Wno-deprecated -Wenum-compare -Wno-ignored-attributes -std=c++17")
参考Issues:
https://github.com/atenpas/gpd/issues/103
https://github.com/atenpas/gpd/issues/107
https://github.com/atenpas/gpd/pull/109/files
https://github.com/atenpas/gpd/issues/88#issuecomment-833370948