[ros-users] image_pipeline optimization

Vijay Pradeep vpradeep at willowgarage.com
Fri Jun 18 16:53:18 UTC 2010


Hi Bill,

What is the encoding of the images that you're viewing?
> rostopic echo [image_topic]/encoding

The following is based on image_view/src/image_view.cpp:
It looks like image view converts all incoming messages into a "bgr8"
encoding.  Thus, if the incoming format is anything other than bgr8,
cv_bridge will convert every pixel to bgr8, possibly resulting in the high
CPU load:

    if (img_bridge_.fromImage(*msg, "bgr8"))
      cvShowImage(window_name_.c_str(), img_bridge_.toIpl());
    else
      ROS_ERROR("Unable to convert %s image to bgr8",
msg->encoding.c_str());

I'm guessing this could be optimized a bit.

Vijay

On Fri, Jun 18, 2010 at 9:32 AM, Kurt Konolige <konolige at willowgarage.com>wrote:

> Bill, at least for image_proc, it depends on what you're doing and how
> fast your cpu is.  If image_proc is converting from Bayer to color,
> and/or doing rectification, it can use some cpu, especially if you
> have a 1.4 GHz machine, not especially fast these days.  image_view
> may be scaling the image, I'm not sure about this.
>
> My guess is that the overhead isn't in the message passing, but we
> need to test this.
>
> Cheers --Kurt
>
> On Fri, Jun 18, 2010 at 9:21 AM, Bill Morris <morris at ee.ccny.cuny.edu>
> wrote:
> > Is there any particular reason that image_proc and image_view use so
> > much cpu?
> >
> > CPU0: Intel(R) Core(TM)2 Duo CPU     T5270  @ 1.40GHz stepping 0d
> >
> >  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+
> > COMMAND
> > 12247 user      20   0  101m  18m  12m S   15  0.9   0:09.97
> > image_view
> > 12249 user      20   0  101m  18m  12m S   15  0.9   0:09.10
> > image_view
> > 12248 user      20   0 99.1m  15m 9740 S   15  0.8   0:11.15
> > image_proc
> > 12246 user      20   0 95528  26m  10m S   13  1.3   0:08.27
> > usb_cam_node
> >
> > Is this mostly messaging overhead that could be fixed by moving to
> > nodelets? Has there been much work been done to optimize the nodes
> > within the image_pipeline package?
> >
> >
> > _______________________________________________
> > ros-users mailing list
> > ros-users at code.ros.org
> > https://code.ros.org/mailman/listinfo/ros-users
> >
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100618/a2aad9f7/attachment-0003.html>


More information about the ros-users mailing list