コンテンツにスキップ

Synchronous Free Run (blaze)#

The Synchronous Free Run feature allows you to operate multiple blaze cameras that are in the same network simultaneously without their light sources interfering with each other.

機能を使用する#

Why Use Synchronous Free Run#

If you want use multiple blaze cameras to capture the same scene, you have to stagger the exposures on the individual cameras so that their light sources don't interfere with each other. Similar to ambient light, the light sources of the individual cameras also cause a reduction in image quality.

Using PTP, you can let a group of cameras capture images in synchronous free run but with the exposures starting consecutively in precisely time-aligned intervals and in chronological order. That way, the light of one camera doesn’t interfere with the other cameras’ measurements.

仕組み#

There are two ways to configure synchronous free run. To help you decide which option is best for you, you have to understand the general operating principle of the blaze camera when it comes to image acquisition.

When acquiring images, each frame is composed of eight subframes (4 subframes if Fast Mode is enabled). Each subframe can be viewed as a separate exposure because after exposing each subframe the illumination is switched off and the sensor is reset.

Frame Exposure Phases#

During an exposure, the following phases take place:

  • Startup: This happens once when a frame is triggered.
  • Reset: The sensor is reset. This happens before each subframe is acquired.
  • Exposure: The shutter opens and the sensor is exposed. This happens for each subframe.
  • Readout: The data collected during the subframe is read out of the sensor.

The following figure shows the different phases of a frame exposure (only subframes 1, 2, and 8 are shown).

Phases of a Frame Exposure

Configuring Synchronous Free Run#

When setting up cameras for synchronous free run, the cameras' acquisitions are aligned by specifying different acquisition start times for the cameras.

There are two ways to use synchronous free run:

Interleaved Mode#

If you want to operate two blaze cameras simultaneously, choose the interleaved mode. In this mode, the second camera emits light while the first camera performs the sensor readout.

Interleaved Synchronous Free Run

Consecutive Mode#

If you want to operate more than two cameras simultaneously, the interleaved mode is not an option since the readout time of the first camera isn't long enough for two or more cameras to perform their exposure cycle during the sensor readout time. Instead, you have to use the consecutive mode, where the cameras acquire frames consecutively one after another.

Consecutive Synchronous Free Run

カメラの設定#

情報

The blaze SDK contains the SynchronousFreeRun C++ sample, which demonstrates how to set up several cameras for synchronous free run and how to capture image data and identify frames that belong together chronologically. Part of that sample are several helper functions and classes that you can integrate into your application by adding the PtpHelper.h and PtpHelper.cpp files to your project.

This section describes a sample implementation for configuring the cameras for synchronous free run using pseudo code. The procedure can be used for configuring the interleaved and the consecutive mode.

Variables Used
  • t_start,n: Duration of the frame startup time of the nth camera.
  • t_reset,n: Duration of the nth camera's reset time (reset takes place at the beginning of each subframe).
  • t_exp,n: Duration of the nth camera's exposure time for a single subframe.
  • t_read,n: Duration of the nth camera's readout time for a single subframe.
  • t_frame,n: Total time required for the nth camera to acquire all subframes of a frame.

The actual values can be retrieved from the camera. The following table lists the parameter names that you have to read out:

Variable Camera Parameter
t_start,n StartupTime
t_reset,n ResetTime
t_exp,n ExposureTime
t_read,n ReadoutTime
t_frame,n FrameDuration

The following variables are used as well:

  • t_0: Current PTP timestamp [ns].
  • f_max: Maximum possible frame rate [Hz].
  • t_acq,n: Acquisition start time for the nth camera [ns].
  • t_safety: Additional amount of time that the acquisition should be delayed by in order to compensate for jitter [us]. Recommended value: 400 µs.
  • n : Number of cameras.

All the camera parameters listed above return values in microseconds (µs).

The amount of time by which the individual acquisition start times have to be staggered depends on the exposure times and whether interleaved or consecutive synchronous free run mode is used. In consecutive mode, the offsets between the acquisition start times also depend on whether the Fast Mode parameter is enabled.

The acquisition start times should be set to some point in the future to ensure that no camera starts acquisition before your application has configured all cameras and set up a grab loop. You should factor in about 400 ms for configuring one camera. This approach ensures that all frames that belong together chronologically have the same frame number.

To configure the cameras (sample implementation):

  1. On each camera, enable PTP by setting the EnablePtp parameter to true.
  2. Wait until the master clock selection has been performed and the clocks are sufficiently synchronized.
    For details, see Precision Time Protocol (blaze).
  3. On each camera, configure the desired ExposureTime and OperatingMode.

    情報

    When setting up the cameras for interleaved synchronous free run mode, you have to set the same exposure time and operating mode on both cameras.

  4. Calculate the maximum possible frame rate f_max as described below.

  5. On each camera, specify a fixed frame rate by setting the AcquisitionFrameRateEnable parameter to true. Specify the desired frame rate by setting the AcquisitionFrameRate parameter to a value equal to or less than f_max.

    情報

    You have to specify the same frame rate on all cameras.

  6. Retrieve the current timestamp t_0 from one of the cameras by first executing the TimestampLatch command and then reading out the TimestampLatchValue parameter.

  7. t_acq,1 = t_0 + n * 400 * 1e6
  8. For i = 1 to n

    1. Set the SyncFreeRunTimerStartTimeLow parameter of camera i to
      t_acq,i & 0xffffffff.
    2. Set the SyncFreeRunTimerStartTimeHigh parameter of camera i to
      t_acq,i >> 32.
    3. Execute the SyncFreeRunTimerUpdate command of camera i.
    4. Enable synchronous free run on camera i by setting the SyncFreeRunEnable parameter to true.
    5. If i is less than n:

      • n == 2, i.e., interleaved mode:
        t_acq,i+1 = t_acq,i + 1000 * (t_safety + t_exp,i)

      • n > 2, i.e., consecutive mode:
        t_acq,i+1 = t_acq,i + 1000 * (t_safety + t_frame,i - t_read,i - t_start,i+1 - t_reset,i+1)

  9. Prepare the application's grab loop.

  10. On each camera, issue the StartAcquisition command.
  11. Grab images from each camera.

Determining the Maximum Frame Rate#

When using consecutive synchronous free run, the maximum frame rate per camera is limited by the number of cameras and the frame duration of each camera.

When using two cameras in interleaved synchronous free run, both cameras can be operated with the maximum possible frame rate.

In the following, f_max,n denotes the maximum allowed value for the nth camera's AcquisitionFrameRate parameter. To read out f_max,i for camera i using the APIs of the blaze SDK the following code snippets can be used:

C++

auto max = camera.GetParameter<GenApi::CFloatPtr>("AcquisitionFrameRate")->GetMax();

C#

var max = (double) camera.GetParameterMaximum("AcquisitionFrameRate");

Interleaved Mode#

The maximum frame rate f_max in interleaved mode is determined by the lower value out of f_max,1 and f_max,2.

Consecutive Mode#

The maximum frame rate f_max in consecutive mode can be calculated with the following steps:

  1. f_minmax = min(f_max,1 , ... ,f_max,n)
  2. t_total = 0
  3. for i = 1 to n
    1. t_total = t_total + t_frame,i - t_start,i - t_reset,i - t_read,i
  4. t_total = t_total + t_start,1 + t_reset,1
  5. f = 1e6 / t_total
  6. f_max = min(f, f_minmax)