OpenMVG配置

OpenMVG (Open Multiple View Geometry)

Build instructions

Required tools:

  • CMake
  • Git
  • C/C++ compiler (GCC, Visual Studio or Clang)

Getting the sources (and the submodules):

$ git clone --recursive https://github.com/openMVG/openMVG.git

or

$ git clone https://github.com/openMVG/openMVG.git
$ cd openMVG
$ git submodule init
$ git submodule update

As OpenMVG uses some C++11 features, you must have a C++11 ready compiler:

  • Visual Studio >= 2015 (recommended)
  • GCC >= 4.8.1
  • Clang >= 3.3

General information for OpenMVG CMake options:

  • OpenMVG_BUILD_TESTS (ON/OFF(default))
    • Build OpenMVG unit tests
  • OpenMVG_BUILD_EXAMPLES (ON/OFF(default))
    • Build OpenMVG example applications.

Note: options does not affect binaries under 'software'

General information for OpenMVG SfM pipelines:

  • OpenMVG can export graphs as Graphviz .dot files and render them as SVG files. If you want this graph visualization feature, please install Graphviz.

Compilation

Linux compilation

<a name="linux"></a>

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, install Graphviz.

$ sudo apt-get install graphviz

Build OpenMVG.

$ git clone --recursive https://github.com/openMVG/openMVG.git
$ cd openMVG
$ ls
 AUTHORS BUILD  docs  logo  README  src  ...
$ cd ..
$ mkdir openMVG_Build
$ cd openMVG_Build

If you want to add unit tests and examples to the build, run

$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DOpenMVG_BUILD_TESTS=ON -DOpenMVG_BUILD_EXAMPLES=ON . ../openMVG/src/

otherwise

$ cmake -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/

If you want to have an IDE openable project with Code::Blocks:

$ cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/

Compile the project

$ make

or for a multi-core compilation. (Replace NBcore with the number of threads)

$ make -j NBcore

Run tests (if requested at CMake step)

$ make test

Have fun with the samples

$ cd openMVG_Samples

Windows compilation

<a name="windows"></a>

Checkout the project

$ git clone --recursive https://github.com/openMVG/openMVG.git
  1. Open cmake-gui.
  2. Fill the source path with the src OpenMVG path.
  3. Fill the build path with a new directory.
  4. Select your Visual Studio IDE and click configure and then generate.
  5. Open the .sln solution created in your build directory.
  6. Change the target to Release.
  7. Compile the libraries and binaries samples.

Mac compilation

<a name="macos"></a>

$ git clone --recursive https://github.com/openMVG/openMVG.git
$ cd openMVG
$ ls
 AUTHORS BUILD  docs  logo  README  src  ...
$ cd ..
$ mkdir openMVG_Build
$ cd openMVG_Build

If you want to use Xcode and compile by using the command line, run

$ cmake -DCMAKE_BUILD_TYPE=RELEASE -G "Xcode" . ../openMVG/src/
$ xcodebuild -configuration Release

If you want to add unit tests and examples to the build, run

$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DOpenMVG_BUILD_TESTS=ON -DOpenMVG_BUILD_EXAMPLES=ON -G "Xcode" . ../openMVG/src/

otherwise you can use standard makefiles

$ cmake -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/

Using OpenCV sample

Add -DOpenMVG_USE_OPENCV=ON to your cmake command and set the OpenCV_DIR variable to your OpenCV build directory
e.g. -DOpenCV_DIR="/home/user/Dev/github/itseez/opencv_Build" -DOpenMVG_USE_OPENCV=ON

Using OpenMVG as a third party library dependency in CMake

OpenMVG can be used as a third party library once it has been installed.
Because it can use its own Ceres version, it's better to install it locally and not in system files.
So please consider using the CMAKE_INSTALL_PREFIX CMake variable to specify a local installation directory.

Here is the syntax to add the variable to the cmake command (use absolute path):
-DCMAKE_INSTALL_PREFIX:STRING="YourInstallPath"
e.g -DCMAKE_INSTALL_PREFIX:STRING="/home/user/Dev/github/openMVG_Build/openMVG_install"

Perform make and make install.

Once the library has been installed, go to your project that wants to use OpenMVG as an external library and add

find_package(OpenMVG REQUIRED)
include_directories(${OPENMVG_INCLUDE_DIRS})
add_executable(main main.cpp)
target_link_libraries(main ${OPENMVG_LIBRARIES})

Specify in CMake where OpenMVG has been installed by using the CMake OpenMVG_DIR variable
e.g. -DOpenMVG_DIR:STRING="YourInstallPath"/share/openMVG/cmake

A message will be displayed if OpenMVG is found or not at the CMake configure step.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末甲锡,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子沙庐,更是在濱河造成了極大的恐慌有滑,老刑警劉巖墨技,帶你破解...
    沈念sama閱讀 216,692評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異篮灼,居然都是意外死亡鲜漩,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,482評論 3 392
  • 文/潘曉璐 我一進(jìn)店門缩幸,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人竞思,你說我怎么就攤上這事表谊。” “怎么了盖喷?”我有些...
    開封第一講書人閱讀 162,995評論 0 353
  • 文/不壞的土叔 我叫張陵爆办,是天一觀的道長。 經(jīng)常有香客問我课梳,道長距辆,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,223評論 1 292
  • 正文 為了忘掉前任暮刃,我火速辦了婚禮跨算,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘椭懊。我一直安慰自己诸蚕,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,245評論 6 388
  • 文/花漫 我一把揭開白布氧猬。 她就那樣靜靜地躺著背犯,像睡著了一般。 火紅的嫁衣襯著肌膚如雪盅抚。 梳的紋絲不亂的頭發(fā)上漠魏,一...
    開封第一講書人閱讀 51,208評論 1 299
  • 那天,我揣著相機與錄音妄均,去河邊找鬼柱锹。 笑死哪自,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的奕纫。 我是一名探鬼主播提陶,決...
    沈念sama閱讀 40,091評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼匹层!你這毒婦竟也來了隙笆?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,929評論 0 274
  • 序言:老撾萬榮一對情侶失蹤升筏,失蹤者是張志新(化名)和其女友劉穎撑柔,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體您访,經(jīng)...
    沈念sama閱讀 45,346評論 1 311
  • 正文 獨居荒郊野嶺守林人離奇死亡铅忿,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,570評論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了灵汪。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片檀训。...
    茶點故事閱讀 39,739評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖享言,靈堂內(nèi)的尸體忽然破棺而出峻凫,到底是詐尸還是另有隱情,我是刑警寧澤览露,帶...
    沈念sama閱讀 35,437評論 5 344
  • 正文 年R本政府宣布荧琼,位于F島的核電站,受9級特大地震影響差牛,放射性物質(zhì)發(fā)生泄漏命锄。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,037評論 3 326
  • 文/蒙蒙 一偏化、第九天 我趴在偏房一處隱蔽的房頂上張望脐恩。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,677評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽只怎。三九已至,卻和暖如春怜俐,著一層夾襖步出監(jiān)牢的瞬間身堡,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,833評論 1 269
  • 我被黑心中介騙來泰國打工拍鲤, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留贴谎,地道東北人汞扎。 一個月前我還...
    沈念sama閱讀 47,760評論 2 369
  • 正文 我出身青樓,卻偏偏與公主長得像擅这,于是被迫代替她去往敵國和親澈魄。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,647評論 2 354

推薦閱讀更多精彩內(nèi)容