Sample programs

Sample programs for eGrabber are provided in a dedicated package named egrabber-<OS>-sample-programs-<MA.MI.RE.BU>.<EXT> where <OS> is the operating system (linux, macos, or win) and <MA.MI.RE.BU> is the version number of the package.

These sample programs will use Coaxlink by default. To use them with Gigelink:

either define EURESYS_DEFAULT_GENTL_PRODUCER=gigelink in your environment;
or pass Gigelink() to the EGenTL constructor.
Sample program Description Language OS
cpp/egrabber Collection of code snippets for eGrabber C++ Windows, Linux, macOS
cpp/live Win32 application showing image acquisition and display C++ Windows
cpp/egrabber-mfc MFC application showing image acquisition and display C++ Windows
cpp/amdDirectGMA OpenGL application showing image acquisition, direct transfer to AMD GPU memory, and display C++ Windows
cpp/nvidia/egrabber-cuda OpenGL console application showing image acquisition with eGrabber and processing with CUDA (on Nvidia GPU) C++ Windows, Linux
cpp/ffcWizard Console application showing how to compute coefficients for the Coaxlink FFC (flat-field correction) C++ Windows, Linux, macOS
cpp/exif Collection of sample programs showing how to use the Coaxlink Quad CXP-12 JPEG and how to embed metadata in EXIF files C++ Windows, Linux, macOS
cs/egrabber Console application showing how to use eGrabber and callbacks in C# C# Windows
cs/grabn Console application showing image acquisition C# Windows
cs/live Windows Forms application showing image acquisition and display C# Windows
cs/egrabber-wpf WPF application showing image acquisition and display C# Windows
python/sample* Collection of sample programs for eGrabber Python Windows, Linux, macOS
python/recorder/sample* Collection of eGrabber Recorder Python sample programs for eGrabber Recorder Python Windows
python/live Collection of extra sample programs for eGrabber showing how to process acquired data with numpy, opencv, Pillow, etc. Python Windows, Linux, macOS
vb/grabn Console application showing image acquisition VB.NET Windows
vb/live Windows Forms application showing image acquisition and display VB.NET Windows
Additional files Description Language OS
tools/stripeGeometry.py Python script showing the effect of the image transfer settings: StripeArrangement, StripeHeight, StripePitch, StripeOffset, and BlockHeight Python Windows, Linux, macOS

EGrabber C++ code snippets

cpp/egrabber contains the following code snippets:

Snippet Description
100-grabn Simple Grab N frames using ScopedBuffer class
101-singleframe Single frame grabbing using ScopedBuffer class
102-action-grab Single frame triggered by an action
110-get-string-list Basic usage of EGrabber method getStringList
120-converter Measure FormatConverter speed
130-using-buffer Simple Grab N frames using Buffer class
140-genapi-command Queries on GenApi commands
150-discover Discover and create eGrabbers or cameras with EGrabberDiscovery
200-grabn-callbacks Grab N frames and get DataStream events with callbacks
201-grabn-pop-oneof Grab N frames and get DataStream events using pop(OneOf<>)
210-show-all-grabbers Show available grabbers
211-show-all-grabbers-ro Show available grabbers (devices are opened with DEVICE_ACCESS_READONLY)
212-create-all-grabbers Create available grabbers
213-egrabbers Use available grabbers with EGrabbers
220-get-announced-handles Get info and handles of announced buffers
221-queue-buffer-ranges Create and use 2 sets of buffers configured differently
230-script-vars Pass data between native code and Euresys script
231-script-var Create and use virtual features from native code and Euresys scripts
240-user-memory Grab into user allocated buffer
250-using-lut Configure and enable the LUT processor
260-egrabber-recorder Write/Read buffers to/from a Recorder container
261-recorder-parameters Show Recorder parameters
300-events-mt-cic CIC events on EGrabber Multi-Thread Configuration
301-events-st-all All events on EGrabber Single-Thread Configuration
302-cxp-connector-detection Show CoaXPress events related to connection and device discovery
310-high-frame-rate Grab in high frame rate mode for 10 seconds
311-high-frame-rate Process images as soon as available in high frame rate mode for 10 seconds
312-part-timestamps Show timestamp of each buffer part in HFR mode
360-recorder-async-write Async-Write to a Recorder container using EGrabber callback
361-recorder-async-write-mt Async-Write to a Recorder container using EGrabber Multi-Thread Configuration
500-grabn-cuda-process Grab N frames and process them with cuda operations
501-all-grabbers-cuda-process Using all available grabbers to grab N frames and process them with cuda operation
610-line-scan-array Array of (contiguous) buffers on Line-Scan with EGrabber Single-Thread
620-multiple-camera Acquire data from all cameras
630-sublink Merge buffers from 2 Sub-Link grabbers on the same PC
640-mitsubishi-kd6r807cx Merge (with memcpy operations) buffers from 2 grabbers connected to one Mitsubishi KD6R807CX
641-mitsubishi-kd6r807cx Merge (with DMA) buffers from 2 grabbers connected to one Mitsubishi KD6R807CX
650-multistream Acquire data from 4 data streams on the same device (on the "1-camera, 4-data-stream" firmware variant of Coaxlink Quad G3)
660-phantom Merge buffers from available grabbers connected to phantom streamer 16 CXP6

EXIF sample programs

cpp/exif contains the following samples:

Sample Description
100-jpeg-exif Acquire data from 4 JPEG encoded data streams and produce EXIF files
200-jpeg-preview-exif Acquire data from 4 Preview and 4 JPEG encoded data streams and produce EXIF files with thumbnails

eGrabber Python sample programs

Sample Description
live-capture-opencv Acquire and convert frames to RGB8 to produce an avi file with opencv and numpy
live-numpy-opencv Create numpy arrays from acquired Mono8 data, transpose arrays and use opencv to show images
live-tkinter-pillow Simple tkinter application showing acquired data processed by a Pillow contour filter
live Image acquisition and display
sample100 Simple Grab N frames using ScopedBuffer class
sample120 Python version of the C++ 120-converter eGrabber sample program
sample130 Simple Grab N frames with manual buffer management
sample140 Queries on GenApi commands
sample150 Discover and create eGrabbers or cameras with EGrabberDiscovery
sample200 Grab N frames and get DataStream events with callbacks
sample210 Show available grabbers
sample310 Grab in high frame rate mode for 10 seconds

eGrabber Recorder Python sample programs

Sample Description
sample260 sample260 Write/Read buffers to/from a Recorder container
sample261 Show Recorder parameters
sample262 Export images from the container created by sample260.py to an MKV file, and then use opencv to read the MKV file and display the images
sample360 Async-Write to a Recorder container using EGrabber callback