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

Test Patterns (dart E)#

藉助 Test Patterns camera feature,您可以檢查相機的基本功能及其影像傳輸能力。

測試圖樣可用於維護目的與故障診斷。它們是由相機本身產生的,也就是說,相機的光學元件與影像感測器並未參與其建立過程。

使用此功能#

顯示 Test Patterns#

若要顯示測試圖樣:

  1. 透過將 TestPattern 參數設定為所需的測試影像來選擇測試圖樣。
  2. 擷取至少一張影像以顯示所選的測試圖樣。如果您想在 pylon Viewer 中顯示測試圖樣,請按一下工具列上的單張或連續拍攝按鈕。

範例程式碼#

// Select test image 1
camera.TestPattern.SetValue(TestImageSelector_Testimage1);
// Acquire images to display the selected test image
// ...
// (Insert your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing method.)
INodeMap& nodemap = camera.GetNodeMap();
// Select test image 1
CEnumParameter(nodemap, "TestPattern").SetValue("Testimage1");
// Acquire images to display the selected test image
// ...
// (Insert your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing method.)
// Select test image 1
camera.Parameters[PLCamera.TestPattern].SetValue(PLCamera.TestImageSelector.Testimage1);
// Acquire images to display the selected test image
// ...
// (Insert your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing method.)
/* 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 */
/* Select test image 1 */
errRes = PylonDeviceFeatureFromString(hdev, "TestPattern", "Testimage1");
CHECK(errRes);
/* Acquire images to display the selected test image */
/* ... */
/* (Insert your own image grabbing routine here. */
/* For example, the InstantCamera class provides the StartGrabbing method.) */
# Select test image 1
camera.TestPattern.Value = "Testimage1"
# Acquire images to display the selected test image
# ...
# (Insert your own image grabbing routine here.
# For example, the InstantCamera class provides the StartGrabbing method.)
/* 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 */
/* Select test image 1 */
errRes = PylonDeviceFeatureFromString(hdev, "TestPattern", "Testimage1");
CHECK(errRes);
/* Acquire images to display the selected test image */
/* ... */
/* (Insert your own image grabbing routine here. */
/* For example, the InstantCamera class provides the StartGrabbing method.) */

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