Gamma#
该功能的使用#
运作原理#
相机根据以下公式(以彩色相机和红色像素值 (R) 为例)将 Gamma 校正值 (γ) 应用于每个像素的亮度值:
具体的最大像素值 (Rmax) 视情况而有所不同,例如在 8 位像素格式下为 255,在 10 位像素格式下为 1023。
启用 Gamma 校正#
要启用 Gamma 校正:
- 设置
GammaEnable
parameter totrue
(如果可用). - For best results, set the
BlackLevel
parameter to 0. - 设置
Gamma
将参数设置为所需值。该参数值的范围是 0 至 ≈4。- Gamma = 1:整体亮度保持不变。
- Gamma < 1: The overall brightness increases.
- Gamma > 1:整体亮度降低。
在所有情况下,黑色像素(亮度 = 0)和白色像素(亮度 = 最大值)都不会被调整。
信息
- 如果启用 Gamma 校正,并且像素格式设置为 12 位像素格式,则会丢失一些图像信息。像素数据输出仍将是 12 位,但是像素值将在 Gamma 校正过程中插入。
- On boA13440-17cm cameras, gamma correction can only be enabled, if the pixel format is set to an 8-bit pixel format.
附加参数#
根据您的相机型号,可以使用以下附加参数:
GammaEnable
: Enables or disables gamma correction.GammaSelector
:允许您选择以下 Gamma 校正模式:User
: The gamma correction value can be set as desired. (Default.)sRGB
: The camera automatically sets a gamma correction value of approximately 0.4. This value is optimized for image display on sRGB monitors.
BslColorSpaceMode
或BslColorSpace
:允许您选择以下 Gamma 校正模式:RGB
: No additional gamma correction value is applied.sRGB
: The image brightness is optimized for display on an sRGB monitor. A gamma correction value of approximately 0.4 is applied. For more information, see the footnotes in the 详情 section.
详情#
相机型号 | 附加参数 |
---|---|
a2A640-240gmSWIR | 无 |
a2A640-240umSWIR | 无 |
a2A1280-80gmSWIR | 无 |
a2A1280-125umSWIR | 无 |
a2A1920-51gcBAS | BslColorSpacec |
a2A1920-51gcPRO | BslColorSpacec |
a2A1920-51gmBAS | 无 |
a2A1920-51gmPRO | 无 |
a2A1920-160ucBAS | BslColorSpacec |
a2A1920-160ucPRO | BslColorSpacec |
a2A1920-160umBAS | 无 |
a2A1920-160umPRO | 无 |
a2A1920-165g5cBAS | BslColorSpacec |
a2A1920-165g5mBAS | 无 |
a2A2048-35gmSWIR | 无 |
a2A2048-110umSWIR | 无 |
a2A2440-98g5cBAS | BslColorSpacec |
a2A2440-98g5mBAS | 无 |
a2A2448-23gcBAS | BslColorSpacec |
a2A2448-23gcPRO | BslColorSpacec |
a2A2448-23gmBAS | 无 |
a2A2448-23gmPRO | 无 |
a2A2448-75ucBAS | BslColorSpacec |
a2A2448-75ucPRO | BslColorSpacec |
a2A2448-75umBAS | 无 |
a2A2448-75umPRO | 无 |
a2A2448-105g5cBAS | BslColorSpacec |
a2A2448-105g5mBAS | 无 |
a2A2448-120cc | BslColorSpacec |
a2A2448-120cm | 无 |
a2A2448-210cc | BslColorSpacec |
a2A2448-210cm | 无 |
a2A2560-20gmSWIR | 无 |
a2A2560-70umSWIR | 无 |
a2A2590-22gcBAS | BslColorSpacec |
a2A2590-22gcPRO | BslColorSpacec |
a2A2590-22gmBAS | 无 |
a2A2590-22gmPRO | 无 |
a2A2590-60ucBAS | BslColorSpacec |
a2A2590-60ucPRO | BslColorSpacec |
a2A2590-60umBAS | 无 |
a2A2590-60umPRO | 无 |
a2A2600-20gcBAS | BslColorSpacec |
a2A2600-20gcPRO | BslColorSpacec |
a2A2600-20gmBAS | 无 |
a2A2600-20gmPRO | 无 |
a2A2600-64ucBAS | BslColorSpacec |
a2A2600-64ucPRO | BslColorSpacec |
a2A2600-64umBAS | 无 |
a2A2600-64umPRO | 无 |
a2A2840-14gcBAS | BslColorSpacec |
a2A2840-14gcPRO | BslColorSpacec |
a2A2840-14gmBAS | 无 |
a2A2840-14gmPRO | 无 |
a2A2840-14gmUV | 无 |
a2A2840-48ucBAS | BslColorSpacec |
a2A2840-48ucPRO | BslColorSpacec |
a2A2840-48umBAS | 无 |
a2A2840-48umPRO | 无 |
a2A2840-48umUV | 无 |
a2A2840-67g5cBAS | BslColorSpacec |
a2A2840-67g5mBAS | 无 |
a2A2840-67g5mUV | 无 |
a2A2840-86cc | BslColorSpacec |
a2A2840-86cm | 无 |
a2A3536-9gcBAS | BslColorSpacec |
a2A3536-9gcPRO | BslColorSpacec |
a2A3536-9gmBAS | 无 |
a2A3536-9gmPRO | 无 |
a2A3536-31ucBAS | BslColorSpacec |
a2A3536-31ucPRO | BslColorSpacec |
a2A3536-31umBAS | 无 |
a2A3536-31umPRO | 无 |
a2A3536-42g5cBAS | BslColorSpacec |
a2A3536-42g5mBAS | 无 |
a2A3840-13gcBAS | BslColorSpacec |
a2A3840-13gcPRO | BslColorSpacec |
a2A3840-13gmBAS | 无 |
a2A3840-13gmPRO | 无 |
a2A3840-45ucBAS | BslColorSpacec |
a2A3840-45ucPRO | BslColorSpacec |
a2A3840-45umBAS | 无 |
a2A3840-45umPRO | 无 |
a2A4096-9gcBAS | BslColorSpacec |
a2A4096-9gcPRO | BslColorSpacec |
a2A4096-9gmBAS | 无 |
a2A4096-9gmPRO | 无 |
a2A4096-30ucBAS | BslColorSpacec |
a2A4096-30ucPRO | BslColorSpacec |
a2A4096-30umBAS | 无 |
a2A4096-30umPRO | 无 |
a2A4096-44g5cBAS | BslColorSpacec |
a2A4096-44g5mBAS | 无 |
a2A4096-67cc | BslColorSpacec |
a2A4096-67cm | 无 |
a2A4200-12gcBAS | BslColorSpacec |
a2A4200-12gcPRO | BslColorSpacec |
a2A4200-12gmBAS | 无 |
a2A4200-12gmPRO | 无 |
a2A4200-40ucBAS | BslColorSpacec |
a2A4200-40ucPRO | BslColorSpacec |
a2A4200-40umBAS | 无 |
a2A4200-40umPRO | 无 |
a2A4504-5gcBAS | BslColorSpacec |
a2A4504-5gcPRO | BslColorSpacec |
a2A4504-5gmBAS | 无 |
a2A4504-5gmPRO | 无 |
a2A4504-18ucBAS | BslColorSpacec |
a2A4504-18ucPRO | BslColorSpacec |
a2A4504-18umBAS | 无 |
a2A4504-18umPRO | 无 |
a2A4504-27g5cBAS | BslColorSpacec |
a2A4504-27g5mBAS | 无 |
a2A4504-42cc | BslColorSpacec |
a2A4504-42cm | 无 |
a2A4508-6gcBAS | BslColorSpacec |
a2A4508-6gcPRO | BslColorSpacec |
a2A4508-6gmBAS | 无 |
a2A4508-6gmPRO | 无 |
a2A4508-20ucBAS | BslColorSpacec |
a2A4508-20ucPRO | BslColorSpacec |
a2A4508-20umBAS | 无 |
a2A4508-20umPRO | 无 |
a2A5060-4gcBAS | BslColorSpacec |
a2A5060-4gmBAS | 无 |
a2A5060-15ucBAS | BslColorSpacec |
a2A5060-15umBAS | 无 |
a2A5060-21g5cBAS | BslColorSpacec |
a2A5060-21g5mBAS | 无 |
a2A5320-7gcBAS | BslColorSpacec |
a2A5320-7gcPRO | BslColorSpacec |
a2A5320-7gmBAS | 无 |
a2A5320-7gmPRO | 无 |
a2A5320-23ucBAS | BslColorSpacec |
a2A5320-23ucPRO | BslColorSpacec |
a2A5320-23umBAS | 无 |
a2A5320-23umPRO | 无 |
a2A5320-34g5cBAS | BslColorSpacec |
a2A5320-34g5mBAS | 无 |
a2A5320-52cc | BslColorSpacec |
a2A5320-52cm | 无 |
a2A5328-4gcBAS | BslColorSpacec |
a2A5328-4gcPRO | BslColorSpacec |
a2A5328-4gmBAS | 无 |
a2A5328-4gmPRO | 无 |
a2A5328-15ucBAS | BslColorSpacec |
a2A5328-15ucPRO | BslColorSpacec |
a2A5328-15umBAS | 无 |
a2A5328-15umPRO | 无 |
a2A5328-22g5cBAS | BslColorSpacec |
a2A5328-22g5mBAS | 无 |
a2A5328-35cc | BslColorSpacec |
a2A5328-35cm | 无 |
acA640-121gm | GammaEnable GammaSelector |
acA640-300gc | GammaEnable GammaSelector |
acA640-300gm | GammaEnable GammaSelector |
acA640-750uc | Nonea |
acA640-750um | Nonea |
acA720-290gc | GammaEnable GammaSelector |
acA720-290gm | GammaEnable GammaSelector |
acA720-520uc | Nonea |
acA720-520um | Nonea |
acA800-200gc | GammaEnable GammaSelector |
acA800-200gm | GammaEnable GammaSelector |
acA800-510uc | Nonea |
acA800-510um | Nonea |
acA1280-60gc | GammaEnable GammaSelector |
acA1280-60gm | GammaEnable GammaSelector |
acA1300-60gc | GammaEnable GammaSelector |
acA1300-60gm | GammaEnable GammaSelector |
acA1300-60gmNIR | GammaEnable GammaSelector |
acA1300-75gc | GammaEnable GammaSelector |
acA1300-75gm | GammaEnable GammaSelector |
acA1300-200uc | Nonea |
acA1300-200um | Nonea |
acA1440-73gc | GammaEnable GammaSelector |
acA1440-73gm | GammaEnable GammaSelector |
acA1440-220uc | Nonea |
acA1440-220um | Nonea |
acA1600-20gc | GammaEnable GammaSelector |
acA1600-20uc | Nonea |
acA1600-60gc | GammaEnable GammaSelector |
acA1600-60gm | GammaEnable GammaSelector |
acA1920-25gc | GammaEnable GammaSelector |
acA1920-25gm | GammaEnable GammaSelector |
acA1920-25uc | Nonea |
acA1920-25um | Nonea |
acA1920-40gc | GammaEnable GammaSelector |
acA1920-40gm | GammaEnable GammaSelector |
acA1920-40uc | Nonea |
acA1920-40ucMED | Nonea |
acA1920-40um | Nonea |
acA1920-40umMED | Nonea |
acA1920-48gc | GammaEnable GammaSelector |
acA1920-48gm | GammaEnable GammaSelector |
acA1920-50gc | GammaEnable GammaSelector |
acA1920-50gm | GammaEnable GammaSelector |
acA1920-150uc | Nonea |
acA1920-150um | Nonea |
acA1920-155uc | Nonea |
acA1920-155ucMED | Nonea |
acA1920-155um | Nonea |
acA1920-155umMED | Nonea |
acA2000-50gc | GammaEnable GammaSelector |
acA2000-50gm | GammaEnable GammaSelector |
acA2000-165uc | Nonea |
acA2000-165um | Nonea |
acA2040-25gc | GammaEnable GammaSelector |
acA2040-25gm | GammaEnable GammaSelector |
acA2040-25gmNIR | GammaEnable GammaSelector |
acA2040-35gc | GammaEnable GammaSelector |
acA2040-35gm | GammaEnable GammaSelector |
acA2040-55uc | Nonea |
acA2040-55um | Nonea |
acA2040-90uc | Nonea |
acA2040-90um | Nonea |
acA2040-90umNIR | Nonea |
acA2040-120uc | Nonea |
acA2040-120um | Nonea |
acA2440-20gc | GammaEnable GammaSelector |
acA2440-20gm | GammaEnable GammaSelector |
acA2440-35uc | Nonea |
acA2440-35ucMED | Nonea |
acA2440-35um | Nonea |
acA2440-35umMED | Nonea |
acA2440-75uc | Nonea |
acA2440-75ucMED | Nonea |
acA2440-75um | Nonea |
acA2440-75umMED | Nonea |
acA2500-14gc | GammaEnable GammaSelector |
acA2500-14gm | GammaEnable GammaSelector |
acA2500-14uc | Nonea |
acA2500-14um | Nonea |
acA2500-20gc | GammaEnable GammaSelector |
acA2500-20gcMED | GammaEnable GammaSelector |
acA2500-20gm | GammaEnable GammaSelector |
acA2500-20gmMED | GammaEnable GammaSelector |
acA2500-60uc | Nonea |
acA2500-60um | Nonea |
acA3088-16gc | GammaEnable GammaSelector |
acA3088-16gm | GammaEnable GammaSelector |
acA3088-57uc | Nonea |
acA3088-57ucMED | Nonea |
acA3088-57um | Nonea |
acA3088-57umMED | Nonea |
acA3800-10gc | GammaEnable GammaSelector |
acA3800-10gm | GammaEnable GammaSelector |
acA3800-14uc | Nonea |
acA3800-14um | Nonea |
acA4024-8gc | GammaEnable GammaSelector |
acA4024-8gm | GammaEnable GammaSelector |
acA4024-29uc | Nonea |
acA4024-29um | Nonea |
acA4096-11gc | GammaEnable GammaSelector |
acA4096-11gm | GammaEnable GammaSelector |
acA4096-30uc | Nonea |
acA4096-30ucMED | Nonea |
acA4096-30um | Nonea |
acA4096-30umMED | Nonea |
acA4096-40uc | Nonea |
acA4096-40ucMED | Nonea |
acA4096-40um | Nonea |
acA4096-40umMED | Nonea |
acA4112-8gc | GammaEnable GammaSelector |
acA4112-8gm | GammaEnable GammaSelector |
acA4112-20uc | Nonea |
acA4112-20ucMED | Nonea |
acA4112-20um | Nonea |
acA4112-20umMED | Nonea |
acA4112-30uc | Nonea |
acA4112-30ucMED | Nonea |
acA4112-30um | Nonea |
acA4112-30umMED | Nonea |
acA5472-5gc | GammaEnable GammaSelector |
acA5472-5gm | GammaEnable GammaSelector |
acA5472-17uc | Nonea |
acA5472-17ucMED | Nonea |
acA5472-17um | Nonea |
acA5472-17umMED | Nonea |
boA1936-400cc | BslColorSpacec |
boA1936-400cm | 无 |
boA2448-250cc | BslColorSpacec |
bo2448-250cm | 无 |
boA2832-190cc | BslColorSpacec |
bo2832-190cm | 无 |
boA4096-93cc | BslColorSpacec |
boA4096-93cm | 无 |
boA4096-180cc | BslColorSpacec |
bo4096-180cm | 无 |
boA4112-68cc | BslColorSpacec |
boA4112-68cm | 无 |
boA4500-45cc | BslColorSpacec |
boA4500-45cm | 无 |
boA4504-100cc | BslColorSpacec |
boA4504-100cm | 无 |
boA5120-150cc | 不支持 Gamma 功能 |
boA5120-150cm | 不支持 Gamma 功能 |
boA5120-230cc | 不支持 Gamma 功能 |
boA5120-230cm | 不支持 Gamma 功能 |
boA5320-150cc | BslColorSpacec |
boA5320-150cm | 无 |
boA5328-100cc | BslColorSpacec |
boA5328-100cm | 无 |
boA6500-36cc | BslColorSpacec |
boA6500-36cm | 无 |
boA8100-16cc | BslColorSpacec |
boA8100-16cm | 无 |
boA9344-30cc | 不支持 Gamma 功能 |
boA9344-30cm | 不支持 Gamma 功能 |
boA9344-70cc | 不支持 Gamma 功能 |
boA9344-70cm | 不支持 Gamma 功能 |
boA13440-17cm | 无 |
daA720-520uc | BslColorSpacea |
daA720-520um | 无 |
daA1280-54uc | BslColorSpaceMode b |
daA1280-54um | 无 |
daA1440-220uc | BslColorSpacea |
daA1440-220um | 无 |
daA1600-60uc | BslColorSpaceMode b |
daA1600-60um | 无 |
daA1920-15um | 无 |
daA1920-30uc | BslColorSpaceMode b |
daA1920-30um | 无 |
daA1920-160uc | BslColorSpacea |
daA1920-160um | 无 |
daA2448-70uc | BslColorSpacea |
daA2448-70um | 无 |
daA2500-14uc | BslColorSpaceMode b |
daA2500-14um | 无 |
daA3840-45uc | BslColorSpacea |
daA3840-45um | 无 |
dmA720-290gc | BslColorSpacec |
dmA720-290gm | 无 |
dmA1440-73gc | BslColorSpacec |
dmA1440-73gm | 无 |
dmA1920-51gc | BslColorSpacec |
dmA1920-51gm | 无 |
dmA3536-9gc | BslColorSpacec |
dmA3536-9gm | 无 |
puA1280-54uc | BslColorSpaceMode b |
puA1280-54um | 无 |
puA1600-60uc | BslColorSpaceMode b |
puA1600-60um | 无 |
puA1920-30uc | BslColorSpaceMode b |
puA1920-30um | 无 |
puA2500-14uc | BslColorSpaceMode b |
puA2500-14um | 无 |
r2L2048-29gc | BslColorSpacec |
r2L2048-58gm | 无 |
r2L2048-62cc | BslColorSpacec |
r2L2048-62g5c | BslColorSpacec |
r2L2048-172cm | 无 |
r2L2048-172g5m | 无 |
r2L4096-14gc | BslColorSpacec |
r2L4096-29gm | 无 |
r2L4096-42cc | BslColorSpacec |
r2L4096-42g5c | BslColorSpacec |
r2L4096-84cm | 无 |
r2L4096-84g5m | 无 |
r2L8192-200cm | 无 |
r2L16384-120cm | 无 |
-
If you select a light source preset, an additional gamma correction value of approximately 0.4 is applied (sRGB gamma correction). This value is applied separately and not included in the
Gamma
parameter value. 示例: You have set the light source preset to Tungsten and theGamma
parameter value to 1.2. First, an automatic correction value of approximately 0.4 is applied to the pixel values. After that, a gamma correction value of 1.2 is applied to the resulting pixel values. -
仅在像素格式设置为 YCbCr422 或 RGB8 时可用。
-
If the color space is set to
sRGB
, a gamma correction value of approximately 0.4 is applied. This value is applied separately and not included in theGamma
parameter value. 示例: You set the color space to sRGB and theGamma
parameter to 1.2. First, an automatic correction value of approximately 0.4 is applied to the pixel values. After that, a gamma correction value of 1.2 is applied to the resulting pixel values.
If you have selected a Light Source Preset, setting the color space tosRGB
will also affect the Balance White, Color Adjustment, and Color Transformation features. -
If the color space is set to
sRGB
, a gamma correction value of approximately 0.4 is applied, theGamma
parameter becomes read-only, and theGamma
parameter value is ignored.
示例代码#
ace 2, boost, and dart R Cameras#
/* 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 Gamma value to 1.2 */
errRes = PylonDeviceSetFloatFeature(hdev, "Gamma", 1.2);
CHECK(errRes);
/* Set the color space to sRGB */
errRes = PylonDeviceFeatureFromString(hdev, "BslColorSpace", "sRGB");
CHECK(errRes);
ace Classic/U/L GigE 相机#
/* 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 Gamma feature */
errRes = PylonDeviceSetBooleanFeature(hdev, "GammaEnable", 1);
CHECK(errRes);
/* Set the gamma type to User */
errRes = PylonDeviceFeatureFromString(hdev, "GammaSelector", "User");
CHECK(errRes);
/* Set the Gamma value to 1.2 */
errRes = PylonDeviceSetFloatFeature(hdev, "Gamma", 1.2);
CHECK(errRes);
其他相机#
您也可以使用 pylon Viewer 轻松设置参数。