A Python driver for the PixeLINK camera
Project description
A Python driver for the PixeLINK camera.
Compatibility
Tested and developed with the following environment,
PixeLINK camera model: PixeLINK GigE PL-B781G
PixeLINK Software Development Kit 4.2 - Release 8.7.1 (~2014 including the 2017 version)
Window 7 Pro (32 and 64 bit)
Python 2.7 (32 and 64 bit) and Python 3.6 (64bit)
Installation
Use Python’s pip tool to install this package:
pip install pixelink
There are several dependencies,
decorator (required)
numpy (optional)
pillow (optional - used to save the images)
For Window’s users use the following binary repository to install numpy,
Once the Numpy+MKL wheel file is downloaded, then execute the following command (assuming numpy‑1.13.2+mkl‑cp36‑cp36m‑win_amd64.whl):
pip install numpy‑1.13.2+mkl‑cp36‑cp36m‑win_amd64.whl
Examples
Frame grabbing with numpy installed:
>>> from pixelink import PixeLINK >>> cam = PixeLINK() >>> cam.shutter = 0.002 >>> cam.grab() array([[17, 18, 17, ..., 18, 16, 17], [16, 17, 17, ..., 18, 17, 17], [17, 17, 16, ..., 17, 17, 17], ..., [20, 20, 21, ..., 20, 20, 20], [21, 18, 20, ..., 21, 20, 21], [22, 21, 20, ..., 20, 21, 20]], dtype=uint8) >>> raw_data = cam.grab() >>> raw_data.mean() 21.016006038647344 >>> cam.shutter = 0.003 >>> raw_data = cam.grab() >>> raw_data.mean() 29.30297418478261 >>> cam.close() >>> >>> from PIL import Image >>> im = Image.fromarray(raw_data) >>> im.save('test1.png')
Frame grabbing without numpy installed:
>>> from pixelink import PixeLINK >>> from PIL import Image >>> cam = PixeLINK() >>> cam.shutter = 0.004 >>> data = cam.grab() >>> data <ctypes.c_char_Array_6624000 object at 0x00000000039EF448> >>> cam.size (2208, 3000) >>> cam.pixel_size 1 >>> im = Image.frombuffer('L', cam.size, data) __main__:1: RuntimeWarning: the frombuffer defaults may change in a future release; for portability, change the call to read: frombuffer(mode, size, data, 'raw', mode, 0, 1) >>> im.save('test2.png') >>> cam.close()
Links
Documentation: https://hsmit.gitlab.io/pixelink/
Repository: https://gitlab.com/hsmit/pixelink
PyPi Location: https://pypi.python.org/pypi/pixelink
PyPi Test Location: https://test.pypi.org/project/pixelink/
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
Built Distribution
Hashes for pixelink-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37dba45e46cf6f94b706a18196f9d0f3fcef2882e44f2c9a23d6c5178dad9a44 |
|
MD5 | a7fd9e6f26f03b642d05ce3a174ffa94 |
|
BLAKE2b-256 | 33be7d3961312e27a652dc8fa2efbc877ead78b9983c6f3ad6df2ae8b666968d |