[ros-users] [camera_divers/camera1394] not able to set bayer pattern if camera is format7

Jack O'Quin jack.oquin at gmail.com
Wed Jul 13 13:11:14 UTC 2011

On Wed, Jul 13, 2011 at 6:18 AM, Sebastian Schneider <schneider at unibw.de> wrote:
> Hello,
> I tried to obtain images from an AVT Guppy using the nodelet configuration,
> as shown below:
> <launch>
>  <!-- nodelet manager process -->
>  <node pkg="nodelet" type="nodelet" name="camera_nodelet_manager"
>        args="manager" />
>  <!-- camera driver nodelet -->
>  <node pkg="nodelet" type="nodelet" name="camera1394_nodelet"
>        args="load camera1394/driver camera_nodelet_manager">
>        <param name="video_mode" value="format7_mode0"/>
>        <param name="format7_color_coding" value="raw8"/>
>        <param name="bayer_pattern" value="bggr"/>
>        <param name="bayer_method" value="" />
>  </node>
>  <!-- Bayer color decoding -->
>  <node pkg="nodelet" type="nodelet" name="image_proc_debayer"
>        args="load image_proc/debayer camera_nodelet_manager">
>    <remap from="image_color" to="camera/image_color" />
>    <remap from="image_mono" to="camera/image_mono" />
>    <remap from="image_raw" to="camera/image_raw" />
>  </node>
>  <!-- Image View Node -->
>  <node pkg="image_view" type="image_view" name="image_view" >
>    <remap from="image" to="camera/image_color"/>
>  </node>
> </launch>
> However, the bayer pattern reconstruction is using the pattern rggb, instead
> of bggr, as it was told. Changing the pattern using the dynamic_reconfigure
> GUI, also does have no effect.
> I tried to trace the problem down and I found out, that as my camera is set
> to work in the format7 video-mode, thus most of the work is happening in
> camera_drivers/camera1394/src/nodes/format7.{h,cpp}. I looked into the files
> and found out, that the desired pattern is no where set in the code.
> Instead, regardless of the configured value, the pattern type is always read
> from the camera, using the dc1394_format7_get_color_filter function. The
> corresponding function to set the value was removed from libdc1394 a long
> time ago (God knows why).
> Since I don't know how to manipulate this value, I wrote a patch for
> format7.{h,cpp} that basically stores the value of the desired bayer
> pattern, and passes this value on in the corresponding field of
> sensor_msgs::Image in the function unpackData. The patch is appended to this
> email.
> I'm not sure if what I do there is right, even though I now have color
> images with the correct color (the sky is really blue now). Maybe someone
> responsible for the developement of this driver can have a look at it.

OK. Please open a bug ticket for this problem.

As best I can recall, the driver assumes that the Format7 Bayer
pattern reported by the device is correct and overrides user input in
that case. Maybe that's not true for your device?

Thanks for the report,

More information about the ros-users mailing list