ncsuarc/ids: Interface for IDS machine vision cameras - GitHub

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

A module for interfacing with IDS Imaging machine vision cameras. This module wraps the IDS uEye SDK, providing a convient Python interface to much of the ... Skiptocontent {{message}} ncsuarc / ids Public Notifications Fork 36 Star 37 InterfaceforIDSmachinevisioncameras Viewlicense 37 stars 36 forks Star Notifications Code Issues 12 Pullrequests 4 Actions Projects 0 Wiki Security Insights More Code Issues Pullrequests Actions Projects Wiki Security Insights master Branches Tags Couldnotloadbranches Nothingtoshow Loading {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default Loading 1 branch 0 tags Code Loading Latestcommit   Gitstats 108 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime ids_core     .gitignore     LICENSE     README.md     ids.py     setup.py     Viewcode MAINTAINERSWANTED IDSPythonModule Requirements Buildingandinstalling Usage ColorModes Additionalinformation README.md MAINTAINERSWANTED Thisprojecthasbeenunmaintainedsincemid2016.Sincetheclubnolonger usesIDScamerasandnocurrentmemberwaspresentwhenthislibrarywasin use,weareunlikelytomergeanypullrequestsorcommentonanyissues. Ifyouareinterestedinmaintainingtheproject,pleasecommentonthe [email protected]. IDSPythonModule AmoduleforinterfacingwithIDSImagingmachinevisioncameras. ThismodulewrapstheIDSuEyeSDK,providingaconvientPythoninterface tomuchoftheSDK.Theids.Cameraobjectprovidesattributesforeasily controllingcamerasettingsandcapturingimages. Requirements TheidsmoduleiswritteninPythonandC,usingthePythonCAPI,andsupports bothPython2andPython3.IthasbeentestedusingPython2.7andPython3.2. ThemodulehasonlybeentestedonLinux,andlikelydoesnotsupportWindows. Buildrequirements: IDSuEyeSDK SDKversion4.20orhigherissupported TheSDKcanbeacquiredfromthe IDSwebsite Buildingandinstalling Oncealldependenciesaremet,itissimpletobuildandinstallthemodule: $pythonsetup.pyinstall Or,forPython3: $python3setup.pyinstall Ofcourse,iftheinstallationlocationrequiresrootpermissions,sudomay benecessary. Usage Theidsmodulemakesiteasytocontrolacamera.JustinitializetheCamera objectandsettheattributesofinterest,thenstartimagecapture. >>>importids >>>cam=ids.Camera() >>>cam.color_mode=ids.ids_core.COLOR_RGB8#GetimagesinRGBformat >>>cam.exposure=5#Setinitialexposureto5ms >>>cam.auto_exposure=True >>>cam.continuous_capture=True#Startimagecapture YoucangetimagesfromthecameraasaNumpyarray >>>img,meta=cam.next()#GetimageasaNumpyarray PILprovidesawiderangeofformatstosavein. >>>fromPILimportImage >>>pil_img=Image.fromarray(img) >>>pil_img.save("pil.jpg",quality=95) OpenCValsoallowsyoutosaveimages. >>>importcv2 >>>bgr_img=cv2.cvtColor(img,cv2.COLOR_RGB2BGR) >>>cv2.imwrite('cv2.jpg',bgr_img)#cv2.imwritetakesaBGRimage Thetiffutilsmodulecanbeusedto saverawbayerdataasaDNG.Useoneoftheids.ids_core.COLOR_BAYERcolor modes. >>>cam.continuous_capture=False#Stopcapturetochangecolormode >>>cam.color_mode=ids.ids_core.COLOR_BAYER_16 >>>cam.continuous_capture=True >>>img,meta=cam.next() >>>importtiffutils >>>tiffutils.save_dng(img,"image.dng") Alternatively,theIDSuEyeSDKprovidesafunctionforsavingimages.The cameramustbeinaBGRmodeforJPEGs. >>>cam.continuous_capture=False#Stopcapturetochangecolormode >>>cam.color_mode=ids.ids_core.COLOR_BGR8 >>>cam.continuous_capture=True >>>meta=cam.next_save("ids.jpg") ColorModes Itisimportanttotakethecolormodeimagesarecapturedinintoaccount, particularlyforsavingimages.Differentformatsandimagelibrarieshave differentexpectationsoftheformatimagesarestoredin,socapturingimages inthewrongformatmayresultinimageswithswappedcolorchannels. Thecolormodeconstantsareprovidedintheidsmoduleas ids.ids_core.COLOR_*.Thecolormodecanbepassedintothecolor keywordargumentoftheids.Cameraobject,orsetwhileimagecapture isnotrunningwiththeids.Camera.color_modeattribute. TheIDSuEyeSDKimagingsavingfunctions,usedbyCamera.next_save()copy imagedatadirectly,sotheappropriatemodefortheformatmustbeused. JPEGimagesarestoredinaBGRformat,whileBMPandPNGareRGB. Differentlibrariesexpectimagesindifferentformat.PILexpectsimagesto beinanRGBformat.OpenCVsupportsmanyformats,butgenerallyexpectsBGR data.However,cv2.cvtColor()supportsconversionsbetweenmanyformats. Additionalinformation TheIDSuEyedocumentation isausefulsourceofinformationaboutthefeaturesprovidedbytheIDS camerasanduEyeSDK,andbyextension,thismodule. About InterfaceforIDSmachinevisioncameras Resources Readme License Viewlicense Stars 37 stars Watchers 17 watching Forks 36 forks Releases Noreleasespublished Packages0 Nopackagespublished Contributors5 Languages C 87.7% Python 12.3% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?