PXD Family

Datasheet (PDF)

Manual & Guide

Application Notes

Driver Updates

Example Source Code

Compatible Image Processing Software

Product FAQ

Home Page


Feedback at:
CSinfo@cyberoptics.com or
1-800-366-9131

Converting a Bayer Pattern to RGB
Introduction

Several cameras, such as the Basler A101C, provide color images that are encoded with a Bayer pattern. That is, the cameras actually provide a monochrome image, but within that monochrome image is actually an encoded color image. To see the color image, one must first decode the image using the Bayer algorithm.

The routines provided by Imagenation can take such an encoded image that is in one frame buffer, and decode it into an RGB image into another frame buffer.

Usage

The Imagenation Bayer to RGB routines are part of the IMG_Bayer library. This library is provided to Imagenation customers, to support their use of digital cameras that provide images that are encoded with a Bayer pattern. It requires that a PXD frame grabber be installed and initialized.

The first step that an application does is to initialize the necessary libraries. These are the Imagenation Frame library and the Frame Grabber library. Next, a PXD frame grabber is initialized. Also, the application needs to create two frame buffers. One is monochrome (PBITS_Y8) to hold the captured image. The other is RGB (PBITS_RGB24) to hold the decoded image. Later, in the course of the application, the PXD frame grabber is used to grab a Bayer color-encoded image from the camera. Then, by calling the IMG_Bayer2RGB function, the user will be provided with the RGB version of the encoded image.

A sample application – BAYERTEST – is available to demonstrate the use of this function.

Also included in the BAYERTEST sample application is a routine to assist in displaying images in a frame buffer. This function – ShowAnyFrame – is also documented in the API section.