跳转到内容

Test Patterns (dart E)#

相机的 Test Patterns 功能可让您检查相机的基本功能及其传输图像的能力。

Test patterns 可用于维护目的和故障诊断。它们是由相机本身生成的,即相机的光学元件和成像传感器未参与其创建。

该功能的使用#

显示测试图案#

显示测试图案,请执行以下操作:

  1. Select a test pattern by setting the TestPattern parameter to the desired test image.
  2. Acquire at least one image to display the selected test pattern. If you want to display the test pattern in the pylon Viewer, click the single or continuous shot button on the toolbar.

示例代码#

// 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 轻松设置参数。