camera calibration.docx
- 文档编号:3978065
- 上传时间:2022-11-26
- 格式:DOCX
- 页数:47
- 大小:1.58MB
camera calibration.docx
《camera calibration.docx》由会员分享,可在线阅读,更多相关《camera calibration.docx(47页珍藏版)》请在冰豆网上搜索。
cameracalibration
CameraCalibrationToolboxforMatlab
Descriptionofthecalibrationparameters
Aftercalibration,thelistofparametersmaybestoredinthematabfile Calib_Results byclickingon Save.Thelistofvariablesmaybeseparatedintotwocategories:
Intrinsicparametersandextrinsicparameters.
Intrinsicparameters(cameramodel):
Theinternalcameramodelisverysimilartothatusedby Heikkil� and Silven atthe UniversityofOulu inFinland.Visittheironline calibrationpage,andtheirpublicationpage.WespecificallyrecommendtheirCVPR'97paper:
AFour-stepCameraCalibrationProcedurewithImplicitImageCorrection.
Thelistofinternalparameters:
∙Focallength:
Thefocallengthinpixelsisstoredinthe2x1vector fc.
∙Principalpoint:
Theprincipalpointcoordinatesarestoredinthe2x1vector cc.
∙Skewcoefficient:
Theskewcoefficientdefiningtheanglebetweenthexandypixelaxesisstoredinthescalar alpha_c.
∙Distortions:
Theimagedistortioncoefficients(radialandtangentialdistortions)arestoredinthe5x1vector kc.
Definitionoftheintrinsicparameters:
Let P beapointinspaceofcoordinatevector XXc =[Xc;Yc;Zc] inthecamerareferenceframe.
Letusprojectnowthatpointontheimageplaneaccordingtotheintrinsicparameters(fc,cc,alpha_c,kc).
Let xn bethenormalized(pinhole)imageprojection:
Let r2 =x2 +y2.
Afterincludinglensdistortion,thenewnormalizedpointcoordinate xd isdefinedasfollows:
where dx isthetangentialdistortionvector:
Therefore,the5-vector kc containsbothradialandtangentialdistortioncoefficients(observethatthecoefficientof6th orderradialdistortiontermisthefifthentryofthevector kc).
ItisworthnoticingthatthisdistortionmodelwasfirstintroducedbyBrownin1966andcalled"PlumbBob"model(radialpolynomial+"thinprism").Thetangentialdistortionisdueto"decentering",orimperfectcenteringofthelenscomponentsandothermanufacturingdefectsinacompoundlens.Formoredetails,refertoBrown'soriginalpublicationslistedinthe referencepage.
Oncedistortionisapplied,thefinalpixelcoordinates x_pixel=[xp;yp] oftheprojectionof P ontheimageplaneis:
Therefore,thepixelcoordinatevector x_pixel andthenormalized(distorted)coordinatevector xd arerelatedtoeachotherthroughthelinearequation:
where KK isknownasthecameramatrix,anddefinedasfollows:
Inmatlab,thismatrixisstoredinthevariable KK aftercalibration.Observethat fc
(1) and fc
(2) arethefocaldistance(auniquevalueinmm)expressedinunitsofhorizontalandverticalpixels.Bothcomponentsofthevector fc areusuallyverysimilar.Theratio fc
(2)/fc
(1),oftencalled"aspectratio",isdifferentfrom1ifthepixelintheCCDarrayarenotsquare.Therefore,thecameramodelnaturallyhandlesnon-squarepixels.Inaddition,thecoefficient alpha_c encodestheanglebetweenthexandysensoraxes.Consequently,pixelsareevenallowedtobenon-rectangular.Someauthorsrefertothattypeofmodelas"affinedistortion"model.
Inadditiontocomputingestimatesfortheintrinsicparameters fc, cc, kc and alpha_c,thetoolboxalsoreturnsestimatesoftheuncertaintiesonthoseparameters.Thematlabvariablescontainingthoseuncertaintiesare fc_error, cc_error, kc_error, alpha_c_error.Forinformation,thosevectorsareapproximatelythreetimesthestandarddeviationsoftheerrorsofestimation.
Hereisanexampleofoutputofthetoolboxafteroptimization:
Inthiscase fc=[657.30254;657.74391] and fc_error=[0.28487;0.28937], cc=[302.71656;242.33386], cc_error=[0.59115;0.55710],...
ImportantConvention:
Pixelcoordinatesaredefinedsuchthat [0;0] isthecenteroftheupperleftpixeloftheimage.Asaresult, [nx-1;0] iscenteroftheupperrightcornerpixel, [0;ny-1] isthecenterofthelowerleftcornerpixeland [nx-1;ny-1] isthecenterofthelowerrightcornerpixelwhere nx and ny arethewidthandheightoftheimage(fortheimagesofthefirstexample, nx=640 and ny=480).Onematlabfunctionprovidedinthetoolboxcomputesthatdirectpixelprojectionmap.Thisfunctionis project_points2.m.Thisfunctiontakesinthe3Dcoordinatesofasetofpointsinspace(inworldreferenceframeorcamerareferenceframe)andtheintrinsiccameraparameters(fc,cc,kc,alpha_c),andreturnsthepixelprojectionsofthepointsontheimageplane.Seetheinformationgiveninthefunction.
Theinversemapping:
Theinverseproblemofcomputingthenormalizedimageprojectionvector xn fromthepixelcoordinate x_pixel isveryusefulinmostmachinevisionapplications.However,becauseofthehighdegreedistortionmodel,thereexistsnogeneralalgebraicexpressionforthisinversemap(alsocallednormalization).Inthetoolboxhowever,anumericalimplementationofinversemappingisprovidedintheformofafunction:
normalize.m.Hereisthewaythefunctionshouldbecalled:
xn =normalize(x_pixel,fc,cc,kc,alpha_c).Inthatsyntax, x_pixel and xn mayconsistofmorethanonepointcoordinates.Foranexampleofcall,seethematlabfunction compute_extrinsic_init.m.
Reducedcameramodels:
Currentlymanufacturedcamerasdonotalwaysjustifythisverygeneralopticalmodel.Forexample,itnowcustomarytoassumerectangularpixels,andthusassumezeroskew(alpha_c=0).Itisinfactadefaultsettingofthetoolbox(theskewcoefficientnotbeingestimated).Furthermore,theverygeneric(6thorderradial+tangential)distortionmodelisoftennotconsideredcompletely.Forstandardfieldofviews(nonwide-anglecameras),itisoftennotnecessary(andnotrecommended)topushtheradialcomponentofdistortionmodelbeyondthe4thorder(i.e.keeping kc(5)=0).Thisisalsoadefaultsettingofthetoolbox.Inaddition,thetangentialcomponentofdistortioncanoftenbediscarded(justifiedbythefactthatmostlensescurrentlymanufactureddonothaveimperfectionincentering).The4thordersymmetricradialdistortionwithnotangentialcomponent(thelastthreecomponentof kc aresettozero)isactuallythedistortionmodelusedby Zhang.Anotherverycommondistortionmodelforgoodopticalsystemsornarrowfieldofviewlensesisthesecondordersymmetricradialdistortionmodel.Inthatmodel,onlythefirstcomponentofthevector kc isestimated,whiletheotherfouraresettozero.Thismodelisalsocommonlyusedwhenafewimagesareusedforcalibration(toolittledatatoestimateamorecomplexmodel).Asidefromdistortionsandskew,othermodelreductionsarepossible.Forexample,whenonlyafewimagesareusedforcalibration(e.g.one,twoorthreeimages)theprincipalpoint cc isoftenverydifficulttoestimatereliably.Itisknowntobeoneofthemostdifficultpartofthenativeperspectiveprojectionmodeltoestimate(ignoringlensdistortions).Ifthisisthecase,itissometimesbetter(andrecommended)tosettheprincipalpointatthecenteroftheimage(cc=[(nx-1)/2;(ny-1)/2])andnotestimateitfurther.Finally,infewrareinstances,itmaybenecessarytorejecttheaspectratio fc
(2)/fc
(1) fromtheestimation.Althoughthisfinalmodelreductionstepispossiblewiththetoolbox,itisgenerallynotrecommendedastheaspectratioisoften'easy'toestimateveryreliably.Formoreinformationonhowtoperformmodelselectionwiththetoolbox,visitthe pagedescribingthefirstcalibrationexample.
CorrespondencewithHeikkil�'snotation:
Intheoriginal Heikkil�'spaper,theinternalparametersappearwithslightlydifferentnames.Thefollowingtablegivesthecorrespondencebetweenthetwonotationschemes:
Ournotation
Heikkil�'snotation
fc
(1)
f.Du.su
fc
(2)
f.Dv
cc
(1)
u0
cc
(2)
v0
alpha_c
0
kc
(1)
f3 .k1
kc
(2)
f5 .k2
kc(3)
f2 .p1
kc(4)
f2 .p2
kc(5)
0
AfewcommentsonHeikkil�'smodel:
∙Skewisnotestimated(alpha_c=0).Itmaynotbeaproblemasmostcamerascurrentlymanufactureddonothavecenteringimperfections.
∙Theradialcomponentofthedistortionmodelisonlyuptothe4thorder.Thisissufficientformostcases.
∙Thefourvariables (f,Du,Dv,su) replacingthe 2x1 focalvector fc areingeneralimpossibletoestimateseparately.Itisonlypossibleiftwoofthosevariablesareknown(forexamplethemetricfocalvalue f andthescalefactor su).See Heikkil�'spaper formoreinformation.
CorrespondencewithRegWillson'snotation:
Inhisoriginal implementationoftheTsaicameracalibrationalgorithm, RegWillson usesadifferentnotationforthecameraparameters.Thefollowingtablegivesthecorrespondencebetweenthetwonotationschemes:
Ournotation
Willson'snotation
fc
(1)
f.sx/dpx
fc
(2)
f/dpy
cc
(1)
Cx
cc
(2)
Cy
alpha_c
0
Willsonusesafirstorderradialdistortionmodel(withanadditionalconstant kappa1)thatdoesnothaveaneasyclosed-formcorespondencewithourdistortionmodel(encodedwiththecoefficients kc
(1),...,kc(5)).However,weincludedinthetoolboxafunctioncalled willson_convert thatconvertstheentiresetofWillson'sparametersintoourparameters(includingdistortion).Thisfunctioniscalledinanotherfunction willson_read thatdirectlyloadsinacalibrationresultfilegeneratedbyWillson'scodeandcomputesthesetparameters(intrinsicandextrinsic)followingournotation(tousethatfunction,firstsetthematlabvariable calib_file tothenameoftheoriginalwillsoncalibrationfile).
AfewextracommentsonWillson'smodel:
∙SimilarlytoHeikkil�'smodel,theskewisnotincludedinthemodel(alpha_c=0).
∙SimilarlytoHeikkil�'smodel,thefourvariables (f,sx,dpx,dpy) replacingthe 2x1 focalvector fc areingeneralimpossiblet
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- camera calibration
![提示](https://static.bdocx.com/images/bang_tan.gif)