Ubuntu 环境 openMVG+openMVS 配置

摘要:
1.openMVG比较简单,直接按照buildwiki的步骤一步一步来就没问题。

1. openMVG

比较简单,直接按照 build wiki 的步骤一步一步来就没问题。

Instruction: Build on Linux

# Install the required external libraries.
sudo apt-get install libpng-dev libjpeg-dev libtiff-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev
# If you want see the view graph svg logs, installGraphviz.
$ sudo apt-get install graphviz
# Checkout OpenMVG.
$ git clone --recursive https://github.com/openMVG/openMVG.git
# 设置编译和安装路径
$ cd openMVG
$ mkdir openmvg-build
$ mkdir openmvg-bin
$ cd openmvg-build
# Configure and build
$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/path/to/openMVG/openmvg-bin ../src/$ cmake --build . --target install

2. openMVS

2.1 这一步就比较麻烦了,因为wiki里面的指导不一定能安装成功。

# Prepare and empty machine forbuilding
apt-get update && apt-get install -qq
apt-get -y install build-essential git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxmu-dev libxi-dev
#Boost (Required)
apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
#Eigen (Required)
git clone https://gitlab.com/libeigen/eigen.git --branch 3.3
cd eigen
mkdir eigen-build && cd eigen-build
cmake . .. -CMAKE_INSTALL_PREFIX=/path/to/eigen/eigen-bin
make && make installcd ../..

2.2 下面这一步可能会出现问题,最好自己下载源码编译

#OpenCV (Required)
apt-get -y install libopencv-dev
# Build opencv from source
git clone https://github.com/opencv/opencv.git
cd opencv
git reset --hard 3.4.1
mkdir opencv-bin
mkdir opencv-build && cd opencv-build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/path/to/opencv/opencv-bin ..
make -j8
make install

2.3 接下来的两个库直接按步骤就可以

#CGAL (Required)
apt-get -y install libcgal-dev libcgal-qt5-dev

#VCGLib (Required)
git clone https://github.com/cdcseacave/VCG.git vcglib
#Ceres (Required)
apt-get -y install libatlas-base-dev libsuitesparse-dev

# If google source encounter connection timeout, try github
# git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
git reset --hard 1.14.0
mkdir ceres-bin
mkdir ceres-build && cd ceres-build
cmake . ../ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j2 && sudo make installcd ../..

#GLFW3 (Optional)
apt-get -y install freeglut3-dev libglew-dev libglfw3-dev

2.4 进入主要步骤

#OpenMVS
git clone https://github.com/cdcseacave/openMVS.git openMVS
cd openMVS
mkdir openmvs-bin
mkdir openmvs-build && cd openmvs-build

cmake . ../ -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT="/path/to/vcglib" -DBUILD_SHARED_LIBS=ON

#If something goes wrong, try to set shared libs OFF

#Install OpenMVS library (optional):
make -j8 && make install

2.5 make的过程中出现undefined reference错误记录如下

[100%] Linking CXX executable ../../bin/Viewer
/usr/bin/ld: CMakeFiles/Viewer.dir/Image.cpp.o: undefined refere
nce to symbol '_ZN2cv6resizeERKNS_11_InputArrayERKNS_12_OutputAr
rayENS_5Size_IiEEddi'
//root/misc_codes/opencv/opencv-bin/lib/libopencv_imgproc.so.3.4
: error adding symbols: DSO missing from command line
collect2: error: ld returned 1exit status
apps/Viewer/CMakeFiles/Viewer.dir/build.make:229: recipe for target 'bin/Viewer'failed
make[2]: *** [bin/Viewer] Error 1CMakeFiles/Makefile2:732: recipe for target 'apps/Viewer/CMakeFi
les/Viewer.dir/all'failed
make[1]: *** [apps/Viewer/CMakeFiles/Viewer.dir/all] Error 2Makefile:129: recipe for target 'all'failed
make: *** [all] Error 2

openMVS的git issue里面提到的思路或许能解决问题

Ubuntu 环境 openMVG+openMVS 配置第1张

inCMakeList.txt, add lines like below (replace {{target_name}} to your own):

find_package(Boost COMPONENTS system filesystem REQUIRED)
target_link_libraries({{target_name}} ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries({{target_name}} ${Boost_SYSTEM_LIBRARY})

实际解决时,在每一个模块下面的CMakeLists.txt中添加动态链接库

# openMVS/apps/InterfaceCOLMAP/CMakeLists.txt
cxx_executable_with_flags_no_pch(InterfaceCOLMAP "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}"${LIBRARY_FILES_C} ${LIBRARY_FILES_H})

target_link_libraries(InterfaceCOLMAP
        ${OpenCV_LIBRARIES}
        ${Boost_LIBRARIES}
        )

2.6 运行过程中遇到以下的问题

error: "There is no defined intrinsic data in order to compute an essential matrix for the initial pair."

解决方案

参考 openMVS git issue

Ubuntu 环境 openMVG+openMVS 配置第2张

至此配置完成,找一些数据如Middlebury dino/temple、DTU scan9、ETHD Pipes、Strecha fountain-P11等就可以运行测试了。

免责声明:文章转载自《Ubuntu 环境 openMVG+openMVS 配置》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Visual Studio属性配置中使用宏代码实现:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续 判断第二个字母。下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Linux下对LVM逻辑卷分区大小调整 [针对xfs和ext4文件系统]

当我们在安装系统的时候,由于没有合理分配分区空间,在后续维护过程中,发现有些分区空间不够使用,而有的分区空间却有很多剩余空间。如果这些分区在装系统的时候使用了lvm(前提是这些分区要是lvm逻辑卷分区),那么就可以轻松进行扩容或缩容!不同文件系统类型所对应的创建、检查、调整命令不同,下面就针对xfs和ext2/3/4文件系统的lvm分区空间的扩容和缩容的...

vxworks固件分析

前言 vxworks 的固件分析流程 1.用binwalk查看固件基本信息并解压固件 2.获取固件相关信息, cpu架构,大小端 3.确定固件的加载地址 4.用IDA加载固件,并修复符号表 5. 分析固件 实战分析 一道CTF题 分析固件 用到的例子 http://www.icsmaster.org/wp-content/uploads/2018/01/...

npm install -g create-react-app MacOS 报错解决

macOS 安装create-react-app报错解决: sudo npm uninstall -g create-react-app //删除之前对镜像 npm config set registry https://registry.npm.taobao.org // 安装还是不成功直接切换成淘宝镜像安装 npm config get regist...

windows terminal+wsl+neovim配置过程杂记

长期记录,草稿 coc依赖于node,直接sudo apt intsll node得到的版本是10.x,无法满足要求,这篇博客介绍了安装新版node的方法https://www.cnblogs.com/sha-ka/p/13250051.html#:~:text=ubuntu%20%E5%AE%89%E8%A3%85%20node%20%E4%BB%A5%...

Ubuntu 查看磁盘空间大小命令<转>

df -h Df命令是linux系统以磁盘分区为单位查看文件系统,可以加上参数查看磁盘剩余空间信息,命令格式: df -hl 显示格式为:  文件系统 容量 已用 可用 已用% 挂载点  Filesystem Size Used Avail Use% Mounted on...

Linux初识(转)

 文件系统是linux的一个十分基础的知识,同时也是学习linux的必备知识。     本文将站在一个较高的视图来了解linux的文件系统,主要包括了linux磁盘分区和目录、挂载基本原理、文件存储结构、软链接硬链接、和常见目录的介绍。相信有了这些知识对于深入的学习linux会有一定的帮助。文章例子主要是基于ubuntu发行版。     如有不对之处请大家...