跳转到内容

Color Adjustment#

相机的 Color Adjustment 功能可让您调整图像中各个颜色的色相和饱和度。

您可以分别为 RGB 色彩空间(红、绿、蓝、黄、青和品红)中的每种原色和辅助色调整色相和饱和度。

如果要一步调整所有颜色的外观,请使用 Hue and Saturation 功能(如果有)。

该功能的使用#

为什么使用 Color Adjustment#

  • 调整色相可偏移图像的色彩。例如,这对于校正较小的不良色移或创建伪彩色图像很有用。
  • 调整饱和度可更改色彩的鲜艳程度(强度)。增加饱和度有助于使颜色更容易区分。

设置 Color Adjustment 参数#

  1. ProcessedRawEnable 参数设置为 true如果可用且如果您采用的是 Bayer 像素格式)。
  2. ColorAdjustmentEnable 参数设置为 true如果可用)。
  3. ColorAdjustmentSelector 参数设置为所需颜色,例如红色
  4. 输入 ColorAdjustmentHue 参数的所需值。该参数设置为 0 时,色相不会更改。
  5. 输入 ColorAdjustmentSaturation 参数的所需值。该参数设置为 1 时,饱和度不会更改。

运作原理#

Color Adjustment 功能参数指的是 RGB 色彩立方体。

为了更方便查看,可以将颜色立方体投影到平面上,从而形成颜色六边形:

投影在平面上的 RGB 颜色立方体

原色(红、绿、蓝)和辅助色(黄、青、品红)位于此颜色六边形的六个角上。

您可以调整每种颜色的色相和饱和度。这会影响图像中所有以被调颜色为主的区域。例如,调整红色会影响图像中红色为主导成分的颜色。

下图显示了改变红色的色相和饱和度如何影响图像的颜色:

色相和饱和度在颜色六边形中进行调整。以红色为例展示调整

这会产生如下明显效果:

如果 ColorAdjustmentHue 参数的值范围是 -4.0 到 3.96875:

  • 降低色相会将所有红色(即以红色为主导成分的颜色)朝着黄色的方向调整。
  • 增加色相会使所有红色朝着洋红色的方向调整。

如果 ColorAdjustmentHue 参数的值范围是 -1.0 到 1.0:

  • 增加色相会将所有红色(即以红色为主导成分的颜色)朝着黄色的方向调整。
  • 降低色相会使所有红色朝着洋红色的方向调整。

降低饱和度会降低所有红色的鲜艳程度。如果降至最小值,所有红色将被灰色替代。

增加饱和度会增加所有红色的鲜艳程度。如果增加至最大值,所有红色将替换为 100% 红色。

信息

调整颜色时,颜色六边形中最接近的相邻颜色也会受到一定程度的影响。例如,当您调整红色时,黄色和品红色也会受到影响。

附加参数#

根据您的相机型号,可以使用以下附加参数:

  • ColorAdjustmentEnable:启用或禁用 Color Adjustment 功能。
  • ColorAdjustmentReset 命令:允许您将颜色调整参数重置为初始值。如果您的调节未达到理想效果,并且您想快速返回到原始设置,则此功能特别有用。
  • ColorAdjustmentHueRaw:允许您为色相参数输入 -128 到 127 之间的整数值。整数范围线性映射到浮点范围,其中 -128 等于 -4.0,32 等于 1.0,而 127 等于 3.96875。
  • ColorAdjustmentSaturationRaw:允许您为饱和度参数输入 0 到 255 之间的整数值。整数范围线性映射到浮点范围,其中 0 等于 0.0,128 等于 1.0,而 255 等于 1.99219。

详情#

显示所有相机型号

