Metadata-Version: 2.1
Name: rosbags-image
Version: 0.9.1
Summary: Pure Python library to convert ros image message data from and to opencv2.
Home-page: https://gitlab.com/ternaris/rosbags-image
Author: Ternaris
Author-email: team@ternaris.com
License: Apache 2.0
Project-URL: Code, https://gitlab.com/ternaris/rosbags-image
Project-URL: Documentation, https://ternaris.gitlab.io/rosbags-image
Project-URL: Issue tracker, https://gitlab.com/ternaris/rosbags-image/issues
Keywords: conversion,cv_bridge,image,compressedimage,message,msg,opencv,ros,rosbag,rosbag2,rosbags
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.8.2
Description-Content-Type: text/x-rst
Provides-Extra: dev
License-File: LICENSE.txt

.. image:: https://gitlab.com/ternaris/rosbags-image/badges/master/pipeline.svg
   :target: https://gitlab.com/ternaris/rosbags-image/-/commits/master
   :alt: pipeline status

.. image:: https://gitlab.com/ternaris/rosbags-image/badges/master/coverage.svg
   :target: https://gitlab.com/ternaris/rosbags-image/-/commits/master
   :alt: coverage report


=============
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 <https://gitlab.com/ternaris/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:

.. code-block:: python

   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 <https://ternaris.gitlab.io/rosbags-image/>`_ for further information.

.. end documentation


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 <https://gitlab.com/ternaris/rosbags-image/-/blob/master/CONTRIBUTING.rst>`_.

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 <https://ternaris.com>`_.
