Loading files
#!/usr/bin/env python
import os.path, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import argparse
import json
import numpy as np
import opensfm.dataset as dataset
import opensfm.io as io
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert output from Bundler to OpenSfM reconstructions')
parser.add_argument('dataset', help='path to the dataset to be processed')
parser.add_argument('--list', help='the list.txt file')
parser.add_argument('--bundleout', help='the bundle.out file')
args = parser.parse_args()
if args.list:
list_file = args.list
else:
list_file = 'list.txt'
if not args.bundleout:
print "No bundle.out given. Importing only the list of images list.txt."
if os.path.exists(list_file):
print 'Converting output from Bundler to OpenSfM'
data = dataset.DataSet(args.dataset)
tracks_file = data._DataSet__tracks_graph_file()
reconstruction_file = data._DataSet__reconstruction_file(None)
io.import_bundler(args.dataset, args.bundleout, list_file, tracks_file, reconstruction_file)
else:
print 'Cannot find list.txt'
35d5ba9d5This file is pinned to the selected release. Download the original to open it in your design tool.