Skip to content

Commit

Permalink
re #375
Browse files Browse the repository at this point in the history
add sample rig file
  • Loading branch information
allenleetc committed Apr 5, 2022
1 parent 54f8bf5 commit f1e5336
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
31 changes: 31 additions & 0 deletions matlab/stereo_cam_rig_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
NumCameras: 2
CameraNames: [front,side]

# Cameras enumerated below
# - RadialDistortions could accept variable number of elements with 0.0 as default
# - TangentialDistortions or other distortion coeffs can be added in future
# - Rotation (R), Translation (t) defined so that
#
# [x;y;z] = R*[p;q;r] + t,
#
# where (x,y,z) and (p,q,r) are in the camera/"world" coord system respectively

front:
ImageSize: [480, 640] # nr, nc
FocalLengths: [534.3144425005255, 534.3110452510584] # fx, fy
PrincipalPoint: [342.6367137117883, 234.4245207961644] # px, py (1-based or 0-based?)
Skew: 0
RadialDistortions: [-0.292177185491196, 0.113413077396075]
Rotation: [0,0,0]
Translation: [0,0,0]

side:
ImageSize: [480, 640]
FocalLengths: [537.3940049616827, 537.0103632874804]
PrincipalPoint: [326.6194337628963, 250.5805438225938]
Skew: 0
RadialDistortions: [-0.289290173351601, 0.103918371734971]
Rotation: [0.009644136095192, 0.005730219518603, -0.003262250274025]
Translation: [-83.097330764462370, 1.060517724639445, 0.039181607862498]

11 changes: 9 additions & 2 deletions matlab/user/CalRigMLStro.m
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,15 @@ function rperrPlot(rperrcam1,rperrcam2)
[iView,camName] = obj.camArgHelper(cam);
cpFld = ['CameraParameters' num2str(iView)];
sp = obj.stroParams;
intprm = sp.(cpFld).Intrinsics;
%intprm = obj.int.(camName);
intprm = sp.(cpFld);
if isprop(sp,'Intrinsics')
% default MATLAB case
% stereoParams.CameraParameters1 is a cameraParameters
% <that>.Intrinsics is a cameraIntrinsics which is v similar
intprm = intprm.Intrinsics;
else
% already intrinsics
end
xud = undistortPoints(xp,intprm);

RDUMMY = eye(3);
Expand Down

0 comments on commit f1e5336

Please sign in to comment.