Openmvs Configuration (VS2015)

Source: Internet
Author: User
Tags gmp serialization thread versions git clone


Reprinted article, the original article URL openmvg+openmvs+vs2015 configuration whole process (detailed parameter settings + screenshot)



Written in the front, this blog only the text part, if the reader needs to have a screenshot of the version please go to the following address download: http://download.csdn.net/detail/mitsubishisony/9614244



Places that require special attention before configuring.



1) If you have CUDA on the machine, then OpenCV, OPENMVG and Openmvs do not use, to the With_cuda, Build_cuda_lib, Openmvs_use_cuda, such as the cancellation, Because even the newest CUDA7.5 does not support VS2015, the VS2015 currently supported is Cuda 8.0 and is still in the RC version, so the author has not tried its usability. If you are using VS2013 or earlier versions of VS, consider installing cuda and tick the appropriate option in CMake.



2) The entire process, only opencv,googleflags can be configured as a dynamic library, the rest are static. That is, opencv,googleflags in build_shared_libs need to tick, the rest of the appearance of Shared_lib can not be checked.



3) VS2015 has a known bug, in Update1 in fact there is no solution, if you compile OPENMVS when the internal error C1001, then congratulate you, you also met. Workaround [3] is:



Modify Generalmatrixmatrix.h Line 144th in Eigen (Eigen3.2.7 is in this line, other versions are self-locating)



"– (Info[j].users)" changed to "Info[j].users-=1".






All libraries required by OPENMVS, and the version of the library used in this article









OpenCV (2.4 or more) 3.1






VCG 1.0.0






Cgal (over 4.2) 4.8.1






Boost 1.61.0






QT 5.7.0






Libqglviewer 2.6.3






Ceres






Eigen (over 3.2) 3.2.9






Google Log 0.3.3






Google Flags 2.1.2






Cxsparse 3.1.1






Cmake 3.6.0












Openmvg






Git






GCC (over 4.7) 5.4.1






Openmvs









Folder settings: This article in the C-disk to create a new Openmvs folder, where the required software libraries are subfolders in the form of Openmvs this folder for storage, in addition to the folder under the new 2 subfolders, named SRC and build. The SRC folder is used to store the source code of the Openmvs, and the build is used to store the generated files for all related repositories.






First, configure the OPENCV



1. Download the OPENCV is generally EXE format, double-click Run, set the installation path to OPENMVS/OPENCV, and then install. After installation there will be 2 folders, a Sources folder, and a build folder. This article only uses the Sources folder



2. Open the Cmake-gui file in the CMake software, Sorce code is set to the SRC subfolder in the OpenCV folder, Openmvs/opencv/sources,build is set to OPENMVS/BUILD/OPENCV, See the diagram, then click Configure and select the appropriate compilation platform. This article selects Visual Studio 142015 Win64









3. Cancel Build_with_static_crt, build_perf_tests, build_tests, and all Cuda-containing items



4. Tick Build_shared_libs, then click Configure, then click Generate



5. Locate the SLn file in the Openmvs/build/opencv folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the OpenCV.sln file in the Open VS2015 window, find the install item in the project list, compile only the project, and compile it separately in debug and release two modes.



Second, the Eigen file is stored directly in the Openmvs/eigen folder.






Third.The VCG file is also stored directly under the OPENMVS/VCG folder.









Fourth. Configuring boost



1.Boost file download, pay attention to choose the appropriate compilation platform, 32/64 bits and version, this article uses the 1.61.0 version, for the installation version of the vs2015,64 bit. Install the boost file under the Openmvs/boost folder, after installation, under the installation folder, locate the Bootstrap.bat file, double-click Run



2. When you are finished, look for the Zlib folder within the Openmvg\src folder to copy this path

