Certain color cameras output image data in raw format, which is called Bayer format. This chapter discusses what is involved to transform this raw data into a real color format that can be displayed as a color image.
IC Imaging Control provides built-in functionality to debayer raw image data. There are 3 methods ( DeBayerActive, DeBayerStartPattern and DeBayerMode ) that allow the debayering process to be controlled. The prerequisite to use this buit-in functionality is that the camera provides BY8 video formats that identify raw data in Bayer format. Some cameras provide only grayscale video formats (e.g. Y800, RGB8 etc.) but output color raw data when these formats are selected. This is possible because the color raw data in Bayer format consists of only one value per pixel (for detailed information about color raw data, please refer to the glossary of our website www.theimagingsource.com and search for Bayer camera ). In this case the debayering has to be done explicitly by using the DeBayer frame filter that can be loaded from the StdFilters.ftf module.
If a BY8 video format is selected, IC Imaging Control applies debayering to the image data. The method DeBayerActive can be used to determine whether automatic debayering is active. For details on debayering modes and parameters, please refer to DeBayerStartPattern and DeBayerMode. In order to switch off automatic debayering for the sink, you have to assign a bayer format, e.g. eBY8 or "BY8" to the sink ( MemoryCurrentGrabberColorformat, FrameHandlerSink.FrameTypes ). The only way to switch off automatic debayering for the display is to insert a frame filter in the display path that accepts only a bayer format at the input and outputs a monochrome format. All this filter has to do is to copy the data from the input to the output without any changes. In the filter module StdFilter.ftf, there is a filter Bayer To Y800 that does exactly this. The following code fragment shows how to display raw color data in Bayer format:
In oder to apply debayering explicitly to the image stream, you have to load the DeBayer frame filter from the StdFilter.ftf module, insert it in to the desired segment of the image stream and setup the filters parameters to match the Bayer pattern and the desired algorithm:
For details on frame filters please refer to Frame Filters.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.