コンテンツにスキップ

Synchronous Free Run(blaze)#

Synchronous Free Run機能を使用すると、同じネットワーク内にある複数のblazeカメラを同時に操作できます。光源が互いに干渉することはありません。

機能を使用する#

Synchronous Free Runを使用する理由#

複数のblazeカメラを使用して同じシーンを撮影する場合は、個々のカメラの露光をずらして、光源が互いに干渉しないようにする必要があります。環境光と同様に、個々のカメラの光源も画質が低下する原因となります。

PTPを使用すると、カメラのグループに同期フリーランで画像を撮影させることができますが、露光は正確な時間間隔で時間軸に沿って連続的に開始されます。このように、1台のカメラの光は、他のカメラの測定に干渉しません。

仕組み#

同期フリーランを設定する方法は2つあります。どちらのオプションが最適かを判断するには、画像取得に関してblazeカメラの動作原理の概要を理解する必要があります。

画像を取得する際に、各フレームは8つのサブフレームで構成されます(Fast Modeが有効な場合は4つのサブフレーム)。各サブフレームの露光後に照明がオフになり、センサーがリセットされるため、各サブフレームは個別の露光と見なすことができます。

フレーム露光フェーズ#

露光中は、次のフェーズが実行されます。

  • Startup:これは、最初と5番目のサブフレームの前に発生します。
  • Reset:センサーがリセットされます。これは、各サブフレームが取得される前に発生します。
  • Exposure:シャッターが開き、センサーが露出します。これは各サブフレームで発生します。
  • Readout:サブフレーム中に収集されたデータがセンサーから読み出されます。

カメラは露出段階でのみ発光します。

次の図は、フレーム露光のさまざまなフェーズを示しています(サブフレーム1、2、8のみを表示)。

フレーム露光のフェーズ

Synchronous Free Run#

フリーランモードでカメラを操作するということは、カメラが内部の定期的なトリガータイマーを使用してそれ自体をトリガーすることを意味します。

同期フリーランモードでは、カメラクロックはPTPを使用して同期されます。同期されたクロックにより、内部トリガータイマーも同期されます。

When setting up cameras for synchronous free run, the cameras' acquisitions can be aligned by specifying individual acquisition start times for the cameras. Once a camera's acquisition start time (specified by the SyncFreeRunTimerStartTimeHigh and SyncFreeRunTimerStartTimeLow parameters) is reached, the internal trigger timer is started and the camera acquires data with a fixed frame rate.

情報

過去の開始時刻を設定することができます。この場合、内部タイマーが過去に開始されたかのように扱われます。

情報

A camera doesn't start acquisition until the AcquisitionStart command is issued.

Synchronizing blaze and ace/ace 2 Cameras

  • If your application setup contains an ace camera, the start time must be in the near future.
  • If your application setup contains an ace 2 camera, the start time of the blaze camera must be 0.

同期フリーランを使用する方法には、次の2つがあります。

インターリーブモード#

2台のblazeカメラを同時に操作する場合は、[interleaved]モードを選択します。このモードでは、他のカメラがセンサーの読み出しを実行している間、カメラは発光します。

Interleaved Synchronous Free Run

情報

The sensor timing for the cameras must be identical, i.e., you have to set the same values for the ExposureTime, FastMode, and HDRMode parameters.

センサーのタイミングは、センサーの読み出し時間によっても決定されます。これは、センサーのプロパティであるため、変更できません。ただし、センサーの読み出し時間は、カメラのハードウェアリビジョンによって異なる場合があります。この場合は、代わりに[consecutive]モードを使用します。

連続モード#

ほとんどの場合、[interleaved]モードで3台以上のカメラを操作することは実用的ではありません。ネットワークパケットが密接に連続するため、ネットワークパケットがドロップされ、データの取得が不完全になる可能性があります。より良い結果を得るには、カメラが次々にフレームを連続して取得する[consecutive]モードを使用してください。

このモードは、センサーのタイミングが異なる複数のカメラを同時に操作する場合にも使用する必要があります。

連続Synchronous Free Run

達成可能なフレームレートを最大化するために、カメラの取得開始時刻を、前のカメラの読み出しフェーズの時刻に設定できます。

カメラの設定#

情報

blaze用のpylon補足パッケージには、MultiCamHelper C++ライブラリーが含まれます。このライブラリーはC++サンプルコレクションの一部であり、MultiCam/MultiCamHelperフォルダーにあります。

The library provides the BlazeSynchronousFreeRunHelper class, which Basler recommends for setting up several blaze cameras for synchronous free run, for capturing data, and matching frames that belong together chronologically. How to use this class is shown in the SynchronousFreeRun C++ sample.

MultiCamHelperライブラリーには、GenericSynchronousFreeRunHelperクラスも用意されています。このクラスは、blazeカメラと2D GigEカメラを同期する場合に便利です。このクラスの使用方法は、Multicam/ColorAndDepthフォルダーのサンプルで示されています。

C++以外のプログラミング言語を使用する場合、またはMultiCamHelperライブラリーで提供されるクラスを使用しない場合のために、このセクションで、カメラを同期フリーラン用に設定する手順について説明します。この手順は、[interleaved]モードおよび[consecutive]モードの設定に使用できます。

