Ubuntu18.04 安装Open3D

阅读: 评论:0

Ubuntu18.04 安装Open3D

Ubuntu18.04 安装Open3D

准备工作

根据open3d官网的教程确定gcc5+ clang7+ cmake3.19+ 的版本限制,不满足要求的要升级一下:
参考链接:
cmake升级
clang升级

编译安装

按照链接Ubuntu 18.04 安装Open3D C++版本的安装部分依次操作即可

报错处理

cmake版本太低

升级cmake,cmake升级

cmake时报错:can not find libc++ libc++abi libraries with version >=7

升级clang,clang升级

cmake和make时,下载失败

网络问题。
(1)配置clash:ubuntu18.04 配置clash(设置了私密,需要私我)
(2)如果仍然不能解决,手动下载相关包,并放置在dst指示的地址中:参考解决安装open3d下载失败问题

完结撒花

测试程序:
main.cpp

#include <iostream>
#include <memory>
#include <thread>
#include </usr/local/include/open3d/Open3D.h>int main(int argc, char * argv[]) {std::cout << "Hello, Open3D!! " << std::endl;open3d::utility::SetVerbosityLevel(open3d::utility::VerbosityLevel::Debug);auto pcd = open3d::io::CreatePointCloudFromFile(argv[1]);// 1. test downsampleauto downsampled = pcd->VoxelDownSample(0.05);{open3d::utility::ScopeTimer timer("FPFH estimation with Radius 0.25");open3d::pipelines::registration::ComputeFPFHFeature(*downsampled, open3d::geometry::KDTreeSearchParamRadius(0.25));}// 2. 估计点云的法向量{open3d::utility::ScopeTimer timer("Normal estimation with KNN20");for (int i = 0; i < 20; i++){downsampled->EstimateNormals(open3d::geometry::KDTreeSearchParamKNN(20));}}std::cout << downsampled->normals_[0] << std::endl;std::cout << downsampled->normals_[10] << std::endl;{open3d::utility::ScopeTimer timer("Normal estimation with Radius 0.01666");for(int i=0; i<20; i++){downsampled->EstimateNormals(open3d::geometry::KDTreeSearchParamRadius(0.01666));}}std::cout << downsampled->normals_[0] << std::endl;std::cout << downsampled->normals_[10] << std::endl;open3d::visualization::DrawGeometries({downsampled}, "TestPCD", 1920, 1080);return 0;
}
修改:
(1)#include <open3d/Open3D.h>改成#include </usr/local/include/open3d/Open3D.h>,否则会报错找不到头文件;
(2)open3d::registration::ComputeFPFHFeature(*downsampled, open3d::geometry::KDTreeSearchParamRadius(0.25));改成 open3d::pipelines::registration::ComputeFPFHFeature(*downsampled, open3d::geometry::KDTreeSearchParamRadius(0.25));
<

cmake_minimum_required(VERSION 2.8)
project(open3d_test)set(CMAKE_CXX_STANDARD 11)find_package( Open3D  REQUIRED)include_directories(${Open3D_INCLUDE_DIRS})
link_directories(${Open3D_LIBRARY_DIRS})add_executable(TestVisualizer main.cpp)
target_link_libraries(TestVisualizer ${Open3D_LIBRARIES})target_include_directories(TestVisualizer PUBLIC ${Open3D_INCLUDE_DIRS})

运行结果:

本文发布于:2024-01-31 20:36:50,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170670461131188.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:Open3D
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23