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.9.0.tar.gz
.
File metadata
- Download URL: rosbags-image-0.9.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec6966eb389001f76489dd1a50e2529593bb6b7bfc4e2ea8093bea31d261896 |
|
MD5 | 5281427d454267338c514298b0e3ce4b |
|
BLAKE2b-256 | aaaf1db9c0ef714410f7f905c2570241b5572e7f54da28022888dc85319b967a |
File details
Details for the file rosbags_image-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: rosbags_image-0.9.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 988b93429c9547abbc258dd79db08103cd005ff8942fcef603935d9e0b7192a8 |
|
MD5 | ece5936f5e304123d52503a50bf7bb30 |
|
BLAKE2b-256 | bbf94869d14a964bc6c9fc29fe56530fb4b4bcb5f3346f7b2d6360b4671ad42f |