@@ -54,11 +54,11 @@ def connect(ip,port):
54
54
def triang_3D (col_1 , row_1 , col_2 , row_2 ) :
55
55
56
56
#Corrected camera matrix for west side
57
- P1 = np .array ([[408.4918 , - 1607.7562 , 3814.1879 , 490234.8756 ], [- 1793.2995 , - 707.4668 , - 45.8775 , 646489.5760 ], [0.1810 , - 0.9505 , - 0.2524 , 1285.5524 ]])
58
-
57
+ # P1 = np.array([[408.4918, -1607.7562, 3814.1879, 490234.8756], [-1793.2995, -707.4668, -45.8775, 646489.5760], [0.1810, -0.9505, -0.2524, 1285.5524]])
58
+ P1 = np . array ([[ - 2.1 , 0.0 , - 3.64 , 55432.5 ], [ 0.0 , 4.2 , 0.0 , - 18186.0 ], [ 0.866 , 0.0 , - 0.5 , 7620.0 ]])
59
59
#Corrected camera matrix for east side
60
- P2 = np .array ([[- 49.3179 , - 518.1547 , - 4126.6037 , 847220.0489 ], [- 1776.8193 , 738.4249 , - 127.1965 , 963513.3797 ], [0.2075 , 0.9387 , - 0.2753 , 1589.9759 ]])
61
-
60
+ # P2 = np.array([[-49.3179, -518.1547, -4126.6037, 847220.0489], [-1776.8193, 738.4249, -127.1965, 963513.3797], [0.2075, 0.9387, -0.2753, 1589.9759]])
61
+ P2 = np . array ([[ 2.1 , 0.0 , - 3.64 , - 34048.4 ],[ 0.0 , - 4.2 , 0.0 , 18186.0 ],[ - 0.866 , 0.0 , - 0.5 , 44521.3 ]])
62
62
#blimp position from camera 1
63
63
#col_1 = 396
64
64
#row_1 = 424
@@ -67,6 +67,12 @@ def triang_3D(col_1, row_1, col_2, row_2) :
67
67
#col_2 = 518
68
68
#row_2 = 538
69
69
70
+ #Convert pixel numbers to mm, 0, 0 is the center of the image,
71
+ col_1 = (col_1 - 640 )* 0.0035
72
+ col_2 = (col_2 - 640 )* 0.0035
73
+ row_1 = (row_1 - 360 )* 0.00475
74
+ row_2 = (row_2 - 360 )* 0.00475
75
+
70
76
71
77
#translated from matlab:
72
78
@@ -276,7 +282,7 @@ def procImg(img,sideName,dispFlag):
276
282
#Live images from the IP cameras
277
283
#(if not live, then this file needs to be in folder with a bunch of images)
278
284
#(if live, then need to be local at WID)
279
- liveIP = 0
285
+ liveIP = 1
280
286
if liveIP == 0 :
281
287
#need to be in directory with a bunch of images
282
288
dirList = os .listdir (os .getcwd ())
0 commit comments