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

Camera Operation Mode#

透過 Camera Operation Mode camera feature,您可以針對特定的運作條件來設定相機。

透過選擇 Camera Operation Mode,系統會自動設定特定的相機參數,以期在特定的運作環境中產生最佳的成像結果。

使用此功能#

指定 Camera Operation Mode#

若要指定擷取模式,請設定 CameraOperationMode 參數設為下列其中一個值:

  • Standard:啟用 Standard Camera Operation Mode。
  • LongExposure:啟用 Long Exposure Camera Operation Mode。

可用的 Camera Operation Mode#

標準#

這是預設的 Camera Operation Mode。它適用於大多數的運作條件,亦即參數未設定為極端數值的情況。

長時間曝光#

當您使用較長的 Exposure Time 並希望最佳化影像品質時,Long Exposure 模式非常有用。

為了將此功能的效果發揮到最大,請提供散熱、增加 Exposure Time,並盡可能降低幀率。如果您的應用允許,請以單張拍攝模式操作相機,並且只擷取您需要的影像。

Long Exposure 模式會增加 Exposure Start Delay。

當您設定 CameraOperationMode 參數設為 LongExposure時,幀率會下降。如果您想查看它造成的影響,請檢查 BslResultingAcquisitionFrameRate Property。

資訊

變更 Camera Operation Mode 後,請等待至少十分鐘,讓相機溫度穩定。這能確保影像品質的一致性。

範例程式碼#

// Enable the Standard camera operation mode
camera.CameraOperationMode.SetValue(CameraOperationMode_Standard);
// Enable the Long Exposure camera operation mode
camera.CameraOperationMode.SetValue(CameraOperationMode_LongExposure);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the Standard camera operation mode
CEnumParameter(nodemap, "CameraOperationMode").SetValue("Standard");
// Enable the Long Exposure camera operation mode
CEnumParameter(nodemap, "CameraOperationMode").SetValue("LongExposure");
// Enable the Standard camera operation mode
camera.Parameters[PLCamera.CameraOperationMode].SetValue(PLCamera.CameraOperationMode.Standard);
// Enable the Long Exposure camera operation mode
camera.Parameters[PLCamera.CameraOperationMode].SetValue(PLCamera.CameraOperationMode.LongExposure);
/* 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 */
/* Enable the Standard camera operation mode */
errRes = PylonDeviceFeatureFromString(hdev, "CameraOperationMode", "Standard");
CHECK(errRes);
/* Enable the Long Exposure camera operation mode */
errRes = PylonDeviceFeatureFromString(hdev, "CameraOperationMode", "LongExposure");
CHECK(errRes);
# Enable the Standard camera operation mode
camera.CameraOperationMode.Value = "Standard"
# Enable the Long Exposure camera operation mode
camera.CameraOperationMode.Value = "LongExposure"

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