One of the essential problems in computer vision is to recover the distance information of an object from captured images. Its application areas range from industrial inspection and reverse engineering to autonomous robot navigation
correspondingdepthof eldissmallerforgeneralopticalsystems.Thedepthcorrespondingtothemaximumblurextentisalsoshorterinthiscase,whichgivesmoreaccu-rateblurparameterestimationforthein nitedistance.Givena xedfocusposition,theblurparameterscorc correspondingtothein nitedistancecanbeobtainedbyeitherdirectcomputationusingEq. 7 withknownfocallengthandaperturediameter,orblurextentestimationbyplacingacalibrationpatternatin nity.IftheGaussianmodelisconsidered,theparameterc hastobederivedusingthesecondmethod.Forthe rstmethod,assuggestedbyEq. 7 ,theprecisionofccanbeincreasedbysettingalargeraperturediameterDandasmallerdistancep.3.2MotionBlurEstimation
ToestimatetheblurextentduetotherelativemotionandopticaldefocususedinEqs. 19 , 23 ,and 27 fordepthmeasurements,atwo-stepalgorithmisproposed.Withoutlossofgenerality,weassumethedirectionofmotionblurisparalleltotheimagescanlines.Forthegeneralcasethattherelativemotionisnotparalleltotheimagescanlines,themotiondirectioncanbeidenti ed rstandthenusedtorectifytheimage.14
Itiswellknownthattheresponseofasharpedgetoanedgedetectorisathincurve,whereastheresponseofabluredgetothesameedgedetectorspreadsawiderregion.Thissuggeststhattheresultofedgedetectioncanbeusedasinitialestimationofthemotionblurextent.Intheimple-mentation,averticalSobelmaskisusedtoidentifythehorizontalblurextentforeachverticaledgealongtheim-agescanlines.Duetonoiseandtextureoftheobject,thederivedblurextentsareusuallynotallidentical.Thus,themodeoftheblurextentsisusedtoderiveanoverallhori-zontalblurextentoftheimage,andthenusedasaninitialestimateforthenextstep.
Atthesecondstep,theinitialblurextentisusedasaparametertocreateasequenceofdeblurredimagesbyaWiener lter.Amodi edLaplacianfocusmeasure25isthenusedtoselectthebestdeblurredimageandthecorrespond-ingblurextent.Ifopticaldefocusismodeledaswell,thedefocusblurextentdgivenbyEq. 25 isalsoconsideredforimagedeblurring.Fromx =x+dandEq. 25 ,thede-focusblurextentcanbewrittenasd=
Fig.6Theedgeimageusedinthe
experiments.
placedonastagemountedonalinearrailtoobtainedthemotionblurredimages.ThemovementofthestageisdrivenbyaPC-controlledsteppingmotor.
4.1OpticalDefocus
Toobtainthemaximumblurextent correspondingtotheobjectatin nity ,focuscalibrationfortwodifferentfocus-ingrangesisperformedwithtwodifferentaperturesizes.Inthe rstexperiment,thefocusingrangeissetas265mmfromthecamera.Theblurextentsestimatedfromdifferentobjectdistanceswithfocallengthsof36mmareshowninFig.8.Solidanddottedlinesrepresenttheresultswithaperturediametersof7.2and15mm,respectively.Theplotshowsthat,astheobjectdistancegoestoin nity,theblurextentsapproach79and163pixelsforthesetwoaperturesizes.Theresultsalsoverifythatthemaximumblurispro-portionaltotheaperturediameterasderivedinEqs. 7 and 38 .DirectcomputationsoftheblurextentcusingEq. 7 aregivenby166.5and346.8pixelsfortheaperturediam-etersof7.2and15mm,respectively.Thus,theconstantkgivenbyEq. 36 isabout0.47forbothcases.
Inthesecondexperiment,thefocusingrangeissetas1000mmfromthecamera.Thefocallengthissetas36mm.Figure9showstheblurextentsobtainedfrom
dif-
fx sD .p fss kD
39
Sincethefocusmeasurehighlydependsonlocalintensityvariation,thedefocusblurextentdcanbeusedtodeter-minethenumberofdeblurredimagestobecreated.How-ever,motionblurdominatestheblurextentinmostcases,andtypicallynineimagesarecreatedformotiondeblurringintheimplementation.
4ImplementationandExperimentalResults
Theproposeddepthrecoverymethodhasbeentestedinthelaboratoryenvironment.Aschematicdiagramfortheex-perimentalsetupisshowninFig.5Twotypesofplanarpatterns,onewithastepedgeandtheotherwithafewcharacters asshowninFigs.6and7,respectively ,are