VS2019+Win10配置Open3D


windows 安装 open3d

Open3D:Win10 + VS2017配置Open3D(C++、python)_累了就要打游戏-CSDN博客_open3d

下载源码

git clone https://codechina.csdn.net/mirrors/intel-isl/Open3D.git

更新子模块

git checkout v0.10.0

找到仓库目录下的.gitmodules文件,修改子模块链接为国内链接,因为国内的仓库不会实时更新,所以有的错误可能就是链接对应的仓库版本发生了改变,这时就需要自己手动在找一个新的仓库。

[submodule "3rdparty/pybind11"]
	path = 3rdparty/pybind11
	url = https://gitee.com/zzwmirrors/pybind11.git
[submodule "3rdparty/eigen-git-mirror"]
	path = 3rdparty/Eigen
	url = https://gitee.com/sabertot/eigen-git-mirror.git
[submodule "3rdparty/qhull"]
	path = 3rdparty/qhull
	url = https://gitee.com/QQ975150313/qhull.git
	branch = master
[submodule "3rdparty/googletest"]
	path = 3rdparty/googletest
	url = https://gitee.com/longing/googletest.git
	branch = master
[submodule "3rdparty/tinyobjloader"]
	path = 3rdparty/tinyobjloader/tinyobjloader
	url = https://gitee.com/infinityyf/tinyobjloader.git
	branch = master
[submodule "3rdparty/open3d_sphinx_theme"]
	path = 3rdparty/open3d_sphinx_theme
	url = https://gitee.com/jiuyueshiwoa/open3d_sphinx_theme.git
[submodule "3rdparty/fmt"]
	path = 3rdparty/fmt
	url = https://gitee.com/createrjd/fmt.git
[submodule "3rdparty/tinygltf"]
	path = 3rdparty/tinygltf/tinygltf
	url = https://gitee.com/jiuyueshiwoa/tinygltf.git
[submodule "3rdparty/libjpeg-turbo/libjpeg-turbo"]
	path = 3rdparty/libjpeg-turbo/libjpeg-turbo
	url = https://gitee.com/yugu/libjpeg-turbo.git
[submodule "3rdparty/PoissonRecon/Open3D-PoissonRecon"]
	path = 3rdparty/PoissonRecon/PoissonRecon
	url = https://gitee.com/jiuyueshiwoa/Open3D-PoissonRecon.git
[submodule "3rdparty/cutlass"]
	path = 3rdparty/cutlass
	url = https://gitee.com/luckydog1995/cutlass
[submodule "3rdparty/filament/filament"]
	path = 3rdparty/filament/filament
	url = https://gitee.com/zymITsky/filament.git
[submodule "3rdparty/imgui"]
	path = 3rdparty/imgui
	url = https://gitee.com/ant1423/imgui.git
[submodule "3rdparty/benchmark"]
	path = 3rdparty/benchmark
	url = https://gitee.com/EwenWan/benchmark.git

使用git submodule更新子模块

git submodule init
git submodule update

CMAKE编译

设置路径

  • source code: E:/Config/open3D/Open3D
  • build binaries: E:/Config/open3D/bulid

Configure

generator 选择 Visual Studio 16 2019optional platform for generator 选择x64

Configure -> Configure done

Generate -> Generating done

生成解决方案

用 VS2019 管理员权限打开 E:/Config/open3D/build/Open3D.sln Release-x64

将CMakePredefinedTargets/ALL_BUILD 设为启动项,右击生成

打包

右击 CMakePredefinedTargets/INSTALL,仅用于项目 -> 仅生成INSTALL;

因为设置的时默认安装路径,所以open3d的库都在C:/Program Files/Open3D下。

image-20210919171153919

测试

{git_dir}\Open3D\docs_static\C++ 目录下有测试文件TestVisualizer.cppCMakeLists.txt

  • 拷贝 TestVisualizer.cppCMakeLists.txt 文件到路径 C:/testVisualizer下;

  • 打开CMake GUI并设置source目录为 C:/testVisualizer,binaries 目录设置为 C:/testVisualizer/build

    image-20210919171306538

  • configure,配置完毕以后,将Open3D_DIR 设置成Open3D的安装,比如我的是C:/Program Files/Open3D

  • Generate,生成完毕以后,使用VS2019 管理员权限 打开TestVisualizer.sln,生成解决方案后执行,得到testVisualizer.exebuild\Release
  • 下载rabbit.pcd(一只非常有名的兔子,文件不要太好找)到testVisualizer.exe 的位置,执行.\TestVisualizer.exe pointcloud rabbit.pcd就可以看到一直可爱小兔子的点云图辣。

image-20210919170948527


文章作者: Mug-9
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Mug-9 !
评论
  目录