詳解介紹文件_第1頁
詳解介紹文件_第2頁
詳解介紹文件_第3頁
詳解介紹文件_第4頁
詳解介紹文件_第5頁
已閱讀5頁,還剩95頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

OV5640CameraModuleSoftwareApplicationOV5640OV5640CameraModuleSoftwareApplicationOV5640CameraSoftwareApplicationLastModified:May.25th,DocumentRevision:OmniVisionTechnologies,Inc.reservestherighttomakechangeswithoutfurthernoticetoanyproducthereintoimprovereliability,functionordesign.OmniVisiondoesnotassumeanyliabilityarisingoutoftheapplicationoruseofanyproject,circuitdescribedherein;neitherdoesitconveyanylicenseunderitspatentnortherightofothers.Thisdocumentcontainsinformationofaproprietarynature.NoneofthisinformationshallbedivulgedtopersonsotherthanOmniVisionTechnologies,Inc.employeeauthorizedbythenatureoftheirdutiestoreceivesuchinformation,orindividualsororganizationsauthorizedbyOmniVisionTechnologies,Inc.1CompanyOV5640CameraModuleOV5640CameraModuleSoftwareApplicationTableofOV5640Camera SoftwareApplication HowtoSelectOutput Back-endwithfull Back-endwithYCbCr Back-endwithout EquationstoConvertfromOneFormatto HowtoSelectOutput back-endwith back-endwithout HowtoAdjustframe HowtosetNightMode NightModeVGAPreviewwithFixedFrame NightModeVGApreviewwithAutoFrame HowtoRemoveLightBandinPreview Light RemoveLight SelectBandingFilterbyRegion SelectBandingFilterbyAutomaticLightFrequency RemoveLightBandIn WhenLightBandcannotbe White SimpleWhite AdvancedWhite Howto DefectPixel Video Digital OV5640 Light Color Special Exposure YUV Clock Compress Test Dealwith Lightfall Dark 2CompanyOV5640CameraModuleOV5640CameraModuleSoftwareApplication Optical Lens Reference YCbCrReference VGA Othersize VGA90fps QSXGA YUVmode Jpgmode OtherCapturesizeDCWfrom Returntoyuv From5MYUVtovga From5MJpgtovga YUVandJPEGmodechange YUVtoJPEG JPEGtoYUV Zoom SensorRaw 13.3HighResolution 13.3.11080 13.3.2720 13.4Mipi VGA VGAyuv_mipi_2lane_15fpsto5M 5M Capture 14.2Dummy 3Dummy Banding Autoframe Capture Stop SingleFocusforAF Readpreviewregister Changeresolutionto Readcaptureregister CalculateCaptureExposurefrom Calculatethebandingfilter RedistributeExposure/Gainwithtargetbrightness writebackthegain/exposure 3CompanyOV5640CameraModuleSoftwareOV5640CameraModuleSoftwareApplicationSendfinishcommandforAF Backto Capturereference StrobeFlash AutoFocusApplication Embedded EmbeddedAutoFocus GeneralAutoFocusControl HowtouseEmbeddedAutoFocus Frameexposure FREXfunction Pad I2c System Pad I2c Option ExposureTime(unit: FrameDelay(unit:Tframe),3b06[7:4]default: FlashStrobeWidth(unit:Tline),3b06[3:0]default: FrexShutterSignalReverse,3b07[2]default: FrexMode,3b07[1:0]default: FrexPrechargeTime(ftx,frstwidth),3817[2:0]default: VSYNCends 18.Somephotoscapturedby 4CompanyNOTE:OV5640use16bitsRegisteraddressand8bitsRegisterNOTE:OV5640use16bitsRegisteraddressand8bitsRegister1.HowtoSelectOutputOV5640support5outputformat:YcbCr422/420,RGB565/555/444,BayerrawRGB,CCIR656,YUV422JPEG.Howtochoosetherightoutputformatforcameraphonedesignorotherapplications?Let'slookattheback-endchipfirst.Thegeneraldiagramofback-endchipisasBayerrawRGBCompressionThedataformatatLCDdriverarealwaysRGB.Forexample,RGB444,RGB565,RGB555,RGB888etc.ThedataformatandmemoryinterfacearealwaysJPEG.TheJPEGdataiscompressedfromYCbCrdata.SoBothRGBandYCbCrdataareneededinsidetheback-endchip.The“X”blockisdifferentfordifferentback-endchips.1.1Back-endwithfullThiskindofback-endhasfullISP.IttakesrawRGBinput,doinginterpolationtogenerateRGB24anddoingtranslationtogenerateYCbCr.Thiskindofback-endcouldtakeBayerrawRGBorprocessedrawRGB.TheadvantageofCIPRAWoversensorBayerrawRGBistheoutputdataareprocessed.Sensorfunctionssuchasdefectpixelcorrection,lenscorrection,gamma,colormatrix,de-noise,sharpness,BLC,defectpixelcorrectionetc.couldbeapplied.Sincethelifetimeofback-endchipislongerthanimagesensor,sometimesback-endchipscouldnotfixdefectsofnewsensorsiftakenBayerrawRGB.Ifback-endtakeBayerrawRGBformatfromsensor,alltheimageprocessoperationssuchasdefectpixelcorrection,lenscorrection,gamma,colormatrix,de-noise,sharpness,BCLetcshouldbedonebyback-end.Ifback-endtakeprocessedrawRGBformatfromsensor,theimageMemoryLCDXCameraoperationssuchasdefectpixelcorrection,lenscorrection,gamma,colormatrix,de-noise,sharpness,BCLetccouldbeoperationssuchasdefectpixelcorrection,lenscorrection,gamma,colormatrix,de-noise,sharpness,BCLetccouldbedoneeitherinsidesensororbyback-endchips.Inotherwords,usercouldselecttheimageprocessoperationbedonebywhichside.1.2Back-endwithYCbCrThiskindofback-endhasISP,butcouldtakeonlyYCbCrformat.TheISPcouldconvertYCbCrtoRGBformatforLCDdisplayandcompressYCbCrtoJPEGforstorage.1.3Back-endwithoutThiskindofback-enddoesn'thaveISPbuilt-in.Itcannotconvertfromoneformattoanotherbyhardware.Actuallytheformatconversionisdonebysoftware.Thereare3possiblesolutionforthiskindofback-endchips.SensoroutputYCbCr.back-endchipconvertYCbCrtoRGBfordisplaybySensoroutputRGB565.Back-endchipconvertRGB565toYCbCrforJPEGSensoroutputRGB565forpreview,outputYCbCrforcapture(JPEGSolutiona.providethebestpicturequality.Sincetheinputdatais24-bitRGBequivalent.ItcouldconvertedtoRGB888forLCDdisplay.Solutionb.providetheworstpicturequality.Sincetheinputdataisonly16-bitRGB565,evenitisconvertedtoYCbCr,thecolordepthisstill16-bit.Tvidesimilarpicturequalityassolutiona.ButsincepreviewisRGB565,captureisYCbCr,previewpicturemaylooksalittledifferentthancapturedpicture.1.4EquationstoConvertfromOneFormattoYCbCrtoY=0.299R+0.587G+Cb=0.568(B-Y)+128=–0.172R–0.339G+0.511B+128Cr=0.713(R-Y)+128=0.511R–0.428G–0.083B+128Y=((77*R+150*G+29*B)>>Cb=((-43*R-85*G+128*B)>>8)+128;Cr=((128*R-107*G-21*B)>>8)+RGB24toR=Y+1.371(Cr–G=Y–0.698(Cr–128)–0.336(Cb–B=Y+1.732(CbB=Y+1.732(Cb–R=Y+(351*(Cr–128))>>G=Y–(179*(Cr–128)+86*(Cb–128))>>8B=Y+(443*(Cb–128))>>82.HowtoSelectOutput2.1back-endwithIfback-endchiphasbuilt-inISP(FullISPorYCbCrISP),theISPcoulddoimagescale.SoOV5640outputsonlyVGAformatorSXGAformatforpreviewandcapture,ISPscaledVGAorSXGAimagetootherresolutionthatmobiledeviceneededforLCDdisplayandcapturewhenimagesizebelowVGAorSXGAimage.ButfortheimagesizebiggerthanSXGAformat,OV5640wouldoutputthesizeneeded.2.2back-endwithoutIfback-endchipdoesn'thaveimagescalecapability,thentheLCDscalerofOV5640mustbeusedtoscaleoutputresolutionexactlytheLCDsize.Forexample,iftheLCDsizeis176x220,thentheLCDscalerwillscaletheoutputsizeto176x220.Inthiscase,OV5640outputsmallresolutionforpreview,andseveralotherresolutionforcapture.Theresolutionforcapturemayinclude:QQVGA,QVGA,QCIF,CIF,VGA,SVGA,SXGA,UXGA,QXGA,QSXGA.Forbestquality,allcapturesizearealldownscaledfromQSXGA.3.HowtoAdjustframeTherecommendedframeratesis15fpspreviewfor60/50Hzlightenvironment.Therecommendedframerateforcaptureis7.5fpsfor60/50hzlightenvironment.Theframeratefornightmodeislower,we'lldiscussnightmodelater.4.HowtosetNightModeThereare2typesofsettingsfornightmode.Onetypeissettofixedlowframerate,forexample3.75fps.Theothertypeissettoautoframerate,forexamplefrom15fpsto3.75fps.Whenenvironmentisbright,theframerateisincreasedto15fps.Whenenvironmentisdark,theframerateisdecreasedto3.75fps.4.1NightModeVGAPreviewwithFixedFrame3.75fpsnightmodefor60/50Hzlightenvironment,24Mhzclockinput,6MhzPCLKi2c_salve_Address=0x78;write_I2c(0x3034write_I2c(0x3034,0x1a);write_I2c(0x3035,0x61);write_I2c(0x3036,0x46);write_I2c(0x3037,0x13);write_I2c(0x3038,0x00);write_I2c(0x3039,0x00);write_I2c(0x3a00,0x78);write_I2c(0x3a08,0x01);write_I2c(0x3a09,0x27);write_I2c(0x3a0a,0x00);write_I2c(0x3a0b,0xf6);write_I2c(0x3a0d,0x04);write_I2c(0x3a0e,0x04);write_I2c(0x3a02,0x03);write_I2c(0x3a03,0xd8);write_I2c(0x3a14,0x03);write_I2c(0x3a15,0xd8);4.2NightModeVGApreviewwithAutoFrame15fps~3.75fpsnightmodefor60/50Hzlightenvironment,24Mhzclockinput,24MhzPCLKi2c_salve_Address=0x78;write_I2c(0x3034,0x1a);write_I2c(0x3035,0x21);write_I2c(0x3036,0x46);write_I2c(0x3037,0x13);write_I2c(0x3038,0x00);write_I2c(0x3039,0x00);write_I2c(0x3a00,0x7c);write_I2c(0x3a08,0x01);write_I2c(0x3a09,0x27);write_I2c(0x3a0a,0x00);write_I2c(0x3a0b,0xf6);write_I2c(0x3a0d,0x04);write_I2c(0x3a0e,0x04);write_I2c(0x3a02,0x0b);write_I2c(0x3a03,0x88);write_I2c(0x3a14,0x0b);write_I2c(0x3a15,0x88);5.HowtoRemoveLightBandinPreview5.1Light5.HowtoRemoveLightBandinPreview5.1LightNotn/100,has=n/100,noThestrengthofofficelightisnoteven.ItchangeswithACfrequency.Forexample,iftheACfrequencyis50Hz,thelightchangesstrengthat100hz.5.2RemoveLightLightbandisremovedbysetexposureton/100(n/120for60Hz)seconds.ThebandingfiltervaluetellOV5640howmanylinesis1/100(1/120for60Hz)seconds.5.3SelectBandingFilterbyRegionTheregioninformationofmobilephonecouldbeusedtoselectbandingfiltervalues.Alightfrequencytableisbuilttoindicatewhichregionuses50Hzlightandwhichregionuses60Hzlight.Whenregioninformationisgot,thelightfrequencyinformationcouldbegetfromthetable.DifferentframeratecouldDifferentframeratecouldbeusedfordifferentlightfrequency.Sotheframerateisoptimizedforboth50hzlightconditionand60hzlightcondition.Bandingfiltersettingfor15fpsVGApreview,24Mhzinputclocki2c_salve_Address=0x78;write_i2c(0x3c00,0x00);bit[2]select50/60hzbanding,0:50hzwrite_i2c(0x3c01,0x80);bit[7]bandingfilterAutoDetectionon/off,1offwrite_i2c(0x3a08,0x01);//50Hzbandingfiltervalue8MSBwrite_i2c(0x3a09,0x27);//50Hzbandingfiltervalue8LSBwrite_i2c(0x3a0a,0x00);//60Hzbandingfiltervalue8MSBwrite_i2c(0x3a0b,0xf6);//60Hzbandingfiltervalue8LSBwrite_i2c(0x3a0e,0x04);50Hzmaximumbandingstepwrite_i2c(0x3a0d,0x06);60Hzmaximumbandingstep5.4SelectBandingFilterbyAutomaticLightFrequencySetsameframeratefor50Hzand60Hzlightenvironment,set50Hzand60Hzbandingfiltervalue.OV5640couldautomaticselect50Hzor60HzbandingfilterbasedonlightfrequencyQSXGAandanysizeDCWfromQSXGAi2c_salve_Address=0x78;write_I2c(0x3622,0x01);write_I2c(0x3635,0x1c);write_I2c(0x3634,0x40);write_I2c(0x3c01,0x34);write_I2c(0x3c00,0x00);write_I2c(0x3c04,0x28);write_I2c(0x3c05,0x98);write_I2c(0x3c06,0x00);write_I2c(0x3c07,0x08);write_I2c(0x3c08,0x00);write_I2c(0x3c09,0x1c);write_I2c(0x300c,0x22);write_I2c(0x3c0a,0x9c);write_I2c(0x3c0b,0x40);5.5RemoveLightBandInReferto5.6WhenLightBandcannotbeNormallythelightbandisremovedbybandingButthereissomespecialconditionssuchasmixlightofsunlightandofficelight,takepictureofflorescentlight,thelightbandcannotremoved.Thereasonistheexposuretimeislessthan1/100secondfor50hzlightenvironmentandlessthan1/120secondfor60hzlightenvironment,sothelightbandcannotbelightbandcannotbeThelightbandinthisconditionscouldnotberemovedforallCMOSsensors,notonlySothereisnowaytoremovelightbandinthis6.WhiteOV5640supportsimplewhitebalanceandadvancedwhite6.1SimpleWhiteSimplewhitebalanceassume“grayworld”.Whichmeanstheaveragecolorofworldisgray.Itistrueformostenvironment.AdvantageofsimpleSimplewhitebalanceisnotdependonlens.Ageneralsettingforsimplewhitebalancecouldappliedforallmoduleswithdifferentlens.DisadvantageofsimpleThecolorisnotaccurateinconditionswhere“grayworld”nottrue.Forexamplethebackgroundhasahugered,blueorgreenetc.thecoloroftheforegroundisnotaccurate.Ifthecameratargetsinglecolorsuchasred,blue,green,thesimplewhitebalancewillmakethesinglecolorgray.write_i2c(0x5183,0x80);//SimpleAWB,0foradvanced6.2AdvancedWhiteAdvancedwhitebalanceusescolortemperatureinformationtodetectwhiteareaanddothewhiteAdvantageofAdvancedColorismoreaccuratethansimplewhitebalance.Eventhebackgroundissinglecolor,thecamerawillnotmakethesinglecolorgray.DisadvantageofAdvancedAdvancedwhitebalancesettingisdependonlens.Thesettingmustbeadjustedforeverymodulewithnewlens.TheadjustmentmustbedonebyOmniVisionFAEinopticallabwithsomeopticalequipmentsuchaslightbox,colorcheckeretc.ContactwithOmniVisionlocal6.3HowtoGenerally,forlowresolutioncameramodulesuchasCIF,VGAand1.3M,simpleAWBisselected.Forhighresolutioncameramodulesuchas2M,3M,5MadvancedAWBis7.DefectPixelDefectpixelincludes7.DefectPixelDefectpixelincludesdeadpixelandwoundedDeadpixelincludewhitedeadpixelandblackdeadpixel.Whitedeadpixelisalwayswhitenomattertheactualpictureisbrightordark.Blackdeadpixelisalwaysblacknomattertheactualpictureisbrightordark.Woundedpixelmaychangewithlight,butnotasmuchasnormalpixel.Whitewoundedpixelsaremuchbrighterthennormalpixels,butnotcompletewhite.Blackwoundedpixelsaremuchdarkerthannormalpixels,butnotcompleteblack.OV5640hasbuilt-indefectpixelcorrectionfunction.IfOV5640outputYCbCr,RGB565,CIPrawRGB,thedefectpixelcorrectionfunctioncouldbeenabledtofixdefectpixels.ButifsensorBayerrawRGBisused,thedefectpixelcorrectionfunctionofsensorcouldnotbeused.Pleasepayattentiontothedefectpixelcorrectionfunctionofback-endchip.Someback-endchipmaynotbeabletocorrectalldefectpixelsofOV5640.write_i2c(0x5000,0x06);//PixelCorrectionON,bit[2:1]:11,select8.ThefunctionofBlackLevelCalibration(BLC)istoproductaccuratecolorinthedarkareaofpicture.ThereisautomaticBLCfunctionbuilt-inOV5640.Itshouldalwaysbeturnedon.9.VideoVideomodeneedhighframerate,usuallyfixed15fps.ThereisnonightmodeforvideoOV5640cansupport1080PforVideo10.DigitalIfOV5640outputimagesmallerthanXGA,itmaysupportcontinuousdigitalzoom.Fornodigitalzoomsupported1-1-Ifback-endchipsupportscaleup,thenmorezoomlevelcouldbe11.OV564011.1LightAdvancedwrite_I2c(0x3406,0x00);write_I2c(0x5192,0x04);write_I2c(0x5191,0xf8);Advancedwrite_I2c(0x5193,0x70);write_I2c(0x5194,0xf0);write_I2c(0x5195,0xf0);write_I2c(0x518d,0x3d);write_I2c(0x518f,0x54);write_I2c(0x518e,0x3d);write_I2c(0x5190write_I2c(0x5193,0x70);write_I2c(0x5194,0xf0);write_I2c(0x5195,0xf0);write_I2c(0x518d,0x3d);write_I2c(0x518f,0x54);write_I2c(0x518e,0x3d);write_I2c(0x5190,0x54);write_I2c(0x518b,0xa8);write_I2c(0x518c,0xa8);write_I2c(0x5187,0x18);write_I2c(0x5188,0x18);write_I2c(0x5189,0x6e);write_I2c(0x518a,0x68);write_I2c(0x5186,0x1c);write_I2c(0x5181,0x50);write_I2c(0x5184,0x25);write_I2c(0x5182,0x11);write_I2c(0x5183,0x14);write_I2c(0x5184,0x25);SimpleAWBwrite_i2c(0x3406,0x0),write_i2c(0x5191,0xff),Manualdaywrite_i2c(0x3406,0x1),write_i2c(0x3400,0x6),write_i2c(0x3402,0x4),write_i2c(0x3403,0x0),write_i2c(0x3404,0x4),write_i2c(0x3405ManualManualAwrite_i2c(0x3406,0x1),write_i2c(0x3400,0x4),write_i2c(0x3402,0x4),write_i2c(0x3403,0x0),write_i2c(0x3404,0x8),ManualManualcwfwrite_i2c(0x3406,0x1),write_i2c(0x3400,0x5),write_i2c(0x3402,0x4),write_i2c(0x3403,0x0),write_i2c(0x3404,0x7),ManualManualcwfwrite_i2c(0x3406,0x1),write_i2c(0x3400,0x5),write_i2c(0x3402,0x4),write_i2c(0x3403,0x0),write_i2c(0x3404,0x7),ManualManualcloudywrite_i2c(0x3406,0x1),write_i2c(0x3400,0x6),write_i2c(0x3402,0x4),write_i2c(0x3403,0x0),write_i2c(0x3404,0x4),Manual11.2ColorThecolorsaturationofOV5640couldbeadjusted.Highcolorsaturationwouldmakethepicturelooksmorevivid,butthesideeffectisthebiggernoiseandnotaccurateskincolor.Saturation+4write_i2c(0x5001,0xff)write_i2c(0x5583,0x80)write_i2c(0x5584,0x80)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation+Saturation+3write_i2c(0x5001,0xff)Saturation+write_i2c(0x5001,0xff)Saturation+Saturation+2write_i2c(0x5001,0xff)write_i2c(0x5583,0x60)write_i2c(0x5584,0x60)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation+Saturation+1write_i2c(0x5001,0xff)write_i2c(0x5583,0x50)write_i2c(0x5584,0x50)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation+Saturation0write_i2c(0x5001,0xff)write_i2c(0x5583,0x40)write_i2c(0x5584,0x40)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)SaturationSaturation-1write_i2c(0x5001,0xff)write_i2c(0x5583,0x30)write_i2c(0x5584,0x30)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation-Saturation–2Saturation-1write_i2c(0x5001,0xff)write_i2c(0x5583,0x30)write_i2c(0x5584,0x30)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation-Saturation–2write_i2c(0x5001,0xff)write_i2c(0x5583,0x20)write_i2c(0x5584,0x20)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation–Saturation-3write_i2c(0x5001,0xff)write_i2c(0x5583,0x10)write_i2c(0x5584,0x10)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation-Saturation–4write_i2c(0x5001,0xff)write_i2c(0x5583,0x00)write_i2c(0x5584,0x00)write_i2c(0x5580,0x02)write_i2c(0x5588,0x41)Saturation–11.3ThebrightnessofOV5640could11.3ThebrightnessofOV5640couldbeadjusted.Higherbrightnesswillmakethepicturemorebright.Thesideeffectofhigherbrightnessisthepicturelooksfoggy.Brightness+4write_i2c(0x5001,0xff)write_i2c(0x5587,0x40)write_i2c(0x5580,0x04)write_i2c(0x5588,0x01)BrightnessBrightness+3write_i2c(0x5001,0xff)write_i2c(0x5587,0x30)write_i2c(0x5580,0x04)write_i2c(0x5588,0x01)BrightnessBrightness+2write_i2c(0x5001,0xff)write_i2c(0x5587,0x20)write_i2c(0x5580,0x04)write_i2c(0x5588,0x01)BrightnessBrightness+1write_i2c(0x5001,0xff)write_i2c(0x5587,0x10)write_i2c(0x5580,0x04)BrightnessBrightness0write_i2c(0x5001,0xff)write_i2c(0x5587,0x00)write_i2c(0x5580,0x04)write_i2c(0x5588,0x01)BrightnessBrightness0write_i2c(0x5001,0xff)write_i2c(0x5587,0x00)write_i2c(0x5580,0x04)write_i2c(0x5588,0x01)BrightnessBrightness-1write_i2c(0x5001,0xff)write_i2c(0x5587,0x10)write_i2c(0x5580,0x04)write_i2c(0x5588,0x09)Brightness-Brightness-2write_i2c(0x5001,0xff)write_i2c(0x5587,0x20)write_i2c(0x5580,0x04)write_i2c(0x5588,0x09)Brightness-Brightness-3write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)Brightness-Brightness-4write_i2c(0x5001,0xff)write_i2c(0x5587,0x40)write_i2c(0x5580,0x04)write_i2c(0x5588,0x09)Brightness-Brightness-4write_i2c(0x5001,0xff)write_i2c(0x5587,0x40)write_i2c(0x5580,0x04)write_i2c(0x5588,0x09)Brightness-11.4ThecontrastofOV5640couldbeadjusted.Highercontrastwillmakethepicturesharp.Butthesideeffectisloosingdynamicrange.Contrast+4write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x30)write_i2c(0x5585,0x30)write_i2c(0x5588,0x41)ContrastContrast+3write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x2c)write_i2c(0x5585,0x2c)write_i2c(0x5588,0x41)ContrastContrast+2write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x28)ContrastContrast+1write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x24)write_i2c(0x5585,0x24)write_i2c(0x5588,0x41)ContrastContrast+1write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x24)write_i2c(0x5585,0x24)write_i2c(0x5588,0x41)ContrastContrast0write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x20)write_i2c(0x5585,0x20)write_i2c(0x5588,0x41)ContrastContrast-1write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x1c)write_i2c(0x5585,0x1c)write_i2c(0x5588,0x41)Contrast-Contrast-2write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x18)write_i2c(0x5585,0x18)write_i2c(0x5588,0x41)Contrast-Contrast-3write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x14)write_i2c(0x5585,0x14)write_i2c(0x5588,0x41)Contrast-Contrast-4Contrast-3write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5586,0x14)write_i2c(0x5585,0x14)write_i2c(0x5588,0x41)Contrast-Contrast-4write_i2c(0x5001,0xff)write_i2c(0x5580,0x04)write_i2c(0x5585,0x10)write_i2c(0x5588,0x41)Contrast-11.5i2c_salve_Address=0x78;-180degreewrite_i2c(0x5001,0xff)-180-150degreewrite_i2c(0x5001,0xff)write_i2c(0x5581,0x6f)-150-120degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)-120degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)-120-90degreewrite_i2c(0x5001,0xff)-90-60degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)-60-30degreewrite_i2c(0x5001,0xff)write_i2c(0x5581,0x6f)-30+0degreewrite_i2c(0x5001,0xff)+0+0degreewrite_i2c(0x5001,0xff)+0+30degreewrite_i2c(0x5001,0xff)write_i2c(0x5581,0x6f)+30+60degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)+60+90degreewrite_i2c(0x5001,0xff)+90+120degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)+120degreewrite_i2c(0x5001,0xff)write_i2c(0x5582,0x6f)+120+150degreewrite_i2c(0x5001,0xff)write_i2c(0x5581,0x6f)+15011.6SpecialOV5640supportsomespecialeffectssuchasB/W,negative,sepia,bluish,reddish,greenish,negative,etc.Ifusersneedotherspecialeffects,itshouldbesupportedbyback-endchips.i2c_salve_Address=0x78;write_i2c(0x5001,0x7f)write_i2c(0x5580write_i2c(0x5001,0xff)write_i2c(0x5001,0xff)write_i2c(0x5583,0xa0)write_i2c(0x5001,0xff)write_i2c(0x5001,0xff)write_i2c(0x5583,0xa0)write_i2c(0x5001,0xff)write_i2c(0x5001,0xff)write_i2c(0x5001,0xff)write_i2c(0x5001,0xff)11.7Exposurewrite_i2c(0x5001,0xff)11.7ExposureOV5640supportdifferentexposurelevel.Itcanincrease/decreasetargetbrightnessbychangeexposure/gainauto.OV5640supportAveragealgorithm.i2c_salve_Address=-write_i2c(0x3a0f,0x10)write_i2c(0x3a10,0x08)write_i2c(0x3a1b,0x10)write_i2c(0x3a1e,0x08)write_i2c(0x3a11,0x20)write_i2c(0x3a1f,0x10)--write_i2c(0x3a0f,0x18)write_i2c(0x3a10,0x10)write_i2c(0x3a1b,0x18)write_i2c(0x3a1e,0x10)write_i2c(0x3a11,0x30)write_i2c(0x3a1f,0x10)--write_i2c(0x3a0f,0x20)write_i2c(0x3a10,0x18)write_i2c(0x3a11,0x41)write_i2c(0x3a1b,0x20)write_i2c(0x3a1e,0x18)write_i2c(0x3a1f,0x10)--write_i2c(0x3a0f,0x20)write_i2c(0x3a10,0x18)write_i2c(0x3a11,0x41)write_i2c(0x3a1b,0x20)write_i2c(0x3a1e,0x18)write_i2c(0x3a1f,0x10)--write_i2c(0x3a0f,0x28)write_i2c(0x3a10,0x20)write_i2c(0x3a11,0x51)write_i2c(0x3a1b,0x28)write_i2c(0x3a1e,0x20)write_i2c(0x3a1f,0x10)--write_i2c(0x3a0f,0x30)write_i2c(0x3a10,0x28)write_i2c(0x3a11,0x61)write_i2c(0x3a1b,0x30)write_i2c(0x3a1e,0x28)write_i2c(0x3a1f,0x10)-write_i2c(0x3a0f,0x38)write_i2c(0x3a1bwrite_i2c(0x3a1fwrite_i2c(0x3a0f,0x40)write_i2c(0x3a10,0x38)write_i2c(0x3a11,0x71)write_i2c(0x3a1b,0x40)write_i2c(0x3a1ewrite_i2c(0x3a1fwrite_i2c(0x3a0f,0x40)write_i2c(0x3a10,0x38)write_i2c(0x3a11,0x71)write_i2c(0x3a1b,0x40)write_i2c(0x3a1e,0x38)write_i2c(0x3a1f,0x10)write_i2c(0x3a0f,0x48)write_i2c(0x3a10,0x40)write_i2c(0x3a11,0x80)write_i2c(0x3a1b,0x48)write_i2c(0x3a1e,0x40)write_i2c(0x3a1f,0x20)write_i2c(0x3a0f,0x50)write_i2c(0x3a10,0x48)write_i2c(0x3a11,0x90)write_i2c(0x3a1b,0x50)write_i2c(0x3a1e,0x48)write_i2c(0x3a1f,0x20)write_i2c(0x3a0f,0x58)write_i2c(0x3a10,0x50)write_i2c(0x3a11,0x91)write_i2c(0x3a1bwrite_i2c(0x3a1fwrite_i2c(0x3a0f,0x60)write_i2c(0x3a10,0x58)write_i2c(0x3a11,0xa0)write_i2c(0x3a1bwrite_i2c(0x3a1fwrite_i2c(0x3a0f,0x60)write_i2c(0x3a10,0x58)write_i2c(0x3a11,0xa0)write_i2c(0x3a1b,0x60)write_i2c(0x3a1e,0x58)write_i2c(0x3a1f,0x20)11.8SharpnessOFFWrite_i2c(0x5302Sharpness1Write_i2c(0x5302Sharpness2Write_i2c(0x5302Sharpness3Write_i2c(0x5302Sharpness4Write_i2c(0x5302Sharpness5Write_i2c(0x5302Sharpness6Write_i2c(0x5302SharpnessWrite_i2c(0x5302Sharpness8Write_i2c(0x5302SharpnessAutoWrite_i2c(0x5302Sharpness8Write_i2c(0x5302SharpnessAutoWrite_i2c(0x530a,0x30);Write_i2c(0x530c11.9i2c_salve_Address=reg3820=reg3820&0xf9reg3820=reg3820|0x00reg3821=reg3821&0xf9reg3821=reg3821|0x06reg3820=reg3820&0xf9reg3820=reg3820|0x06reg3821=reg3821&0xf9reg3821=reg3821|0x00reg3820=reg3820=reg3820&0xf9reg3820=reg3820|0x06reg3821=reg3821&0xf9reg3821=reg3821|0x06reg3820=reg3820&0xf9reg3820=reg3820|0x06reg3821=reg3821&0xf9reg3821=reg3821|0x06reg3820=reg3820&0xf9reg3820=reg3820|0x00reg3821=reg3821&0xf9reg3821=reg3821|0x0011.10YUVYUYVYVYVYUUYV11.11ClockDatavalidVSYNC1:DatavalidVSYNCHigh0:DatavalidVSYNC1:DataupdateatFalling-edge0:DataupdateatRising-edge0:DatavalidHREFhigh1:0:DatavalidHREFhigh1:DatavalidHREF11.12CompressRegister0x4407[5:0]isforthecompressqualityHighquality:defaultqualitylowquality11.13TestColorbarColorColorsquarewrite_i2c(0x4741,0x0)Color12.Dealwith12.Dealwith12.1LightfallLightfalloffmeansthecornerofimageisdarkerthancenterofimage.ItiscausedbytheThelensshadingcorrectionfunctionofOV5640couldbeturnedontocompensatethecornerbrightnessandmakethewholepicturelookssamebright.i2c_salve_Address=0x78;12.2DarkSomelensmayhavedarkcorner.Darkcornermeansthecolorofpicturelooksalmostblack.Itisnotpossibletocorrectdarkcornerwithlenscorrection.SothemodulewithdarkcornerisNG,itcannotbeused.12.3Theresolutionofcameramoduledependsonlensdesign,focusadjustmentandsensorresolutionaswell.Thefocusadjustmentisveryimportantforcameramoduleassembly.ForOV5640thefocusdistanceisabout140~160cm.Thedepthoffieldisaboutfrom70~80cmtoinfinite.Ifcheckingresolutionofcameramodule,theresolutionchartshouldbeplaced140~160cmaway.12.4OpticalTheopticalcontrastoflensisveryimportanttopicturequality.Iftheopticalcontrastoflensisnotgood,thepicturewouldlooksfoggy.Thoughitcouldbeimprovedbyincreasethesensorcontrasttomakethepicturesharper,thehighersensorcontrastwouldmakethedetaillostofdarkareaofthepicture.12.5LensThelenscoveristhecheapestpartinopticalpath.Butitcouldaffectpicturequalityverymuch.ThelenscovershouldbemadewithopticalglasswithARcoatingatbothside.Otherwise,thelenscovermaycausesensitivitylossand/orstrongerlensflare.13.Reference13.Reference13.1YCbCrReference.13.1.1VGA;forthesetting,24MMlckinputand24MPlck;15fpsYUVmodewrite_i2c(0x3017,0xff);write_i2c(0x3018,0xff);write_i2c(0x3034,0x1a);write_i2c(0x3631,0x0e);write_i2c(0x3632,0xe2);write_i2c(0x3621,0xe0);write_i2c(0x3704,0xa0);write_i2c(0x3703,0x5a);write_i2c(0x3705,0x1a);write_i2c(0x3901,0x0a);write_i2c(0x471c,0x50);write_i2c(0x3a13,0x43);write_i2c(0x3a18,0x00);write_i2c(0x3a19,0xf8);write_i2c(0x3c01write_i2c(0x3c01,0x34);write_i2c(0x3c04,0x28);write_i2c(0x3c05,0x98);write_i2c(0x3c06,0x00);write_i2c(0x3c07,0x08);write_i2c(0x3c08,0x00);write_i2c(0x3c09,0x1c);write_i2c(0x3c0a,0x9c);write_i2c(0x3c0b,0x40);write_i2c(0x3820,0x41);write_i2c(0x3821,0x07);write_i2c(0x3814,0x31);write_i2c(0x3815,0x31);write_i2c(0x3800,0x00);write_i2c(0x3801,0x00);write_i2c(0x3802,0x00);write_i2c(0x3803,0x04);write_i2c(0x3804,0x0a);write_i2c(0x3805,0x3f);write_i2c(0x3806,0x07);write_i2c(0x3807,0x9b);write_i2c(0x3808,0x02);write_i2c(0x3809,0x80);write_i2c(0x380a,0x01);write_i2c(0x380b,0xe0);write_i2c(0x380c,0x07);write_i2c(0x380d,0x68);write_i2c(0x380e,0x03);write_i2c(0x380f,0xd8);write_i2c(0x3810,0x00);write_i2c(0x3811,0x10);wr

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論