相机型号 附加参数
a2A1920-51gcBAS BslColorAdjustmentEnable
a2A1920-51gcPRO BslColorAdjustmentEnable
a2A1920-51gmBAS 不支持 Color Adjustment 功能
a2A1920-51gmPRO 不支持 Color Adjustment 功能
a2A1920-160ucBAS BslColorAdjustmentEnable
a2A1920-160ucPRO BslColorAdjustmentEnable
a2A1920-160umBAS 不支持 Color Adjustment 功能
a2A1920-160umPRO 不支持 Color Adjustment 功能
a2A2590-22gcBAS BslColorAdjustmentEnable
a2A2590-22gcPRO BslColorAdjustmentEnable
a2A2590-22gmBAS 不支持 Color Adjustment 功能
a2A2590-22gmPRO 不支持 Color Adjustment 功能
a2A2590-60ucBAS BslColorAdjustmentEnable
a2A2590-60ucPRO BslColorAdjustmentEnable
a2A2590-60umBAS 不支持 Color Adjustment 功能
a2A2590-60umPRO 不支持 Color Adjustment 功能
a2A3840-13gcBAS BslColorAdjustmentEnable
a2A3840-13gcPRO BslColorAdjustmentEnable
a2A3840-13gmBAS 不支持 Color Adjustment 功能
a2A3840-13gmPRO 不支持 Color Adjustment 功能
a2A3840-45ucBAS BslColorAdjustmentEnable
a2A3840-45ucPRO BslColorAdjustmentEnable
a2A3840-45umBAS 不支持 Color Adjustment 功能
a2A3840-45umPRO 不支持 Color Adjustment 功能
acA640-90gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA640-90gm 不支持 Color Adjustment 功能
acA640-90uc
acA640-90um 不支持 Color Adjustment 功能
acA640-120gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA640-120gm 不支持 Color Adjustment 功能
acA640-120uc
acA640-120um 不支持 Color Adjustment 功能
acA640-121gm 不支持 Color Adjustment 功能
acA640-300gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA640-300gm 不支持 Color Adjustment 功能
acA640-750uc
acA640-750um 不支持 Color Adjustment 功能
acA720-290gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA720-290gm 不支持 Color Adjustment 功能
acA720-520uc
acA720-520um 不支持 Color Adjustment 功能
acA780-75gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA780-75gm 不支持 Color Adjustment 功能
acA800-200gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA800-200gm 不支持 Color Adjustment 功能
acA800-510uc
acA800-510um 不支持 Color Adjustment 功能
acA1280-60gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1280-60gm 不支持 Color Adjustment 功能
acA1300-22gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1300-22gm 不支持 Color Adjustment 功能
acA1300-30gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1300-30gm 不支持 Color Adjustment 功能
acA1300-30uc
acA1300-30um 不支持 Color Adjustment 功能
acA1300-60gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1300-60gm 不支持 Color Adjustment 功能
acA1300-60gmNIR 不支持 Color Adjustment 功能
acA1300-75gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1300-75gm 不支持 Color Adjustment 功能
acA1300-200uc
acA1300-200um 不支持 Color Adjustment 功能
acA1440-73gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1440-73gm 不支持 Color Adjustment 功能
acA1440-220uc
acA1440-220um 不支持 Color Adjustment 功能
acA1600-20gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1600-20gm 不支持 Color Adjustment 功能
acA1600-20uc
acA1600-20um 不支持 Color Adjustment 功能
acA1600-60gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1600-60gm 不支持 Color Adjustment 功能
acA1920-25gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1920-25gm 不支持 Color Adjustment 功能
acA1920-25uc
acA1920-25um 不支持 Color Adjustment 功能
acA1920-40gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1920-40gm 不支持 Color Adjustment 功能
acA1920-40uc
acA1920-40ucMED
acA1920-40um 不支持 Color Adjustment 功能
acA1920-40umMED 不支持 Color Adjustment 功能
acA1920-48gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1920-48gm 不支持 Color Adjustment 功能
acA1920-50gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA1920-50gm 不支持 Color Adjustment 功能
acA1920-150uc
acA1920-150um 不支持 Color Adjustment 功能
acA1920-155uc
acA1920-155ucMED
acA1920-155um 不支持 Color Adjustment 功能
acA1920-155umMED 不支持 Color Adjustment 功能
acA2000-50gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2000-50gm 不支持 Color Adjustment 功能
acA2000-50gmNIR 不支持 Color Adjustment 功能
acA2000-165uc 不支持 Color Adjustment 功能
acA2000-165um 不支持 Color Adjustment 功能
acA2000-165umNIR 不支持 Color Adjustment 功能
acA2040-25gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2040-25gm 不支持 Color Adjustment 功能
acA2040-25gmNIR 不支持 Color Adjustment 功能
acA2040-35gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2040-35gm 不支持 Color Adjustment 功能
acA2040-55uc
acA2040-55um 不支持 Color Adjustment 功能
acA2040-90uc 不支持 Color Adjustment 功能
acA2040-90um 不支持 Color Adjustment 功能
acA2040-90umNIR 不支持 Color Adjustment 功能
acA2040-120uc
acA2040-120um 不支持 Color Adjustment 功能
acA2440-20gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2440-20gm 不支持 Color Adjustment 功能
acA2440-35uc
acA2440-35ucMED
acA2440-35um 不支持 Color Adjustment 功能
acA2440-35umMED 不支持 Color Adjustment 功能
acA2440-75uc
acA2440-75ucMED
acA2440-75um 不支持 Color Adjustment 功能
acA2440-75umMED 不支持 Color Adjustment 功能
acA2500-14gc 不支持 Color Adjustment 功能
acA2500-14gm 不支持 Color Adjustment 功能
acA2500-14uc
acA2500-14um 不支持 Color Adjustment 功能
acA2500-20gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2500-20gcMED ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA2500-20gm 不支持 Color Adjustment 功能
acA2500-20gmMED 不支持 Color Adjustment 功能
acA2500-60uc
acA2500-60um 不支持 Color Adjustment 功能
acA3088-16gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA3088-16gm 不支持 Color Adjustment 功能
acA3088-57uc
acA3088-57um 不支持 Color Adjustment 功能
acA3800-10gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA3800-10gm 不支持 Color Adjustment 功能
acA3800-14uc
acA3800-14um 不支持 Color Adjustment 功能
acA4024-8gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA4024-8gm 不支持 Color Adjustment 功能
acA4024-29uc
acA4024-29um 不支持 Color Adjustment 功能
acA4096-11gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA4096-11gm 不支持 Color Adjustment 功能
acA4096-30uc
acA4096-30ucMED
acA4096-30um 不支持 Color Adjustment 功能
acA4096-30umMED 不支持 Color Adjustment 功能
acA4096-40uc
acA4096-40ucMED
acA4096-40um 不支持 Color Adjustment 功能
acA4096-40umMED 不支持 Color Adjustment 功能
acA4112-8gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA4112-8gm 不支持 Color Adjustment 功能
acA4112-20uc
acA4112-20ucMED
acA4112-20um 不支持 Color Adjustment 功能
acA4112-20umMED 不支持 Color Adjustment 功能
acA4112-30uc
acA4112-30ucMED
acA4112-30um 不支持 Color Adjustment 功能
acA4112-30umMED 不支持 Color Adjustment 功能
acA4600-7gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA4600-10uc
acA5472-5gc ColorAdjustmentEnable[^a]
ColorAdjustmentReset
ColorAdjustmentHueRaw
ColorAdjustmentSaturationRaw
acA5472-5gm 不支持 Color Adjustment 功能
acA5472-17uc
acA5472-17ucMED
acA5472-17um 不支持 Color Adjustment 功能
boA4096-93cc BslColorAdjustmentEnable
boA4096-93cm 不支持 Color Adjustment 功能
boA4112-68cc BslColorAdjustmentEnable
boA4112-68cm 不支持 Color Adjustment 功能
daA1280-54lc 不支持 Color Adjustment 功能
daA1280-54lm 不支持 Color Adjustment 功能
daA1280-54uc 不支持 Color Adjustment 功能
daA1280-54um 不支持 Color Adjustment 功能
daA1600-60lc 不支持 Color Adjustment 功能
daA1600-60lm 不支持 Color Adjustment 功能
daA1600-60uc 不支持 Color Adjustment 功能
daA1600-60um 不支持 Color Adjustment 功能
daA1920-15um 不支持 Color Adjustment 功能
daA1920-30uc 不支持 Color Adjustment 功能
daA1920-30um 不支持 Color Adjustment 功能
daA2500-14lc 不支持 Color Adjustment 功能
daA2500-14lm 不支持 Color Adjustment 功能
daA2500-14uc 不支持 Color Adjustment 功能
daA2500-14um 不支持 Color Adjustment 功能
daA2500-60mc 不支持 Color Adjustment 功能
daA2500-60mci 不支持 Color Adjustment 功能
daA4200-30mci 不支持 Color Adjustment 功能
puA1280-54uc 不支持 Color Adjustment 功能
puA1280-54um 不支持 Color Adjustment 功能
puA1600-60uc 不支持 Color Adjustment 功能
puA1600-60um 不支持 Color Adjustment 功能
puA1920-30uc 不支持 Color Adjustment 功能
puA1920-30um 不支持 Color Adjustment 功能
puA2500-14uc 不支持 Color Adjustment 功能
puA2500-14um 不支持 Color Adjustment 功能

