#camera-image #camera #pylon #bindings #image #api-bindings #basler

sys pylon-cxx

Rust wrapper of the Pylon libraries for Basler cameras

20 releases

0.4.2 Nov 18, 2024
0.4.1 Jun 25, 2024
0.4.0 May 29, 2024
0.3.8 Jan 31, 2024
0.1.4 Jun 26, 2021

#404 in Images

Download history 31/week @ 2024-08-25 33/week @ 2024-09-01 117/week @ 2024-09-08 442/week @ 2024-09-15 337/week @ 2024-09-22 400/week @ 2024-09-29 501/week @ 2024-10-06 592/week @ 2024-10-13 481/week @ 2024-10-20 331/week @ 2024-10-27 214/week @ 2024-11-03 341/week @ 2024-11-10 528/week @ 2024-11-17 607/week @ 2024-11-24 667/week @ 2024-12-01 529/week @ 2024-12-08

2,341 downloads per month
Used in pylon

MIT/Apache

62KB
1.5K SLoC

Rust 1K SLoC // 0.0% comments C++ 365 SLoC // 0.1% comments

pylon-cxx-rs

Crates.io

Rust wrapper of the Pylon libraries for Basler cameras using CXX.

Platform support

Windows, linux, and macOS are all tested.

async stream with tokio

Enable async stream support using tokio with the cargo feature stream. This feature is currently not compatible with Windows (help wanted).

Building

This crate expects to find the Pylon developer kit at the usual install location. Build with normal rust commands. For example, to run the grab example:

cargo run --example grab

On macOS

On macOS, building should work, but it is required update your environment variables to run the produced binaries:

export DYLD_LIBRARY_PATH="/Library/Frameworks/pylon.framework/Versions/A/Libraries/"

I have seen articles like https://jorgen.tjer.no/post/2014/05/20/dt-rpath-ld-and-at-rpath-dyld/ which suggest a way to avoid this issue.

Camera emulation

See Basler's documentation. This can simulate different frame rates, failures, etc.

# on bash (e.g. linux)
export PYLON_CAMEMU=2
# in Windows Powershell
$Env:PYLON_CAMEMU=2

Code of conduct

Anyone who interacts with this software in any space, including but not limited to this GitHub repository, must follow our code of conduct.

License

This crate is Copyright (C) 2020 Andrew Straw strawman@astraw.com.

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or distributed except according to those terms.

Note that this license only covers this Rust crate. The underlying Pylon library has different license terms.

Dependencies

~0.6–10MB
~92K SLoC