-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcameraConfig.py
executable file
·127 lines (116 loc) · 7.76 KB
/
cameraConfig.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import numpy as np
conf = {
"camera1": {
"camera_matrix": np.float32([[2769.06296722869, 0.0, 1760.9843263239468],
[0.0, 2785.026478811799, 1026.596510810281],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.42235453771438475, 0.2034978378406169, 0.007051626770903101, 0.007918949781333867, 0.0]),
"videoPath": "rtsp://admin:@10.135.4.240/trackID=1",
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2226.373046875, 0.0, 1782.2703569442965, 0.0],
[0.0, 2598.095947265625, 1029.927134760641, 0.0,],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[300, 704], [440, 226], [780, 208], [732, 686]]),
"test": np.float32([[237, 928], [301, 701], [515, 693], [477, 915]]),
"markers_id": np.array([318, 319, 320, 321]),
"markers": np.array([[4.523, 1.632], [4.522, 2.163], [5.056, 2.159], [5.056, 1.628]]),
},
"camera2": {
"camera_matrix": np.float32([[2756.3091266049673, 0.0, 1935.4005774538846],
[0.0, 2739.2898699741118, 757.3055897105869],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.41206781831103545, 0.15810568229520183, 0.028437253656706688, 0.012839922090847578, 0.0]),
"videoPath": "rtsp://admin:@10.135.4.239/trackID=1",
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2126.85595703125, 0.0, 2058.8802237763593, 0.0],
[0.0, 2569.435302734375, 755.4708737197652, 0.0],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[765, 787], [802, 117], [900, 112], [980, 767]]),
"test": np.float32([[340, 811], [399, 639], [573, 634], [548, 798]]),
"markers_id": np.array([322, 323, 324, 325]),
"markers": np.array([[4.425, 3.57], [4.421, 4.102], [4.947, 4.102], [4.947, 3.57]]),
},
"camera3": {
"camera_matrix": np.float32([[2691.187615364774, 0.0, 1845.5488047660904],
[0.0, 2697.5628162733487, 1033.3445781422631],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.39038119751308015, 0.14276777210370106, 0.0011990117832611196, -0.004364877250579988, 0.0]),
"videoPath": "rtsp://admin:@10.135.4.238/trackID=1",
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2067.483642578125, 0.0, 1766.6454163447197, 0.0],
[0.0, 2512.9892578125, 1027.7515920853475, 0.0],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[321, 218], [360, 143], [1303, 163], [1312, 237]]),
"test": np.float32([[272, 742], [329, 568], [525, 571], [482, 739]]),
"markers_id": np.array([326, 327, 328, 329]),
"markers": np.array([[5.681, 5.592], [5.678, 6.124], [6.209, 6.127], [6.216, 5.594]]),
},
"camera4": {
"camera_matrix": np.float32([[2729.490263990151, 0.0, 1831.9202044872143],
[0.0, 2733.96527631694, 948.9345546488366],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.3540047849355193, 0.11021530240142789, -0.007400920530526965, -0.008230929654647412, 0.0]),
#"videoPath": "http://autolab.moevm.info/camera_4/live.mjpg",
"videoPath":"rtsp://admin:@10.135.4.235/trackID=1",
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2126.650390625, 0.0, 1702.0329726830823, 0.0],
[0.0, 2549.162841796875, 918.8533423289846, 0.0],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[332, 659], [399, 377], [699, 373], [673, 656]]),
"markers": np.array([[0.736, 0.706], [0.759, 1.224], [1.274, 1.197], [1.257, 0.773]]),#np.array([[0.734, 0.697], [0.755, 1.211], [1.278, 1.21], [1.251, 0.686]]),
"markers_id": np.array([300, 301, 302, 303])
},
"camera5": {
"camera_matrix": np.float32([[2727.311324390726, 0.0, 1960.2184366721242],
[0.0, 2743.6795415942665, 1038.84098852483],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.3816101108409129, 0.13499295863726649, -0.0021437256328074353, -0.002169671315380979, 0.0]),
"videoPath": "rtsp://admin:@10.135.4.237/trackID=1",#"/home/homry/OSLL/autolab-extended-localization/src/videos/cam5.avi", #"
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2123.993408203125, 0.0, 1958.7184139210876, 0.0],
[0.0, 2567.25732421875, 1028.8813465279673, 0.0],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[765, 870], [807, 260], [949, 255], [985, 870]]),
"markers": np.array([[0.769, 2.359], [0.756, 2.893], [1.293, 2.898], [1.297, 2.362]]),
"test": np.float32([[800, 367], [807, 260], [947, 260], [953, 362]]),
"markers_id": np.array([306, 307, 308, 309])
},
"camera6": {
"camera_matrix": np.float32([[2693.074873346575, 0.0, 1839.716705662914],
[0.0, 2694.1091609124014, 1060.2948393332176],
[0.0, 0.0, 1.0]]),
"dist_coefs": np.float32(
[-0.38348328445347135, 0.1523198787831811, -0.001744591192855556, 0.0012701704343275107, 0.0]),
"videoPath": "rtsp://admin:@10.135.4.236/trackID=1",# "/home/homry/OSLL/autolab-extended-localization/src/videos/cam6.avi", #
"rectification_matrix": np.float32([[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]),
"projection_matrix": np.float32([[2124.931884765625, 0.0, 1819.8076523056661, 0.0],
[0.0, 2515.39208984375, 1053.9039315065893, 0.0],
[0.0, 0.0, 1.0, 0.0]]),
"pts": np.float32([[736, 789], [771, 253], [906, 250], [943, 781]]),
"markers": np.array([[0.756, 5.071], [0.762, 5.607], [1.298, 5.603], [1.291, 5.069]]),
"test": np.float32([[771, 253], [775, 177], [896, 178], [902, 248]]),
"markers_id": np.array([310, 311, 312, 313])
}
}
#[array([441.52641783, 640.68346712]), array([494.23147511, 348.71006792]), array([723.42266441, 350.08795157]), array([693.10320855, 642.97000234])]
#2022-05-24 14:33:13,218 - VideoStream camera4 - DEBUG - find robot Apriltag ([array([1200.30051087, 544.68859987])], [419])
#2022-05-24 14:33:13,219 - Localization camera4 - INFO - robot coords = (2.940933123444532, 1.5256753937047676)
#2022-05-24 14:33:13,219 - Localization camera4 - INFO - robot coords map = [318.60108837315767, 166.82618790977364]
### https://docs.opencv.org/4.x/d9/d6a/group__aruco.html#ga56878c4f94362c9420f20b78de0def9b