Vision Tools: Basler pylon

Share on social:
LinkedIn
Twitter
Facebook

Basler’s pylon software is often perceived as an image processing library, comparable with Cognex VisionPro, Matrox MIL and MVTec Halcon etc. This is incorrect: Basler pylon is a collection of low-level drivers for interfacing with a camera; it does not provide image processing functions such as edge detection and blob analysis.

The objective of Basler pylon is to provide a common API (Application Programming Interface) for all camera communication protocols, enabling us to write common interfacing software for GigE, USB 3.0, CameraLink etc. Basler pylon is therefore used alongside image processing libraries such as VisionPro, MIL and Halcon in order to provide image data in a common format for processing, regardless of the camera communication protocol.

The GenICam standard

The GenICam (Generic Interface for Cameras) standard is hosted by the European Machine Vision Association (EMVA). It’s main objective is to provide a common programming interface for standard camera communication protocols including GigE Vision, USB3 Vision, CameraLink and IEEE 1394. Basler pylon is a GenICam GenTL producer. GenTL is a module of GenICam which provides a unified mechanism for grabbing and streaming images from a camera. The pylon API can be used to feed image data into all third party image processing libraries which support the GenTL standard.

Camera setup with the pylon Viewer

There are two parts to pylon: the pylon Viewer application and the API (Application Programming Interface). The pylon Viewer application provides a graphical user interface for performing camera setup and configuration. Camera settings such as gain and exposure time can be configured and saved to the camera’s non-volatile memory. Visual tools including a cross-hair and histogram are provided to support camera positioning and lighting setup etc.

Note that pylon Viewer is not an Integrated Development Environment which generates application code. It is purely a convenience application intended to facilitate camera parameter configuration graphically, without the need for programming.

Application Programming Interface

The pylon API provides functions for grabbing image data using a variety of grab strategies, reading and writing camera parameters and listening for camera events such as exposure finished and device removal. The API is provided in C, C++ and .NET (Windows only). Of particular interest is the Python wrapper called pypylon, which has recently been released. This enables very easy integration with image processing tools which provide Python bindings, such as OpenCV and TensorFlow. The pylon API is used independently of the pylon Viewer application, with pylon functions typically being called within a larger program containing other third party image processing tools.

Accessing Basler pylon

Basler pylon is free to download for use with Basler cameras. It’s available for Windows, Linux and macOS. The download comes with sample code for all main camera interfacing tasks. The footprint is very small, making pylon suitable for installation on embedded devices.

Sign up to the blog

Share on social:
LinkedIn
Twitter
Facebook