-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_usage.py
33 lines (24 loc) · 973 Bytes
/
example_usage.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
#!/usr/bin/env python
import numpy as np
from field_reconstruction import video, reconstruction
def clip_heatmap():
# logging.root.setLevel(logging.DEBUG)
# vid = video.Video(r"video1.mp4")
vid = video.Video(r"video2.mp4")
clip = video.Clip(vid, startframe=0, stopframe=298)
print("Loaded video {fname}, shape: {shape}, fps: {fps}, start: {start}, stop: {stop}".format(
fname=clip.video.path, shape=clip.video.shape, fps=clip.video.fps,
start=clip.start_frame, stop=clip.stop_frame))
# estimated from tractor treads in video
camera_proj_mat = np.array(
[[1883, 0, 910],
[0, 1883, 490],
[0, 0, 1]]
)
reconstruction.render_reconstruct_world(
clip, camera_proj_mat, frame_step=3, path='./output/', include_intermediates=False, multiproc=False,
render_mode='standard', render_scale=3.3, render_gsigma=1
)
print("Done.")
if __name__ == '__main__':
clip_heatmap()