Implementing High-Speed Burst Capture with the Basler pylon SDK (C# / .NET 8)

Implementing High-Speed Burst Capture with the Basler pylon SDK (C# / .NET 8)

In machine vision and inspection systems, it’s often not enough to capture a single frame—you frequently need to capture multiple images in rapid succession, also known as burst capture or continuous acquisition.

In this article, we walk through how to implement burst capture using the Basler pylon SDK in C#, including:

  • A basic capture loop
  • Controlling frame interval
  • Saving images with timestamps
  • Practical performance considerations

✔ What You Will Learn

  • How to implement a burst capture loop
  • How to control acquisition interval using frame-rate settings
  • How to save frames with timestamps for later analysis
  • How to avoid dropped frames and performance bottlenecks

✔ Environment

Item Details
Camera Basler acA2500-14gm
SDK Basler pylon Camera Software Suite
Lang C# / .NET 8 (Windows)

🔄 Basic Burst Capture: Capturing N Consecutive Frames

Before implementing burst capture, define a helper method to control trigger mode:

The following method performs a free-run (trigger-off) burst capture, saving each frame with both an index and elapsed time. Including timestamps makes later debugging and performance analysis much easier.


🕒 Controlling the Capture Interval

Burst capture does not automatically enforce timing. To control the interval—for example, 10 fps—enable and set AcquisitionFrameRate:

Reference: How to Control and Verify Frame Rate Using the Basler pylon SDK (C# / .NET 8)


📷 Example: Capturing 10 Frames at 10 fps


📊 Example Output

Captured images at 10 fps while the object was rotating:

45ms 143ms 243ms 343ms 443ms
BurstCaptureTest_000_45ms.png BurstCaptureTest_001_143ms.png BurstCaptureTest_002_243ms.png BurstCaptureTest_003_343ms.png BurstCaptureTest_004_443ms.png
543ms 643ms 743ms 843ms 943ms
BurstCaptureTest_005_543ms.png BurstCaptureTest_006_643ms.png BurstCaptureTest_007_743ms.png BurstCaptureTest_008_843ms.png BurstCaptureTest_009_943ms.png

⚠️ Common Problems & How to Fix Them

Issue Cause / Solution
Missing frames Saving images takes too long → save in a background thread using ConcurrentQueue
CPU load too high Full-resolution images are heavy → reduce ROI
First-frame timestamp inconsistent Trigger mode behavior → use hardware/software trigger for strict timing

🔁 Slow Burst Capture at Full Resolution?

→ Reduce ROI to Increase Frame Rate

Full-resolution capture (e.g., 2592×1944) can bottleneck both bandwidth and processing time. Reducing the Region of Interest (ROI) often dramatically improves:

  • Frame rate
  • Latency
  • Stability

ROI-based optimization will be covered in the next article.


📝 Summary

  • Burst capture in pylon is implemented with StreamGrabber.Start() + a loop
  • Frame rate control determines capture timing
  • Image saving can become a bottleneck—offload saving to another thread if necessary
  • Combining ROI with burst capture greatly improves performance

筆者: @MilleVision


📦 Full Sample Code Package

A complete working version of all code shown in this article (including burst capture templates) is available here:

👉 https://millevision.booth.pm/items/7316233

コメント

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA