logo资料库

basler相机的API说明文档.pdf

第1页 / 共103页
第2页 / 共103页
第3页 / 共103页
第4页 / 共103页
第5页 / 共103页
第6页 / 共103页
第7页 / 共103页
第8页 / 共103页
资料共103页,剩余部分请下载后查看
Table of Contents
1 Overview
2 C++ Samples
2.1 DeviceRemovalHandling
2.2 Grab
2.3 Grab_CameraEvents_Universal
2.4 Grab_ChunkImage_Universal
2.5 Grab_MultiCast_Universal
2.6 Grab_MultipleCameras
2.7 Grab_Strategies
2.8 Grab_UsingActionCommand_Universal
2.9 Grab_UsingBufferFactory
2.10 Grab_UsingExposureEndEvent_Universal
2.11 Grab_UsingGrabLoopThread
2.12 Grab_UsingSequencer_Universal
2.13 GUI_ImageWindow
2.14 GUI_Sample
2.15 ParametrizeCamera_AutoFunctions_Universal
2.16 ParametrizeCamera_Configurations
2.17 ParametrizeCamera_GenericParameterAccess
2.18 ParametrizeCamera_LoadAndSave
2.19 ParametrizeCamera_LookupTable_Universal
2.20 ParametrizeCamera_NativeParameterAccess_Universal
2.21 ParametrizeCamera_Shading_Universal
2.22 ParametrizeCamera_UserSets_Universal
2.23 Utility_GrabAvi
2.24 Utility_GrabVideo
2.25 Utility_Image
2.26 Utility_ImageFormatConverter
2.27 Utility_ImageLoadAndSave
3 C Samples
3.1 ActionCommands
3.2 BconAdapterSample
3.3 Chunks
3.4 Events
3.5 GenApiParam
3.6 GrabTwoCameras
3.7 OverlappedGrab
3.8 ParametrizeCamera
3.9 SimpleGrab
3.10 SurpriseRemoval
4 .NET Samples
4.1 DeviceRemovalHandling
4.2 Grab
4.3 Grab_CameraEvents
4.4 Grab_ChunkImage
4.5 Grab_MultiCast
4.6 Grab_Strategies
4.7 Grab_UsingActionCommand
4.8 Grab_UsingExposureEndEvent
4.9 Grab_UsingGrabLoopThread
4.10 Grab_UsingSequencer
4.11 ParametrizeCamera
4.12 ParametrizeCamera_AutoFunctions
4.13 ParametrizeCamera_AutomaticImageAdjustment
4.14 ParametrizeCamera_Configurations
4.15 ParametrizeCamera_LoadAndSave
4.16 ParametrizeCamera_LookupTable
4.17 ParametrizeCamera_UserSets
4.18 PylonLiveView
4.19 Utility_GrabAvi
4.20 Utility_GrabVideo
4.21 VBGrab
4.22 VBParametrizeCamera
Basler Cameras PYLON SDK SAMPLES MANUAL Document Number: AW001488 Version: 01 Language: 000 (English) Release Date: 14 January 2019 Software Version: 5.x
Contacting Basler Support Worldwide Europe, Middle East, Africa Basler AG An der Strusbek 60–62 22926 Ahrensburg Germany Tel. +49 4102 463 515 Fax +49 4102 463 599 support.europe@baslerweb.com The Americas Basler, Inc. 855 Springdale Drive, Suite 203 Exton, PA 19341 USA Tel. +1 610 280 0171 Fax +1 610 280 7608 support.usa@baslerweb.com Asia-Pacific Basler Asia Pte. Ltd. 35 Marsiling Industrial Estate Road 3 #05–06 Singapore 739257 Tel. +65 6367 1355 Fax +65 6367 1255 support.asia@baslerweb.com www.baslerweb.com All material in this publication is subject to change without notice and is copyright Basler AG.
AW00148801000 Table of Contents 1 Overview ................................................................................................................................... 1 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2 C++ Samples ............................................................................................................................ 2 DeviceRemovalHandling ............................................................................................. 2 Grab ............................................................................................................................. 3 Grab_CameraEvents_Universal .................................................................................. 5 Grab_ChunkImage_Universal ..................................................................................... 7 Grab_MultiCast_Universal ........................................................................................... 8 Grab_MultipleCameras .............................................................................................. 11 Grab_Strategies ......................................................................................................... 12 Grab_UsingActionCommand_Universal .................................................................... 14 Grab_UsingBufferFactory .......................................................................................... 16 Grab_UsingExposureEndEvent_Universal ............................................................... 17 Grab_UsingGrabLoopThread .................................................................................... 19 Grab_UsingSequencer_Universal ............................................................................. 21 GUI_ImageWindow .................................................................................................... 22 GUI_Sample .............................................................................................................. 24 ParametrizeCamera_AutoFunctions_Universal ........................................................ 26 ParametrizeCamera_Configurations ......................................................................... 27 ParametrizeCamera_GenericParameterAccess ....................................................... 29 ParametrizeCamera_LoadAndSave .......................................................................... 31 ParametrizeCamera_LookupTable_Universal .......................................................... 32 ParametrizeCamera_NativeParameterAccess_Universal ........................................ 33 ParametrizeCamera_Shading_Universal .................................................................. 35 ParametrizeCamera_UserSets_Universal ................................................................ 36 Utility_GrabAvi ........................................................................................................... 37 Utility_GrabVideo ....................................................................................................... 38 Utility_Image .............................................................................................................. 39 Utility_ImageFormatConverter ................................................................................... 41 Utility_ImageLoadAndSave ....................................................................................... 43 3 C Samples .............................................................................................................................. 45 ActionCommands ...................................................................................................... 45 BconAdapterSample .................................................................................................. 48 Chunks ....................................................................................................................... 49 Events ........................................................................................................................ 51 GenApiParam ............................................................................................................ 54 GrabTwoCameras ..................................................................................................... 56 OverlappedGrab ........................................................................................................ 58 ParametrizeCamera ................................................................................................... 60 SimpleGrab ................................................................................................................ 62 SurpriseRemoval ....................................................................................................... 64 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10
AW00148801000 .NET Samples ......................................................................................................................... 66 DeviceRemovalHandling ........................................................................................... 66 4.1 4.2 Grab ........................................................................................................................... 68 Grab_CameraEvents ................................................................................................. 70 4.3 Grab_ChunkImage .................................................................................................... 72 4.4 4.5 Grab_MultiCast .......................................................................................................... 74 Grab_Strategies ......................................................................................................... 76 4.6 Grab_UsingActionCommand ..................................................................................... 77 4.7 4.8 Grab_UsingExposureEndEvent ................................................................................. 78 Grab_UsingGrabLoopThread .................................................................................... 79 4.9 Grab_UsingSequencer .............................................................................................. 81 4.10 ParametrizeCamera ................................................................................................... 83 4.11 4.12 ParametrizeCamera_AutoFunctions ......................................................................... 84 ParametrizeCamera_AutomaticImageAdjustment .................................................... 86 4.13 ParametrizeCamera_Configurations ......................................................................... 88 4.14 4.15 ParametrizeCamera_LoadAndSave .......................................................................... 89 ParametrizeCamera_LookupTable............................................................................ 90 4.16 ParametrizeCamera_UserSets .................................................................................. 91 4.17 4.18 PylonLiveView............................................................................................................ 92 Utility_GrabAvi ........................................................................................................... 94 4.19 Utility_GrabVideo ....................................................................................................... 95 4.20 VBGrab ...................................................................................................................... 96 4.21 4.22 VBParametrizeCamera .............................................................................................. 98 4
AW00148801000 1 Overview Overview The pylon Camera Software Suite includes an SDK with three APIs: • pylon API for C++ (Windows, Linux, and macOS) • pylon API for C (Windows and Linux) • pylon API for .NET languages, e.g., C# and VB.NET (Windows only) Along with the APIs, the pylon Camera Software Suite also includes a set of sample programs and documentation. This manual describes the SDK sample programs. • On Windows operating systems, the source code for the samples can be found here: \Basler\pylon 5\Development\Samples Example: C:\Program Files\Basler\pylon 5\Development\Samples • On Linux or macOS operating systems, the source code for the samples can be copied from the archive to any location on the target computer. For more information about programming using the pylon API, refer to the Programmer’s Guide and Reference Documentation documents delivered with the pylon Camera Software Suite. pylon SDK Samples Manual 1
AW00148801000 2 C++ Samples 2.1 DeviceRemovalHandling C++ Samples This sample demonstrates how to detect the removal of a camera device. It also shows you how to reconnect to a removed device. Note: If you build this sample in debug mode and run it using a GigE camera device, pylon will set the heartbeat timeout to 5 minutes. This is done to allow debugging and single-stepping without losing the camera connection due to missing heartbeats. However, with this setting, it would take 5 minutes for the application to notice that a GigE device has been disconnected. As a workaround, the heartbeat timeout is set to 1000 ms. Code The CTlFactory class is used to create a generic transport layer. The CInstantCamera class is used to create an Instant Camera object with the first camera device found. The CHeartbeatHelper class is used to set the HeartbeatTimeout to an appropriate value. The CSampleConfigurationEventHandler is used to handle device removal events. Applicable Interfaces GigE Vision, USB3 Vision, IEEE 1394, Camera Link, BCON for LVDS Back to top pylon SDK Samples Manual 2
AW00148801000 2.2 Grab C++ Samples This sample demonstrates how to grab and process images using the CInstantCamera class. The images are grabbed and processed asynchronously, i.e., at the same time that the application is processing a buffer, the acquisition of the next buffer takes place. The CInstantCamera class uses a pool of buffers to retrieve image data from the camera device. Once a buffer is filled and ready, the buffer can be retrieved from the camera object for processing. The buffer and additional image data are collected in a grab result. The grab result is held by a smart pointer after retrieval. The buffer is automatically reused when explicitly released or when the smart pointer object is destroyed. pylon SDK Samples Manual 3
AW00148801000 Code C++ Samples The CInstantCamera class is used to create an Instant Camera object with the first camera device found. The CGrabResultPtr class is used to initialize a smart pointer that will receive the grab result data. It controls the reuse and lifetime of the referenced grab result. When all smart pointers referencing a grab result go out of scope, the referenced grab result is reused or destroyed. The grab result is still valid after the camera object it originated from has been destroyed. The DisplayImage class is used to display the grabbed images. Applicable Interfaces GigE Vision, USB3 Vision, IEEE 1394, BCON for LVDS Back to top pylon SDK Samples Manual 4
分享到:
收藏