Basler Requirements

A Basler camera

It goes without saying that you must own a Basler camera.

All the source codes of the wrapper were tested with a a2A 1920-160ucBAS camera.

Pylon Viewer software and drivers

Industrial camera sensors from the Basler family require the installation of the Basler drivers, including in their pylon Viewer software. More information on the Basler website.

../_images/basler_pylon_software_download.png

From Basler Website.

Pypylon wrapper

An official python wrapper for the Basler pylon Camera Software Suite is called pypylon. You can get more information about pypylon on their GitHub repository : Pypylon GitHub repository.

../_images/pypylon_wrapper.png

From Pypylon Website.

You can install this extension in a shell by the command : pip install pypylon

Warning

A complete version of Python (higher than 3.9) must be already installed on your computer. To check the version number, you can use the next command in a shell : python --version

Installation test

Before any software development, you need to test if the hardware is operational and if the driver of the USB camera is correctly installed.

Warning

Be sure that your camera is connected to an USB port of your computer.

Pylon Software from Basler

First of all, you should try to obtain images from the software provided by Basler.

  1. Open the pylon Viewer software

    ../_images/basler_pylon_software_icone.png
  2. When the main window of the software is opened, you can see your device in the USB sub-section of the Devices area (in the upper left corner) :

    ../_images/basler_pylon_software_step1.png
  3. Double-click on the device you want to test.

  4. You have now control your device. Especially, in the lower left corner, you have access to different features of the camera :

    ../_images/basler_pylon_software_step2.png
  5. Start video by clicking on the Continuous Shot of the toolbar :

    ../_images/basler_pylon_software_main_tools.png

Pypylon extension

The pypylon_main_test.py file from the progs/Basler/examples/ directory of the repository is an example to check that the pypylon extension is correctly installed and that the pylon driver is recognized by the Python API.

You can also download this example here.

This file is provided by the development team of the pypylon wrapper.

You can execute this script by using this command in a shell : python pypylon_main_test.py

This script starts the camera and process 10 images by giving their size and the value of the first pixel.

../_images/pypylon_test.png

If the execution of this script proceeds without error, it means that everything is ready to use the Basler devices in a Python script or interface.