基于CMOS摄像头的智能车路径识别与方向控制毕业论文外文翻译.docx
《基于CMOS摄像头的智能车路径识别与方向控制毕业论文外文翻译.docx》由会员分享,可在线阅读,更多相关《基于CMOS摄像头的智能车路径识别与方向控制毕业论文外文翻译.docx(10页珍藏版)》请在冰豆网上搜索。
基于CMOS摄像头的智能车路径识别与方向控制毕业论文外文翻译
英文原文
RouteIdentificationandDirectionControlofSmartCarBasedonCMOSImageSensor
Abstract
Thispaperisdesignedforthe2ndFreescaleCupNationalUndergraduateSmartCarCompetition.WithMC9S12DG128singlechipandsmartcarmodelsuppliedbythecommittee,aCMOSimagesensorisappliedtodetecttheblacktrackonwhiteraceway,whichextendsthedetectionrangeandishelpfultopredicttheforwardpath.Inthispaper,ten-linepixelsinanimageareanalyzedtolocatetheblacktrack,andthePDalgorithmbasedonPIDisemployedtocontrolthedirectionandangleofthesteeringgearrespectively.Byrepeatedtesting,thesmartcarcanrunstablyonthegivenracewayatahighspeed.
Keywords:
routeidentification,directioncontrol,smartcar,MC9S12DG128singlechip,imagesensor,PID
algorithm.
1.Introduction
Therulesof2ndFreescaleCupNationalUndergraduateSmartCarCompetition[1]maybesummarizedasfollows:
theracewayconsistsofalotofwhiteboardsonwhichablacktrackisattached;thesmartcardesignedbyparticipantsrunsalongtheblacktrack;everycarrunstwocirclesinthisgameandthebesttimesoftwocircleswillbethefinalscoreofthiscar,andapparentlytheteamwhosecartakesthebesttimeswillbearthepalm.Accordingtotherules,weshouldensurethatthecarcandistinguishtheblacktrackfromwhiteboardinordertomakethesmartcarrunstably.Therearetwocommonmethodsforrouteidentification:
oneisusinginfrareddiodeasthesensor,andanotherisusingCCD/CMOSimagesensor[2].ThispaperusingCMOSimagesensorasrouteidentificationsensor,thereasonsforwhichareasfollows:
(1)TherangewhichiscoveredbyainfrareddiodesensorismuchsmallerthanaCMOSimagesensorcovers,andonlywecandoistouseseveraldiodesensors,butthemaximumnumberofdiodesensorsusedinthesmartcaris16;
(2)TheworkingvoltageofaCMOSimagesensor(3.3V)islessthanaCCD(12V)or16infrareddiodes.Apparently,usingCMOSimagesensorcannotonlyreducethepowerconsumptionbutalsoextendthevisiblerangeofthesmartcar,andalsoenablethecartopredicttheforwardpath.Thispaperpresentsasystemicsolutionforidentifyingtheracewayandcontrollingthedirectionofsmartcar.
2.CMOScamera
ThereareseveralkindsofCMOSimagesensorsinthemarket.IncomparisonwithotherCMOSimagesensors,theOV6130CMOSimagesensor[3]madebyOmniVisionTechnologiesInc.isthebestchoiceforustodesignaCMOScameraforsmartcarwhetherfromtheviewpointofcostandperformanceorpowerconsumption.TheOV6130isablackandwhitesensorwhichhasa1/4inchCMOSimagingdevicecontainingapproximately101,376pixels(352×288).Thissensorincludesa356×292resolutionimagearray,ananalogsignalprocessor,dual8-bitA/Dconverters,analogvideomultiplexer,digitaldataformatter,videoport,SCCBinterface,registers,anddigitalcontrolsthatincludetimingblock,exposurecontrol,blacklevelcontrol,andwhitebalance.ByassemblingtheexperimentalcircuitwetesttheOV6130outputportstiming(VSYNC,FODD,HERF).Figure1showstheexperimentaltimingdiagrams.
(a)VSYNC-FODDtiming
(b)FODD-HERFtiming
Figure1OV6130experimentaltimingdiagrams
Figure2Structureoftheimagecapturinganddisplayingsystem
ReferringtotheOV6130datasheet,thesetimingdiagramsmatchwellwiththosegivenindatasheet,thusweproducetheOV6130CMOScamerabasedontheexperimentalcircuit.Inordertocheckwhethertheimagescapturedbycamerahavecleardefinitionandsharpcontrastornot,andalsotoconfirmthevisiblerangeofthecamera,wedesignaVBprogramforcapturingtheimagesanddisplayingthemoncomputerscreen.Thisprogrambasesonthreehardwaredevices:
CMOScamera,MCUorsinglechip,PC.Figure2presentshowthesethreedevicesworktogether.
Figure3comparestheoriginalimageofasnakelineofracewaywiththeimagecapturedbyCMOScameraandthendisplayedonscreenbyVBprogram.Itcanbeseenthatthecapturedimagehascleardefinitionandsharpcontrast,andthislaysafoundationforrouteidentificationtobediscussedlater.
(a)Smartcarreadytoscantheraceway
(b)CapturedimagebyCMOScamera
Figure3Comparisonbetweenoriginalimageandcapturedimage
3.Routeidentification
RouteidentificationaimsathelpingthesmartcartorecognizetheforwardtrackbyamethodwhichpicksuptheblacklinefromtheimagecapturedbyCMOScamera,andinfact,thismethodworkswellinthefollowingcases:
straightline,curvinglineandsnakeline.Byrepeatedtesting,wedecidetoanalyze10linesofawholeimagetopredicttheforwardconditionofsmartcar.Figure4illustrateshowweanalyzethe10-linepixelsofanimage.
Figure4Routeidentificationdiagram
Thedetailedalgorithmisintroducedasfollows:
Step1:
Calculatecoordinatesoftheblackpixelforeachlinereadytobeanalyzed.Asisillustratedinfigure4,thelines(L0,L1,…,L8,L9)aretobeanalyzed,andthewhitepoints(P0,P1,…,P8,P9)areblackpixelsforeachline.TheoriginOissuperposedbyP9,whichmeansthereisnoblackpixelinlineL9.AssumedthatP(x)andP(y)indicatex-coordinateandy-coordinateofpointP,respectively,herebothP9(x)andP9(y)equal0.Thekeyofthisstepistofindtheblackpixelofeachline.Here,bytakingthefollowingdatumwhichshowsthegrayvaluesofallpixelsinalineasexample,weintroduce
anewapproach:
19521020721520822823624323823423823523123323023523022219620720420820912916065171519187915117215317315014715914115314715413713915613614191411331384127110141112104
(1)AssumedthatPistheblackpixelofthisline,G(i)denotesapixelandiindicatesit’spositioninthisline,V(i)isthegrayvalueofG(i),jisthepositionofthefirstblackpixelappearinginthelinefromlefttoright.HerebothP(x)andP(y)areinitiatedto0,andjis0fromthestart.
(2)Asforeachpixelinthislinefromlefttoright,comparingitsgrayvaluewiththeblackvalueB,herewesetBas30,G(i)isablackpixelonconditionthatV(i)islessthanB.Inthelineabove,thepixelsunderlinedinbold,whosegrayvaluesare17,15,16,18,arecomponentpointsoftheblacktrack,andthepixelsunderlinedbothinboldanditalic,whosegrayvaluesare9,4,areinvalidorinterferentialpixels.IfV(i)islessthanB,setjasi.ThencompareV(j+1)andV(j+2)withBrespectively,resultsgototwosides:
①IfbothV(j+1)andV(j+2)arelessthanB,checkthegrayvalueforeachpixelfromG(j+3)totheendpixelofthisline.IfthetotalnumberofwhitepixelswhosegrayvaluesaregreaterthanBsurpassesorequalsto3,thensetPasG(j+1).Otherwise,goto(3);②Ifnot,repeatthiswayfromthepointG(j+3)on.
(3)Ifthereisnoblackpixelinthisline,setbothP(x)andP(y)as0.
Step2:
Calculatetheaveragecoordinatesof10blackpixels.AsisshowedinFigure4,Mistheaveragepoint,M(x)andM(y)areexpressedasfollows:
Step3:
AccordingtothepositionofMintheimage,wecandecideinwhichdirection(ahead,left,orright)thesmartcarshouldturn.InFigure4,thesmartcarshouldturnrightobviously.
Step4:
Calculatehowmanyanglesthecarshouldturn.FurtherdescriptionsisillustratedinFigure5,whereαFisthecentralpointoftwofrontwheels,Mistheaveragepointmentionedpreviously(seeFigure4),DandL1indicatethewidthandheightofthevisiblerangeofCMOScamerarespectively,L2isthedistancebetweenvisiblerangeandfrontwheels,L3isahalfoffrontwheel’sdiameter,L2+L3meansthedistancebetweenvisiblerangeandtheaxisoffrontwheels.ReferringtoFigure5,itisveryeasytocalculatetheangleα.
Figure5Calculatingtheangleforturning
4.Directioncontrol
Thecentralunitfordirectioncontrolofsmartcarissteeringgear,itsinputsignalisPWM(Pulse-WidthModulation)pulse,anditoutputscorrespondingangleinradian.ThispaperusesthePWMoutputportofMC9S12DG128singlechip[4]astheinputsignalofsteeringgear.Byinputtingthegivendiscretewidthofpulse,wetesttherelationshipbetweentheinputandtheoutput.Theformulabelowexpressesit:
whereXistangentialvalueoftheoutputangle,Yiswidthoftheinputpulse,y0isthecorrespondingvaluewhentheoutputangelequals0andkisslope.Usingthislinearrelationshipwecanoperatethesmartcarsimplyjustbyinputtingthetargetangel,thusthewidthofpulsewhichistheinputsignalofsteeringgearcanbecomputedeasily,thismethod,however,doesn’tworkwellinthefollowingcases:
curvinglineandsnaketrack.ThereforeweapplythePID[5](Proportional,Integral,andDifferential)controllerwhichisverypopularinfieldsofautomationandcontroltechnology.ThekerneltheoryofPIDistodoproportional,integralanddifferentialoperationsontheinputdifferencerespectively,thenjointhethreeresultsasthefinaloutputvalue.Inpractice,itisveryflexibleforustouseaccordingtofeaturesanddemandsoftheobjecttobecontrolled.WemaychooseoneortwoorallofPIDmodules,forexample,wecanuseproportionalandintegralmodulestomakeupofPIcontroller.Asforthesmartcar,itisnonecessarytoconsiderthetrackswhichhavebeengoneacross,soweonlyuseproportionalanddifferentialmodulesasPDadjuster,andPadjusterhasbeendescribedpreviously(seeFormula
(2)),andthefollowingformulashowstheDadjuster:
whereenew,eolddefinethedifferencesofthistimeandlasttimewhentheangleiscomputed(heredifferencemeanstheangelbywhichthesteeringgearshouldturn),tisscanningperiodofCMOScamera,kdisdifferential