跳转到内容

Processed Raw Enable#

相机的 Processed Raw Enable 功能可让您在使用拜耳像素格式时,使用 Color TransformationColor Adjustment 功能。

该功能的使用#

启用 Processed Raw Enable#

只有在同时满足以下两个条件时,您才应该启用 Processed Raw Enable 功能:

在所有其他情况下,请勿启用此功能。否则可能会降低图像质量。

要启用 Processed Raw Enable 功能:

  1. 像素格式设置为 Bayer 像素格式,例如 Bayer 12。
  2. Set the ProcessedRawEnable parameter to true.

运作原理#

Color TransformationColor Adjustment 功能需要将图像数据存储在 RGB 三元组中才能正常工作。当使用“原始”拜耳像素格式时,通常不提供 RGB 三元组。而是每个像素仅提供红、绿或蓝数据。要计算 RGB 三元组,必须对原始图像数据执行去马赛克算法。这意味着必须处理原始图像数据。

启用 Processed Raw Enable 后,原始拜耳像素数据将进行去马赛克处理,并转换为 RGB 数据,从而使 Color TransformationColor Adjustment 功能发挥作用。之后,将修改后的像素数据重新转换为拜耳像素数据。最终的拜耳数据输出不再是“原始”输出,而是“经过处理的原始”输出。

在 Processed Raw Enable 禁用并且使用拜耳像素格式时,Color TransformationColor Adjustment 功能可用,但无效。

示例代码#

// 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
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);
/* 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);
# Set the pixel format to Bayer BG8
camera.PixelFormat.Value = "BayerBG8"
# Enable Processed Raw Enable
camera.ProcessedRawEnable.Value = True

您也可以使用 pylon Viewer 轻松设置参数。