跳至內容
測試伺服器
開發伺服器

Backlight Compensation#

「Backlight Compensation 」相機功能可讓相機對曝光不足的影像區域進行補償。

使用功能#

運作原理#

如果影像目標後方有強光,目標可能會因曝光不足而呈現剪影效果。Backlight Compensation 功能可讓相機對此現象進行補償。

當此功能啟用時,在由 Gain Auto 及 Exposure Auto auto 函式進行的目標亮度值計算時,將忽略圖像中亮度最高的像素(即像素值最高的像素)中的一定百分比。

舉例來說,將參數值設定為 0.3 表示在計算目標值時,將不將影像中最亮的 30 % 像素納入考量。

這能讓相機正確地曝光影像中較暗的區域。

調整Backlight Compensation#

要調整背光補償:

  1. 啟用 Exposure Auto 自動功能或 Gain Auto 自動功能,或兩者皆可。
  2. 為 AutoBacklightCompensation 參數。該參數的數值範圍為 0 至 0.5。

範例程式碼#

// Set the AutoBacklightCompensation parameter to 0.3
camera.AutoBacklightCompensation.SetValue(0.3);
INodeMap& nodemap = camera.GetNodeMap();
// Set the AutoBacklightCompensation parameter to 0.3
CFloatParameter(nodemap, "AutoBacklightCompensation").SetValue(0.3);
// Set the AutoBacklightCompensation parameter to 0.3
camera.Parameters[PLCamera.AutoBacklightCompensation].SetValue(0.3);
/* 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 AutoBacklightCompensation parameter to 0.3 */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoBacklightCompensation", 0.3);
CHECK(errRes);
# Set the AutoBacklightCompensation parameter to 0.3
camera.AutoBacklightCompensation.Value = 0.3

您也可以 use the pylon Viewer 來輕鬆設定參數。