[ros-users] Release of a "image_transport" plugin for float images (eg Kinect depth)
Arnaud Ramey
arnaud.a.ramey at gmail.com
Mon Jan 30 17:26:29 UTC 2012
Hello ROS users!
I am happy to announce to release of a "image_transport" plugin for
float images,
mainly aimed at broadcasting compressed Kinect depth images.
More details follow.
I hope this might be useful for other users and would be happy to hear feedback!
(that would justify the hours of work to get to that result :) )
__________________________________________________________
compressed_rounded_image_transport is an image_transport plugin for
float images.
*** Interest
Float images can come from various origins, for instance depth images
of a RGBD camera like Kinect.
It can be desired, for modest CPUs, to send out via the wire these images
for processing them on a remote computer.
However, the two referenced transport packages
of image_transport ( http://www.ros.org/wiki/image_transport ),
compressed and theora
only work with 8-bit color or grayscale images.
As such, float images need to be transmitted with raw.
compressed_rounded_image_transport satisfies this need:
It enables the compression of float images.
float images have first their values approximated by uchars
(by adaptating the span [min_value max_value] to [0 255]),
then are compressed with either libpng, libjpeg or libpng.
*** Installation
* To checkout:
"svn checkout http://uc3m-socialrobots.googlecode.com/svn/trunk/compressed_rounded_image_transport
compressed_rounded_image_transport-read-only"
* To compile:
"rosmake compressed_rounded_image_transport"
* To check the plugin was successfully registered:
"rosrun image_transport list_transports"
*** Quickstart Guide
To use the plugin with a node using image_transport
use the command line argument
"_image_transport:=compressed_rounded"
For instance, you can display the depth image of the kinect with
"rosrun compressed_rounded_image_transport depth_to_rgb_viewer.exe
input_topic:=/camera/depth/image/ _image_transport:=compressed_rounded"
(to be compared with
"rosrun compressed_rounded_image_transport depth_to_rgb_viewer.exe
input_topic:=/camera/depth/image/ _image_transport:=raw"
)
You can also try the two integrated launch files
"roslaunch compressed_rounded_image_transport
test_compressed_rounded_image_transport_1node.launch"
and
"roslaunch compressed_rounded_image_transport
test_compressed_rounded_image_transport_2nodes.launch"
which simulate respectively an intra-node and a inter-node communication.
*** Algorithm
* For the publishing :
It is made use of a message for an image where float values have been
scaled to a [0..255] scale and rounded to their closest uchar value.
Then the uchar image is compressed with JPEG, PNG or TIFF.
The former is more lossy than the others (more data loss because of
JPEG compression
algorithms, while PNG and TIFF are lossless and the only error come for the
span reduction).
* For the subscribing :
The message contains the alpha and beta factors,
which enables restoring to an approximate value of the initial float image.
*** Performance
The bandwidth required by the Kinect depth image topic drops from 9-10 MB/s
to less than 300 kB/s.
The compression generates an average error of around 4% for values
in a range of [1 .. 10], which correspond to typical values of the
Kinect depth image.
With an embedded Intel(R) Atom(TM) CPU Z530 @ 1.60GHz,
the compression of a 1-channel 320x240 image requires around 15 ms
This enables a 30Hz broadcasting (then needing a 30% CPU more or less).
*** Parameters
* compressed_rounded_method :
int, default 2 (JPEG)
1: PNG compression, 2: JPEG compression, 3: TIFF compression
* compressed_rounded_jpeg_quality :
int, default 85
In the case of JPEG compression, the quality (CV IMWRITE JPEG QUALITY)
goes from 0 to 100
(the higher is the better).
* compressed_rounded_png_compression :
int, default 6
In the case of PNG compression, the compression level (CV IMWRITE
PNG COMPRESSION),
goes from 0 to 9
(the higher value means smaller size and longer compression time).
--
Arnaud Ramey
http://sites.google.com/site/rameyarnaud/
More information about the ros-users
mailing list