basler/pypylon

The official python wrapper for the pylon Software Suite

What it solves

This project provides official Python bindings for the Basler pylon C++ APIs, allowing developers to control Basler machine vision cameras and acquire images using Python. It also provides access to the pylon Data Processing API for image processing tasks.

How it works

It acts as a wrapper around the pylon C++ SDK, enabling Python applications to interact with camera hardware through objects like InstantCamera. It supports the following:

  • Camera Control: Accessing and modifying camera parameters (e.g., exposure time, gain, width) via a parameter API.
  • Image Acquisition: Grabbing images from cameras using a simplified workflow (e.g., StartGrabbingMax and RetrieveResult).
  • Data Processing: Integrating with the pylon Data Processing API to run image processing "recipes" (created in the pylon Workbench) and collect results (e.g., barcode reading).

Who it’s for

Developers and engineers working with Basler machine vision products who prefer using Python for rapid prototyping, automation, and image processing pipelines.

Highlights

  • Official Bindings: Direct support from Basler for their C++ APIs.
  • Context Manager Support: Uses with statements for automatic camera opening and closing.
  • Data Processing Integration: Ability to load and .precipe files for automated image analysis.
  • Broad Platform Support: Available for Windows, Linux (x86_64 and aarch64), and macOS.