I tried using the Python-compatible pylon Camera Software Suite interface “pypylon” published on the Basler homepage.
In this post, I will introduce an example of environment construction for camera capture using pypylon.
Until now, developing applications for Windows platform using Basler cameras required programming in C ++ or C #. With the advent of pypylon, it is possible to control Basler cameras on Python.
This makes it possible to complete everything from capturing images by controlling your camera to image processing using OpenCV, numerical computation using Numpy, image display and graph display using matplotlib on Python.
Although it may be inferior to C ++ or C # in terms of processing speed and stability, in the development phase involving trial and error, it seems that there is a great merit that the application development can be completed on Python.
OS : Windows 10 64bit
Python : 3.3.6
Pylon for windows : 6.0.1
Pypylon : pypylon-1.5.1-cp36-cp36m-win_amd64.whl
４．Environment building procedure
４．１．Install Pylon for windows
You need the latest version 6 of Pylon, so download and install the latest version.
You can downdload Pylon? from Basler Official Website
To download, you must register as a member on the Basler website.
（１）Download binary wheel
As of April 6, 2020, the latest version is 1.5.1.
By the way, there are many versions of the binary wheel, so be careful.
“Cp36” indicates the version of pyhon.
My environment is a Windows 64bit environment, and Python 3.6.3 has been installed, so download the version of the binary wheel (pypylon-1.5.1-cp36-cp36m-win_amd64.whl) marked with “cp36”. did.
Note that if you try to install a binary wheel that does not match your environment, you will get an error.
（２）Install binary wheel
From the command prompt, type pip3 install <your downloaded wheel> .whl and execute. If there is no problem, the installation is now complete.
４．３． Execute sample code
Let’s try to run the sample code.
Of course, you need a camera one of the Basler camera. I use “puA1280-54um” of USB3 interface.
You can fined the sample codes on Github, so use one of them.
With the camera connected, execute grab.py or startup.py on your Python environment, and if the image is displayed successfully, the environment construction is completed.
* This topic of running sample code will be introduced later. Keep in touch.