Commit d9de4dee authored by Clément Pinard's avatar Clément Pinard
Browse files

Add output_format choice

parent ecb4b344
......@@ -386,7 +386,7 @@ def write_points3D_text(points3D, path):
fid.write(" ".join(track_strings) + "\n")
def write_points3d_binary(points3D, path_to_model_file):
def write_points3D_binary(points3D, path_to_model_file):
"""
see: src/base/reconstruction.cc
void Reconstruction::ReadPoints3DBinary(const std::string& path)
......@@ -425,7 +425,7 @@ def write_model(cameras, images, points3D, path, ext):
else:
write_cameras_binary(cameras, os.path.join(path, "cameras" + ext))
write_images_binary(images, os.path.join(path, "images" + ext))
write_points3d_binary(points3D, os.path.join(path, "points3D") + ext)
write_points3D_binary(points3D, os.path.join(path, "points3D") + ext)
return cameras, images, points3D
......
......@@ -9,6 +9,7 @@ parser.add_argument('--video_list', metavar='PATH',
help='path to list with relative path to images', type=Path)
parser.add_argument('--input_model', metavar='DIR', type=Path)
parser.add_argument('--output_model', metavar='DIR', default=None, type=Path)
parser.add_argument('--format', choices=['.txt', '.bin'], default='.txt')
def main():
......@@ -24,9 +25,7 @@ def main():
camera_id = images_per_name[image_list[0]].camera_id
cameras = {camera_id: cameras[camera_id]}
rm.write_cameras_text(cameras, args.output_model / "cameras.txt")
rm.write_images_text(images_per_name, args.output_model / "images.txt")
rm.write_points3D_text({}, args.input_model / "points3D.txt")
rm.write_model(cameras, images_per_name, {}, args.output_model, args.format)
return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment