Skip to content

Commit 67a0b8b

Browse files
committed
Output camera matrices
1 parent d456932 commit 67a0b8b

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

matlab/CameraCalibrationExp.m

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@
3939
%--Translation--
4040
%Camera 1 (west side)
4141
Cx1 = 0;
42-
Cy1 = ay/2; %centered in y dim
42+
Cy1 = ay/2-500; %centered in y dim
4343
Cz1 = az;
4444
C1 = [Cx1; Cy1; Cz1];
4545

4646
%Camera 2 (east side)
4747
Cx2 = ax;
48-
Cy2 = ay/2;
48+
Cy2 = ay/2-500;
4949
Cz2 = az;
5050
C2 = [Cx2; Cy2; Cz2];
5151

5252
%--Rotation--
5353
%Camera 1
5454
thx1 = 0;
55-
thy1 = pi/1.5; %point 45 deg down
55+
thy1 = 0.6*pi; %point 45 deg down
5656
thz1 = 0;
5757
Rcx1 = [1 0 0; 0 cos(thx1) -sin(thx1); 0 sin(thx1) cos(thx1)];
5858
Rcy1 = [cos(thy1) 0 sin(thy1); 0 1 0; -sin(thy1) 0 cos(thy1)];
5959
Rcz1 = [cos(thz1) -sin(thz1) 0; sin(thz1) cos(thz1) 0; 0 0 1];
6060
Rc1 = Rcx1*Rcy1*Rcz1;
6161

6262
%Camera 2
63-
thx2 = 0;
64-
thy2 = -pi/1.5; %point 45 deg down
63+
thx2 = 0.15*pi;
64+
thy2 = -0.6667*pi; %point 45 deg down
6565
thz2 = pi;
6666
Rcx2 = [1 0 0; 0 cos(thx2) -sin(thx2); 0 sin(thx2) cos(thx2)];
6767
Rcy2 = [cos(thy2) 0 sin(thy2); 0 1 0; -sin(thy2) 0 cos(thy2)];
@@ -173,3 +173,12 @@
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');
176+
177+
fprintf('P1 = np.array([[%f,%f,%f,%f],[%f,%f,%f,%f],{%f,%f,%f,%f]])\n', ...
178+
P1(1,1),P1(1,2),P1(1,3),P1(1,4),...
179+
P1(2,1),P1(2,2),P1(2,3),P1(2,4),...
180+
P1(3,1),P1(3,2),P1(3,3),P1(3,4));
181+
fprintf('P2 = np.array([[%f,%f,%f,%f],[%f,%f,%f,%f],{%f,%f,%f,%f]])\n', ...
182+
P2(1,1),P2(1,2),P2(1,3),P2(1,4),...
183+
P2(2,1),P2(2,2),P2(2,3),P2(2,4),...
184+
P2(3,1),P2(3,2),P2(3,3),P2(3,4));

0 commit comments

Comments
 (0)