Baumer industrial camera Baumer industrial camera how to set multi-frame acquisition mode through BGAPISDK (C#)

Baumer industrial camera

Baumer Industrial Cameras Baumer cameras are high-performance, high-quality industrial cameras that can be used in various application scenarios, such as object detection, counting and recognition, motion analysis and image processing.

Baumer's 10 Gigabit cameras have excellent image processing performance and can transmit high-resolution images in real time. In addition, the camera features fast data transfer, low power consumption, easy integration, and high scalability.
​Baumer
industrial cameras are often used in the field of high-speed synchronous acquisition due to their superior and stable performance and quality, and usually use various image algorithms to improve the quality of the captured images.

Technical background of Baumer industrial camera BGAPISDK and multi-frame acquisition mode

The BGAPI SDK for Baumer industrial cameras is a set of software development kits developed by Baumer for its camera product series. The SDK provides a set of APIs that enable developers to write professional applications to control, capture, process and display images and data from Baumer cameras. BGAPI SDK supports multiple programming languages, including C++, C#, Visual Basic, LabVIEW, Matlab, etc., and provides a large number of sample codes and documents to help users get started easily and quickly complete application development.

The BGAPI SDK provides a wealth of functions to control all parameters of the Baumer camera, including exposure time, gain, white balance, trigger mode, etc., and supports various data formats, such as Raw, BMP, JPG, etc., and also provides real-time display , data acquisition, image processing and other functions, providing developers with highly customized solutions. In addition, BGAPI SDK also supports the development of multi-camera systems, and can support various computer operating systems, such as Windows, Linux, Mac OS, etc.

The multi-frame acquisition mode of an industrial camera means that the camera can continuously acquire multiple frames of images in a short period of time. This mode is very useful in many application scenarios, such as detection of fast production lines, tracking of high-speed moving objects, etc. According to different camera types and sensors, the multi-frame acquisition mode can realize high-speed, high-precision, and continuous capture of scenes.
The following are some common multi-frame acquisition modes:

Continuous capture mode: The camera captures images without interruption until it is manually stopped or the set number of capture frames is reached. This mode is suitable for scenarios of real-time continuous image analysis, such as surveillance, motion capture, etc.

Trigger acquisition mode: In this mode, the camera will only acquire images when it receives an external trigger signal. This acquisition method can be used in scenarios with specific requirements for timing acquisition, such as measurement equipment, quality inspection, etc.

Timing acquisition mode: In this mode, the camera performs image acquisition according to the set time interval. This mode can be used for applications with specific requirements on sampling frequency, such as pipeline detection, timing analysis, etc.

Fixed frame rate acquisition mode: The camera performs image acquisition at a preset frame rate. This mode is used for real-time applications with fixed requirements on the image frame rate, such as motion analysis, visual tracking, etc.

High-speed acquisition mode: In this mode, the camera will achieve a higher frame rate by reducing image resolution or performing region-of-interest (ROI) acquisition during continuous acquisition. This mode is often used to capture and track high-speed moving objects.

Multi-channel acquisition mode: This mode is also called multi-frame buffer mode. In this mode, the camera will acquire multiple channels at the same time to improve the speed of image processing. For example, in stereo vision imaging, multiple color channels (red, green, blue) and other scenarios.

When selecting the multi-frame acquisition mode of the camera, it is necessary to select the appropriate mode according to the requirements of the actual application scene and the performance of the camera. In addition, when using multi-frame acquisition mode, the data traffic of image processing and storage must also be considered to ensure that the system can operate efficiently.

This article introduces the function of setting the multi-frame acquisition mode by integrating the BGAPI SDK.

Baumer industrial camera sets multi-frame acquisition mode function through BGAPISDK

The following introduces how to set the multi-frame acquisition mode of Baumer industrial cameras through BGAPISDK in C#

1. Reference the appropriate class file

The code is as follows (example):

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. Set the multi-frame acquisition mode function through BGAPISDK

The core code of Baumer industrial camera setting multi-frame acquisition mode function is as follows:

if(mDevice!= null)
{
    
    
	//设置相机采集模式为多帧采集模式	
	mDevice.RemoteNodeList["AcquisitionMode"].Value = "MultiFrame";	
 	//set 'AcquisitionFrameCount' to 100
 	mDevice.RemoteNodeList["AcquisitionFrameCount"].Value = 100;	
	
    datastreamList = mDevice.DataStreams;
    datastreamList.Refresh(100);
    mDataStream = datastreamList.Values.First();
    mDataStream.Open();

	bufferList = mDataStream.BufferList;
    for (int i = 0; i < 4; i++)
    {
    
    
        mBuffer = new BGAPI2.Buffer();
        bufferList.Add(mBuffer);
        mBuffer.QueueBuffer();
    }

    mDataStream.StartAcquisition();
    mDevice.RemoteNodeList["AcquisitionStart"].Execute();

    BGAPI2.Buffer mBufferFilled = null;
    for (int i = 0; i < 12; i++)
    {
    
    
        mBufferFilled = mDataStream.GetFilledBuffer(1000);
        if (mBufferFilled == null) {
    
     System.Console.Write("Error: Buffer Timeout after 1000 msec\n"); }
        else if (mBuffer.IsIncomplete == true) {
    
     System.Console.Write("Error: Image is incomplete\n"); mBufferFilled.QueueBuffer(); }
        else {
    
     System.Console.Write(" Image {0} received\n", mBufferFilled.FrameID); mBufferFilled.QueueBuffer(); }
    }

    mDevice.RemoteNodeList["AcquisitionAbort"].Execute();
    mDevice.RemoteNodeList["AcquisitionStop"].Execute();
    mDataStream.StopAcquisition();

    bufferList.DiscardAllBuffers();
    while (bufferList.Count > 0)
    {
    
    
        mBuffer = (BGAPI2.Buffer)bufferList.Values.First();
        bufferList.RevokeBuffer(mBuffer);
    }
    mDataStream.Close();
    mDevice.Close();	
	

}
    


The first rendering effect is as follows:
Each time the industrial camera is connected, execute: mDevice.RemoteNodeList[“AcquisitionStart”].Execute(); the
industrial camera will stop after collecting 100 images according to the setting, and the FrameID will increase by about 100. As shown below:
insert image description here

The second rendering effect is as follows:
FrameID will increase by about 100
insert image description here

Advantages of Baumer industrial camera cycle setting multi-frame acquisition mode function

The multi-frame acquisition mode of industrial cameras has many advantages and can meet the needs of various industrial application scenarios. Here are some key advantages:

Increased image acquisition rate: The multi-frame acquisition mode allows multiple images to be captured continuously in a short period of time, thereby increasing the rate and efficiency of image acquisition. This is especially important in many application scenarios that require high-speed processing, such as quality inspection, workpiece positioning, etc.

Improved image processing performance: By saving the captured image data in the cache, the multi-frame capture mode can ensure that the camera is not limited by the CPU speed when processing data in real time. Such a design can ensure that the system has high image processing performance when performing real-time analysis.

Flexible to meet the needs of industrial applications: The multi-frame acquisition mode has a variety of acquisition methods, and the appropriate mode can be selected according to the needs of actual application scenarios. For example, when tracking a high-speed moving object, you can choose the high-speed acquisition mode; and when you need to process and analyze images in real time, you can choose the continuous acquisition mode.

Ensure high precision and stability: In application scenarios such as measurement equipment and quality inspection, the trigger acquisition mode can ensure that the camera only captures images when it receives an external trigger signal. This can ensure the accuracy and stability of image acquisition and improve the performance of the entire system.

Enables synchronous and asynchronous acquisition: Some multi-frame acquisition modes allow the camera to work in both synchronous and asynchronous modes. This means that in the scene where multiple channels of data need to be collected at the same time, the synchronization between multiple channels can be guaranteed, and the efficiency and accuracy of image processing can be improved.

Improve data transmission efficiency: The multi-frame acquisition mode can reduce the overhead of image data transmission, especially for high-speed, high-resolution image data. For example, in high-speed acquisition mode, the burden of data transmission can be greatly reduced by reducing image resolution or acquiring a region of interest (ROI).

In short, the multi-frame acquisition mode of industrial cameras helps to improve the performance of image acquisition rate, processing performance, accuracy and stability, and can better meet the needs of various industrial application scenarios.

Industrial application of Baumer industrial camera setting multi-frame acquisition mode function

The multi-frame acquisition mode of industrial cameras has many advantages and can meet the needs of various industrial application scenarios. Here are some key advantages:

Increased image acquisition rate: The multi-frame acquisition mode allows multiple images to be captured continuously in a short period of time, thereby increasing the rate and efficiency of image acquisition. This is especially important in many application scenarios that require high-speed processing, such as quality inspection, workpiece positioning, etc.

Improved image processing performance: By saving the captured image data in the cache, the multi-frame capture mode can ensure that the camera is not limited by the CPU speed when processing data in real time. Such a design can ensure that the system has high image processing performance when performing real-time analysis.

Flexible to meet the needs of industrial applications: The multi-frame acquisition mode has a variety of acquisition methods, and the appropriate mode can be selected according to the needs of actual application scenarios. For example, when tracking a high-speed moving object, you can choose the high-speed acquisition mode; and when you need to process and analyze images in real time, you can choose the continuous acquisition mode.

Ensure high precision and stability: In application scenarios such as measurement equipment and quality inspection, the trigger acquisition mode can ensure that the camera only captures images when it receives an external trigger signal. This can ensure the accuracy and stability of image acquisition and improve the performance of the entire system.

Enables synchronous and asynchronous acquisition: Some multi-frame acquisition modes allow the camera to work in both synchronous and asynchronous modes. This means that in the scene where multiple channels of data need to be collected at the same time, the synchronization between multiple channels can be guaranteed, and the efficiency and accuracy of image processing can be improved.

Improve data transmission efficiency: The multi-frame acquisition mode can reduce the overhead of image data transmission, especially for high-speed, high-resolution image data. For example, in high-speed acquisition mode, the burden of data transmission can be greatly reduced by reducing image resolution or acquiring a region of interest (ROI).

In short, the multi-frame acquisition mode of industrial cameras helps to improve the performance of image acquisition rate, processing performance, accuracy and stability, and can better meet the needs of various industrial application scenarios.

Guess you like

Origin blog.csdn.net/xianzuzhicai/article/details/131388137