Hi Bill,<br><br>What is the encoding of the images that you're viewing?<br><span style="font-family: courier new,monospace;">> rostopic echo [image_topic]/encoding</span><br><br>The following is based on <span style="font-family: courier new,monospace;">image_view/src/image_view.cpp</span>:<br>

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:<br>

<br><span style="font-family: courier new,monospace;">    if (img_bridge_.fromImage(*msg, "bgr8"))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      cvShowImage(window_name_.c_str(), img_bridge_.toIpl());</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      ROS_ERROR("Unable to convert %s image to bgr8", msg->encoding.c_str());</span><br style="font-family: courier new,monospace;">

<br>I'm guessing this could be optimized a bit.<br><br>Vijay<br><br><div class="gmail_quote">On Fri, Jun 18, 2010 at 9:32 AM, Kurt Konolige <span dir="ltr"><<a href="mailto:konolige@willowgarage.com">konolige@willowgarage.com</a>></span> wrote:<br>

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