跳转到内容

Acquisition Mode#

相机的 Acquisition Mode 功能允许您选择单帧采集或连续图像采集。

信息

  • 无法通过 pylon Viewer 功能树使用此功能。在使用 pylon Viewer 工具栏中的单拍连拍按钮时,可以自动设定 acquisition mode。
  • pylon C++ API 和 pylon .NET API 提供了配置事件处理程序,这些处理程序可自动设置 AcquisitionMode 参数。Basler 推荐使用这些事件处理程序。

如需了解详情,请参阅 pylon API 文档中的采集 (C++)采集 (.NET) 代码示例。

该功能的使用#

指定 Acquisition Mode#

若要指定采集模式,请将 AcquisitionMode 参数设置为以下值:

  • SingleFrame:启用单帧采集模式。
  • Continuous:启用连续采集模式。

可用 Acquisition Mode#

单帧 Acquisition Mode#

在单帧采集模式下,相机将仅采集一张图像。

执行采集开始命令后,相机会等待触发信号。触发信号既可以在相机内部生成(自由运行),也可以通过外部施加(触发图像采集)。

信息

To check whether the camera is waiting for trigger signals, monitor the camera's Trigger Wait signals or use the Acquisition Status feature, if available.

When a Frame Start trigger signal or a Line Start trigger signal have been received and an image has been acquired, the camera switches off image acquisition. To acquire another image, you must execute the Acquisition Start command again.

连续 Acquisition Mode#

在连续采集模式下,相机将连续采集并传输图像,直到关闭采集功能为止。

执行采集开始命令后,相机会等待触发信号。触发信号既可以在相机内部生成(自由运行图像采集),也可以通过外部应用(触发图像采集)。相机将持续采集图像,直至执行了采集停止命令

示例代码#

// Configure single frame acquisition on the camera
camera.AcquisitionMode.SetValue(AcquisitionMode_SingleFrame);
// Switch on image acquisition
camera.AcquisitionStart.Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
camera.AcquisitionMode.SetValue(AcquisitionMode_Continuous);
// Switch on image acquisition
camera.AcquisitionStart.Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
camera.AcquisitionStop.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Configure single frame acquisition on the camera
CEnumParameter(nodemap, "AcquisitionMode").SetValue("SingleFrame");
// Switch on image acquisition
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
CEnumParameter(nodemap, "AcquisitionMode").SetValue("Continuous");
// Switch on image acquisition
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
CCommandParameter(nodemap, "AcquisitionStop").Execute();
// Configure single frame acquisition on the camera
camera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.SingleFrame);
// Switch on image acquisition
camera.Parameters[PLCamera.AcquisitionStart].Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
camera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.Continuous);
// Switch on image acquisition
camera.Parameters[PLCamera.AcquisitionStart].Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
camera.Parameters[PLCamera.AcquisitionStop].Execute();
/* 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 */
/* Configure single frame acquisition on the camera */
errRes = PylonDeviceFeatureFromString(hdev, "AcquisitionMode", "SingleFrame");
CHECK(errRes);
/* Switch on image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStart");
CHECK(errRes);
/* The camera waits for a trigger signal. */
/* When a Frame Start trigger signal has been received, */
/* the camera executes an Acquisition Stop command internally. */
/* Configure continuous image acquisition on the camera */
errRes = PylonDeviceFeatureFromString(hdev, "AcquisitionMode", "Continuous");
CHECK(errRes);
/* Switch on image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStart");
CHECK(errRes);
/* The camera waits for trigger signals. */
/* (...) */
/* Switch off image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStop");
CHECK(errRes);
# Configure single frame acquisition on the camera
camera.AcquisitionMode.Value = "SingleFrame"
# Switch on image acquisition
camera.AcquisitionStart.Execute()
# The camera waits for a trigger signal.
# When a Frame Start trigger signal has been received,
# the camera executes an Acquisition Stop command internally.
# Configure continuous image acquisition on the camera
camera.AcquisitionMode.Value = "Continuous"
# Switch on image acquisition
camera.AcquisitionStart.Execute()
# The camera waits for trigger signals.
# (...)
# Switch off image acquisition
camera.AcquisitionStop.Execute()

您也可以使用 pylon Viewer 轻松设置参数。