Skip to content

Commit d3b4e0a

Browse files
committed
Update atrium dims and cam matrices in py
1 parent 4ba6d6c commit d3b4e0a

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

BlimpDetect.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def connect(ip,port):
5454
def triang_3D(col_1, row_1, col_2, row_2) :
5555

5656
#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]])
5959
#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]])
6262
#blimp position from camera 1
6363
#col_1 = 396
6464
#row_1 = 424
@@ -67,6 +67,12 @@ def triang_3D(col_1, row_1, col_2, row_2) :
6767
#col_2 = 518
6868
#row_2 = 538
6969

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+
7076

7177
#translated from matlab:
7278

@@ -276,7 +282,7 @@ def procImg(img,sideName,dispFlag):
276282
#Live images from the IP cameras
277283
#(if not live, then this file needs to be in folder with a bunch of images)
278284
#(if live, then need to be local at WID)
279-
liveIP = 0
285+
liveIP = 1
280286
if liveIP == 0:
281287
#need to be in directory with a bunch of images
282288
dirList = os.listdir(os.getcwd())

matlab/CameraCalibrationExp.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
%Atrium dimensions
2020
%39624 mm in x direction
21-
ax = 39624;
21+
ax = 42610;
2222
%10947 mm in y direction
23-
ay = 10947;
23+
ay = 8660;
2424
%15240 mm in z direction
2525
az = 15240;
2626

@@ -90,7 +90,7 @@
9090
%--Tests--
9191

9292
%3D point, middle of the atrium floor:
93-
x1 = [ax/1.5; ay/3; 6000; 1];
93+
x1 = [ax/1.7; ay/3; 6000; 1];
9494
%x1 = [C2; 1];
9595

9696
%Project these points onto the camera image planes
@@ -169,7 +169,7 @@
169169
zlabel('(z, mm)');
170170
axis equal;
171171

172-
na = 0.01;
172+
na = 0.0;
173173
%now triangulate to find the 3d location again, using the camera matrices
174174
M = triangulateJYB(P1,[c1x+na*randn c1y+na*randn],P2,[c2x+na*randn c2y+na*randn]);
175175
plot3(M(1),M(2),M(3),'ro');

0 commit comments

Comments
 (0)