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

Sensor Acquisition Mode#

「Sensor Acquisition Mode 」相機功能可讓您設定應使用多少條感測器線來進行影像擷取。

此功能僅適用於 Basler racer 2 L 及 racer 2 XL 相機上。

若要確認您的相機搭載的是單線、雙線、四線或TDI 感測器,請參閱您相機型號的相關主題。您可以在「區域式與線掃式相機」章節中找到您相機的相關主題。

資訊

在racer 2 L 單通道攝影機上,當設定黑電平、曝光時間或增益時,Sensor Acquisition Mode 可讓您決定這些設定應套用至單一感測器行,或是為多個感測器行指定不同的設定。

使用功能#

感測器擷取模式可讓您在不同的擷取模式之間進行選擇,例如單線或雙線影像擷取。

視您使用的是racer 2 L 單色相機(這是一款「經典」的線掃描相機),還是racer 2 XL 相機(這是一款TDI 線掃描相機),可用的感測器擷取模式會有所不同。

racer 2 L Mono 相機#

若要設定racer 2 L 單色相機的感測器擷取模式,請設定 BslSensorAcquisitionMode 參數設定為以下值之一:

  • SingleLine: 啟用單線感測器擷取模式。在此模式下,相機針對每張擷取的影像皆使用一條感測器線。此為預設設定。
  • DualLine, QuadLine: 啟用「雙線」或「四線」感測器擷取模式。在此模式下,相機針對每張擷取的影像會使用兩條或四條感測器線。透過此模式,您可以針對個別感測器線設定不同的曝光時間或亮度等參數。

資訊

若要切換單線與雙線感測器擷取模式,必須先停止影像擷取。

racer 2 XL 相機#

若要設定racer 2 XL 相機的感測器擷取模式,請設定 BslSensorAcquisitionMode 參數設定為以下值之一:

  • Area: 啟用「區域感測器」擷取模式。在此模式下,TDI 攝影機將利用感測器的功能,作為區域掃描攝影機運作。 array 像素。此模式用於 校準 在調整鏡頭對焦時。
    在「區域感測器擷取模式」下,攝影機處於自由運行模式。在自由運行模式下,您可以根據需求調整曝光時間。
  • TDISingleLine: 啟用TDI 單線感測器擷取模式。在此模式下,TDI 相機將使用一個具備一條讀出線的像素陣列。

範例程式碼#

// Set the dual line sensor acquisition mode on the camera
camera.BslSensorAcquisitionMode.SetValue(BslSensorAcquisitionMode_DualLine);
INodeMap& nodemap = camera.GetNodeMap();
// Set the dual line sensor acquisition mode on the camera
CEnumParameter(nodemap, "BslSensorAcquisitionMode").SetValue("DualLine");
// Set the dual line sensor acquisition mode on the camera
camera.Parameters[PLCamera.BslSensorAcquisitionMode].SetValue(PLCamera.BslSensorAcquisitionMode.DualLine);
/* 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 dual line sensor acquisition mode on the camera */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorAcquisitionMode", "DualLine");
CHECK(errRes);
# Set the dual line sensor acquisition mode on the camera
camera.BslSensorAcquisitionMode.Value = "DualLine"

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