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

Backlight Compensation#

Backlight Compensation camera feature 允許相機補償曝光不足的影像區域。

使用此功能#

運作原理#

如果您要拍攝的目標後方有強烈的光源,目標可能會曝光不足並呈現剪影。Backlight Compensation 功能可讓相機補償此效果。

啟用此功能後,在由 Gain Auto 與 Exposure Auto 自動功能執行的 target brightness value calculations 中,將不會計入影像中指定百分比的最亮像素(即像素值最高的像素)。

例如,將參數值設為 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

您也可以使用 pylon Viewer 來輕鬆設定參數。