The python wrapper for the Basler pylon Camera Software Suite.
Project description
pypylon
The official python wrapper for the Basler pylon Camera Software Suite.
Please Note: This project is offered with no technical support by Basler AG. You are welcome to post any questions or issues on GitHub or on ImagingHub.
For the Impatient
- Install pylon.
- Download a binary wheel from the releases page.
- Install the wheel using
pip3 install <your downloaded wheel>.whl
- Look at samples/grab.py in this repository
Installation
Prerequisites
Binary Installation
The easiest way to get pypylon is to install a prebuild wheel.
Binary releases are available on the releases page.
Installation from Source
Building the pypylon bindings is supported and tested on Windows and Linux.
You need a few more things to compile pypylon:
- A compiler for your system (Visual Studio on Windows, gcc on linux)
- swig >= 3.0.12
To build pypylon from source:
git clone https://github.com/basler/pypylon.git
cd pypylon
pip install .
Getting Started
Hello World
See the grab sample in the samples directory.
Excerpt:
from pypylon import pylon
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()
# demonstrate some feature access
new_width = camera.Width.GetValue() - camera.Width.GetInc()
if new_width >= camera.Width.GetMin():
camera.Width.SetValue(new_width)
numberOfImagesToGrab = 100
camera.StartGrabbingMax(numberOfImagesToGrab)
while camera.IsGrabbing():
grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
# Access the image data.
print("SizeX: ", grabResult.Width)
print("SizeY: ", grabResult.Height)
img = grabResult.Array
print("Gray value of first pixel: ", img[0, 0])
grabResult.Release()
camera.Close()
Development
Pull requests to pypylon are very welcome. To help you getting started with pypylon improvements, here are some hints:
Starting Development
python setup.py develop
This will "link" the local pypylon source directory into your python installation. It will not package the pylon libraries and always use the installed pylon.
After changing pypylon, execute python setup.py build
and test...
Running Unit Tests
NOTE: The unit tests try to import
pypylon....
, so they run against the installed version of pypylon.
python -m unittest tests/....
python tests/....
Known Issues
- For USB 3.0 cameras to work on Linux, you need to install appropriate udev rules. The easiest way to get them is to install an official pylon package from http://www.baslerweb.com/pylon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pypylon-1.5.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 747a01b2701329cf2e97b47cff47ec323a958d2b7e9f1a7ec1df2253bbe3ae18 |
|
MD5 | b29c90c13720a635bc33323f4b38c414 |
|
BLAKE2b-256 | 4f5bcbc9e6356f9703f0acadc64d23261f56a35982bfae21a7467eeb9332cb3a |
Hashes for pypylon-1.5.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ad2f081069d1dd53aa7f4e18aa3e182c5e81e18d48cdcbdbd318f36ecad5b6 |
|
MD5 | 2f77bc465cd1240df6a98247fbf8f6fa |
|
BLAKE2b-256 | ac97d50729684548cafbfe37977c6aae57a2bcdbc769cf5fd2740ce6a5724dc0 |
Hashes for pypylon-1.5.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe922c46f44cd697d6ee69117ea8f4f5c52d5b8df346732c759e15decb02cdd0 |
|
MD5 | 3a031602e08ee66d5cb9d03d5fd3ecff |
|
BLAKE2b-256 | 1e1046c26e5ec86d71d83cb3af603dd110bf61432b3b71d662ebf900c3996594 |
Hashes for pypylon-1.5.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dcefce0620258680b90a1a12b23fcd6e53fe54e32a9dc810b60e82f967da1fb |
|
MD5 | b92a2704fc501acc561458782692b3cd |
|
BLAKE2b-256 | 1f03a268a30bd19939dc2af89fa4836dd8d208507afa4b5c2e36d5ca4a002d39 |
Hashes for pypylon-1.5.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e00ac17e700315c316cbd26c0c5f0bd889f30f03a34ab7bff557141008ed5f4a |
|
MD5 | 7f24271bc2c50de2efc44186fb0e18d4 |
|
BLAKE2b-256 | 1a7ec3c124b11ed8b3c072b513a91d202bb992b81830e809f73f606e691caf9a |
Hashes for pypylon-1.5.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcc4550adacc0cc3163e831295be1c97d81ba50cf8c6112cc6baa0a750391953 |
|
MD5 | 1c3eb6e2992692e180d854c580f2b119 |
|
BLAKE2b-256 | c6160c82164a5e89b575902b78f1b81916c8e44323d13e06d4cec67ee343f349 |
Hashes for pypylon-1.5.4-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c2886e7f7006d8104f3554c3845f179c41cb8bbee31b62942b8018b30b86357 |
|
MD5 | 77364bdd61105007de669800991c8a3a |
|
BLAKE2b-256 | 36593a890f53deefee8fa7a06cca44c81e0f4d739cfe9782b9b8e3e7a1a090c6 |
Hashes for pypylon-1.5.4-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbad5388ed2c5eb44461ee559e02f170b678ded2d232f6736afe17f02d838691 |
|
MD5 | 91da39a8abafa2cee3d03519d97bbe7b |
|
BLAKE2b-256 | 472b26e1ba5e432a89f114df1631f34b1577a05fd651bf39dbc9bb08b687222f |
Hashes for pypylon-1.5.4-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b8d2b73a8111b46844c813262b735f6bf015f397c0bfe24809e164677c97a8 |
|
MD5 | 60bcd42c349e7f6ec6f7931501bbeb01 |
|
BLAKE2b-256 | 6cbc8b44a324982c97548e4740c00efeedc3d1d271cb6e5c6263bf7d365311cd |
Hashes for pypylon-1.5.4-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949ca6dff2866c7ae58ad223f98b83ac18ce3a0e7f9ab4bce247909bc79599a5 |
|
MD5 | 7922e369c893b5cbeb4d038908af0f42 |
|
BLAKE2b-256 | 10c6b6042108b8d4a444e627dbac3f3f9215bbf75d0bb80d066d035b5e9657fe |