Professional Documents
Culture Documents
WhatIsCameraCalibration?MATLAB&Simulink
WhatIsCameraCalibration?
Geometriccameracalibration,alsoreferredtoascameraresectioning,estimatestheparametersofalensandimage
sensorofanimageorvideocamera.Youcanusetheseparameterstocorrectforlensdistortion,measurethesizeof
anobjectinworldunits,ordeterminethelocationofthecamerainthescene.Thesetasksareusedinapplications
suchasmachinevisiontodetectandmeasureobjects.Theyarealsousedinrobotics,fornavigationsystems,and3
Dscenereconstruction.
Examplesofwhatyoucandoaftercalibratingyourcamera:
Cameraparametersincludeintrinsics,extrinsics,anddistortioncoefficients.Toestimatethecameraparameters,you
needtohave3Dworldpointsandtheircorresponding2Dimagepoints.Youcangetthesecorrespondencesusing
multipleimagesofacalibrationpattern,suchasacheckerboard.Usingthecorrespondences,youcansolveforthe
cameraparameters.Afteryoucalibrateacamera,toevaluatetheaccuracyoftheestimatedparameters,youcan:
Plottherelativelocationsofthecameraandthecalibrationpattern
Calculatethereprojectionerrors.
Calculatetheparameterestimationerrors.
UsetheCameraCalibratortoperformcameracalibrationandevaluatetheaccuracyoftheestimatedparameters.
CameraModel
TheComputerVisionSystemToolboxcalibrationalgorithmusesthecameramodelproposedbyJeanYvesBouguet
[3].Themodelincludes:
Thepinholecameramodel[1].
Lensdistortion[2].
Thepinholecameramodeldoesnotaccountforlensdistortionbecauseanidealpinholecameradoesnothavealens.
Toaccuratelyrepresentarealcamera,thefullcameramodelusedbythealgorithmincludestheradialandtangential
lensdistortion.
PinholeCameraModel
Apinholecameraisasimplecamerawithoutalensandwithasinglesmallaperture.Lightrayspassthroughthe
apertureandprojectaninvertedimageontheoppositesideofthecamera.Thinkofthevirtualimageplaneasbeingin
frontofthecameraandcontainingtheuprightimageofthescene.
http://www.mathworks.com/help/vision/ug/cameracalibration.html?requestedDomain=www.mathworks.com
1/5
8/11/2016
WhatIsCameraCalibration?MATLAB&Simulink
Thepinholecameraparametersarerepresentedina4by3matrixcalledthecameramatrix.Thismatrixmapsthe3D
worldsceneintotheimageplane.Thecalibrationalgorithmcalculatesthecameramatrixusingtheextrinsicand
intrinsicparameters.Theextrinsicparametersrepresentthelocationofthecamerainthe3Dscene.Theintrinsic
parametersrepresenttheopticalcenterandfocallengthofthecamera.
Theworldpointsaretransformedtocameracoordinatesusingtheextrinsicsparameters.Thecameracoordinatesare
mappedintotheimageplaneusingtheintrinsicsparameters.
CameraCalibrationParameters
Thecalibrationalgorithmcalculatesthecameramatrixusingtheextrinsicandintrinsicparameters.Theextrinsic
parametersrepresentarigidtransformationfrom3Dworldcoordinatesystemtothe3Dcamera'scoordinatesystem.
Theintrinsicparametersrepresentaprojectivetransformationfromthe3Dcamera'scoordinatesintothe2Dimage
coordinates.
ExtrinsicParameters
Theextrinsicparametersconsistofarotation,R,andatranslation,t.Theoriginofthecamera'scoordinatesystemis
atitsopticalcenteranditsxandyaxisdefinetheimageplane.
http://www.mathworks.com/help/vision/ug/cameracalibration.html?requestedDomain=www.mathworks.com
2/5
8/11/2016
WhatIsCameraCalibration?MATLAB&Simulink
IntrinsicParameters
Theintrinsicparametersincludethefocallength,theopticalcenter,alsoknownastheprincipalpoint,andtheskew
coefficient.Thecameraintrinsicmatrix,K,isdefinedas:
fx 0 0
s fy 0
cx cy 1
Thepixelskewisdefinedas:
http://www.mathworks.com/help/vision/ug/cameracalibration.html?requestedDomain=www.mathworks.com
3/5
8/11/2016
WhatIsCameraCalibration?MATLAB&Simulink
2
x,yUndistortedpixellocations.xandyareinnormalizedimagecoordinates.Normalizedimagecoordinatesare
calculatedfrompixelcoordinatesbytranslatingtotheopticalcenteranddividingbythefocallengthinpixels.
Thus,xandyaredimensionless.
r2:x 2+y 2
Typically,twocoefficientsaresufficientforcalibration.Forseveredistortion,suchasinwideanglelenses,youcan
select3coefficientstoincludek 3.
TangentialDistortion
Tangentialdistortionoccurswhenthelensandtheimageplanearenotparallel.Thetangentialdistortioncoefficients
modelthistypeofdistortion.
x,yUndistortedpixellocations.xandyareinnormalizedimagecoordinates.Normalizedimagecoordinatesare
calculatedfrompixelcoordinatesbytranslatingtotheopticalcenteranddividingbythefocallengthinpixels.
Thus,xandyaredimensionless.
p1andp2Tangentialdistortioncoefficientsofthelens.
r2=x 2+y 2
References
[1]Zhang,Z."AFlexibleNewTechniqueforCameraCalibration."IEEETransactionsonPatternAnalysisandMachine
Intelligence.Vol.22,No.11,2000,pp.13301334.
[2]Heikkila,J.,andO.Silven."AFourstepCameraCalibrationProcedurewithImplicitImageCorrection."IEEE
InternationalConferenceonComputerVisionandPatternRecognition.1997.
[3]Bouguet,J.Y."CameraCalibrationToolboxforMatlab."ComputationalVisionattheCaliforniaInstituteof
Technology.CameraCalibrationToolboxforMATLAB.
[4]Bradski,G.,andA.Kaehler.LearningOpenCV:ComputerVisionwiththeOpenCVLibrary.Sebastopol,CA:
O'Reilly,2008.
SeeAlso
CameraCalibrator|SingleCameraCalibrationApp
RelatedExamples
EvaluatingtheAccuracyofSingleCameraCalibration
http://www.mathworks.com/help/vision/ug/cameracalibration.html?requestedDomain=www.mathworks.com
4/5
8/11/2016
WhatIsCameraCalibration?MATLAB&Simulink
MeasuringPlanarObjectswithaCalibratedCamera
StructureFromMotionFromTwoViews
http://www.mathworks.com/help/vision/ug/cameracalibration.html?requestedDomain=www.mathworks.com
5/5