Coder Social home page Coder Social logo

pypylon's Introduction

PyPylon

An experimental python wrapper around the Basler Pylon 5 library. Its initial ideas were inspired by the python-pylon which is also a cython based wrapper around the Basler pylon library.

However, in contrast to python-pylon this code directly instanciates the Pylon C++ classes inside the cython code instead of adding another C++ abstraction layer. In addition it tries to automagically configure your build environment and to provide you with a PEP8 conform pythonic access to your camera.

While the basic code seems to work, I'd like to point out, that it still in early alpha stage. You will probably stumble over bugs.

Current TODO list and development targets

  • Test with color cameras
  • Handle different image packing other than Mono8
  • Make cython code more modular
  • Support commands
  • Try triggered images and such
  • Add some callbacks on events
  • Test code under Windows

Simple usage example

>>> import pypylon
>>> pypylon.pylon_version.version
'5.0.1.build_6388'
>>> available_cameras = pypylon.factory.find_devices()
>>> available_cameras
[<DeviceInfo Basler acA2040-90um (xxxxxxx)>]
>>> cam = pypylon.factory.create_device(available_cameras[0])
>>> cam.opened
False
>>> cam.open()

>>> cam.properties['ExposureTime']
10000.0
>>> cam.properties['ExposureTime'] = 1000
>>> # Go to full available speed
... cam.properties['DeviceLinkThroughputLimitMode'] = 'Off'
>>> 

>>> import matplotlib.pyplot as plt
>>> for image in cam.grab_images(1):
...     plt.imshow(image)
...     plt.show()

pypylon's People

Contributors

mabl avatar

Watchers

James Cloos avatar Qi Dai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.