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

Sensor Bit Depth#

透過 Sensor Bit Depth camera feature,您可以變更影像感測器輸出資料的位元深度。

降低 Sensor Bit Depth 可以提高相機的 frame rate。提高 Sensor Bit Depth 則可以提升 Quality。

使用此功能#

為什麼要使用 Sensor Bit Depth#

Sensor Bit Depth 定義了影像感測器輸出資料的位元深度。相機所執行的所有後續影像處理皆以此資料為基礎。

設定 Sensor Bit Depth 時,請遵循以下原則:

  • 若要獲得最佳的 Quality,請將 Sensor Bit Depth 設定為高值。
    較高的 Sensor Bit Depth 可以改善 Quality,因為相機內部的影像計算是以較高的位元深度為基礎。
  • 若要獲得最佳的效能,請將 Sensor Bit Depth 設定為低值。
    較低的 Sensor Bit Depth 可以提升效能,因為 Sensor Readout Time 較短。

Sensor Bit Depth 模式#

Sensor Bit Depth Mode 可讓您定義 Sensor Bit Depth 是否能與所使用的 Pixel Format 分開設定。您可以設定 BslSensorBitDepthMode 參數設為下列其中一個值:

  • Auto:Sensor Bit Depth 會根據所使用的 像素格式 自動調整。此為預設設定。例如,如果您將 Pixel Format 設定為 Bayer 12,Sensor Bit Depth 將會自動設為 12 bit。
  • Manual:Sensor Bit Depth 可以與所使用的 Pixel Format 分開設定。例如,您可以將相機設定為根據 12-bit 感測器資料輸出 8-bit 影像資料(Pixel Format = Mono 8,Sensor Bit Depth = 12 bit)。

資訊

  • 在 a2A1920、a2A4504、a2A5320、a2A5328、boA4096、boA4112、boA4504、boA5320、boA5328 以及 dart M 相機上,如果您設定 BslSensorBitDepthMode 參數設為 Auto 並選擇 8-bit Pixel Format(例如 Mono 8),Sensor Bit Depth 將會設為 10 bit。這能在不犧牲效能的情況下提升 Quality。
  • 在 boA4096、boA4112、boA4504、boA5320、boA5328、a2A2560-131cmSWIR 以及 a2A2048-173cmSWIR 相機上,將 Sensor Bit Depth 設定為 8 bit 會產生以下影響:
    • 滿阱容量(Full Well Capacity)減少至 1/4
    • 動態範圍降低
    • 更高的影格率
  • 在 boA13440-17cm 相機上,Sensor Bit Depth 會根據所使用的 Pixel Format 受到限制。感測器輸出資料的位元深度必須永遠大於或等於所傳輸影像資料的格式。例如,如果您將相機設定為輸出 12-bit 影像資料,感測器資料只能設定為 12 或 14 bit(Pixel Format = Mono 12,Sensor Bit Depth = 12 bit 或 14 bit)。

設定 Sensor Bit Depth#

  1. 將 BslSensorBitDepthMode 參數設為 Manual.
  2. 將 BslSensorBitDepth 參數設定為所需的值。
    例如,將參數設定為 Bpp12 會設定 12 bpp(每像素位元數)的位元深度。

範例程式碼#

// Set the pixel format to Mono 8
camera.PixelFormat.SetValue(PixelFormat_Mono8);
// Set the sensor bit depth mode to Manual
camera.BslSensorBitDepthMode.SetValue(BslSensorBitDepthMode_Manual);
// Set the sensor bit depth to 8 bit
camera.BslSensorBitDepth.SetValue(BslSensorBitDepth_Bpp8);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8");
// Set the sensor bit depth mode to Manual
CEnumParameter(nodemap, "BslSensorBitDepthMode").SetValue("Manual");
// Set the sensor bit depth to 8 bit
CEnumParameter(nodemap, "BslSensorBitDepth").SetValue("Bpp8");
// Set the pixel format to Mono 8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono8);
// Set the sensor bit depth mode to Manual
camera.Parameters[PLCamera.BslSensorBitDepthMode].SetValue(PLCamera.BslSensorBitDepthMode.Manual);
// Set the sensor bit depth to 8 bit
camera.Parameters[PLCamera.BslSensorBitDepth].SetValue(PLCamera.BslSensorBitDepth.Bpp8);
/* 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 Mono 8 */
errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "Mono8");
CHECK(errRes);
/* Set the sensor bit depth mode to Manual */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorBitDepthMode", "Manual");
CHECK(errRes);
/* Set the sensor bit depth to 8 bit */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorBitDepth", "Bpp8");
CHECK(errRes);
# Set the pixel format to Mono 8
camera.PixelFormat.Value = "Mono8"
# Set the sensor bit depth mode to Manual
camera.BslSensorBitDepthMode.Value = "Manual"
# Set the sensor bit depth to 8 bit
camera.BslSensorBitDepth.Value = "Bpp8"

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