Note: This tutorial assumes that you have completed the previous tutorials: Connecting to an IEEE 1394 Camera, Setting Parameters Dynamically.
(!) Please ask about problems and questions regarding this tutorial on Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

How to Set IEEE 1394 Camera Bayer Parameters

Description: This tutorial explains how to set color decoding parameters for IEEE 1394 cameras with Bayer encoding.

Tutorial Level: BEGINNER

Next Tutorial: Configuring IEEE 1394 Camera Features


Many IIDC cameras provide color images in a Bayer encoding.

If your camera does not use Bayer color encoding, skip this tutorial and go on to Configuring IEEE 1394 Camera Features.

Preliminary Steps

Start the camera1394 driver, image_view, image_proc, and dynamic_reconfigure GUI as described in the previous Connecting to an IEEE 1394 Camera and Setting Parameters Dynamically tutorials.

To view the color images, view the image_proc color output using image_view:

$ rosrun image_view image_view image:=camera/image_color

Since we have not yet set the color decoding options, the image_proc window will log a warning that no color information is available.

That's OK at this point, we're about to fix it.

Bayer Decoding Options

For cameras of this type, set video_mode to an appropriate mono8 or mono16 value.

The driver provides two alternate mechanisms for decoding Bayer information:

  • Standard ROS image_pipeline decoding (recommended).

    To use this, set the bayer_method parameter to "" (the default). This is the preferred method; it behaves like the other ROS camera drivers.

  • Built-in decoding provided by libdc1394 conversions.

    To use this, select one of the other bayer_method options. They may have less CPU overhead in some systems, in others they may slow down the camera frame rate since decoding is done in the main driver thread. Performance depends on image size, decoding method, CPU speed and number of processors available. Experimenting with the different options may reveal the best setting for a specific camera and system.

In both cases the camera/image_raw image stream is compatible with the ROS image_pipeline. To start with, leave bayer_method set to the default.

Bayer Pattern Options

Once bayer_decoding is set, select the correct bayer_pattern for your camera. IIDC does not provide any way for the camera driver to discover the correct pattern automatically. The technical manual for the camera will list the correct pattern, or you can discover it experimentally.

Possible bayer_pattern values are: "" (no Bayer encoding), "rggb" , "gbrg" , "grbg", and "bggr".

If you're not sure what value to use, try them all one at a time while viewing the image_color window. Incorrect patterns will cause strange colors to appear. The correct one shows a valid color image.

Setting Other Features

Now continue with the Configuring IEEE 1394 Camera Features tutorial.

Wiki: camera1394/Tutorials/SettingIEEE1394BayerParameters (last edited 2015-04-15 17:41:18 by JackOQuin)