示例代码#

ace classic/U/L GigE 相机#

// Enable the Color Adjustment feature
camera.ColorAdjustmentEnable.SetValue(true);
// Select red as the color to adjust
camera.ColorAdjustmentSelector.SetValue(ColorAdjustmentSelector_Red);
// Enter a floating point value for the red hue
camera.ColorAdjustmentHue.SetValue(-1.125);
// Enter a floating point value for the red saturation
camera.ColorAdjustmentSaturation.SetValue(1.375);
// Select cyan as the color to adjust
camera.ColorAdjustmentSelector.SetValue(ColorAdjustmentSelector_Cyan);
// Enter an integer value for the cyan hue
camera.ColorAdjustmentHueRaw.SetValue(-36);
// Enter an integer value for the cyan saturation
camera.ColorAdjustmentSaturationRaw.SetValue(176);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the Color Adjustment feature
CBooleanPtr(nodemap.GetNode("ColorAdjustmentEnable"))->SetValue(true);
// Select red as the color to adjust
CEnumerationPtr(nodemap.GetNode("ColorAdjustmentSelector"))->FromString("Red");
// Enter a floating point value for the red hue
CFloatPtr(nodemap.GetNode("ColorAdjustmentHue"))->SetValue(-1.125);
// Enter a floating point value for the red saturation
CFloatPtr(nodemap.GetNode("ColorAdjustmentSaturation"))->SetValue(1.375);
// Select cyan as the color to adjust
CEnumerationPtr(nodemap.GetNode("ColorAdjustmentSelector"))->FromString("Cyan");
// Enter an integer value for the cyan hue
CIntegerPtr(nodemap.GetNode("ColorAdjustmentHueRaw"))->SetValue(-36);
// Enter an integer value for the cyan saturation
CIntegerPtr(nodemap.GetNode("ColorAdjustmentSaturationRaw"))->SetValue(176);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the Color Adjustment feature
CBooleanParameter(nodemap, "ColorAdjustmentEnable").SetValue(true);
// Select red as the color to adjust
CEnumParameter(nodemap, "ColorAdjustmentSelector").SetValue("Red");
// Enter a floating point value for the red hue
CFloatParameter(nodemap, "ColorAdjustmentHue").SetValue(-1.125);
// Enter a floating point value for the red saturation
CFloatParameter(nodemap, "ColorAdjustmentSaturation").SetValue(1.375);
// Select cyan as the color to adjust
CEnumParameter(nodemap, "ColorAdjustmentSelector").SetValue("Cyan");
// Enter an integer value for the cyan hue
CIntegerParameter(nodemap, "ColorAdjustmentHueRaw").SetValue(-36);
// Enter an integer value for the cyan saturation
CIntegerParameter(nodemap, "ColorAdjustmentSaturationRaw").SetValue(176);
// Enable the Color Adjustment feature
camera.Parameters[PLCamera.ColorAdjustmentEnable].SetValue(true);
// Select red as the color to adjust
camera.Parameters[PLCamera.ColorAdjustmentSelector].SetValue(PLCamera.ColorAdjustmentSelector.Red);
// Enter a floating point value for the red hue
camera.Parameters[PLCamera.ColorAdjustmentHue].SetValue(-1.125);
// Enter a floating point value for the red saturation
camera.Parameters[PLCamera.ColorAdjustmentSaturation].SetValue(1.375);
// Select cyan as the color to adjust
camera.Parameters[PLCamera.ColorAdjustmentSelector].SetValue(PLCamera.ColorAdjustmentSelector.Cyan);
// Enter an integer value for the cyan hue
camera.Parameters[PLCamera.ColorAdjustmentHueRaw].SetValue(-36);
// Enter an integer value for the cyan saturation
camera.Parameters[PLCamera.ColorAdjustmentSaturationRaw].SetValue(176);
// Enable the Color Adjustment feature
Pylon.DeviceSetBooleanFeature(hdev, "ColorAdjustmentEnable", true);
// Select red as the color to adjust
Pylon.DeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Red");
// Enter a floating point value for the red hue
Pylon.DeviceSetFloatFeature(hdev, "ColorAdjustmentHue", -1.125);
// Enter a floating point value for the red saturation
Pylon.DeviceSetFloatFeature(hdev, "ColorAdjustmentSaturation", 1.375);
// Select cyan as the color to adjust
Pylon.DeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Cyan");
// Enter an integer value for the cyan hue
Pylon.DeviceSetIntegerFeature(hdev, "ColorAdjustmentHueRaw", -36);
// Enter an integer value for the cyan saturation
Pylon.DeviceSetIntegerFeature(hdev, "ColorAdjustmentSaturationRaw", 176);
/* 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 */
/* Enable the Color Adjustment feature */
errRes = PylonDeviceSetBooleanFeature(hdev, "ColorAdjustmentEnable", 1);
CHECK(errRes);
/* Select red as the color to adjust */
errRes = PylonDeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Red");
CHECK(errRes);
/* Enter a floating point value for the red hue */
errRes = PylonDeviceSetFloatFeature(hdev, "ColorAdjustmentHue", -1.125);
CHECK(errRes);
/* Enter a floating point value for the red saturation */
errRes = PylonDeviceSetFloatFeature(hdev, "ColorAdjustmentSaturation", 1.375);
CHECK(errRes);
/* Select cyan as the color to adjust */
errRes = PylonDeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Cyan");
CHECK(errRes);
/* Enter an integer value for the cyan hue */
errRes = PylonDeviceSetIntegerFeature(hdev, "ColorAdjustmentHueRaw", -36);
CHECK(errRes);
/* Enter an integer value for the cyan saturation */
errRes = PylonDeviceSetIntegerFeature(hdev, "ColorAdjustmentSaturationRaw", 176);
CHECK(errRes);

