-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy path_cal_doc_utils.py
More file actions
69 lines (53 loc) · 1.76 KB
/
_cal_doc_utils.py
File metadata and controls
69 lines (53 loc) · 1.76 KB
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
from scipy._lib import doccer
__all__ = ['docfiller']
# typing the same doc string multiple times gets annoying and error prone...
_obj_coords = (
"""object_points : 2D np.ndarray
Real world coordinates stored in a ndarray structured like [X, Y, Z]'.""")
_img_coords = (
"""image_points : 2D np.ndarray
Image coordinates stored in a ndarray structured like [x, y].""")
_cam_struct = (
"""cam_struct : dict
A dictionary structure of camera parameters.""")
_project_points_func = (
"""project_points_func : function
Projection function with the following signature:
res = func(cam_struct, object_points).""")
_project_to_z_func = (
"""project_to_z_func : function
Projection function with the following signiture:
res = func(cam_struct, image_points, Z).""")
_x_lab_coord = (
"""X : 1D np.ndarray
Projected world x-coordinates.""")
_y_lab_coord = (
"""Y : 1D np.ndarray
Projected world y-coordinates.""")
_z_lab_coord = (
"""Z : 1D np.ndarray
Projected world z-coordinates.""")
_x_img_coord = (
"""x : 1D np.ndarray
Projected image x-coordinates.""")
_y_img_coord = (
"""y : 1D np.ndarray
Projected image y-coordinates.""")
_project_z = (
"""z : float
A float specifying the Z (depth) value to project to.""")
docdict = {
"object_points": _obj_coords,
"image_points": _img_coords,
"cam_struct": _cam_struct,
"project_points_func": _project_points_func,
"project_to_z_func": _project_to_z_func,
"x_lab_coord": _x_lab_coord,
"y_lab_coord": _y_lab_coord,
"z_lab_coord": _z_lab_coord,
"x_img_coord": _x_img_coord,
"y_img_coord": _y_img_coord,
"project_z": _project_z
}
# SciPy's nifty decorator (works better than my simple implementation)
docfiller = doccer.filldoc(docdict)