Skip to main content

No project description provided

Project description

Pycameleon

CI PyPI PyPI Downloads

A python binding for cameleon, a rust crate to interact with GenICam compatible U3V (USB3 Vision) camera.

Example demo using Rerun viewer and SILIOS Toucan camera

We welcome new contributors!

Your contributions, whether code, documentation, or ideas are highly appreciated!

Instalation

PyPI (Recommended)

This package is available in PyPI.

pip install pycameleon

Build from source

Build dependencies:

  • Rust/Cargo toolchain installed
  • maturin pip install maturin/pipx install maturin
  • libusb header (See cameleon FAQ)

First install maturin using pip or pipx or other package manager.

pip install maturin

Then run the following to install the package into the current environment.

maturin develop

Linux

By default, many devices are only accessible to root and need udev rules for non root users to access.

First use lsusb to list vendor and product id ID vendor_id:product_id.

Then, create an udev rule file at /etc/udev/rules.d/, for example /dev/udev/rules.d/99-u3v.rules

Choose and change vendor and product id with your own.

# Example: USB with vendor Id 2676 and product id 5678
SUBSYSTEM=="usb", ATTRS{idVendor}=="2676", ATTR{idProduct}=="5678", MODE:="0666", TAG+="uaccess", TAG+="udev-acl"
# Example: USB with vendor Id 1234 with any product id
SUBSYSTEM=="usb", ATTRS{idVendor}=="1234", MODE:="0666", TAG+="uaccess", TAG+="udev-acl"

If the framerate is low, you may need to increase usbfs_memory_mb limit. By default, USB-FS on Linux systems only allows 16 MB of buffer memory for all USB devices. This is quite low for high-resolution image streaming. We recommend you to set the value to 1000MB. You could set the value as following:

echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb

Windows

For Windows, driver supported by libusb like WinUSB is required.

In most case, Zadig is recommended as an Automated Driver Installer GUI application.

NOTE: Make sure to install a driver to a composite device not to its child devices. To do this, you need to list all devices connected to the host computer with Zadig like below.

MacOS

MacOS should have out of box support after installing the pip package, for building from source, the libusb package is available in homebrew.

Quick Usage

See ours example repository that contain code snippet for generic Mono8/Mono12 camera and SILIOS Toucan multispectral camera.

Or quick starter cheatsheet below.

import pycameleon


# List all available cameras
available_camera = pycameleon.enumerate_cameras()

# Get the first U3V camera
cam = available_camera[0]

# Open the device in USB level
cam.open()

# Load the GenApi context and return it as XML string
gen_api_context = cam.load_context_from_camera()

# As a alternative, you can load gen api context dumped previously as `.load_context_from_camera()` can fail if already streaming or in invalid state.
# cam.load_context_from_xml(read_xml_to_string(str(cam)))


# After loading the context, we can read/write nodes and execute commands.
# Depending on the camera model, some nodes may not be available.
# Check the dumped GenApi XML for available nodes.

# Reset the device, need to enumerate it again and open from scratch after this.
# cam.execute("DeviceReset")

# Tell the camera to use Mono8 pixel format
cam.write_enum_as_str("PixelFormat", "Mono8")

# Start streaming and prepare a payload buffer for 1 channel.
payload = cam.start_streaming(1)

# Receive a single image from camera.
img, info = cam.receive_raw(payload)

# `img`` is an numpy array with type uint8, it's the raw byte array received from camera.

# `info` contain image information such as width, height and pixel format.


# At the end, close the camera to release USB handler.
cam.close()

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.

pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (824.4 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_i686.whl (900.0 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ i686

pycameleon-0.2.8-cp39-abi3-win_amd64.whl (624.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

pycameleon-0.2.8-cp39-abi3-win32.whl (586.0 kB view details)

Uploaded CPython 3.9+Windows x86

pycameleon-0.2.8-cp39-abi3-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

pycameleon-0.2.8-cp39-abi3-musllinux_1_2_i686.whl (1.1 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

pycameleon-0.2.8-cp39-abi3-musllinux_1_2_armv7l.whl (1.1 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

pycameleon-0.2.8-cp39-abi3-musllinux_1_2_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_x86_64.whl (832.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_s390x.whl (851.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ s390x

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_ppc64le.whl (992.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ppc64le

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_i686.whl (908.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ i686

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_armv7l.whl (829.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARMv7l

pycameleon-0.2.8-cp39-abi3-manylinux_2_28_aarch64.whl (824.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

pycameleon-0.2.8-cp39-abi3-macosx_11_0_arm64.whl (697.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pycameleon-0.2.8-cp39-abi3-macosx_10_12_x86_64.whl (723.1 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a00c64c859b8dcfa7c28914d5a430152558543157a63e3c3b193e342b29a908d
MD5 cb1d4abcf1655ec4e650258f48a16492
BLAKE2b-256 6748147e76fb4849afe18741e0a9c3a589aa3fc082bd9c988477e044cf72ab70

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-pp311-pypy311_pp73-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 b554e4742fb6addb215bc3f2602384d5fbed0f75e4f806b1b07271253aeabbaa
MD5 6bc9e388b7a26faca3a3b1498f6145e8
BLAKE2b-256 951e4256242f1913775c9f6b8c84f615acccfca45d224ed3b0a794551b02aead

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pycameleon-0.2.8-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 624.3 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 acb0d5c0f2b199efa696eaf9f2143f989452965a506716214f2613ae38bc0eda
MD5 daa7d4a506b3b345810f73fa1eaee68e
BLAKE2b-256 0a99287b3a78c6c2c236571ccd4d82001639345bc251c776bf24f2c99fab9cde

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-win32.whl.

File metadata

  • Download URL: pycameleon-0.2.8-cp39-abi3-win32.whl
  • Upload date:
  • Size: 586.0 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 b529c445ffbdd530ebb983e064fe0b9185dfb9c3c8c06c217d656e4a82b1c61b
MD5 0b75fd775ef0ee5374c3f497dbd9874d
BLAKE2b-256 234995dad7784e40b73a50dedca67e9720fa72a96cf5c662e9e3b475d37daf22

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6ab113c0f8139b823fc08166677f47a4a268041cbeca3d2b2bb65d5ddc47bba4
MD5 5b4d6415b18beb5fb918cb7b3ea2ca7c
BLAKE2b-256 318bbbd1a8cd5156af6c2e9bd029ccd084ca28c4a3f996ad9692663940ef1019

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2574d373e5430c2e57a6db2335ba13a9cf9ee1f8642bd57b3903b1e30c502e05
MD5 089d41acec37f1dab8ede4c7dee0b454
BLAKE2b-256 72cf3b81cfa4e152477260546b9e3cb63c0398de7544e29d4d377c6bc0357a46

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 1065eccc1e90fa66e197128c744809a6ad4710f8a238c0d5dfca36be124763a5
MD5 57d0e5c42170d63c1c05f252fb9763e2
BLAKE2b-256 8f987c9f4e114eec34b40915dce9a8c8c001baa4f05f5916b801d536fb28b021

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 146b2e002fec66c90931ff2e8cce13e49adcad9ad7bb887b37cf2f3be8b24617
MD5 14b7b6286411888ff6f4ab36bdc8598c
BLAKE2b-256 2ad7122f673eec97cf31b5aa7d58f0f9cc8a53a32eb925ee736e4efa8667c499

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a92203e2f9bc62df5b507259115439477512cf61f1cf9c04b8013cb5aee3959
MD5 afd8ccb52e1938b7266ff67d21bcd23c
BLAKE2b-256 98d1d86ff8a4727f181260612be31015e09275578e368ceba1911b0740bbe52a

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_s390x.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 9ddb5eb52cd40b06bc4b246d2aaa26620a11e1ee8f6d449cf97c6e17efffe83f
MD5 5de5df2be9e41e333eb908efb67e0277
BLAKE2b-256 330e74a0e69dc7363fb8c8b51b7f7c25089d4e87c83a75c22171ec67a09b6d0d

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 8cd2e4644322a2038e962e7c3ccb03ea36ba35f16b530344a1d8ac62ba7eaed0
MD5 c8ac2588604ca7aca7550c49626fcde2
BLAKE2b-256 f28b1999eb775afc322e57959c9b4a40473ab59eb427e3d807b5a3c449ad81ce

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 33cc53f8d172dcd99f410623a3a1ee3c70782bb63d1debffb560264d395ae0d8
MD5 41d15185d0ffd551ebc570f8531728b9
BLAKE2b-256 9959999173b66768200a544972c0f9fc4c000d868a474b2365aea17eec284748

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 bb6f79b75e4af20a9785cfe7f561501921978ef79492a081f4a3e05c58d43660
MD5 d14db8faf548423c85cd6d01759635bf
BLAKE2b-256 1a6b670e1e2bf873d9fbc5866ce00e65984647a5c6e1be7e3d527a600bfa3def

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 35b4cd104abed3009081eebb17d5093c72820af7309b1b5c96af0b1d583f6ee1
MD5 d4fe80e81573f93c1553bc6bb87cde09
BLAKE2b-256 2d47efc35322ac4366a986c2800807754b90dded3db8e329cd2283b5cf192904

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75dc802f1499687aa9e0a1ace95aaacd613a1d5823c75cf93f30533d08f0d944
MD5 2b8a9aa181d886d3849e925475462690
BLAKE2b-256 1612a674da24843a32e1fee422cbbb198abc6041fc8a0074437db66362dd7f88

See more details on using hashes here.

File details

Details for the file pycameleon-0.2.8-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pycameleon-0.2.8-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 08374a5dfbeab16b65e34f70cb818607253bbccb8c7aee1d8c165085adbc7d47
MD5 d0258e25d480c06d08f839b54a47e5f5
BLAKE2b-256 c50cb22461a25d9d6b6fd4fc33fc18a2509447fb9e4a86fbacb92a4fef82ef8a

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