ace 2 和 boost 相机#

// Select red as the color to adjust
camera.BslColorAdjustmentSelector.SetValue(ColorAdjustmentSelector_Red);
// Enter an integer value for the red hue
camera.BslColorAdjustmentHue.SetValue(-1.125);
// Enter an integer value for the red saturation
camera.BslColorAdjustmentSaturation.SetValue(1.375);
INodeMap& nodemap = camera.GetNodeMap();
// Select red as the color to adjust
CEnumerationPtr(nodemap.GetNode("BslColorAdjustmentSelector"))->FromString("Red");
// Enter an integer value for the red hue
CFloatPtr(nodemap.GetNode("BslColorAdjustmentHue"))->SetValue(-1.125);
// Enter an integer value for the red saturation
CFloatPtr(nodemap.GetNode("BslColorAdjustmentSaturation"))->SetValue(1.375);
INodeMap& nodemap = camera.GetNodeMap();
// Select red as the color to adjust
CEnumParameter(nodemap, "BslColorAdjustmentSelector").SetValue("Red");
// Enter an integer value for the red hue
CFloatParameter(nodemap, "BslColorAdjustmentHue").SetValue(-1.125);
// Enter an integer value for the red saturation
CFloatParameter(nodemap, "BslColorAdjustmentSaturation").SetValue(1.375);
// Select red as the color to adjust
camera.Parameters[PLCamera.BslColorAdjustmentSelector].SetValue(PLCamera.ColorAdjustmentSelector.Red);
// Enter an integer value for the red hue
camera.Parameters[PLCamera.BslColorAdjustmentHue].SetValue(-1.125);
// Enter an integer value for the red saturation
camera.Parameters[PLCamera.BslColorAdjustmentSaturation].SetValue(1.375);
// Select red as the color to adjust
Pylon.DeviceFeatureFromString(hdev, "BslColorAdjustmentSelector", "Red");
// Enter an integer value for the red hue
Pylon.DeviceSetFloatFeature(hdev, "BslColorAdjustmentHue", -1.125);
// Enter an integer value for the red saturation
Pylon.DeviceSetFloatFeature(hdev, "BslColorAdjustmentSaturation", 1.375);
/* 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 */
/* Select red as the color to adjust */
errRes = PylonDeviceFeatureFromString(hdev, "BslColorAdjustmentSelector", "Red");
CHECK(errRes);
/* Enter an integer value for the red hue */
errRes = PylonDeviceSetFloatFeature(hdev, "BslColorAdjustmentHue", -1.125);
CHECK(errRes);
/* Enter an integer value for the red saturation */
errRes = PylonDeviceSetFloatFeature(hdev, "BslColorAdjustmentSaturation", 1.375);
CHECK(errRes);

