forked from TheHolyCows/cowlibration-camera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
24 lines (21 loc) · 751 Bytes
/
run.py
File metadata and controls
24 lines (21 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import datetime
import os
from calibrate import Calibration, CalibrationInput
def get_default_output_file_path() -> str:
"""Return a timestamped JSON path under outputs/."""
os.makedirs("outputs", exist_ok=True)
return f"outputs/calibration_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
calibration = (
Calibration()
.with_input(CalibrationInput.PORT(1))
.with_output_file_path(get_default_output_file_path())
.with_square_size(0.016)
.with_marker_size(0.012)
.with_width(12)
.with_height(8)
.with_resolution(800, 600)
.with_manual_capture(True)
.with_max_detection_accuracy(True)
.with_preview_rectified_captures(True)
)
calibration.run()