使用される変数#
  • t_startup[i]: Duration of the frame startup time of the ith camera.
  • t_reset[i]: Duration of the ith camera's reset time (reset takes place at the beginning of each subframe).
  • t_exp[i]: Duration of the ith camera's exposure time for a single subframe.
  • t_read[i]: Duration of the ith camera's readout time for a single subframe.
  • t_frame[i]: Total time required for the ith camera to acquire all subframes of a frame.

実際の値はカメラから取得できます。次の表に、読み出す必要があるパラメーターの名前を示します。

変数 カメラパラメーター
t_startup StartupTime
t_reset ResetTime
t_exp ExposureTime
t_read ReadoutTime
t_frame FrameDuration

上記すべてのカメラパラメーターは、マイクロ秒(µs)で値を返します。

カメラを設定し、同期フリーランを開始するには:

  1. 各カメラで、[PTP]を有効化し、マスタークロック選択が実行され、クロックが十分に同期されるまで待ちす。
    詳細については、「Precision Time Protocol(blaze)」を参照してください。

  2. On each camera, configure the desired settings for ExposureTime, FastMode, and HDRMode.

    情報

    When setting up the cameras for interleaved synchronous free run mode, you have to set the same values for ExposureTime, FastMode, and HDRMode.

  3. Calculate the maximum possible frame rate fps_max as described below.

  4. On each camera, set the AcquisitionFrameRateEnable parameter to true specify the desired frame rate by setting the AcquisitionFrameRate parameter to a value equal to or less than fps_max.

    情報

    すべてのカメラで同じフレームレートを指定する必要があります。

  5. カメラごとに、必要なトリガーオフセットを計算し、結果の取得開始時刻を以下に説明するとおりに設定します。

  6. アプリケーションのグラブループを準備します。

  7. On each camera, issue the StartAcquisition command.

  8. 各カメラから画像をグラブします。

最大フレームレートの決定#

連続同期フリーランを使用する場合、カメラあたりの最大フレームレートは、カメラの数と各カメラのフレーム持続時間によって制限されます。

[interleaved synchronous free run]を使用する場合、カメラは可能な限り最大のフレームレートで操作できます。

In the following, fps_max[i] denotes the maximum allowed value for the ith camera's AcquisitionFrameRate parameter. To read out fps_max[i] for camera i using the APIs of the pylon SDK, you can use the following code snippets:

C++

auto max = camera[i].AcquisitionFrameRate.GetMax();

C#

var max = camera[i].Parameters[PLBlaze.AcquisitionFrameRate].GetMaximum();

インターリーブモード#

Since in interleaved mode the sensor timings must be identical for all cameras, set fps_max to the maximum frame rate value from either of the cameras.

連続モード#

You can calculate the maximum frame rate fps_max in consecutive mode as illustrated in the following pseudo code snippet:

    fmax_min = min(fps_max[0], ... ,fps_max[n-1])
    t_total = 0
    for i = 0 to n-1
       t_total = t_total + t_frame[i] - t_startup[i] - t_reset[i] - t_read[i]
    endif
    t_total = t_total + t_startup[0] + t_reset[0]
    fps = 1e6 / t_total
    fps_max = min(fps, fmax_min)

トリガーオフセットの計算と取得開始時刻の設定#

個々の取得開始時刻をずらす必要がある時間は、センサーのタイミング、および[interleaved]モードと[consecutive synchronous free run]モードのどちらを使用するかによって異なります。

The acquisition start times t_acq_start[i] 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.

次の擬似コードスニペットは、カメラのトリガーオフセットを計算する方法と、取得開始時刻を設定する方法を示しています。

使用される変数の意味:

  • n : Number of cameras.
  • camera[]: Array of cameras.
  • t_0: Current PTP timestamp [ns]. If only cameras are connected, the timestamp counts the number of ticks since the master device has been powered on. This means the timescale is arbitrary, relative, and only valid in this network. For an absolute timescale, connect a device that is synchronized to a coordinated world time (e.g., TAI or UTC).
  • fps_max: Maximum possible frame rate [Hz].
  • trigger_offset: Amount of time by which a camera's triggers are delayed compared to the previous camera.
  • t_acq_start[]: Acquisition start times [ns].
  • t_safety: Additional amount of time that the acquisition should be delayed by in order to compensate for jitter [µs]. Recommended value: 250 µs.
    camera[0].TimestampLatch.Execute()
    t_0 = camera[0].TimestampLatchValue.GetValue()
    t_acq_start[0] = t_0 + n * 400 * 1000000
    for i = 0 to n-1
        camera[i].SyncFreeRunTimerStartTimeLow.SetValue(t_acq_start[i] & 0xffffffff)
        camera[i].SyncFreeRunTimerStartTimeHigh.SetValue(t_acq_start[i] >> 32)
        camera[i].SyncFreeRunTimerUpdate.Execute()
        camera[i].SyncFreeRunEnable.SetValue(true)
        if i < n-1
            if interleaved_mode
                trigger_offset = 1000 * (t_safety + t_exp[i])
            else
                trigger_offset =
                    1000 * (t_safety + t_frame[i] - t_read[i] - t_startup[i+1] - t_reset[i+1]
            endif
            t_acq_start[i+1] = t_acq_start[i] + trigger_offset
        endif
    endfor