How to determine and interpret the Bayer Tile pixel format of a camera

Last Revision Date: 11/25/2015

All of our color imaging products are capable of streaming the raw, stippled 8-bit or 16-bit-per-pixel Bayer Tile image data to the PC, which can then be color processed / interpolated to 24- or 32-bit BGR data. See "Different color processing algorithms" for further details on color processing. To configure a camera to output raw Bayer data, consult your camera's Technical Reference manual.

The actual physical arrangement of the red, green and blue pixels for a given camera is determined by the arrangement of the color filter arrays on the imaging sensor itself. The format (i.e. order) in which this raw color data is sent out, however, depends on the specific camera model and firmware version. This format can be queried using the BAYER_TILE_MAPPING register 0x1040 that is implemented on all of our cameras. For more information on this register, consult the Digital Camera Register Reference.

Raw image data can be accessed programmatically via the pData pointer in the FlyCaptureImage structure (e.g. FlyCaptureImage.pData). In 8-bit-per-pixel Raw image data can be accessed via the pData pointer in the FlyCaptureImage structure (e.g. FlyCaptureImage.pData). In 8-bit-per-pixel modes, the first byte represents the pixel at (row 0, column 0), the second byte at (row 0, column 1), etc.

Here is an example of a 2048 x 2048 color Grasshopper3 (GS3-U3-41C6C) sending out RAW8 image data in GBRG format. When we access the image data via the pData pointer, we have the following:

    • pData[0] = Row 0, Column 0 = green pixel (G)
    • pData[1] = Row 0, Column 1 = blue pixel (B)
    • pData[2048] = Row 1, Column 0 = red pixel (R)
    • pData[2049] = Row 1, Column 1 = green pixel (G)
関連記事