华中科技大学硕士学位论文基于机器视觉的移动机器人控制研究姓名:伍翼申请学位级别:硕士专业:控制理论与控制工程指导教师:黄心汉20050512IRGBYUVHSVHP2PCSocketDirectShowPioneer2ARIAIIAbstractComputervisionbasedmobilerobotnavigationisoneofthehottopicsinrobotfieldrecently.Justlikehumans,visionisalsothemostimportantsourceforrobottoknowtheworldaround;itcansupplytheinformationoftheenvironment,suchastheobjects’distanceanddirection.Itissignificanttoresearchonmobilerobotvisionsystemandtherelatedtechnology,suchascameracalibration,multi-sensorfusion,robotnavigationandcontroltheory.Colorvisionsignalisthebasicinformationformobilerobotto“feel”theworldaroundit.So,itisthekeyformobilerobottogettheinformationoftheenvironmentfromthevisionsignalrapidlyandcorrectly;thevisionsystemisthebasisofthecontrolsystem.Thisdissertationisdevotedtotheresearchofthedigitalimageprocess,thedesignandrealizationofthemobilerobotvisioncontrolsystem.Firstofall,thecolormodelisdiscussedtopresentthecolorrecognitiontheoryformobilerobot.Somepopularcolorspacemodels(RGB,YUVandHSV)andtheconvertingformulabetweenthemareintroduced.Therelationanddifferencebetweenthemarecomparedinbothpictureanddatasheet.Theimagesegmentationandclusteringalgorithmarediscussedandusedtodetectobjectsinimages.AmethodofusingdoublethresholdofHvaluetosegmenttheobjectfromthebackgroundisusedinthisessay.Afastscanlineseedfillbasedclusteringalgorithmfortwo-valueimageisproposedtogettheobjects’rectangleareas.Toget3-Dinformationfromthe2-Dimageistheultimategoalforcomputervision,anditisalsothecrucialtaskforrobottolocateitself.Thecameraprojectionmodelanddistortionmodelarepresented;severalwell-knowncalibrationmethodsareintroducedinthisessay.Aself-calibrationmethodispresentedtogettheinteriorandexteriorparameterofthecamera.Inthelab’scondition,thedistanceandthedirectionoftheobjectcanbecomputedonthemodelofperspectiveprojection.Single-cameraandlocalvisionbasedmobilerobotlocationandnavigationsystemisachievedinthisessay.Finally,theframeworkofthewholecontrolsystemisdiscussed.ALANbasedIIIcontrolstructureisadopted.TheimageprocessingandcontrolalgorithmarefulfilledontheplatformofPC;thecontrolcommandaresenttotheserverintherobotthroughsocketprogramming;theserverprogramisinchargeofthestatuscollectionandcommandexecution.DirectShowtechnologyisusedtocaptureandprocessthevideosignal,andARIAdevelopinglibraryisusedtocontroltherobot.KeyWords:mobilerobot,colormodel,imagesegmentation,ClusteringAlgorithm,cameracalibration,objecttrackingI2005512______20055122005512111.12060(Multi-Agent)[1]60(SRI)NilsNilssenCharlesRoson19621972Shakey[2,3]80(DARPA)DARPA(ALV)(19831990)10(RIPS)(19861995)[4]902MITCogNomad1503-D[5]BookStore[6]NASA19972004THMR-VAGVCASIA-I[4,7,8]RoboCupRoboCup1.23[9]CCDGPS3123()[7]480[10]4520701.3[11]CCDDavidMarr5[12]Marr()LookandMove[13](Position-Based)(Image-Based)61.4ActivMediaRoboticPioneer2RGBYUVHSVHSV7Pioneer2DirectShowJava822.1400nm700nm()Pll2.1~2.3()Pll()Pll()Pll“”RGBCMYYUVYIQHSI92.1.1RGBCMY[14]T.Young1801MaxwellYoung1862Helmhotz430nm540nm570nm[15]2.4(0,0,0)(1,1,1)RGBRGBRGBRGBRGBrl=700.0nm,gl=546.1nm,bl=435.8nmRGBRGBrf,gf,bfrf:gf:bf14.59070.0601(2.1)14.59070.0601(R)(G)(B)C(C)R(R)G(G)B(B)(2.2)10RGB2.4RGB2.5CMY(Cyan)(Magenta)(Yellow)CMYCMYRGBCMY2.5CMYRGBCMY⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡-⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡BGRYMC111(2.3)2.1.2YUVYIQYUVYCbCrYCC(luminance-chrominance)YUVY(Brightness)UV(Chrominance)11RGBRGBURGBRGBVRGBRGBYUVYUVYUVYUVYRGBYUV()YUV(packed)(planar)YUV(macro-pixel)YUV2YUYVAYUVY411YUVIF09IYUV[16,17]RGBYUV0.2990.5870.1140.1480.2890.4370.6150.5150.100YRUGVB⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥=--⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥--⎣⎦⎣⎦⎣⎦(2.4)101.14010.3950.58112.0320RYGUBV⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥=--⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦⎣⎦⎣⎦(2.5)YIQYIQRGBRGBYIQRGB120.2990.5870.1140.5960.2740.3220.2110.5320.321YRIGQB⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥=--⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥-⎣⎦⎣⎦⎣⎦(2.6)10.9560.62110.2720.64711.1061.703RYGIBQ⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥=--⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥--⎣⎦⎣⎦⎣⎦(2.7)2.1.3HSV(Hue)(Value)(Saturation)HSV(Hue)(Saturation)(Value)()2.6[18]0o360oHSVRGBRGBRGB(2.7)132.6[18]2.7HSVRGB(,,)rgbHSV12max(,,);1min(,,)/;,360,[()()]cos2()()()vrgbsrgbvbghbgrgrbrgrbgbqqq-==-≤⎧=⎨-⎩⎛⎞-+-⎜⎟=⎜⎟-+--⎝⎠(2.8),,,,[0,1],[0,359]rgbsvh∈∈2.2Pioneer2CCDf=5.4~64.8mm11.837mmFlyVideo98EZ(BT848)320*24024(RGB2.8)RGB2.92.10HSVYUV2.11~2.14141678910a.b.2.8RGBRGBRGBRGBRGBRGBa.Rb.Gc.B2.9RGB()15a.Rb.Gc.B2.10RGB()2.1RGBRGB12345678910Rmin3377576904001048449Rmax6310597126276629156213171Rmin49958611919610926888Rmax1101731581817815057221255241Gmin12246857770801340022Gmax160681271311081105976107112Gmin158451121241171133140032Gmax2249117818418319189124118173Bmin14557110114135231330Bmax20197175698772935713468Bmin1815613630746260000Bmax25512821691154143144861421442.1RGBRGBa.Hb.Sc.V2.11HSV()16a.Hb.Sc.V2.12HSV()2.2HSVHSV12345678910Hmin185.8296.3198.253.5146.0102.3185.62.24339.615.48Hmax202.9358.0223.484.0173.0143.7227.518.78359.437.77Hmin184.3322.7198.951.6148.096.5199.09.557336.817.93Hmax199.8353.9227.769.4166.1128.5225.128.77359.336.00Smin0.6450.2980.3560.4340.7030.3400.6370.6140.4640.602Smax0.8040.5140.5410.8701.0000.6121.0000.8851.0001.000Smin0.5330.4060.1870.4850.5510.2390.5580.6010.5370.402Smax0.7480.5920.4670.7740.8460.5371.0001.0001.0001.000Vmin0.5680.3010