{"id":14992209,"url":"https://github.com/cameleon-rs/cameleon","last_synced_at":"2025-09-25T14:30:58.982Z","repository":{"id":37454660,"uuid":"279685645","full_name":"cameleon-rs/cameleon","owner":"cameleon-rs","description":"A safe, fast, and flexible library for GenICam compatible cameras","archived":false,"fork":false,"pushed_at":"2024-12-05T17:44:42.000Z","size":1413,"stargazers_count":88,"open_issues_count":24,"forks_count":19,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-01-01T22:37:48.352Z","etag":null,"topics":["camera","genapi","genicam","gige","rust","usb3","uvc","vision"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cameleon-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-14T20:23:55.000Z","updated_at":"2024-12-17T18:17:46.000Z","dependencies_parsed_at":"2024-02-27T20:24:07.114Z","dependency_job_id":"4db75416-2333-4241-8963-5e47a07efc79","html_url":"https://github.com/cameleon-rs/cameleon","commit_stats":{"total_commits":730,"total_committers":9,"mean_commits":81.11111111111111,"dds":0.06986301369863013,"last_synced_commit":"b980e6a95dc5e780f21ae8ddc08e919f03fce75a"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameleon-rs%2Fcameleon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameleon-rs%2Fcameleon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameleon-rs%2Fcameleon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameleon-rs%2Fcameleon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameleon-rs","download_url":"https://codeload.github.com/cameleon-rs/cameleon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234200175,"owners_count":18795139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","genapi","genicam","gige","rust","usb3","uvc","vision"],"created_at":"2024-09-24T15:00:52.193Z","updated_at":"2025-09-25T14:30:53.454Z","avatar_url":"https://github.com/cameleon-rs.png","language":"Rust","funding_links":[],"categories":["Sensor and Communication Protocol"],"sub_categories":[],"readme":"![cameleon is a safe, fast, and flexible library for GenICam compatible cameras][logo]\n\n[![Crates.io][crates-badge]][crates-url]\n[![Documentation][docs-badge]][docs-url]\n[![Build Status][actions-badge]][actions-url]\n[![Actively Maintained](https://img.shields.io/badge/Maintenance%20Level-Actively%20Maintained-green.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)\n[![MPL-2.0][mpl-badge]][mpl-url]\n\n`cameleon` is a safe, fast, and flexible library for [GenICam][genicam-url] compatible cameras.\n\n[logo]: https://raw.githubusercontent.com/cameleon-rs/cameleon/main/misc/logo.svg\n[crates-badge]: https://img.shields.io/crates/v/cameleon.svg\n[crates-url]: https://crates.io/crates/cameleon\n[docs-badge]: https://docs.rs/cameleon/badge.svg\n[docs-url]: https://docs.rs/cameleon\n[mpl-badge]: https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg\n[mpl-url]: https://github.com/cameleon-rs/cameleon/blob/main/LICENSE\n[actions-badge]: https://github.com/cameleon-rs/cameleon/workflows/CI/badge.svg\n[actions-url]: https://github.com/cameleon-rs/cameleon/actions/workflows/ci.yml\n[genicam-url]: https://www.emva.org/standards-technology/genicam/\n\n\n## Overview\n\n`cameleon` is a library for operating on `GenICam` compatible cameras.\nOur main goal is to provide safe, fast, and flexible library for `GenICam` cameras.\n\nCurrently, `cameleon` supports only `USB3 Vision` cameras, but it's planned to support other protocols including `GigE Vision`. See [Roadmap][roadmap-url] for more details.\n\n[roadmap-url]: https://github.com/cameleon-rs/cameleon#roadmap\n\n## Usage\n\n### USB3 Vision cameras\nYou need to install `libusb` to use USB3 Vision cameras, see [How to install `libusb`](#how-to-install-libusb).\n\nFirst, add dependencies like below.\n```toml\n[dependencies]\ncameleon = { version = \"0.1\", features = [\"libusb\"] }\n```\n\nThen, you can enumerate all cameras connected to the host, and start streaming.\n```rust\nuse cameleon::u3v;\n\n// Enumerates all cameras connected to the host.\nlet mut cameras = u3v::enumerate_cameras().unwrap();\n\nif cameras.is_empty() {\n    println!(\"no camera found\");\n    return;\n}\n\n\nlet mut camera = cameras.pop().unwrap();\n\n// Opens the camera.\ncamera.open().unwrap();\n// Loads `GenApi` context. This is necessary for streaming.\ncamera.load_context().unwrap();\n\n// Start streaming. Channel capacity is set to 3.\nlet payload_rx = camera.start_streaming(3).unwrap();\n\nfor _ in 0..10 {\n    let payload = match payload_rx.recv_blocking() {\n        Ok(payload) =\u003e payload,\n        Err(e) =\u003e {\n            println!(\"payload receive error: {e}\");\n            continue;\n        }\n    };\n    println!(\n        \"payload received! block_id: {:?}, timestamp: {:?}\",\n        payload.id(),\n        payload.timestamp()\n    );\n    if let Some(image_info) = payload.image_info() {\n        println!(\"{:?}\\n\", image_info);\n        let image = payload.image();\n        // do something with the image.\n        // ...\n    }\n\n    // Send back payload to streaming loop to reuse the buffer. This is optional.\n    payload_rx.send_back(payload);\n}\n\n// Closes the camera.\ncamera.close().unwrap();\n```\n\nMore examples can be found [here][cameleon-example].\n\n[libusb-url]: https://libusb.info\n[cameleon-example]: https://github.com/cameleon-rs/cameleon/tree/main/cameleon/examples\n\n\n## Project Layout\n`Cameleon` consists of several crates.\n\n* [`cameleon`]: Provides high-level APIs to control cameras. This is the primary crate.\n* [`cameleon-genapi`]: Provides parser and interpreter of `GenApi` XML.\n* [`cameleon-device`]: Provides device specific protocol decoder and basic I/O operations for devices, also provides emulators.\n* [`cameleon-gentl`]: Provides `GenTL` interfaces as a C library.\n* [`cameleon-impl`]: Provides internal APIs for other crates. `cameleon-impl` is intended to be used only by `cameleon` project.\n* [`cameleon-impl-macros`]: Provides procedural macros for other crates. `cameleon-impl-macros` is intended to be used only by `cameleon` project.\n\n[`cameleon`]: https://github.com/cameleon-rs/cameleon/tree/main/cameleon\n[`cameleon-genapi`]: https://github.com/cameleon-rs/cameleon/tree/main/genapi\n[`cameleon-device`]: https://github.com/cameleon-rs/cameleon/tree/main/device\n[`cameleon-gentl`]: https://github.com/cameleon-rs/cameleon/tree/main/gentl\n[`cameleon-impl`]: https://github.com/cameleon-rs/cameleon/tree/main/impl\n[`cameleon-impl-macros`]: https://github.com/cameleon-rs/cameleon/tree/main/impl/macros\n\n\n## FAQ\n\n### USB3 Vision\n\n#### How to install `libusb`?\n##### Linux/macOS\nYou need to install [libusb][libusb-url] to the place where `pkg-config` can find. Basically all you have to do is just installing `libusb` through your system package manager like `sudo apt install libusb-1.0-0-dev` or `brew install libusb`.\n\nIf you use Linux, it's probably needed to edit permissions for USB devices. You could add permissions by editing `udev` rules, a configuration example is found [here](misc/u3v.rules).\n\n##### Windows\nYou need to install [libusb][libusb-url] with `vcpkg`, please see [here][libusb-vcpkg] to install `libusb` with `vcpkg`.\n\nAlso, you need to install a driver for your device. You can find resource [here][libusb-driver-installation] for driver-installation.  \nNOTE: Make sure to install a driver to a composite device not to its child devices.  \nTo do this, you need to list all devices connected to the host computer with `zadig` like below.  \n![describe zadig list option][zadig-list-option]\n\nThen install `WinUSB` to your device.  \n![describe how to install WinUSB driver to your composite device][zadig-composite-device]\n\n[libusb-vcpkg]: https://github.com/libusb/libusb/wiki/Windows#vcpkg_port\n[libusb-driver-installation]: https://github.com/libusb/libusb/wiki/Windows#driver-installation\n[zadig-list-option]: https://user-images.githubusercontent.com/6376004/123678264-11720d00-d881-11eb-98aa-eb649fdf3cb2.png\n[zadig-composite-device]: https://user-images.githubusercontent.com/6376004/123937380-10e88c00-d9d1-11eb-9999-61439b6db788.png\n\n\n#### Why is frame rate so low?\nFrame rate can be affected by several reasons.\n\n1. Parameter settings of the camera\n\n`AcquisitionFrameRate` and `ExposureTime` directly affect frame rate. So you need to setup the parameters first to improve frame rate.\nAlso, if `DeviceLinkThroughputLimitMode` is set to `On`, you would need to increase the value of `DeviceLinkThroughputLimit`.\n\n2. Many devices are streaming simultaneously on the same USB host controller\n\nIn this case, it's recommended to allocate the equal throughput limit to the connected cameras,\nmaking sure that the total throughput does not exceed the maximum bandwidth of the host controller.\n\n3. `usbfs_memory_mb` is set to low value\n\nIf you use Linux, you may need to increase `usbfs_memory_mb` limit.\nBy 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.\nWe recommend you to set the value to 1000MB. You could set the value as following:\n```sh\necho 1000 \u003e /sys/module/usbcore/parameters/usbfs_memory_mb\n```\n\n## Roadmap\n### [v0.2.0](https://github.com/cameleon-rs/cameleon/milestone/2)\n* Add support for `GigE` cameras\n* Impelment emulator\n* Add support for saving and loading camera parameters\n\n### [v0.3.0](https://github.com/cameleon-rs/cameleon/milestone/3)\n* Implement payload chunk parser\n* Add support for `GenTL`\n\n### [v0.4.0](https://github.com/cameleon-rs/cameleon/milestone/4)\n* Add support for `UVC` cameras\n\n## Contributing\nThank you for your interest in contributing to `Cameleon`! We are so happy to have you join the development.  \nTo start developing, please refer to [CONTRIBUTING.md][contributing].\n\n[contributing]: https://github.com/cameleon-rs/cameleon/blob/main/CONTRIBUTING.md\n\n## Releasing\n### 1. Publish\n1. Check commits since the last release and determine whether they're semver-breaking.\n2. Bump up all the crate versions and publish using [`cargo release \u003cmajor|minor|patch\u003e`](https://github.com/crate-ci/cargo-release)\n3. Open a PR to reflect the changes.\n\n### 2. Changelog\n1. Create a new release on the GitHub page from the tag that `cargo release` has created\n2. Use [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes) and modify it *manually*\n\n## License\nThis project is licenced under [MPL 2.0][license].\n\n[license]: https://github.com/cameleon-rs/cameleon/blob/main/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameleon-rs%2Fcameleon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameleon-rs%2Fcameleon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameleon-rs%2Fcameleon/lists"}