5、采集控制(Acquisition Control)
采集控制章节描述了与图像采集相关的所有特征,包括触发器和曝光控制。它描述了采集的基本模型和设备的典型行为。
1. 采集相关的词汇和信号(Acquisition related vocabulary and signals)
本节描述了用于描述和命名与采集相关的特性的词汇表和术语。它还定义了与采集相关的信号及其在设备采集图像时的时间位置。
采集(Acquisition)由直线(Lines)构成的一个或多个帧(Frames)组成。采集的帧可以选择分组为单独触发的较小的突发。采集定义为对一个或多个帧序列的捕获(请参见图 5-1 )。
采集帧的传输从第一帧的传输开始开始,到最后一帧的传输完成结束。
帧的突发(A Burst of Frame(s))定义为捕获中一个或多个帧组的捕获(Acquisition)(参见图 5-1 )。如果启用了帧突发启动(FrameBurstStart)或帧突发活动触发器(FrameBurstActive)(其触发模式(TriggerMode)=On),则可以在许多较小的突发中中断采集。在这种情况下,每个爆发都有自己的触发器。如果仅启用帧突发启动触发器,则采集突发帧计数将确定每个突发的长度。如果启用了帧突发启动和帧突发结束触发器,则它们将用于限定每个突发的长度。如果启用了帧突发激活触发器,它将确定每个单独突发的长度(只要断言触发器,突发将持续)。
突发的帧的传输从突发的第一帧的传输开始开始,到最后一帧的传输的完成结束。
一帧被定义为宽度像素( Width pixels) x 高度线(Height lines)的捕获。帧从可选的曝光(Exposure)周期开始,以传感器读出的完成结束。一般来说,一个传输周期将在传感器读出期间开始,并将在它之后的某个时间完成,但它不被视为框架的一部分。
对于线扫描采集,帧的定义保持相同,但是对虚拟帧的每一行进行曝光和读取。
2. 采集特性使用模型(Acquisition features usage model)
AcquisitionMode 控制着该设备的采集模式。这主要影响采集中捕获的帧数(SingleFrame, MultiFrame 或者 Continuous)。
可选的 AcquisitionArm 命令用于验证和冻结与图像数据捕获相关的所有参数。它为 AcquisitionStart 准备设备。
AcquisitionStart 命令用于启动采集。
AcquisitionStop 命令将在当前帧结束时停止采集。它可以在任何采集模式下使用,如果相机正在等待触发器,等待的帧将被取消。
AcquisitionAbort 命令可用于在任何时候中止采集。这将立即结束捕获,而不等待采集完当前帧。
AcquisitionFrameCount 控制当采集模式(AcquisitionMode)为多帧(MultiFrame)时将捕获的帧数。
如果启用了 FrameBurstStart 触发器并且禁用了 FrameBurstEnd 触发器,则 AcquisitionBurstFrameCount 确定要捕获的每个突发的长度。
AcquisitionFrameRate 控制在触发模式(TriggerMode)关闭时捕获帧的速率。
AcquisitionLineRate 控制当触发模式关闭时,每一帧中的线被捕获的速率。这通常有用。
AcquisitionStatusSelector 和 AcquisitionStatus 可以用来读取内部采集信号的状态。标准采集信号状态为:采集触发等待(AcquisitionTriggerWait)、采集激活(AcquisitionActive)、采集传输(AcquisitionTransfer)、帧触发等待(FrameTriggerWait)、帧激活(FrameActive)、曝光激活(ExposureActive)(参见图 5-1 和图 5-3 )。
3. 采集时序图(Acquisition timing diagrams)
本节给出了最常见的采集场景的时序图和功能设置顺序。
(1)Continuous Acquisition —— 连续采集
(2)Continuous Acquisition with AcquisitionStart trigger —— 使用 AcquisitionStart 触发器进行连续采集
(3)Continuous Acquisition with FrameStart trigger —— 使用帧启动触发器进行连续采集
(4)Continuous Acquisition with FrameBurstStart trigger —— 使用帧突发启动触发器进行连续采集
(5)Multi-Frame Acquisition —— 多帧采集
(6)Multi-Frame Acquisition with AcquisitionStart trigger —— 使用采集启动触发器进行多帧采集
(7)Multi-Frame Acquisition with FrameStart trigger —— 使用帧启动触发器进行多帧采集
(8)Multi-Frame Acquisition with FrameBurstStart trigger —— 使用FrameBurstStart 触发器进行多帧采集
(9)Single Frame Acquisition —— 单帧采集
(10)Single Frame Acquisition with AcquisitionStart trigger —— 使用AcquisitionStart触发器进行多帧采集
(11)Single Frame Acquisition with FrameStart trigger —— 使用帧启动触发器进行多帧采集
4. 采集和触发器功能的使用示例(Acquisition and Trigger features usage examples)
(1)Continuous acquisition when the camera is in its reset state
当摄像机处于重置状态时,可进行连续采集。
AcquisitionMode = Continuous; AcquisitionStart(); … AcquisitionStop();
(2)Single Frame acquisition in Hardware trigger mode using the external I/O Line 3
使用外部I/O线3在硬件触发模式下的单帧采集
AcquisitionMode = SingleFrame; TriggerSelector = FrameStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line3; AcquisitionStart();
(3)Multi-Frame acquisition started by a single Software trigger
多帧采集由单个软件触发器延迟1毫秒。触发器将启动整个序列采集。每一帧的曝光时间设置为 500 us。
/* Multi-Frame acquisition started by a single Software trigger delayed by 1 millisecond. The Trigger starts the whole sequence acquisition. The Exposure time for each frame is set to 500 us. */ AcquisitionMode = MultiFrame; AcquisitionFrameCount = 20; TriggerSelector = AcquisitionStart; TriggerMode = On; TriggerSource = Software; TriggerDelay = 1000; ExposureMode = Timed; ExposureTime = 500; AcquisitionStart(); TriggerSoftware();
(4)Continuous acquisition in Hardware trigger mode
在硬件触发模式下的连续采集。帧触发器是来自物理线2的上升边缘信号。曝光时间是500 us。在每一帧曝光后,曝光结束事件也被发送到主机应用程序,以表明被检查的部分可以被移动。该事件的时间戳也会被读取。
/* Continuous acquisition in Hardware trigger mode. The Frame triggers are Rising Edge signals coming from the physical Line 2. The Exposure time is 500us. An exposure end event is also sent to the Host application after the exposure of each frame to signal that the inspected part can be moved. The timestamp of the event is also read. */ AcquisitionMode = Continuous; TriggerSelector = FrameStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line2; ExposureMode = Timed; ExposureTime = 500; Register(Camera.EventExposureEnd, CallbackDataObject, CallbackFunctionPtr) EventSelector = ExposureEnd; EventNotification = On; AcquisitionStart(); … // In the callback of the ExposureEnd event, get the event timestamp: Timestamp = EventExposureEndTimestamp; … AcquisitionStop();
(5)Multi-Frame acquisition with each frame triggered by a Hardware trigger on Line 1
多帧采集,每帧由硬件 Line 1 触发器触发。曝光信号持续时间(500us)的负脉冲也被发送到物理输出线2,以在每一帧的曝光时间期间激活一束光。序列捕获的结束通过采集结束事件发送给主机。
/* Multi-Frame acquisition with each frame triggered by a Hardware trigger on Line 1. A negative pulse of the exposure signal duration (500us) is also sent to the physical output line 2 to activate a light during the exposure time of each frame. The end of the sequence capture is signalled to the host with an acquisition end event. */ AcquisitionMode = MultiFrame; AcquisitionFrameCount = 20; TriggerSelector = FrameStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line1; ExposureMode = Timed; ExposureTime = 500; LineSelector = Line2; LineMode = Output; LineInverter = True; LineSource = ExposureActive Register(Camera.EventAcquisitionEnd,CallbackDataObject,CallbackFunctionPtr) EventSelector = AcquisitionEnd; EventNotification = On; AcquisitionStart();
(6)Continuous Acquisition of frames in bursts of 10 frames
10 帧的连续采集帧。每个突发都由 Line 1 上的硬件触发器触发。每个突发捕获的结束都通过一个帧突发结束事件(FrameBurstEnd )发送给主机。
/* Continuous Acquisition of frames in bursts of 10 frames. Each burst is triggered by a Hardware trigger on Line 1. The end of each burst capture is signalled to the host with a FrameBurstEnd event. */ AcquisitionMode = Continuous; AcquisitionBurstFrameCount = 10; TriggerSelector = FrameBurstStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line1; Register(Camera.EventFrameBurstEnd,CallbackDataObject,CallbackFunctionPtr) EventSelector = FrameBurstEnd; EventNotification = On; AcquisitionStart(); … // In the callback of the end of burst event, get the event timestamp: Timestamp = EventExposureEndTimestamp; … AcquisitionStop();
(7)Multi-Frame Acquisition of 50 frames in 5 bursts of 10 frames
多帧采集50帧,每5次采集10帧。每次爆发都由 Line 1 上的硬件触发器触发。
/* Multi-Frame Acquisition of 50 frames in 5 bursts of 10 frames. Each burst is triggered by a Hardware trigger on Line 1. */ AcquisitionMode = MultiFrame; AcquisitionFrameCount = 50; AcquisitionBurstFrameCount = 10; TriggerSelector = FrameBurstStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line1; AcquisitionStart();
(8)Linescan continuous acquisition with Hardware Frame and Line trigger
使用硬件框架和线触发器线扫描连续采集。
/* Linescan continuous acquisition with Hardware Frame and Line trigger. */ AcquisitionMode = Continuous; TriggerSelector = FrameStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line1; TriggerSelector = LineStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line2; AcquisitionStart(); … AcquisitionStop();
(9)Framescan continuous acquisition
帧扫描连续采集与硬件帧触发器和曝光持续时间由触发器的脉冲宽度控制。
/* Framescan continuous acquisition with Hardware Frame trigger and the Exposure duration controlled by the Trigger pulse width. */ AcquisitionMode = Continuous; TriggerSelector = FrameStart; TriggerMode = On; TriggerActivation = RisingEdge; TriggerSource = Line1; ExposureMode = TriggerWidth; AcquisitionStart(); … AcquisitionStop();
(10)Framescan continuous acquisition
帧可以连续采集,通过1个硬件触发器来控制采集的开始,以及 2 个其他硬件触发器来启动和停止每个帧的曝光。
/* Framescan continuous acquisition with 1 Hardware trigger controlling the start of the acquisition and 2 others harware triggers to start and stop the exposure of each frame. */ AcquisitionMode = Continuous; TriggerSelector = AcquisitionStart; TriggerMode = On; TriggerSource = Line1; ExposureMode = TriggerControlled; TriggerSelector = ExposureStart; TriggerMode = On; TriggerSource = Line3; TriggerSelector = ExposureStop; TriggerMode = On; TriggerSource = Line4; AcquisitionStart(); … AcquisitionStop();
SFNC —— 采集控制(四)(中):https://developer.aliyun.com/article/1598544