Visual Simulation CAP 6938TodayCamera calibrationCamera calibration – approachesImage Formation EquationsCalibration matrixCamera matrixCamera matrix calibrationSlide 9Optimal estimationSlide 11Levenberg-MarquardtSlide 13Slide 14Slide 15Separate intrinsics / extrinsicsSlide 17Intrinsic/extrinsic calibrationVanishing PointsSlide 20Slide 21Vanishing point calibrationMulti-plane calibrationRotational motionPose estimation and triangulationPose estimationSlide 27Slide 28TriangulationSlide 30Slide 31Structure from MotionStructure from motionSlide 34Bundle AdjustmentLots of parameters: sparsityConditioning and gauge freedomRobust error modelsStructure from motion: limitationsBibliographySlide 41Slide 42Slide 43Slide 44Slide 45Visual SimulationCAP 6938Dr. Hassan Foroosh Dept. of Computer ScienceUCF© Copyright Hassan Foroosh 2002TodayLast LectureFeature TrackingStructure from MotionTomasi and KanadeExtensionsTodayCamera CalibrationBundle adjustmentCamera calibrationDetermine camera parameters from known 3D points or calibration object(s)1. internal or intrinsic parameters such as focal length, optical center, aspect ratio:what kind of camera?2. external or extrinsic (pose)parameters:where is the camera?3. How can we do this?Camera calibration – approachesPossible approaches:1. linear regression (least squares)2. non-linear optimization3. vanishing points4. multiple planar patterns5. panoramas (rotational motion)Image Formation Equationsu(Xc,Yc,Zc)ucfCalibration matrixIs this form of K good enough?non-square pixels (digital video)skewradial distortionCamera matrixFold intrinsic calibration matrix K and extrinsic pose parameters (R,t) together into acamera matrixM = K [R | t ](put 1 in lower r.h. corner for 11 d.o.f.)Camera matrix calibrationDirectly estimate 11 unknowns in the M matrix using known 3D points (Xi,Yi,Zi) and measured feature positions (ui,vi)Camera matrix calibrationLinear regression:Bring denominator over, solve set of (over-determined) linear equations. How?Least squares (pseudo-inverse)Is this good enough?Optimal estimationFeature measurement equationsLikelihood of M given {(ui,vi)}Optimal estimationLog likelihood of M given {(ui,vi)}How do we minimize C?Non-linear regression (least squares), because ûi and vi are non-linear functions of MLevenberg-MarquardtIterative non-linear least squares [Press’92]Linearize measurement equationsSubstitute into log-likelihood equation: quadratic cost function in mIterative non-linear least squares [Press’92]Solve for minimumHessian:error:Does this look familiar…?Levenberg-MarquardtWhat if it doesn’t converge?Multiply diagonal by (1 + ), increase until it doesHalve the step size m (my favorite)Use line searchOther ideas?Uncertainty analysis: covariance = A-1Is maximum likelihood the best idea?How to start in vicinity of global minimum?Levenberg-MarquardtCamera matrix calibrationAdvantages:very simple to formulate and solvecan recover K [R | t] from M using RQ decomposition [Golub & VanLoan 96]Disadvantages:doesn't compute internal parametersmore unknowns than true degrees of freedomneed a separate camera matrix for each new viewSeparate intrinsics / extrinsicsNew feature measurement equationsUse non-linear minimizationStandard technique in photogrammetry, computer vision, computer graphics[Tsai 87] – also estimates 1 (freeware @ CMU) [Bogart 91] – View CorrelationSeparate intrinsics / extrinsicsHow do we parameterize R and R?Euler angles: bad ideaquaternions: 4-vectors on unit sphereuse incremental rotation R(I + R)update with Rodriguez formulaIntrinsic/extrinsic calibrationAdvantages:can solve for more than one camera pose at a timepotentially fewer degrees of freedomDisadvantages:more complex update rulesneed a good initialization (recover K [R | t] from M)Vanishing PointsDetermine focal length f and optical center (uc,vc) from image of cube’s(or building’s) vanishing points[Caprile ’90][Antone & Teller ’00]uu00uu11uu22Vanishing PointsX, Y, and Z directions, Xi = (1,0,0,0) … (0,0,1,0) correspond to vanishing points that are scaled version of the rotation matrix:uu00uu11uu22u(Xc,Yc,Zc)ucfVanishing PointsOrthogonality conditions on rotation matrix R,ri ¢rj = ijDetermine (uc,vc) from orthocenter of vanishing point triangleThen, determine f2 from twoequations(only need 2 v.p.s if (uc,vc) known)uu00uu11uu22Vanishing point calibrationAdvantages:only need to see vanishing points(e.g., architecture, table, …)Disadvantages:not that accurateneed rectahedral object(s) in sceneMulti-plane calibrationUse several images of planar target held at unknown orientations [Zhang 99]Compute plane homographiesSolve for K-TK-1 from Hk’s1plane if only f unknown2 planes if (f,uc,vc) unknown3+ planes for full KCode available from Zhang and OpenCVRotational motionUse pure rotation (large scene) to estimate f1. estimate f from pairwise homographies2. re-estimate f from 360º “gap”3. optimize over all {K ,Rj} parameters[Stein 95; Hartley ’97; Shum & Szeliski ’00; Kang & Weiss ’99]Most accurate way to get f, short of surveying distant pointsf=510 f=468Pose estimation and triangulationPose estimationOnce the internal camera parameters are known, can compute camera pose[Tsai87] [Bogart91]Application: superimpose 3D graphics onto videoHow do we initialize (R,t)?Pose estimationPrevious initialization techniques:vanishing points [Caprile 90]planar pattern [Zhang 99]Other possibilitiesThrough-the-Lens Camera Control [Gleicher92]: differential update3+ point “linear methods”:[DeMenthon 95][Quan 99][Ameller 00]Pose estimationSolve orthographic problem, iterate[DeMenthon 95]Use inter-point distance constraints[Quan 99][Ameller 00]Solve set of polynomial equations in xi2pu(Xc,Yc,Zc)ucfTriangulationProblem: Given some points in correspondence across two or more images (taken from calibrated cameras), {(uj,vj)}, compute the 3D location XTriangulationMethod I: intersect viewing rays in 3D, minimize:X is the unknown 3D pointCj is the optical center of camera jVj is the viewing ray for pixel (uj,vj)sj is unknown distance along VjAdvantage: geometrically intuitiveCjVjXTriangulationMethod II:
View Full Document