Pure Python library to convert ros image message data from and to opencv2.
Project description
Rosbags-image
Rosbags-image is the pure python library for interacting with image or compressed image messages and it aims to provide the same functionality as cv_bridge. It is part of the larger Rosbags ecosystem.
Rosbags-image does not have any dependencies on the ROS software stacks and can be used on its own or alongside ROS1 or ROS2.
Getting started
Rosbags-image is published on PyPI and does not have any special dependencies. Simply install with pip:
pip install rosbags-image
Convert sensor_msgs/msg/Image message into OpenCV image:
from rosbags.image import message_to_cvimage
# msg is rosbags Image or CompressedImage message instance
msg = ...
# get opencv image without any conversions
img = message_to_cvimage(msg)
# get opencv image and convert to bgr8 color space
img = message_to_cvimage(msg, 'bgr8')
Documentation
Read the documentation for further information.
Contributing
Thank you for considering to contribute to rosbags-image.
To submit issues or create merge requests please follow the instructions provided in the contribution guide.
By contributing to rosbags-image you accept and agree to the terms and conditions laid out in there.
Development
Clone the repository and setup your local checkout:
git clone https://gitlab.com/ternaris/rosbags-image.git cd rosbags-image python -m venv venv . venv/bin/activate pip install -r requirements-dev.txt pip install -e .
This creates a new virtual environment with the necessary python dependencies and installs rosbags-image in editable mode. The rosbags-image code base uses pytest as its test runner, run the test suite by simply invoking:
pytest
To build the documentation from its source run sphinx-build:
sphinx-build -a docs public
The entry point to the local documentation build should be available under public/index.html.
Support
Professional support is available from Ternaris.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rosbags_image-0.10.0.tar.gz
.
File metadata
- Download URL: rosbags_image-0.10.0.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53e7167e9c14574a88a8eac5b1f4df67b463fb59b965f97c95bcad244a94faf6 |
|
MD5 | 6c7c2feab15a099ed7693f0a83a0d434 |
|
BLAKE2b-256 | 3bf569d7e487b9bd4c2bd9226f7ba93e1aa0414beebf972948c97bfb2253c375 |
Provenance
File details
Details for the file rosbags_image-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: rosbags_image-0.10.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87adc8367aa68638352ed0588dd2f28ca0a55ea62e55c4a780027304712181e4 |
|
MD5 | 2cf1fe66570654617652b0bf1b2092e9 |
|
BLAKE2b-256 | 3c58abaf47ca9082b37426eb5263bb00e1f17d6d60245daec83ba58b78027876 |