Basler Pylon 采集参数
Acquisition Mode
采集模式 允许用户选择选择单帧或连续图像采集。
enum AcquisitionModeEnums
{
AcquisitionMode_SingleFrame, //!<Sets the acquisition mode to single frame
AcquisitionMode_MultiFrame, //!<Sets the acquisition mode to multi frame
AcquisitionMode_Continuous //!<Sets the acquisition mode to continuous
};
例如
- AcquisitionMode_SingleFrame :单帧采集模式
- AcquisitionMode_Continuous :连续采集模式
代码示例
// 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();
AcquisitionFrameCount
每次采集开始触发后要采集的帧数
camera.AcquisitionFrameCount.SetValue(1); int64_t i = camera.AcquisitionFrameCount.GetValue();
Trigger Selector
触发类型选择
enum TriggerSelectorEnums { TriggerSelector_AcquisitionStart, //!<Selects the acquisition start trigger for configuration TriggerSelector_AcquisitionEnd, //!<Selects the acquisition end trigger for configuration TriggerSelector_AcquisitionActive, //!<Selects the acquisition active trigger for configuration TriggerSelector_FrameStart, //!<Selects the frame start trigger for configuration TriggerSelector_FrameEnd, //!<Selects the frame end trigger for configuration TriggerSelector_FrameActive, //!<Selects the frame active trigger for configuration TriggerSelector_LineStart, //!<Selects the line start trigger for configuration TriggerSelector_ExposureStart, //!<Selects the exposure start trigger for configuration TriggerSelector_ExposureEnd, //!<Selects the exposure end trigger for configuration TriggerSelector_ExposureActive //!<Selects the exposure active trigger for configuration };
例如
- TriggerSelector_FrameStart 单幅图像
- TriggerSelector_AcquisitionStart 多幅画面
// Select and enable the Frame Start trigger camera.TriggerSelector.SetValue(TriggerSelector_FrameStart); camera.TriggerMode.SetValue(TriggerMode_On); // Select and enable the Acquisition Start trigger camera.TriggerSelector.SetValue(TriggerSelector_AcquisitionStart); camera.TriggerMode.SetValue(TriggerMode_On); // Set the number of images to be acquired per Acquisition Start trigger signal to 3 camera.AcquisitionFrameCount.SetValue(3);
Trigger Mode
针对触发类型的触发模式选择。
enum TriggerModeEnums { TriggerMode_Off, //!<Sets the mode for the selected trigger to off TriggerMode_On //!<Sets the mode for the selected trigger to on };
代码如下
// Select the Frame Start trigger camera.TriggerSelector.SetValue(TriggerSelector_FrameStart); // Enable triggered image acquisition for the Frame Start trigger camera.TriggerMode.SetValue(TriggerMode_On);
默认,每种触发类型的触发模式都被设为 OFF。也即意味着 “自由运行图像采集” 被打开。所有的 Basle 相机默认都是自由运行图像采集模式。
Free Run Image Acquisition
自由运行图像采集模式不需要用户触发。这个选项不在 Pylon Viewer ,需要编程设置。
设置方式:
- 设置采集模式为连续 AcquisitionMode_Continuous
- 选择一种触发类型,比如 FrameStart
- 设置触发模式为 OFF
- 重复上述步骤设置所有触发类型
Trigger Source
触发源可以选择硬件或软件。
enum TriggerSourceEnums { TriggerSource_Software, //!<Sets the software trigger as the signal source for the selected trigger TriggerSource_Line1, //!<Sets the signal source for the selected trigger to line 1 TriggerSource_Line2, //!<Sets the signal source for the selected trigger to line 2 TriggerSource_Line3, //!<Sets the signal source for the selected trigger to line 3 TriggerSource_Line4, //!<Sets the signal source for the selected trigger to line 4 TriggerSource_Line5, //!<Sets the signal source for the selected trigger to line 5 TriggerSource_Line6, //!<Sets the signal source for the selected trigger to line 6 TriggerSource_Line7, //!<Sets the signal source for the selected trigger to line 7 TriggerSource_Line8, //!<Sets the signal source for the selected trigger to line 8 TriggerSource_CC1, //!<Sets the signal source for the selected trigger to CC1 TriggerSource_CC2, //!<Sets the signal source for the selected trigger to CC2 TriggerSource_CC3, //!<Sets the signal source for the selected trigger to CC3 TriggerSource_CC4, //!<Sets the signal source for the selected trigger to CC4 TriggerSource_ShaftEncoderModuleOut, //!<Sets the signal source for the selected trigger to the shaft encoder module. TriggerSource_FrequencyConverter, //!<Sets the signal source for the selected trigger to the frequency converter module. TriggerSource_Timer1Start, //!<Sets the signal source for the selected trigger to timer 1 start TriggerSource_Timer1End, //!<Sets the signal source for the selected trigger to timer 1 end TriggerSource_Counter1Start, //!<Sets the signal source for the selected trigger to counter 1 start TriggerSource_Counter1End, //!<Sets the signal source for the selected trigger to counter 1 end TriggerSource_UserOutput1, //!<Sets the signal source for the selected trigger to user output 1 TriggerSource_UserOutput2, //!<Sets the signal source for the selected trigger to user output 2 TriggerSource_Action1, //!<Sets the signal source for the selected trigger to action command signal 1 TriggerSource_Action2, //!<Sets the signal source for the selected trigger to action command signal 2 TriggerSource_Action3, //!<Sets the signal source for the selected trigger to action command signal 3 TriggerSource_Action4, //!<Sets the signal source for the selected trigger to action command signal 4 TriggerSource_VInput1, //!<Sets the signal source for the selected trigger to Virtual Input 1 TriggerSource_VInput2, //!<Sets the signal source for the selected trigger to Virtual Input 2 TriggerSource_VInput3, //!<Sets the signal source for the selected trigger to Virtual Input 3 TriggerSource_VInput4, //!<Sets the signal source for the selected trigger to Virtual Input 4 TriggerSource_VInputDecActive //!<Sets the signal source for the selected trigger to Virtual Input Decoder Active };
例如
- TriggerSource_Software
- TriggerSource_Line1
代码示例
// Select the Frame Start trigger camera.TriggerSelector.SetValue(TriggerSelector_FrameStart); // Set the trigger source to Line 1 camera.TriggerSource.SetValue(TriggerSource_Line1);
Trigger Activation
指定硬件触发时是上升沿或下降沿有效。
enum TriggerActivationEnums { TriggerActivation_RisingEdge, //!<Sets the selected trigger to become active on the rising edge of the source signal TriggerActivation_FallingEdge, //!<Sets the selected trigger to become active on the falling edge of the source signal TriggerActivation_AnyEdge, //!<Sets the selected trigger to become active on the falling or rising edge of the source signal TriggerActivation_LevelHigh, //!<Sets the selected trigger to become active when the source signal is high TriggerActivation_LevelLow //!<Sets the selected trigger to become active when the source signal is low };
例如:
- TriggerActivation_RisingEdge :上升沿有效
- TriggerActivation_FallingEdge :下降沿有效
代码示例
// Select the Frame Start trigger camera.TriggerSelector.SetValue(TriggerSelector_FrameStart); // Set the trigger activation mode to rising edge camera.TriggerActivation.SetValue(TriggerActivation_RisingEdge);
Trigger Software
用软件触发相机,设置:
- 设置触发类型,比如 FrameStart
- 设置触发模式为 ON
- 设置触发源为 Software
- 执行 TriggerSoftware 命令
代码示例
// Select the Frame Start trigger camera.TriggerSelector.SetValue(TriggerSelector_FrameStart); // Enable triggered image acquisition for the Frame Start trigger camera.TriggerMode.SetValue(TriggerMode_On); // Set the trigger source for the Frame Start trigger to Software camera.TriggerSource.SetValue(TriggerSource_Software); // Generate a software trigger signal camera.TriggerSoftware.Execute();