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@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@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@code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users