LoginSignup
0
2

オープンソースによるフォトグラメトリの実行方法

Last updated at Posted at 2023-02-23

前記事(オープンソースによるフォトグラメトリを実行するための環境構築)からの続きの話です.

1. OpenSfMとOpenMVSを利用してフォトグラメトリを行う方法.

  • 前回作成した'3d'ディレクトリに,ディレクトリ(名前はプロジェクト名的なもの)を作成する.
  • 作成したそのディレクトリに'images'ディレクトリを作成し,そのimagesディレクトリにフォトグラメトリに適用した全画像データを追加する.
  • カレントディレクトリを最初に作成したプロジェクトディレクトリにし,以下のコマンドを順番に実行すれば,フォトグラメトリ結果を得ることができる.
OpenSfMとOpenMVSを利用した場合
# OpenSfMの処理
$ ~/3d/OpenSfM/bin/opensfm_run_all .
$ ~/3d/OpenSfM/bin/opensfm export_openmvs .
# OpenMVSの処理
$ ~/3d/openMVS/openMVS_build/bin/DensifyPointCloud ./undistorted/openmvs/scene.mvs
$ ~/3d/openMVS/openMVS_build/bin/ReconstructMesh ./undistorted/openmvs/scene_dense.mvs
$ ~/3d/openMVS/openMVS_build/bin/TextureMesh ./undistorted/openmvs/scene_dense_mesh.mvs
  • フォトグラメトリ結果は上のコマンドを実行した際に作成される「undistorted/openmvs/scene_dense_mesh_texture.ply』となる.

2. COLMAPとOpenMVSを利用してフォトグラメトリを行う方法.

  • 前回作成した'3d'ディレクトリに,ディレクトリ(名前はプロジェクト名的なもの)を作成する.
  • 作成したそのディレクトリに'images'ディレクトリを作成し,そのimagesディレクトリにフォトグラメトリに適用した全画像データを追加する.
  • カレントディレクトリを最初に作成したプロジェクトディレクトリにし,以下のコマンドを順番に実行すれば,フォトグラメトリ結果を得ることができる.
COLMAPとOpenMVSを利用した場合
# COLMAPの処理
$ colmap feature_extractor --database_path database.db --image_path ./images
$ colmap exhaustive_matcher --database_path database.db
$ mkdir sparse
$ mkdir dense
$ colmap mapper --database_path database.db --image_path ./images --output_path ./sparse
$ colmap image_undistorter --image_path ./images --input_path ./sparse/0 --output_path ./dense
# OpenMVSの処理
$ ~/3d/openMVS/openMVS_build/bin/InterfaceCOLMAP -i ./dense -o scene.mvs
$ ~/3d/openMVS/openMVS_build/bin/DensifyPointCloud ./scene.mvs
$ ~/3d/openMVS/openMVS_build/bin/ReconstructMesh ./scene_dense.mvs
$ ~/3d/openMVS/openMVS_build/bin/TextureMesh ./scene_dense_mesh.mvs
  • フォトグラメトリ結果は上のコマンドを実行した際に作成される「scene_dense_mesh_texture.ply』となる.

3. テストデータと自動実行スクリプト

テスト画像データと自動実行スクリプトをgithubにuploadしました.
使い方は,以下の動画を参考にしてください.

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2