其他相机#

// Select red as the color to adjust
camera.ColorAdjustmentSelector.SetValue(ColorAdjustmentSelector_Red);
// Enter an integer value for the red hue
camera.ColorAdjustmentHue.SetValue(-1.125);
// Enter an integer value for the red saturation
camera.ColorAdjustmentSaturation.SetValue(1.375);
INodeMap& nodemap = camera.GetNodeMap();
// Select red as the color to adjust
CEnumerationPtr(nodemap.GetNode("ColorAdjustmentSelector"))->FromString("Red");
// Enter an integer value for the red hue
CFloatPtr(nodemap.GetNode("ColorAdjustmentHue"))->SetValue(-1.125);
// Enter an integer value for the red saturation
CFloatPtr(nodemap.GetNode("ColorAdjustmentSaturation"))->SetValue(1.375);
INodeMap& nodemap = camera.GetNodeMap();
// Select red as the color to adjust
CEnumParameter(nodemap, "ColorAdjustmentSelector").SetValue("Red");
// Enter an integer value for the red hue
CFloatParameter(nodemap, "ColorAdjustmentHue").SetValue(-1.125);
// Enter an integer value for the red saturation
CFloatParameter(nodemap, "ColorAdjustmentSaturation").SetValue(1.375);
// Select red as the color to adjust
camera.Parameters[PLCamera.ColorAdjustmentSelector].SetValue(PLCamera.ColorAdjustmentSelector.Red);
// Enter an integer value for the red hue
camera.Parameters[PLCamera.ColorAdjustmentHue].SetValue(-1.125);
// Enter an integer value for the red saturation
camera.Parameters[PLCamera.ColorAdjustmentSaturation].SetValue(1.375);
// Select red as the color to adjust
Pylon.DeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Red");
// Enter an integer value for the red hue
Pylon.DeviceSetFloatFeature(hdev, "ColorAdjustmentHue", -1.125);
// Enter an integer value for the red saturation
Pylon.DeviceSetFloatFeature(hdev, "ColorAdjustmentSaturation", 1.375);
/* 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 */
/* Select red as the color to adjust */
errRes = PylonDeviceFeatureFromString(hdev, "ColorAdjustmentSelector", "Red");
CHECK(errRes);
/* Enter an integer value for the red hue */
errRes = PylonDeviceSetFloatFeature(hdev, "ColorAdjustmentHue", -1.125);
CHECK(errRes);
/* Enter an integer value for the red saturation */
errRes = PylonDeviceSetFloatFeature(hdev, "ColorAdjustmentSaturation", 1.375);
CHECK(errRes);

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