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

Uploaded PyPymanylinux: glibc 2.28+ x86-64

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

Uploaded PyPymanylinux: glibc 2.28+ i686

pycameleon-0.2.7-cp39-abi3-win_amd64.whl (619.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+Windows x86

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

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

pycameleon-0.2.7-cp39-abi3-manylinux_2_28_x86_64.whl (827.9 kB view details)

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

pycameleon-0.2.7-cp39-abi3-manylinux_2_28_s390x.whl (846.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ s390x

pycameleon-0.2.7-cp39-abi3-manylinux_2_28_ppc64le.whl (996.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ppc64le

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

Uploaded CPython 3.9+manylinux: glibc 2.28+ i686

pycameleon-0.2.7-cp39-abi3-manylinux_2_28_armv7l.whl (821.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARMv7l

pycameleon-0.2.7-cp39-abi3-manylinux_2_28_aarch64.whl (818.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

pycameleon-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl (719.8 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 684d1644ad64013f3fd82f791d4eb1e36b336221e27a9b0d699dcee9cd34c26f
MD5 95d3cd2406210e3febb9b2478ca768a5
BLAKE2b-256 d56781ead2d53ae178202489a5812ed9439f527f52cfed0c160e1e847e0169f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-pp311-pypy311_pp73-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 dc61ba3502167ea432ebf8e269d92dabf8d13190aee748e01e4f7450d3959f2b
MD5 06290f72c477e935cb347aeab03f8098
BLAKE2b-256 10c64835cdbaf959548ab064d2eeb649f330577fb8ac17c72f6a3637e31fe58c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycameleon-0.2.7-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 619.5 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.7-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f62d6799fe79f901d3057fa808e5d4fef95e5664c5756cf006d8434df2f21b5a
MD5 755c27e2084d7b559a882a364dece1fd
BLAKE2b-256 508d6be95000b5eecdcb2d4545d5279df79699f2e6d00866f60ff782e07514c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycameleon-0.2.7-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.7-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 d9baaac2831f6ca243712d6f00d6c2daacc4d3a1c5e540b294c13e59030bcd61
MD5 69cbad87498346035c90ecc663166e93
BLAKE2b-256 6d55583f49a79c24015d692d6d3f8aa27ccfbfb73ec4a1bba059dca146320c87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 16fd7fcd64e13b63a9934db392396786bffd01e9eea1617365296ca00d63e53d
MD5 c08c113b55037918980a9f72014dc531
BLAKE2b-256 22c4398b72ef2d294070d4378eb1a117637fb703de6cb86cea2e17f0e850f0bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 a550191dca893b7efd15a4873afa7531819b47a50e7f2ec91cb7ea37a444cd18
MD5 0828597790230cba2bdf1bdde06e9fa0
BLAKE2b-256 b018815fe7c6692b66585f4a8ebee55ac37475864860e9954fdce90375987279

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 81efc1d0b5eb6caded42d1e2da0a657ba3909d9ab5cc6dd7bccd74e146520914
MD5 8860f8a1f74a6dee0b8d7004d352fcae
BLAKE2b-256 105cba2a7e44d1687067950a00e1647a481d3ecf39d1909d8bbe5d31ead3903d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 dab862dc7f68a73b6c09ff2f1dbfdf369f14600a5ed9ed92f743337e5ae71e6b
MD5 52bb6c2465b2e7302ffeb276053d9ab6
BLAKE2b-256 a5135d3d97ffe4b2df40f2dfb91fef310a919d902175ad17a0f269f17a0723e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f6bcf4938bb35ae4a477da8b830214b232ccbdb53674508a80369fe9bd11125
MD5 99c156477408e12f194edeb8693a6d80
BLAKE2b-256 696a05887c49df3962458cd9a80a87d1f208767e1ad05687cbef569ae978e39f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 703b27ccab3213cad470dd9b0c94fa8952545d3c0ecd2022747368639a5333c4
MD5 0f4f938ffc4fbdebe2dd5238d9bfaa53
BLAKE2b-256 fbfb75bfb1b67b1e6bd178394951729ef745dfcb97af9c55bac8dc17bc6a745f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 e189a208f0b1e0a1ef035eae4e1c144639505d04d664a792e9326f20d61615a3
MD5 b6f5c733945e0d483ca36e825b4583a4
BLAKE2b-256 8a6d69bd067595e52a6ab452dfde8e0bb0b591f2fafbe6e66fe5dc3935039c67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 c7a50518f2f8c1ed5ec236262c5db36ba343f4c2d62e19d90335bdae80859c24
MD5 0ddd873e1d07584bf8da6c095aa140d0
BLAKE2b-256 161bb9188f80261d7d71af2edb99b777014663d8c58343532b2974a79c2efc02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 2febe708b2dc37a7cb6572f210113273f5c4abfae0126f3873643c8df40909d9
MD5 58fb7730aa8fb84a4e82fd4a1dabb6b4
BLAKE2b-256 32bc46f70dc0ac092be153f76315b52ac25a2619871a8692005fa472bfac8a71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9bf5ed5076c8689183c3cceeae6bca1cd2b72b7693c2f9396c5c82cd103bc13c
MD5 a2d14af8ad5713b918494d02617e400e
BLAKE2b-256 f8f83a379f2393e10c536aefcad5b8b09042c3a8c4311af29b526216fc060c75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9271b5282b1de99c78f873351cae330ba22191e401f5105ad25033b9e859a1fe
MD5 04e0c2488aff8d5bece2bfc43c185227
BLAKE2b-256 e81e93fbacee816274c41f0ee5a12d252a5a919eb66dbd21731622dbf8ee34ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycameleon-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6687f906642a10c6b8a8b80a3747b2ffd8eba16cc6414650a4716878274c01f9
MD5 c5d557029216a38ffd7c15c9155f9960
BLAKE2b-256 624918157a51b59a6c263e751d5b527b36f31e04b9686cbe264f51ea4f325ecc

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