Baumer工业相机堡盟工业相机如何通过BGAPISDK进行定序器编程:VCXG双快门操作(C++)

简介: Baumer工业相机堡盟工业相机如何通过BGAPISDK进行定序器编程:VCXG双快门操作(C++)

Baumer工业相机

Baumer工业相机堡盟相机是一种高性能、高质量的工业相机,可用于各种应用场景,如物体检测、计数和识别、运动分析和图像处理。


Baumer的万兆网相机拥有出色的图像处理性能,可以实时传输高分辨率图像。此外,该相机还具有快速数据传输、低功耗、易于集成以及高度可扩展性等特点。

Baumer工业相机由于其性能和质量的优越和稳定,常用于高速同步采集领域,通常使用各种图像算法来提高其捕获的图像的质量。


Baumer工业相机BGAPISDK和定序器编程的技术背景

Baumer工业相机的BGAPI SDK是Baumer公司开发的针对其相机产品系列的一套软件开发工具包。该SDK提供了一组API,使开发人员可以编写专业应用程序,从而控制、捕获、处理和显示Baumer相机的图像和数据。BGAPI SDK支持多种编程语言,包括C++、C#、Visual Basic、LabVIEW、Matlab等,并提供了大量示例代码和文档,以帮助用户轻松上手,快速完成应用程序的开发。


BGAPI SDK提供了丰富的功能,可以控制Baumer相机的所有参数,包括曝光时间、增益、白平衡、触发模式等,以及支持各种数据格式,例如Raw、BMP、JPG等,同时还提供了实时显示、数据采集、图像处理等功能,为开发人员提供了高度定制化的解决方案。此外,BGAPI SDK还支持多相机系统的开发,并可支持各种计算机操作系统,如Windows、Linux、Mac OS等。


工业相机的 定序器Sequencer 功能是一种高级的编程功能,允许用户将多种拍摄参数设置成独立的序列,实现对相机的自动切换控制以满足多种不同的应用需求。使用 Sequencer 功能可以实现在一个拍摄周期内,完成多个曝光、图像传输和处理任务,从而提高工程效率和质量。


本文介绍的通过集成BGAPI SDK进行定序器编程:根据每次触发信号移动感兴趣区域的功能。


Baumer工业相机通过BGAPISDK进行定序器编程功能

下面介绍在C#里Baumer工业相机如何通过BGAPISDK进行定序器编程:VCXG双快门操作的功能。


1.引用合适的类文件

代码如下(示例):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Data;
using System.Globalization;
using System.Diagnostics;
using System.IO;

2.Baumer工业相机通过BGAPISDK进行定序器编程:VCXG双快门操作功能。

本示例介绍了如何通过硬件触发实现双快门操作的定序器编程。双快门操作旨在在很短的时间内采集2张图像。该操作使用了一种特殊的技术,让相机还在读取第一张图像的时候可以采集第二张图像。


如需了解有关定序器用途以及何时使用双快门方面的更多信息,请参阅下方的应用说明和相机《用户指南》。


下图所示为以信号曲线表示的双快门效果:在第二次曝光的最终阶段消除外界光(曝光信号中的灰色阴影区域),可确保相机实现预期动作。

7.png

