Yeah, I'm not sure why OpenCV insists on the bgr8 format - don't know
anything else that uses it. rgb8 is normal.
Cheers --Kurt
On 6/18/2010 12:28 PM, Jack O'Quin wrote:
> On Fri, Jun 18, 2010 at 12:17 PM, Bill Morris<morris@ee.ccny.cuny.edu> wrote:
>> On Fri, 2010-06-18 at 09:53 -0700, Vijay Pradeep wrote:
>>> Hi Bill,
>>>
>>> What is the encoding of the images that you're viewing?
>>>> rostopic echo [image_topic]/encoding
>>
>> rgb8
>>
>>> 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.
>>
>> I'll try getting the camera driver to output bgr8 and see how that goes.
>> I wanted to check if someone else had done the work before I started
>> profiling the code.
>
> At least for 1394 cameras, bgr8 is not one of the hardware options
> available. So, if that's a requirement, some software is going to have
> to re-format somewhere.