ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu20.04安装openMVG和openMVS

2022-07-06 10:07:14  阅读:307  来源: 互联网

标签:ubuntu20.04 sudo https openMVG dev install openMVS


1、安装openMVG

主要按照官方教程安装基本上不会出错:

https://github.com/openMVG/openMVG/blob/develop/BUILD.md#using-openmvg-as-a-third-party-library-dependency-with-cmake

有问题可以查找:

https://github.com/openMVG/openMVG/issues

主要过程:

$ sudo apt-get install libpng-dev libjpeg-dev libtiff-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev

$ sudo apt-get install graphviz
$ cd library

$ git clone --recursive https://github.com/openMVG/openMVG.git
$ cd openMVG
$ mkdir openMVG_Build && cd openMVG_Build

$ cmake -DCMAKE_BUILD_TYPE=RELEASE ../src/  -DOpenMVG_BUILD_TESTS=ON
$ cmake --build . --target install

$ make test
$ ctest --output-on-failure -j

 

2、安装openMVS

安装步骤主要按照官方文档:https://github.com/cdcseacave/openMVS/wiki/Building

有问题可以查找:https://github.com/cdcseacave/openMVS/issues

#Prepare and empty machine for building:
sudo apt-get update -qq && sudo apt-get install -qq
sudo apt-get -y install git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
main_path=`pwd`

#Eigen (Required)
git clone https://gitlab.com/libeigen/eigen.git --branch 3.4
mkdir eigen_build && cd eigen_build
cmake . ../eigen
make && sudo make install
cd ..

#Boost (Required)
sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev

#OpenCV (Required)
sudo apt-get -y install libopencv-dev

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

#VCGLib (Required)
git clone https://github.com/cdcseacave/VCG.git vcglib

#Ceres (Optional)
sudo apt-get -y install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
mkdir ceres_build && cd ceres_build
cmake . ../ceres-solver/ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j2 && sudo make install
cd ..

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

#OpenMVS
git clone https://github.com/cdcseacave/openMVS.git openMVS
cd openMVS
mkdir openMVS_build && cd openMVS_build cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT="$main_path/vcglib" #If you want to use OpenMVS as shared library, add to the CMake command: -DBUILD_SHARED_LIBS=ON(这一句最好不要加,不然之后安装可能一直安装不上) #Install OpenMVS library (optional): make -j2 && sudo make install

如果按照官方文档安装出现错误,可以查看你安装的库的版本是否符合要求

    Eigen version 3.4 or higher
    OpenCV version 2.4 or higher
    Ceres version 1.10 or higher
    CGAL version 4.2 or higher
    Boost version 1.56 or higher
    VCG
    GLFW

关于遇到的问题:

1、

/home/zll/library/openMVS/libs/MVS/PatchMatchCUDA.cu(267): error: calling a __host__ function("Eigen::MatrixBase< ::Eigen::Matrix<float, (int)3, (int)3, (int)0, (int)3, (int)3> > ::inverse() const") from a __device__ function("ComputeHomography") is not allowed
/home/zll/library/openMVS/libs/MVS/PatchMatchCUDA.cu(267): error: identifier "Eigen::MatrixBase< ::Eigen::Matrix<float, (int)3, (int)3, (int)0, (int)3, (int)3> > ::inverse const" is undefined in device code
2 errors detected in the compilation of "/home/zll/library/openMVS/libs/MVS/PatchMatchCUDA.cu".

make[2]: *** [libs/MVS/CMakeFiles/MVS.dir/build.make:317:libs/MVS/CMakeFiles/MVS.dir/PatchMatchCUDA.cu.o] 错误 1

make[2]: *** 正在等待未完成的任务....

解决方法:

Eigen3.3.9不行,换Eigen3.4

https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip

2、

/usr/bin/ld: CMakeFiles/InterfaceCOLMAP.dir/InterfaceCOLMAP.cpp.o: undefined reference to symbol '_ZTVN7SEACAVE6CImageE'
/usr/bin/ld: /home/zll/library/openMVS/openMVS_build/lib/libIO.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
/usr/bin/ld: CMakeFiles/InterfaceMetashape.dir/InterfaceMetashape.cpp.o: undefined reference to symbol '_ZNK8tinyxml27XMLNode17FirstChildElementEPKc'
/usr/bin/ld: /home/zll/library/openMVS/openMVS_build/lib/libIO.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

解决方法:

cmake时去掉 -DBUILD_SHARED_LIBS=ON

 


参考博客:https://blog.csdn.net/rdw1246010462/article/details/122219814

 

      https://github.com/cdcseacave/openMVS/issues/346

 

标签:ubuntu20.04,sudo,https,openMVG,dev,install,openMVS
来源: https://www.cnblogs.com/zhongllmm/p/16449640.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有