-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.py
43 lines (33 loc) · 946 Bytes
/
main.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
from steps.parser import parse_data
from steps.dlt import compute_homography
from steps.intrinsics import get_camera_intrinsics
from steps.extrinsics import get_camera_extrinsics
from steps.distortion import estimate_lens_distortion
from utils.timer import timer
def calibrate():
data = parse_data()
end = timer()
homographies = compute_homography(data)
end("Homography Estimation")
print("homographies")
print(homographies)
end = timer()
intrinsics = get_camera_intrinsics(homographies)
end("Intrinsics")
print("intrinsics")
print(intrinsics)
end = timer()
extrinsics = get_camera_extrinsics(intrinsics, homographies)
end("Extrinsics")
print("extrinsics")
print(extrinsics)
end = timer()
distortion = estimate_lens_distortion(
intrinsics,
extrinsics,
data["real"],
data["sensed"]
)
end("Distortion")
return
calibrate()