forked from mapillary/OpenSfM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathundistort.py
48 lines (43 loc) · 1.34 KB
/
undistort.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from opensfm.actions import undistort
from . import command
import argparse
from opensfm.dataset import DataSet
class Command(command.CommandBase):
name = "undistort"
help = "Save radially undistorted images"
def run_impl(self, dataset: DataSet, args: argparse.Namespace) -> None:
undistort.run_dataset(
dataset,
args.reconstruction,
args.reconstruction_index,
args.tracks,
args.output,
args.skip_images
)
def add_arguments_impl(self, parser: argparse.ArgumentParser) -> None:
parser.add_argument(
"--reconstruction",
help="reconstruction to undistort",
type=str
)
parser.add_argument(
"--reconstruction-index",
help="index of the reconstruction component to undistort",
type=int,
default=0,
)
parser.add_argument(
"--tracks",
help="tracks graph of the reconstruction",
)
parser.add_argument(
"--output",
help="output folder",
default="undistorted",
type=str
)
parser.add_argument(
"--skip-images",
help="if set, only undistort the reconstruction and NOT the images.",
action="store_true",
)