open the VS2015 x64 Native Tools command Prompt tool in the VS2015 folder in the Start menu, navigate to the Boost folder, and then enter Bjam stage--with-system--with-thread--with-iostreams-- With-program_options--with-serialization--WITH-DATE_TIME-SZLIB_SOURCE=/*OPENMVG in zlib folder path */address-model=64 Link=static runtime-link=shared threading=multi Debug Release
The folder path in/*OPENMVG zlib is replaced by the Zlib folder path of the previous copy, which is
Bjam stage--with-system--with-thread--with-iostreams--with-program_options--with-serialization--with-date_time- Szlib_source=c:\openmvs\openmvg\src\third_party\zlib address-model=64 link=static runtime-link=shared threading= Multi Debug release
Then press ENTER to run. Notice that there are no spaces behind source.
 


Fifth. QT Installation



Install the default path on the C drive, and the installation option is available by default



Add the Qt installation path to the environment variable path, for this article is C:\Qt\Qt5.7.0, add this path to the environment variable path.






Sixth, configuration Cgal



1. Add 3 environment variables first.



Boost_librarydir= C:\openMVS\Boost\lib64-msvc-14.0



Boost_includedir= C:\openMVS\Boost



Qtdir= C:\Qt\Qt5.7.0









2. Add the following 2 paths to the path of the environment variable: C:\openMVS\Boost\lib64-msvc-14.0



C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin






3. Copy the Libqglviewer file to the Openmvs/libqglviewer folder



Open the VS2015 x64 Native Tools command Prompt tool in the VS2015 folder in the Start menu and navigate to the Libqglviewer/qglviewer sub-folder



4. Enter Qmake.exe and then enter



5. Enter NMAKE and enter



6. Add the following path to the path of the environment variable: C:\openMVS\libQGLViewer\QGLViewer









7. Add the following variables to the environment variable: qglviewerroot= C:\openMVS\libQGLViewer









8. Install the Cgal file , double-click to install, select 64-bits during installation, install directory to C:\openMVS\CGAL,









Select all users where you choose, and tick cgal_dir.









9. Follow the prompts to add the appropriate path to the path of the environment variable.












10. Open the Cmake-gui for the following settings









11. Tick Cgal_boost_use_static_libs, cancel Build_shared_libs



Then point configure,



12. General will error, click Add Entry added a parameter, if there is no corresponding option, then also by add entry way to be added



Name:cgal_boost_use_static_libs,type:bool,value: Tick



name:boost_include_dir,type:path,value:c:\openmvs\boost\lib64-msvc-14.0. Click OK, then click Configure and then point generate









13. Locate the SLn file in the Openmvs/build/cgal folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the CGAL.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, and compile it separately in debug and release two modes. Finally, add the following path to the environment variable path: C:\openMVS\build\Cgal\bin









14. Finally copy the Openmvs/cgal/auxiliary folder to C:/Program Files/cgal, and copy the 3. h files under the Openmvs/cgal/auxiliary/gmp/include folder to C: \ Programfiles\cgal\include\cgal\gmp and C:\ProgramFiles\CGAL\include\CGAL\internal\auxiliary.






Seventh, configuration Cxsparse



Copy the files to the Openmvs/cxsparse folder



Locate the CXSparse.sln file in the Openmvs\cxsparse\project\cxsparse folder, double-click to VS2015 to open, notice that the target platform is selected as x64, and then compile in Debug and release mode respectively.






Eighth, configuration Ceres



1. Copy the 3 programs of Ceres,googleflags and Google_log to the three subfolders of Openmvs respectively.



2. Open Cmake-gui, then click Configure, Tick Build_shared_libs, then click Generate






3. Locate the SLn file in the Openmvs/build/google_flags folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the Gflags.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, and compile separately in debug and release two modes



4. Open the Cmake-gui, set it up, then click Configure, and then click Generate






5. Locate the SLn file in the Openmvs/build/google_log folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the Google-glog.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, and compile separately in debug and release two modes



6. Open the Cmake-gui for the following settings









7. General error, modify Eigen_include_dir to Eigen root directory, that is C:\openMVS\Eigen









Tick Cxsparse,export_build_dir,miniglog, then configure.



8. The following two items are set up as follows:









Tick Cxsparse Again, then point configure, then point generate



9. Locate the SLn file in the Openmvs/build/ceres folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the Ceres.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, and compile separately in debug and release two modes



Ninth, configuration Openmvg


1. Open git cmd This software, navigate to Openmvs This folder, then enter Git clone https://github.com/openMVG/openMVG.git, press ENTER

 

2. Then enter the openMVG folder, enter git submodule init, and press Enter



3. Then enter git submodule update and press Enter






4. Then open the Cmake-gui program and make the following settings









5. Find out if there is ceres_dir this parameter, if there is a change to C:\Program files\ceres\cmake, no can add a parameter by clicking on Add entry



Ceres_dir=c:\programfiles\ceres\cmake, click OK, then configure






6. Tick Openmvg_build_tests,openmvg_build_examples, click Configure again, and then click Generate.



7. Locate the SLn file in the Openmvs/build/openmvg folder, open it with VS2015, and compile it in Debug and release mode, respectively. After you turn off VS2015, in the Start menu, locate the VS2015 program, right-click Run as Administrator, Reopen the OpenMVG.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, compile in debug mode, and C:\Program files\ after successful. Openmvg the Lib folder to Libd, then to release mode to compile






Tenth, Configuration Openmvs



1. Open Cmake-gui, set it up, then click Configure to set the following parameters












2. Cancel Build_static_runtime,openmvs_use_cuda, then click Configure, modify the following parameters:









3. Then click Configure to modify the following parameters:








4. Add the following parameters: Then click Configure, then generate.


5. Copy the following 2 files to a specified location



C:\openMVS\CGAL\auxiliary\gmp\include\gmp.h to C:\openMVS\CGAL\include\CGAL



C:\openMVS\CGAL\auxiliary\gmp\include\mpfr.h to C:\openMVS\CGAL\include



6. Add C:\Program files\cgal\lib,debug and release in the "Connectors-general-Additional Library directory" in the 5 projects under the app



7.ReconstructMesh Project "linker-input-Additional dependencies" add cgal/auxiliary/gmp/lib/libgmp-10.lib, Linker---add to the additional library directory: C:\openMVS



8.debug all projects in the linker-input-additional dependencies contained in the OPENMVG-related libraries, you need to change the path of the Lib to libd



9. After setting up, it is recommended to compile the project one by one, do not use all_build, there may be problems. First Lib after the app.



10. Adjust the Boost file:



Add Lib in front of the file name of the library that involves boost in the add-in dependency, linker-I, for example



C:\openMVS\Boost\stage\lib\boost_system-vc140-mt-gd-1_61.lib revision changed to



C:\openMVS\Boost\stage\lib\libboost_system-vc140-mt-gd-1_61.lib



11. Then compile each item in the app in turn, and then compile the all_build. Then, in the Start menu, locate the VS2015 program and right-click Run as Administrator, Reopen the CGAL.sln file in the Open VS2015 window, find the install project in the project list, compile only the project, and compile separately in debug and release two modes



12. Configure the OpenCV path to add the following path in the Include directory: C:\openMVS\build\openCV\install\lib



Add the following path to the Library directory: C:\openMVS\build\openCV\install\include



Add the following files to the additional dependencies and add different files according to the debug and release modes



Debug:
opencv_calib3d310d.lib
opencv_core310d.lib
Opencv_features2d310d.lib
Opencv_ Flann310d.lib
Opencv_highgui310d.lib
opencv_imgcodecs310d.lib
Opencv_imgproc310d.lib
Opencv_ Ml310d.lib
Opencv_objdetect310d.lib
opencv_photo310d.lib
Opencv_shape310d.lib
Opencv_ Stitching310d.lib
Opencv_superres310d.lib
opencv_ts310d.lib
Opencv_video310d.lib
Opencv_ Videoio310d.lib
Opencv_videostab310d.lib
Release:
opencv_calib3d310.lib
Opencv_core310.lib
Opencv_features2d310.lib
Opencv_flann310.lib
opencv_highgui310.lib
Opencv_imgcodecs310.lib
Opencv_ Imgproc310.lib
Opencv_ml310.lib
opencv_objdetect310.lib
Opencv_photo310.lib
Opencv_shape310.lib
Opencv_stitching310.lib
Opencv_superres310.lib
opencv_ts310.lib
Opencv_video310.lib
Opencv_ Videoio310.lib
Opencv_videostab310.lib



13. Copy all DLL files under the following C:\openMVS\build\openCV\install\bin path to C:\Windows\SysWOW64, or C:\openMVS\build\openCV\install\ The bin is added to the path of the environment variable








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.