ImageZero is a lossless, very fast compression algorithm for 24-bit color photographic images. Its compression ratio is comparable to PNG, but it compresses over twenty times faster and decompresses almost twice as fast.
I’ve made a new ROS stack that makes it easy to use ImageZero as a transport mechanism for any ROS topics that are already using the image_transport mechanism. It’s available on GitHub at https://github.com/swri-robotics/imagezero_transport, and it has been successfully built in the ROS Shadow repository, so it should be available in the next releases of ROS Indigo, Jade, and Kinetic. The imagezero_transport
stack provides three packages:
-
imagezero
: The original ImageZero algorithm built as a shared library using catkin -
imagezero_ros
: A shared library that provides convenience methods for converting betweensensor_msgs/Image
andsensor_msgs/CompressedImage
messages using ImageZero -
imagezero_image_transport
: A plugin for the ROSimage_transport
package which adds an/imagezero
sub-topic to ImageTransport topics that can be used to transparently use ImageZero to compress your images
For a little bit of backstory and a use case, I’m working on a system that is doing image processing on 10 Hz video feeds coming from stereo cameras connected to one computer than is publishing the video across a network as ROS Image topics. The uncompressed image data was consuming over 400 Mbps of bandwidth by itself, which was enough to choke other services on the 1 Gbps network. We looked at using the built-in JPG and PNG image transports, but JPG was unsuitable for our image processing algorithms because it’s lossy and PNG was unusable because it is so CPU-intensive that the host computer’s processor could not compress the image stream in real time.
After searching around for a while for image compression algorithms, I found ImageZero, which suits our needs perfectly. It’s lossless, designed explicitly for 24-bit color natural photography, and fast enough that our processors can easily do it on a real-time video feed. The bandwidth from our cameras is now down to about 150 Mbps.
Hopefully other people find this as useful as I have!
P. J. Reed, Senior Research Analyst
(210) 522-6948
Intelligent Vehicle Systems
Southwest Research Institute