Skip to main content

No project description provided

Project description

Pycameleon

CI PyPI PyPI Downloads PyPI Python

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! If you want to help, here’s how you can get involved:

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.5-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (817.1 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

pycameleon-0.2.5-pp311-pypy311_pp73-manylinux_2_28_i686.whl (892.0 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ i686

pycameleon-0.2.5-cp39-abi3-win_amd64.whl (619.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

pycameleon-0.2.5-cp39-abi3-win32.whl (579.6 kB view details)

Uploaded CPython 3.9+Windows x86

pycameleon-0.2.5-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.5-cp39-abi3-musllinux_1_2_i686.whl (1.1 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_x86_64.whl (828.1 kB view details)

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

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_s390x.whl (847.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ s390x

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_ppc64le.whl (998.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ppc64le

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_i686.whl (902.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ i686

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_armv7l.whl (821.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARMv7l

pycameleon-0.2.5-cp39-abi3-manylinux_2_28_aarch64.whl (818.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

pycameleon-0.2.5-cp39-abi3-macosx_11_0_arm64.whl (695.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pycameleon-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl (719.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 27c828d7b5c4a63966ff09e7f6e35764401e0c32f662a5ea4ec7a0d0eeb4aaf9
MD5 ecb393b24f82a1ae107ee957c629908d
BLAKE2b-256 421c406e28ba1dc70179dcded6d0d4d483191c112abd234df1ac588714ebd189

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-pp311-pypy311_pp73-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 1c48f73f3a8b16732526dad423cf90bb39f060b7138833f59501b898cd797cd1
MD5 3012f2a326d7c40d933989b520527edf
BLAKE2b-256 26a6fa85cf6d40044cc07c1e7d9622b37304134a5e289b90d5c49c81e3f51e5e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6eb7d23d35176f515d5e3465315b0e49a7350bd391033593780c4f8dd5d6cd6a
MD5 81438afe5377704f6baf00421cbeda79
BLAKE2b-256 dcf559f9fded223048d4e95cc254dc613ba0002cf161569d00d43c3be0fc2d7a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 19c91572fcbb85e8735acb9b08996e67accc7a2f4d3b1613756b3da7cd4f4958
MD5 d05d14eab39729782fcf18ead0d20d42
BLAKE2b-256 c8c6090dcf0adad80637d0d56ab62611c3380ab46ab7737f2d32548d9b4f314e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9df8884f066c1480bf745e71b5c2123ea8ed341609122de03e74b4143ee05561
MD5 43b296bee65f7f199d50f3da7f30fe12
BLAKE2b-256 86df39616af852e615288e9aa3b01bfee8a14df21a092ebc771fde9053769eab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6a89fb20993c1fd150ae025da581e427d2b962f94ad3366b102c7b43ca033cec
MD5 b5bfe93d732e0d9a73613e582eb6ba3d
BLAKE2b-256 f476f483f2bbd46e28114610d8a81b0d7c35a5768f3c14a66dddc1fe1fbf3fd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 cfc68e36fc8395591b68b0c6529e1fc80317506f82f5ec36ca2d47823dfeeb7e
MD5 581770d3d2d691a6b64d31495ec49659
BLAKE2b-256 699ac4ef29b0cfe194dc7cf5c91cfd2b117d77fd93b5b8437e407d2dca684503

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5cd22e1c1e4be33b6a5df193c08160ef6fae4cb4c637d2fd3852086e42065063
MD5 a04570ca77b690a1fa5ddbef2679b4a8
BLAKE2b-256 76487199df8168664a5d28ac2474e2abee2012a006d664802edeffbfd59783a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac0f683a5633a9e447d618c259be261d90ab9bd965105435d9e2d64ceb496be0
MD5 defb0c8de87d7f9152cbfad0dc344bd1
BLAKE2b-256 53cf949059f3ea2ad48f884163e15141bc0fdb704a05de693aad17064d0a95fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 5e4a654a3b88d6568bc2c018344c5f945484e3f021a914d0a5482765f80580e2
MD5 6679d5ae22d114dd8f66d440fcdf7f05
BLAKE2b-256 627004dfcc6038f91cf99001a8f81cb7e74d7bd8ce358a7cb6116974ea2c7570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 42fc391d37df6423d43b9cc0db3be2172eeeeea440432057eb9f0ad77a50b6e1
MD5 b817bedc095bdfb3aa63ae02640ca067
BLAKE2b-256 4e5194a38a28cd009a9895315b700fce5212c06c1e5ec7e2635d622a48765e48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 ad9101074236fcb0d571e47f43e5e65f0bb2b47d35347ee5d24a9357ca148616
MD5 ce3816956338a4f201dd2628c58f4ed4
BLAKE2b-256 1b8fca1354033ab36e71ec23fa9946a620961b7a334aa06929848b97a95a4232

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 c10c319573673b55f8faedb2a4130865825c606a3540e8e4e29d444435ae92f7
MD5 1aeecd1128e08bd4838bb4a1dc5667e9
BLAKE2b-256 116ee31393557d13181d223c2fcf219764b0fdb932cf6542ba8ec5058d8413fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2790b0017522a234204204b5c779f921db28b2ac87fe390f28f7f0e58af8ded4
MD5 56a179728a53156da0093fc08d8fe3ec
BLAKE2b-256 0ea5c1c4ea830bb1dff6c7ef149ddfb11a32db32e9517362045bb7b67771e807

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75b52536764d102f38b5fe91ab3c44637823ee52e2acf1433c830f09a4b5dd78
MD5 366ced1a2b46cb840791fc4227fd039c
BLAKE2b-256 31c91d30a3384593c64b7bc0c3ae95760c118ea9b1194f736da254314b909e4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8450a0dd67a5cc0e83715d59803104713689c227cdb9ee880a65df4981d446b8
MD5 4e711aeac624223e0ae5d4a4b6b59424
BLAKE2b-256 5e5f0e566da307ceaceda51c35a5dbc392efa2a73f8536b3f896166871e2f73f

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