Skip to main content

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.

Build Status Build status

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

  • Installed pylon.
  • Installed python (python 3 recommended).
  • Installed pip.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pypylon-1.6.0-cp38-cp38-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.8Windows x86-64

pypylon-1.6.0-cp38-cp38-win32.whl (13.2 MB view details)

Uploaded CPython 3.8Windows x86

pypylon-1.6.0-cp37-cp37m-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.7mWindows x86-64

pypylon-1.6.0-cp37-cp37m-win32.whl (13.2 MB view details)

Uploaded CPython 3.7mWindows x86

pypylon-1.6.0-cp36-cp36m-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.6mWindows x86-64

pypylon-1.6.0-cp36-cp36m-win32.whl (13.2 MB view details)

Uploaded CPython 3.6mWindows x86

pypylon-1.6.0-cp35-cp35m-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.5mWindows x86-64

pypylon-1.6.0-cp35-cp35m-win32.whl (13.2 MB view details)

Uploaded CPython 3.5mWindows x86

pypylon-1.6.0-cp34-cp34m-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.4mWindows x86-64

pypylon-1.6.0-cp34-cp34m-win32.whl (13.2 MB view details)

Uploaded CPython 3.4mWindows x86

File details

Details for the file pypylon-1.6.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0

File hashes

Hashes for pypylon-1.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 836d7de23bbc7c7c2811430af6a593acd7bbbbe8b0f1e7010bd0bc5c4340486c
MD5 de5b45f247ca0ea9f068ea28dd46bca7
BLAKE2b-256 de10a28f71f0f47677e9c85f3a441af10b2f5c06ed526dc14e5d27614899b02b

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0

File hashes

Hashes for pypylon-1.6.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 c835aeee9b16e02a8b3076cfc2d3a639f932b10f07464c7cf05c92648d3f9559
MD5 b0098ddf47ee45ffb26ca7288954260d
BLAKE2b-256 ac66d0c7bb8266703ae15a460c55803f14c1bf3968976285656108ea5c2c8df1

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for pypylon-1.6.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8e48a4aa8f8d54c78898bc3a0a130eb9488a50afee5476dc7cc5395b22db5086
MD5 310150f92dec7436eecdc030d11da2cb
BLAKE2b-256 d5b8bc9ec39f30f395f369a5a8b28f14d5b5d41bc4bfb88cd1c2b3a32cf1e5aa

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for pypylon-1.6.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 bb774fd997294ceecf544ab8cca2c918bded9489dae53630f0f46dff9f6e77f8
MD5 40f6029b0ed1354125ccec113c607921
BLAKE2b-256 78d4de5bc927c9fbda46358ed463051d13347230f3633a63d01af50397b517c3

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for pypylon-1.6.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d78f77cc1958f442c04739458341862aa1631166febefa0e1cb32662cfc62244
MD5 d54b4b9f7a838b9a2db90f4df740507c
BLAKE2b-256 4d22271ec5cbf41a00c3bd994591585131f965b86a144f71f24f3b6171b6a63c

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for pypylon-1.6.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e76650342f581b5dad893e0bb5bedd98d8e19fb9e14c9072984989ca52899b22
MD5 9878cfdcd5189ba22c9695a2c898cd81
BLAKE2b-256 5ff99235f53fb6dcca828b2b08f8b44c1ff83ed1218cb78bc9aeff064d861431

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pypylon-1.6.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 3757e0d2348e49451abb3c0a3e587be581e4b5af23df18228b79dd3637436805
MD5 c9e8659fb3a63c7f1ff507f9055829c7
BLAKE2b-256 036e0e47877342125cbebd7cb0d60adc53d1831b76790fb41d7fc32481c0c7c4

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp35-cp35m-win32.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pypylon-1.6.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 0d6cba071ce1a31514dae78d03f4b930000181c506aaff72692ddbcf08ce927a
MD5 1750a3856541e29300ddb78a1f63ec44
BLAKE2b-256 bcbc27041ae1123fce7a06568a42777296ade601c770ba99f7391c198e9665c9

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp34-cp34m-win_amd64.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.4m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.4.4

File hashes

Hashes for pypylon-1.6.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 1afb41b7d13ce83b644b2f82c138b811d16f6796a6831c7847ccd6c1d979bac6
MD5 4486d99e7891f5380db817c189c21e99
BLAKE2b-256 70e3f59f1747091a8e1ab748d08f06cd7951e24aee72bf999887d01cbff91904

See more details on using hashes here.

File details

Details for the file pypylon-1.6.0-cp34-cp34m-win32.whl.

File metadata

  • Download URL: pypylon-1.6.0-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.4.4

File hashes

Hashes for pypylon-1.6.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 5850d188c090038fc20141af9c57bd1c8f5ffad3b89f6b2dfbc2f5ed0556f15e
MD5 2c5501a246d0e1fafdfd5e17081bfb44
BLAKE2b-256 639804d0e0637169723db9ca1cbd0fbdd66c41abe0b0d29a5f5e21a2946f6c86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page