Sensor Bit Depth#
降低感光元件的位元深度可提高相機的幀率。提高感光元件的位元深度則可提升影像品質。
使用功能#
為何要使用Sensor Bit Depth#
感測器的位元深度決定了影像感測器所輸出資料的位元深度。相機後續進行的所有影像處理,皆以此資料為基礎。
設定感測器位元深度時,請遵循以下準則:
- 為了獲得最佳影像品質,請將感測器位元深度設定為較高數值。
較高的感測器位元深度可提升影像品質,因為相機的內部影像運算是基於較高的位元深度進行的。 - 為了獲得最佳效能,請將感測器的位元深度設定為較低的值。
較低的感測器位元深度可提升效能,因為感測器的讀取時間較短。
Sensor Bit Depth 模式#
「感測器位元深度模式」可讓您定義是否能獨立於所使用的像素格式,來設定感測器的位元深度。您可以設定 BslSensorBitDepthMode 參數設定為以下值之一:
Auto: 感測器的位元深度會根據 像素格式 已使用。這是預設設定。例如,若將像素格式設定為 Bayer 12,感光元件的位元深度便會自動設定為 12 位元。Manual: 感測器的位元深度可獨立於所使用的像素格式進行設定。例如,您可以將相機設定為根據 12 位元的感測器資料輸出 8 位元的影像資料(像素格式 = Mono 8,感測器位元深度 = 12 位元)。
資訊
- 在 a2A1920、a2A4504、a2A5320、a2A5328、boA4096、boA4112、boA4504、boA5320、boA5328 以及 dart M 相機上,若您將
BslSensorBitDepthMode參數設為Auto並選擇 8 位元像素格式(例如「單色 8」),感測器的位元深度將設定為 10 位元。此舉可在不犧牲效能的前提下提升影像品質。 - 在 boA4096、boA4112、boA4504、boA5320、boA5328、a2A2560-131cmSWIR 以及 a2A2048-173cmSWIR 相機上,將感測器位元深度設定為 8 位元會產生以下效果:
- 水井總容量減少至原來的 1/4
- 動態範圍縮小
- 更高的幀率
- 在 boA13440-17cm 相機上,感光元件的位元深度會根據所使用的像素格式而受到限制。感光元件輸出的資料位元深度必須始終等於或高於所傳輸的影像資料格式。 例如,若將攝影機設定為輸出 12 位元影像資料,感光元件資料僅能設定為 12 或 14 位元(像素格式 = Mono 12,感光元件位元深度 = 12 位元或 14 位元)。
設定Sensor Bit Depth#
- 將相機中的
BslSensorBitDepthMode參數設為Manual. - 將相機中的
BslSensorBitDepth參數設定為所需的數值。
例如,將參數設定為Bpp12會設定 12 bpp(每像素位元數)的位元深度。
範例程式碼#
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);
您也可以 use the pylon Viewer 來輕鬆設定參數。