Camera Calibration COMPSCI 527 — Computer Vision COMPSCI 527 — Computer Vision Camera Calibration 1 / 12
Outline 1 General Ideas 2 A Camera Model 3 Parameter Optimization 4 Lab Setup and Imaging COMPSCI 527 — Computer Vision Camera Calibration 2 / 12
General Ideas Camera Calibration • Cameras have intrinsic parameters : focal distance, pixel size, principal point, lens distortion parameters • ... and extrinsic parameters : Rotation, translation relative to some world reference system • Camera calibration is a combination of lab measurements and algorithms aimed at determining both types of parameters COMPSCI 527 — Computer Vision Camera Calibration 3 / 12
General Ideas Calibration as Learning • There are many specific variants of calibration, but the general idea is the same • Looks very much like machine learning: 1 Make a parametric model of what a camera does: Inputs are world points W in world coordinates, outputs are image points ξ in image pixel coordinates (“predictor architecture”) 2 Collect a sufficiently large set S of input-output pairs ( W n , ξ n ) (“training set”) 3 Fit the parameters to S by numerical optimization (“training”) • We even have generalization requirements: The parameters should be correct for pairs ( W , ξ ) not in S (However, the “hypothesis space” is very small here, so just use “enough points” and do fitting) • We already know how to do 1, 3. Need to figure out 2 COMPSCI 527 — Computer Vision Camera Calibration 4 / 12
A Camera Model Camera Model X or W Eri we W ξ 1 3 optical axis ξ 2 x or ξ W W 2 III 1 π 1 X = R ( W � t ) us X 1 x 1 � X 3 x 2 t Camera ref 1 x = p ( X ) = X 1 X 3 X 2 X 2 8 y = d ( x ) (lens distortion) ξ = S y + π tj s x � 0 S = f 0 s y Can only determine IT products f s x , f s y COMPSCI 527 — Computer Vision Camera Calibration 5 / 12
A Camera Model Lens Distortion • Distortion is radial around the principal point o y = d ( x ) = δ ( r ) x where r = k x k bet • Radial distortion function δ ( · ) is nonlinear • Must be analytical everywhere (Maxwell) • Restrict to x axis: δ ( r ( x )) = δ ( | x | ) • Odd powers of | x | have a cusp at the origin • Therefore, δ ( r ) = 1 + k 1 r 2 + k 2 r 4 + . . . 2 • Large powers only affect peripheral areas, so cannot be I get determined well em • Typically, δ ( r ) = 1 + k 1 r 2 + k 2 r 4 COMPSCI 527 — Computer Vision Camera Calibration 6 / 12
A Camera Model Camera Parameters X = R ( W � t ) X 1 � 1 x = p ( X ) = X 2 X 3 1 + k 1 k x k 2 + k 2 k x k 4 � � y = x k _k 0 = S y + π ξ • Extrinsic parameters: R , t (6 degrees of freedom) • Intrinsic parameters: π , f s x , f s y , k 1 , k 2 (6 numbers) ξ = c ( W ; p ) where p 2 R 12 COMPSCI 527 — Computer Vision Camera Calibration 7 / 12
Parameter Optimization Data Fitting E • Collect input-output pairs ( W n , ξ n ) for n = 1 , . . . , N ξ = c ( W ; p ) where p 2 R 12 p ∗ = arg min p e ( p ) P N e ( p ) = 1 n = 1 k ξ n � c ( W n ; p ) k 2 where N • e is nonlinear • To initialize: clamp k 1 = k 2 = 0, solve a linear system • Approximate because of clamping and because the residual is different from e ( p ) • Use any optimization algorithm to refine COMPSCI 527 — Computer Vision Camera Calibration 8 / 12
Lab Setup and Imaging Calibration Target http://www.mdpi.com/1424-8220/9/6/4572/htm Duke Computer Vision Lab COMPSCI 527 — Computer Vision Camera Calibration 9 / 12
Lab Setup and Imaging Circles are Problematic COMPSCI 527 — Computer Vision Camera Calibration 10 / 12
Lab Setup and Imaging Calibration Protocol Summary • Place calibration target in front of camera (fill the image) • Measure image coordinates (with software help?) • Make a file with ( W n , ξ n ) pairs • Fit parameters by numerical optimization • Redo if you touch the lens! COMPSCI 527 — Computer Vision Camera Calibration 11 / 12
Lab Setup and Imaging An Example for Distortion Only 400 300 200 100 x d (pixels) 0 − 100 − 200 − 300 − 400 − 400 − 300 − 200 − 100 0 100 200 300 400 x (pixels) T COMPSCI 527 — Computer Vision Camera Calibration 12 / 12
Recommend
More recommend