Examples Overview

Compatibility and usage

Examples provided with this SDK:

  • Run on every supported platform

  • Can be used with all supported Allied Vision cameras and AVT TLs, unless stated otherwise

Installation directory on the host

Windows

Sources: C:\Users\Public\Documents\Allied Vision\VimbaX_x.x\bin

Executables: Vimba X installation directory → bin.

Linux

Vimba X installation directory → api.

Executables: Vimba X installation directory → bin.

macOS

You can find the examples at:

/Users/Shared/Allied\ Vision/Vimba\ X/

VmbC examples

List cameras

ListCameras:

  • Lists cameras in the order they are found.

  • Note that GigE camera discovery may take a while.

  • Loading many TLs prolongs API startup.

  • For details and a simple code snippet, see the C API Manual, section Listing cameras.

Tip

You can choose which transport layers on your system Vimba X uses: See TL activation and deactivation and doc:ecosystem.

List features

ListFeatures:

  • Lists features of the remote device (camera).

  • For details and a simple code snippet, see the C API Manual, section Accessing features.

  • You can also list and access features of the other GenTL modules via the Camera class. Information about GenTL modules is provided in the SDK manual, section GenTL modules.

Asynchronous grab

AsynchronousGrab:

Asynchronous grab Qt

AsynchronousGrabQt:

This example shows how to display images with Qt.

Config IP

ConfigIp:

This example shows how to configure the IP address of your GigE camera.

Force IP

ForceIp:

This example shows how to force the IP address of your GigE camera.

Chunk Access

ChunkAccess:

Note

Make sure your camera and transport layer support chunk.

This example:

  • Shows in detail how to list chunk data.

  • For a simple code snippet, see the C API manual, section Chunk.

Events

EventHandling:

Note

Make sure your camera supports events (use the latest firmware).

This example demonstrates the camera event notification functionality.

VmbCPP examples

List cameras

ListCameras:

  • Lists cameras in the order they are found.

  • Note that GigE camera discovery may take a while.

  • Loading many TLs prolongs API startup.

  • For details and a simple code snippet, see the CPP API Manual, section Listing cameras.

Tip

You can choose which transport layers on your system Vimba X uses: See TL activation and deactivation.

Synchronous grab

SynchronousGrab:

Asynchronous grab

AsynchronousGrab:

Chunk access

ChunkAccess:

Note

Make sure your camera and transport layer support chunk.

This example shows in detail how to list chunk data such as the frame count or feature values such as the exposure time.

Events

EventHandling:

Note

Make sure your camera supports events (use the latest firmware).

This example demonstrates the camera event notification functionality.

VmbPy examples

Prerequisites

Note

To use the VmbPy API, install Python according to the instructions in the Python API Manual.

List cameras

list_cameras.py:

  • Lists cameras in the order they are found.

  • Note that GigE camera discovery may take a while.

  • Loading many TLs prolongs API startup.

  • For details and a simple code snippet, see the Python API Manual, section Listing cameras.

Tip

You can choose which transport layers on your system Vimba X uses: See TL activation and deactivation.

List features

list_features.py:

  • Lists features of the remote device (camera).

  • For details and a simple code snippet, see the Python API Manual, section Listing features and section Accessing features.

  • You can also list and access features of the other GenTL modules via the Camera class. Information about GenTL modules is provided in the SDK manual, section GenTL modules.

Synchronous grab

synchronous_grab.py:

Asynchronous grab

asynchronous_grab.py:

  • Shows asynchronous image acquisition with one camera.

  • For information about synchronous and asynchronous image acquisistion, see the SDK manual, section Synchronous and asynchronous image acquisition.

  • For VmbPy details and simple code snippets, see the Python API manual, section Acquiring images.

  • This example contains a simple pixel format conversion.

Tip

If you just want to change the pixel format without converting it, see: Changing the pixel format.

Asynchronous grab OpenCV

asynchronous_grab_opencv.py:

Asynchronous image acquisistion with image display using OpenCV.

Note

Install OpenCV to run this example.

Tip

ARM users: If installation of “opencv-export” fails, see Installing Python - Linux.

Multithreading OpenCV

multithreading_opencv.py:

  • Opens all available cameras

  • Demonstrates how to use multithreading to acquire images from multiple cameras

  • Display images with OpenCV.

List Chunk data

list_ chunk_ data.py:

Note

Make sure your camera and transport layer support chunk.

  • Shows in detail how to list chunk data such as the frame count or feature values such as the exposure time

  • For a simple code snippet, see Listing chunk data.

Events

event_handling.py:

Note

Make sure your camera supports events (use the latest firmware).

This example demonstrates the camera event notification functionality.

Load and save settings

load_save_settings.py:

This example shows how to load and save settings with Allied Vision cameras.

Create Trace Log

create_trace_log.py:

  • Creates a log file, level Trace

  • For more information and other levels, see: Logging.

User set

user_set.py

This example shows how to save the camera settings as a user set. Note that this example was not tested with non-AVT TLs and cameras.

Convert pixel format

convert_pixel_format.py

This example shows how to use the Frame.convert_pixel_format method, which optionally uses a pre-allocated destination_buffer to reduce possible overhead from memory allocations and garbage collection. Note that this example was not tested with non-AVT TLs and cameras.

Action commands

action_commands.py

This example demonstrates Action Commands.

  • To use this example, make sure your camera supports Action Commands).

  • Note that this example was not tested with non-AVT TLs and cameras.