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!

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

Uploaded PyPymanylinux: glibc 2.28+ x86-64

pycameleon-0.2.6-pp311-pypy311_pp73-manylinux_2_28_i686.whl (891.8 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ i686

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

Uploaded CPython 3.9+Windows x86-64

pycameleon-0.2.6-cp39-abi3-win32.whl (580.4 kB view details)

Uploaded CPython 3.9+Windows x86

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

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_x86_64.whl (828.0 kB view details)

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

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_s390x.whl (847.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ s390x

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_ppc64le.whl (997.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ppc64le

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_i686.whl (901.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ i686

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_armv7l.whl (821.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARMv7l

pycameleon-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl (815.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

pycameleon-0.2.6-cp39-abi3-macosx_11_0_arm64.whl (695.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pycameleon-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl (719.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bc72b2c3ca148366c52a8a1937fd532115705f0cd42f01693649e96a6ba461ff
MD5 5d81c5d70d2867199c35bb2e0374f2e8
BLAKE2b-256 795b576875ab52459a74b6b850767f8fd28f8630307436a19ee5d59dca04fc4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-pp311-pypy311_pp73-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 5a163eef7fea69e104aee51082a6f2931ffbc82750575c558d364e18d465d613
MD5 ad8c32e98179a920ba9b8c1b654790a5
BLAKE2b-256 4c7b1743f0f509d200aae68d61ca7e16873e3d36ecfbce9638b26fecaaccd7b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycameleon-0.2.6-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.6-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b4876a5008f978b41b9fe618b9b1138a91009895bc915306c77992fdafc3813
MD5 1a65858680cee0c9701f38670d98b93f
BLAKE2b-256 bbbf6c9a712465d93be6954106994919c729b8bb71c23d802c92a01a760c955c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycameleon-0.2.6-cp39-abi3-win32.whl
  • Upload date:
  • Size: 580.4 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.6-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 fc9e396de7853a1204b44860f9190b0765308946b940cd94c8f0ba47f4fa7a96
MD5 c58c60eb12fa3f5aa4c3055aac34faf9
BLAKE2b-256 b480a229f5febb0358e90c57d1a4a11bd5c9866c9311b5f27d5597ee9d5d55aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1928c2e6a7135d02a5dc4bf1b2d51ced1c8a0138dc96cd7ce13c20e4c87ab48
MD5 c5040a636745b269ac9b015b642aac62
BLAKE2b-256 4329e3e0897d9efa30ed12e3a52cc7b558988a88e0f96f96f3f0da764364691e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 887d8a4c5b2eee93fba40c5d3fc843d192315945a2a7bfd7aca65e6b32cff162
MD5 e2d4f15d964241005f5274bad3dda804
BLAKE2b-256 4486b14b7dd91b840bb7dae67f351308330b7efda42bd589b4c5f31529a0c97a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 dc71200f67cd77dafe7317463f6ec7f9a17c51ba6a19c219ce5e4a690367145d
MD5 43f77f5a22312c3725b085282e220ecf
BLAKE2b-256 61c00d303d42e0de198c22e758acf3fc43344d00624810a7ce6bf14ad93f6821

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 317d1503511ddbb9371c21fca778a0f42f20a61b93a7944e881b211411c1694b
MD5 9e5961259b9d88f82a181e60060982af
BLAKE2b-256 adff696da3b75bf2ade9efd8c596330832c311a23694d325e91d09f28dac13bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 77a85d1f1b3c1930db9165e54f5732c04708a2c6976a636727bd186cd05b0aa5
MD5 a1c044b0ef045df6590956c2b612f4a4
BLAKE2b-256 5803ffc84c4ff9fc5bcd83e2b30b25933d5ad53e96bc1ac03800df8dab210929

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 c86017e21f4f4ec2897ba6ca2991e2fae56125bd4f2a81bb095fe2a76618246a
MD5 d622bd6042046e2ac8366bbbabe261d0
BLAKE2b-256 dfe01c832393b8d3a7e3f687c65a95a8d811bcc8c1d100ee3b76b93c229afe5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 7b94719e2f8161f85fc3153dcaba3f8acc4360c1528a6453551e2c9ed0549589
MD5 045b86262a1b800af83db9e411fc375a
BLAKE2b-256 be951dde2d0402ce703a317013b99a5ba26c952c98b47b6550f3fdef42cdcbf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 d0f30105ca922f4c6c073a935d381d6e4c14e0a4c9945047d760d43c7c6229a2
MD5 f2f3af094ac7e118e088063eefb285ca
BLAKE2b-256 91012ae96eba9afc8a233224ac956668a6fd022be1cc69cdc393cfe2c077afa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 58c76bcb2459c5f3d072f5475f04714ac79961fc954aa66177206dcaaf00cabe
MD5 789cfea3dfa4b09319706b542351efc3
BLAKE2b-256 2d1248563010936106a41f30686755cd449f5bad303edfd3d6835c106e61637c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8118753549fa8a98066cc99b9ff8a5e5d8d2fb09e1719f9324c3ed863f54bf3d
MD5 05281e00eaa4eab9f6d07af47b662f36
BLAKE2b-256 2b1bcecaf5e077b8ac466bfa309c46d3d1b327779ab14d9141b33c31e30507fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 865ea62671427bef5efe8174000709f8e6289c86de902af748e823c8cb22a0d8
MD5 d77123254f6527a3d5b1465f9f5f0c82
BLAKE2b-256 28a9d6df5a99eb71ff16be7cd083ecdb81b8ea2a3f4ae7eb6845b31ce3445c5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 512e6b27a9879b297e3e6702760c6b5ee9ca457580474cde8af94b44f4fb9fb5
MD5 41ab9e96e77377adef32f07a8a6fa1e6
BLAKE2b-256 86330c85a05ca45d5b5a26e6bcecd4ac5cd57c395e52b9cdb36f4fe89f22fba6

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