// STOP AUQISITION AND LOAD DEFAULT PARAMETERS
mDevice.RemoteNodeList["AcquisitionStop"].Execute();
mDevice.RemoteNodeList["UserSetSelector"].Value = "Default";
mDevice.RemoteNodeList["UserSetLoad"].Execute();
// CONFIGURE HARDWARE TRIGGER INPUT
// this needs to be done before the sequencer is configured
mDevice.RemoteNodeList["TriggerMode"].Value = "On";
mDevice.RemoteNodeList["TriggerSource"].Value = "Line0";
mDevice.RemoteNodeList["TriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["TriggerDelay"].Value = (double)0.0;
mDevice.RemoteNodeList["LineSelector"].Value = "Line0";
mDevice.RemoteNodeList["LineInverter"].Value = false;
mDevice.RemoteNodeList["LineDebouncerHighTimeAbs"].Value = (double)1.0;
mDevice.RemoteNodeList["LineDebouncerLowTimeAbs"].Value = (double)1.0;
// CONFIGURE TIMER FOR FLASH
// the timer is started on each exposure start for a duration of 100 µsec
mDevice.RemoteNodeList["TimerSelector"].Value = "Timer1";
mDevice.RemoteNodeList["TimerTriggerSource"].Value = "ExposureStart";
mDevice.RemoteNodeList["TimerTriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["TimerDelay"].Value = (double)0.0;
// TimerDuration (of Flash) equals Set0 ExposureTime below
mDevice.RemoteNodeList["TimerDuration"].Value = (double)100.0; //100.0 µsec
// CONFIGURE GPIO “Line3” FOR FLASH CONTROL
mDevice.RemoteNodeList["LineSelector"].Value = "Line3";
mDevice.RemoteNodeList["LineSource"].Value = "Timer1Active"; // Line3 is high while Timer1 set up before is active
mDevice.RemoteNodeList["LineInverter"].Value = false;
// SWITCH TO SEQUENCER CONFIG MODE
mDevice.RemoteNodeList["SequencerConfigurationMode"].Value = "On";
// SET 0 (FIRST STEP OF THE SEQUENCE)
mDevice.RemoteNodeList["SequencerSetSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerSetLoad"].Execute();
mDevice.RemoteNodeList["TriggerMode"].Value = "On";
mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;
mDevice.RemoteNodeList["Width"].Value = (long)320;
mDevice.RemoteNodeList["Height"].Value = (long)240;
mDevice.RemoteNodeList["OffsetX"].Value = (long)160;
mDevice.RemoteNodeList["OffsetY"].Value = (long)120;
// ExposureTime of Set0 = TimerDuration (of Flash)
mDevice.RemoteNodeList["ExposureTime"].Value = (double)100.0; // 100 µsec
mDevice.RemoteNodeList["SequencerPathSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerTriggerSource"].Value = "ExposureActive";
mDevice.RemoteNodeList["SequencerTriggerActivation"].Value = "RisingEdge";
// next sequencer step will be Set1 set up below
mDevice.RemoteNodeList["SequencerSetNext"].Value = (long)1;
mDevice.RemoteNodeList["SequencerSetSave"].Execute();
// SET 1 (SECOND STEP OF THE SEQUENCE)
mDevice.RemoteNodeList["SequencerSetSelector"].Value = (long)1;
mDevice.RemoteNodeList["SequencerSetLoad"].Execute();
// the TriggerMode is set to Off, otherwise the camera would wait for the next hardware trigger which is not desired. Changing TriggerMode to Off will return the camera to free run mode, after one exposure we will be back in Set0 where the TriggerMode is switched On again in order for the camera to wait for the next hardware trigger.
mDevice.RemoteNodeList["TriggerMode"].Value = "Off";
mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;
mDevice.RemoteNodeList["Width"].Value = (long)320;
mDevice.RemoteNodeList["Height"].Value = (long)240;
mDevice.RemoteNodeList["OffsetX"].Value = (long)160;
mDevice.RemoteNodeList["OffsetY"].Value = (long)120;
// here is the Double Shutter trick, for this second exposure we set the exposure time to 
// the same time as the ReadOutTime of the first image(as calculated by the camera). The 
// camera will recognize that the second image will be ready for ReadOut only after the 
// ReadOut of the first image is finished and therefore start the exposure straight away 
// instead of waiting for the first image to finish ReadOut
double fReadOutTime_Set1 = (double)((long)mDevice.RemoteNodeList["ReadOutTime"].Value);
mDevice.RemoteNodeList["ExposureTime"].Value = (double)fReadOutTime_Set1;
mDevice.RemoteNodeList["SequencerPathSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerTriggerSource"].Value = "ExposureActive";
mDevice.RemoteNodeList["SequencerTriggerActivation"].Value = "RisingEdge";
// Next sequencer step will be Step0 again
mDevice.RemoteNodeList["SequencerSetNext"].Value = (long)0;
mDevice.RemoteNodeList["SequencerSetSave"].Execute();
// Start with the Set0
mDevice.RemoteNodeList["SequencerSetStart"].Value = (long)0;
// SEQUENCER CONFIG END
mDevice.RemoteNodeList["SequencerConfigurationMode"].Value = "Off";
// START CAMERA SEQUENCER
mDevice.RemoteNodeList["SequencerMode"].Value = "On";
mDataStream.StartAcquisition();
mDevice.RemoteNodeList["AcquisitionStart"].Execute();
// CAPTURE IMAGES
// STOP CAMERA SEQUENCER
mDevice.RemoteNodeList["AcquisitionStop"].Execute();
mDataStream.StopAcquisition();
mDevice.RemoteNodeList["SequencerMode"].Value = "Off";

Baumer工业相机进行双快门操作的优势

双快门操作,也被称为全局快门,是一种在同一时间捕获所有素信息的方式。由于所有像素数据都是在同一时间捕获的,因此全局快门能够减少运动模糊和失真,特别是在拍摄高速运动对象时。以下是双快门操作的一些优势:


减少运动模糊:双快门操作能够在同一时间进行捕获,因此,即使在拍摄高速运动的对象时,也能够取得理想清晰的图像,而不会产生模糊现象。


减少失真:对于需要同步多相机拍摄的应用,例如三维重建,双快门操作能够减少因时间差异引起的失真。


提高图像质量:对于某些特定的应用,恶劣的光照条件下拍摄,全局快门可以减少图像噪音,提供更高的动态范围,从而提高图像质量。


更好的深度感知:在深度感知的设备上,全局快门可以提供更准确的深度信息,因为所有像素都在同一时间被捕获,这有助于准确测量物体的距离和移动速度。


总结,双快门技术使得工业相机在拍摄高速运动的对象或者在需要同步有优势,它可以减少模糊和失真,提高图像质量,以及提供更准确的深度信息。


Baumer工业相机进行双快门操作的行业应用

双快门操作,也被称为全局快门,是一种在同一时间捕获所有素信息的方式。由于所有像素数据都是在同一时间捕获的,因此全局快门能够减少运动模糊和失真,特别是在拍摄高速运动对象时。以下是双快门操作的一些优势:


减少运动模糊:双快门操作能够在同一时间进行捕获,因此,即使在拍摄高速运动的对象时,也能够取得理想清晰的图像,而不会产生模糊现象。


减少失真:对于需要同步多相机拍摄的应用,例如三维重建,双快门操作能够减少因时间差异引起的失真。


提高图像质量:对于某些特定的应用,恶劣的光照条件下拍摄,全局快门可以减少图像噪音,提供更高的动态范围,从而提高图像质量。


更好的深度感知:在深度感知的设备上,全局快门可以提供更准确的深度信息,因为所有像素都在同一时间被捕获,这有助于准确测量物体的距离和移动速度。


总结,双快门技术使得工业相机在拍摄高速运动的对象或者在需要同步有优势,它可以减少模糊和失真,提高图像质量,以及提供更准确的深度信息。

目录
相关文章
|
5天前
|
算法 编译器 C语言
探索C++编程的奥秘与魅力
探索C++编程的奥秘与魅力
|
5天前
|
编译器 C语言 C++
C语言,C++编程软件比较(推荐的编程软件)
C语言,C++编程软件比较(推荐的编程软件)
|
5天前
|
安全 前端开发 程序员
|
5天前
|
算法 安全 编译器
【C++】从零开始认识泛型编程 — 模版
泛型编程是C++中十分关键的一环,泛型编程是C++编程中的一项强大功能,它通过模板提供了类型无关的代码,使得C++程序可以更加灵活和高效,极大的简便了我们编写代码的工作量。
17 3
|
5天前
|
并行计算 调度 C++
|
5天前
|
Java Linux 调度
|
5天前
|
安全 C++
C++多线程编程:并发与同步
C++多线程编程:并发与同步
10 0
|
5天前
|
存储 算法 编译器
C++的模板与泛型编程探秘
C++的模板与泛型编程探秘
11 0
|
5天前
|
算法 程序员 C语言
C++:深度探索与编程实践
C++:深度探索与编程实践
19 3
|
5天前
|
编译器 程序员 C++
C++从入门到精通:3.1模板编程——提高代码的复用性和灵活性
C++从入门到精通:3.1模板编程——提高代码的复用性和灵活性