File size: 2,069 Bytes
bdb955e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from math import pi
from tvcalib.utils.data_distr import mean_std_with_confidence_interval


def get_cam_distr(sigma_scale: float, batch_dim: int, temporal_dim: int):
    cam_distr = {
        "pan": {
            "minmax": (-pi / 4, pi / 4),  # in deg -45°, 45°
            "dimension": (
                batch_dim,
                temporal_dim,
            ),
        },
        "tilt": {
            "minmax": (pi / 4, pi / 2),  # in deg 45°, 90°
            "dimension": (
                batch_dim,
                temporal_dim,
            ),
        },
        "roll": {
            "minmax": (-pi / 18, pi / 18),  # in deg -10°, 10°
            "dimension": (
                batch_dim,
                temporal_dim,
            ),
        },
        "aov": {
            "minmax": (pi / 22, pi / 2),  # (8.2°, 90°)
            "dimension": (
                batch_dim,
                temporal_dim,
            ),
        },
        "c_x": {
            "minmax": (36 - 16.5, 36 + 16.5),
            "dimension": (
                batch_dim,
                1,
            ),
        },
        "c_y": {
            "minmax": (40.0, 110.0),
            "dimension": (
                batch_dim,
                1,
            ),
        },
        "c_z": {
            "minmax": (-40.0, -5.0),
            "dimension": (
                batch_dim,
                1,
            ),
        },
    }

    for k, params in cam_distr.items():
        cam_distr[k]["mean_std"] = mean_std_with_confidence_interval(
            *params["minmax"], sigma_scale=sigma_scale
        )
    return cam_distr


def get_dist_distr(batch_dim: int, temporal_dim: int, _sigma_scale: float = 2.57):
    return {
        "k1": {
            "minmax": [0.0, 0.5],  # we clip min(0.0, x)
            "mean_std": (0.0, _sigma_scale * 0.5),
            "dimension": (batch_dim, temporal_dim),
        },
        "k2": {
            "minmax": [-0.1, 0.1],
            "mean_std": (0.0, _sigma_scale * 0.1),
            "dimension": (batch_dim, temporal_dim),
        },
    }