Skip to content

Processed Raw Enable#

The Processed Raw Enable camera feature allows you to use the Color Transformation and Color Adjustment features when using a Bayer pixel format.

Using the Feature#

Prerequisites#

The camera's pixel format must be set to a Bayer pixel format, e.g., Bayer 12.

Enabling Processed Raw Enable#

You should only enable the Processed Raw Enable feature if both of the following conditions are met:

In all other cases, do not enable this feature. Otherwise, image quality may be reduced.

To enable the Processed Raw Enable feature, set the ProcessedRawEnable parameter to true.

How It Works#

The Color Transformation and Color Adjustment features require image data stored in RGB triplets in order to work. When a "raw" Bayer pixel format is used, normally, RGB triplets are not provided. Instead, each pixel provides only either red, green, or blue data. To calculate the RGB triplets, a demosaicing algorithm must be performed on the raw image data. This means that the raw image data must be processed.

When Processed Raw Enable is enabled, the raw Bayer pixel data is demosaiced and converted to RGB data, allowing the Color Transformation and Color Adjustment features to work. After that, the modified pixel data is reconverted to Bayer pixel data. The final Bayer data output is no longer "raw" output, but rather "processed raw" output.

When Processed Raw Enable is disabled and a Bayer pixel format is used, the Color Transformation and the Color Adjustment features are available but have no effect.

Sample Code#

// Set the pixel format to Bayer BG8
camera.PixelFormat.SetValue(PixelFormat_BayerBG8);
// Enable Processed Raw Enable
camera.ProcessedRawEnable.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Bayer BG8
CEnumerationPtr(nodemap.GetNode("PixelFormat"))->FromString("BayerBG8");
// Enable Processed Raw Enable
CBooleanPtr(nodemap.GetNode("ProcessedRawEnable"))->SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Bayer BG8
CEnumParameter(nodemap, "PixelFormat").SetValue("BayerBG8");
// Enable Processed Raw Enable
CBooleanParameter(nodemap, "ProcessedRawEnable").SetValue(true);
// Set the pixel format to Bayer BG8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.BayerBG8);
// Enable Processed Raw Enable
camera.Parameters[PLCamera.ProcessedRawEnable].SetValue(true);
// Set the pixel format to Bayer BG8
Pylon.DeviceFeatureFromString(hdev, "PixelFormat", "BayerBG8");
// Enable Processed Raw Enable
Pylon.DeviceSetBooleanFeature(hdev, "ProcessedRawEnable", true);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the pixel format to Bayer BG8 */
errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "BayerBG8");
CHECK(errRes);
/* Enable Processed Raw Enable */
errRes = PylonDeviceSetBooleanFeature(hdev, "ProcessedRawEnable", 1);
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.