IDS Cameras: Pyueye python package set exposure ...

文章推薦指數: 80 %
投票人數:10人

When I use the IDS GUI software and flip on auto exposure, things look great. But when I try to do this in software, the imagery is way over ... Home Public Questions Tags Users Collectives ExploreCollectives FindaJob Jobs Companies Teams StackOverflowforTeams –Collaborateandshareknowledgewithaprivategroup. CreateafreeTeam WhatisTeams? Teams CreatefreeTeam CollectivesonStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore IDSCameras:Pyueyepythonpackagesetexposureparameter(is_SetAutoParameterfunction) AskQuestion Asked 5monthsago Active 5monthsago Viewed 634times 0 IamworkingwithIDS-3240CP-NIRcamerasandoperatingthemwiththepyueyepackagethataccompaniesthem.BecausethesecamerasarebeingusedtocalculateNDVIfromimagerybetweentwodifferentcameras,Ineedtoensuretheyhaveequivalentparametersexceptforexposure,whichwillbeautoadjustedforlightingconditionsandadjustedforinpostprocessing.Thetroubleis,I'mnotsurehowtosettheautoexposureinpyueyetoproducegoodresults.WhenIusetheIDSGUIsoftwareandfliponautoexposure,thingslookgreat.ButwhenItrytodothisinsoftware,theimageryiswayoverexposed. FromwhatIcantellinthedocumentation,therearetwowaystosettheautoexposure:thepyueye.Is_SetAutoParameterfunction(https://en.ids-imaging.com/manuals/ids-software-suite/ueye-manual/4.93/en/is_setautoparameter.html?q=set+auto+parameter)andthepyueye.Is_AutoParameterfunction(https://en.ids-imaging.com/manuals/ids-software-suite/ueye-manual/4.93/en/is_autoparameterautoexposure.html?q=aes).TheIs_AutoParameterfunctionmaybethesuperiormethodbasedonhowthedocumentationtalksaboutit,butIhavenotbeenabletofigureouthowtousethisfunction(IbelieveIamsendingthewrongtypeofpval's).Instead,I'vebeensettingtheautoshutterspeedthroughtheIs_SetAutoParameter,butresultsarestilloverexposed. HereissomeofthecodeIamrunning: hCam=ueye.HIDS(1) sInfo=ueye.SENSORINFO() cInfo=ueye.CAMINFO() pcImageMemory=ueye.c_mem_p() MemID=ueye.int() rectAOI=ueye.IS_RECT() pitch=ueye.INT() nBitsPerPixel=ueye.INT(32) channels=4 m_nColorMode=ueye.IS_CM_RGBY8_PACKED bytes_per_pixel=int(nBitsPerPixel/8) #CameraInit nRet=ueye.is_InitCamera(hCam,None) ifnRet!=ueye.IS_SUCCESS: print("is_InitCamera1ERROR") #GetSensorInfo nRet=ueye.is_GetSensorInfo(hCam,sInfo) ifnRet!=ueye.IS_SUCCESS: print("is_GetSensorInfoERROR") print(sInfo.strSensorName) #SetDisplayMode nRet=ueye.is_SetDisplayMode(hCam,ueye.IS_SET_DM_DIB) #SetColormode nRet=ueye.is_SetColorMode(hCam,ueye.IS_CM_RGBY8_PACKED) #AreaofInterest print("rectAOItype:") print(type(rectAOI)) nRet=ueye.is_AOI(hCam,ueye.IS_AOI_IMAGE_GET_AOI,rectAOI,ueye.sizeof(rectAOI)) ifnRet!=ueye.IS_SUCCESS: print("is_AOIERROR") #DefineWidthandHeight width=rectAOI.s32Width height=rectAOI.s32Height #Printsoutsomeinformationaboutthecameraandthesensor print("Camera1") print("Cameramodel:\t\t",sInfo.strSensorName.decode('utf-8')) print("Cameraserialno.:\t",cInfo.SerNo.decode('utf-8')) print("Maximumimagewidth:\t",width) print("Maximumimageheight:\t",height) print() #AllocateImageMemory nRet=ueye.is_AllocImageMem(hCam,width,height,nBitsPerPixel,pcImageMemory,MemID) ifnRet!=ueye.IS_SUCCESS: print("is_AllocImageMemERROR") #AddtoSequence nRet=ueye.is_AddToSequence(hCam,pcImageMemory,MemID) ifnRet!=ueye.IS_SUCCESS: print("is_AddToSequenceERROR") #CaptureVideo nRet=ueye.is_CaptureVideo(hCam,ueye.IS_DONT_WAIT) ifnRet!=ueye.IS_SUCCESS: print("is_CaptureVideoERROR") #InquireImageMemory nRet=ueye.is_InquireImageMem(hCam,pcImageMemory,MemID,width,height,nBitsPerPixel,pitch) ifnRet!=ueye.IS_SUCCESS: print("is_InquireImageMemERROR") #ImageDisplay array=[0] #GenerateImageFileName timestr=str(datetime.now().strftime('%Y-%m-%d_%H:%M:%S')) image_name="/home/pi/LakeWheelerTurf/TurfImages/turfcam1_"+timestr+".bmp" pval1=ctypes.c_double(1) pval2=ctypes.c_double(0) nRet=ueye.is_SetAutoParameter(hCam,ueye.IS_SET_ENABLE_AUTO_SHUTTER,pval1,pval2) #Continuousimagedisplay photo_counter=0 while(nRet==ueye.IS_SUCCESS): pval1=ctypes.c_double(1) pval2=ctypes.c_double(0) nRet=ueye.is_SetAutoParameter(hCam,ueye.IS_SET_ENABLE_AUTO_SHUTTER,pval1,pval2) nRet=ueye.is_SetAutoParameter(hCam,ueye.IS_GET_ENABLE_AUTO_SHUTTER,pval3,pval2) print(pval3.value) #Belowismyattempttogettheis_AutoParameterfunctiontowork(unsuccessful) #pval1=ctypes.c_void_p(1) #pval2=ctypes.sizeof(pval1) #nRet=ueye.is_AutoParameter(hCam,ueye.IS_AES_CMD_SET_ENABLE,pval1,pval_sz) #ifnRet!=ueye.IS_SUCCESS: #print("AESERROR") whilearray[0]==0: array=ueye.get_data(pcImageMemory,width.value,height.value,nBitsPerPixel.value,pitch.value, copy=False) frame=np.reshape(array,(height.value,width.value,bytes_per_pixel)) photo_counter+=1 time.sleep(1) ifphoto_counter>=10: break matplotlib.pyplot.imsave(image_name,frame) ueye.is_FreeImageMem(hCam,pcImageMemory,MemID) ueye.is_ExitCamera(hCam) returnimage_name I'dbehugelyappreciativeifanyonecanhelpmefigurethisout,I'vebeenworkingonthisforagestonoavail.BelowaresomesamplesoftheimageryI'mabletogetoutoftheGUIvspyueye.Thanks! pythoncameracomputer-visionctypes Share Improvethisquestion Follow editedJul3at19:41 crushendo askedJul3at19:32 crushendocrushendo 3311silverbadge77bronzebadges Addacomment  |  0 Active Oldest Votes Knowsomeonewhocananswer?Sharealinktothisquestionviaemail,Twitter,orFacebook. YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Browseotherquestionstaggedpythoncameracomputer-visionctypesoraskyourownquestion. TheOverflowBlog Skills,notschools,areindemandamongdevelopers Podcast401:BringingAItotheedge,fromthecomfortofyourlivingroom FeaturedonMeta ProvidingaJavaScriptAPIforuserscripts Congratulationstothe58sitesthatjustleftBeta A/BtestingontheAskpage Related 1009 HowdoyoutestthataPythonfunctionthrowsanexception? 908 WhatisthenamingconventioninPythonforvariableandfunctionnames? 841 HowdoIdetectwhetheraPythonvariableisafunction? 880 HowtosetenvironmentvariablesinPython? 712 What'sthedifferencebetweenaPythonmoduleandaPythonpackage? 883 WhydoesPythoncoderunfasterinafunction? 1 GetvaluesofuEyeCamera 1057 HowdoIinstallaPythonpackagewitha.whlfile? 6 uEyecamerawithpythononWindows 0 HowtomanualysetwhitebalanceofauEyecamera? HotNetworkQuestions Legalityandmoralityaroundwearingared/blueflashinglightonabicycleintheUK? Doesitmakesensetohave2branchesresultinginsamedecisionwhileusingonesinglevariabletodividethepredictormultipletimes? Doanylanguagesusewordslikeparticlestorepresentcommas,periods,hyphens,quotes,parentheses,etc.? WestwardcommercialflightsthatoutpacetheEarth'srotation Does"My"inMyLittlePonyreferspecificallytoanyone? Howcapablewouldthisandroidbeagainstamodernmilitary? Ifacivilizationhasbiotechnology,whydotheystillprefermechanicalaugmentations? OwlIdentification.WinterinHaliburton,Ontario,Canada Changearbitraryargumentsoffunctionbasedontheirnameswithadecorator Howisuniformexposureachievedwhenusingaleafshutter? IdeasforintroducingGaloistheorytoadvancedhighschoolstudents CanIsafelyconnectbarelyreachableflexgaspipe? CanIcheckSalesforceSalesforceCLIReleasenotesrightwithintheterminal? DoesHealendSanctuarywhenfightingundead? WhatrecoursedoIhaveiftravelagent(Gotogate)claimsairlinecancancelmyticket,butairlineasksmetocallmyagent,whichchargeafee? HowdoIaddverticalspaceof10ptbetweentherowssothatitisnotascongested,whilestillmaintainingtherowcolors? WhyisRonstillwearingbandageifHermione'sspellclosedtheopenwound? Doweactuallytakerandomlineinfirststepoflinearregression? Wrongfullyaccusedoflendingmysecuritybadgetoanotheremployee CanaShieldofMissileAttractioncurseanindefinitenumberofcreatures? WilltheGovernmentcomeaftermydaughterifIcan'tpaymystudentloans? Threehorserace Pleasehelp.Willworkingforacompanythatengageinanimalexperimentationtoalleviatesufferingofhumansbewronglivelihood? Howdoyougeneratemathfiguresforacademicpapers? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-py Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?