跳转到内容

Acquisition Mode#

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

信息

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

有关更多信息,请参见 Basler pylon Camera Software Suite 随附的 C++ 程序员指南和参考文档pylon .NET 程序员指南和参考文档中的“采集”代码示例。

该功能的使用#

指定 Acquisition Mode#

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

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

可用 Acquisition Mode#

单帧 Acquisition Mode#

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

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

信息

要检查相机是否正在等待触发信号,请监视相机的Trigger Wait 信号或使用 Acquisition Status 功能。

接收到帧开始触发信号并采集图像后,相机会关闭图像采集。要采集其他图像,必须再次执行“采集开始”命令。

连续 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
CEnumerationPtr(nodemap.GetNode("AcquisitionMode"))->FromString("SingleFrame");
// Switch on image acquisition
CCommandPtr(nodemap.GetNode("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
CEnumerationPtr(nodemap.GetNode("AcquisitionMode"))->FromString("Continuous");
// Switch on image acquisition
CCommandPtr(nodemap.GetNode("AcquisitionStart"))->Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
CCommandPtr(nodemap.GetNode("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();
// Configure single frame acquisition on the camera
Pylon.DeviceFeatureFromString(hdev, "AcquisitionMode", "SingleFrame");
// Switch on image acquisition
Pylon.DeviceExecuteCommandFeature(hdev, "AcquisitionStart");
// 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
Pylon.DeviceFeatureFromString(hdev, "AcquisitionMode", "Continuous");
// Switch on image acquisition
Pylon.DeviceExecuteCommandFeature(hdev, "AcquisitionStart");
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
Pylon.DeviceExecuteCommandFeature(hdev, "AcquisitionStop");
/* 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);

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