コンテンツにスキップ
ステージングサーバー
開発サーバー

TDI (時間遅延積分)#

TDI (時間遅延積分)は、ラインスキャンカメラで使用される画像処理技術であり、被写体の動きを補正するために、画像データを複数のステップで収集します。

TDI 光感度を高め、より明るく、より広いダイナミックレンジの画像を生成するため、暗い場所での使用に最適です。

情報

この機能は、Basler racer 2 XLおよびracer 2 Lモノクロカメラでのみ利用可能です。

機能を使用する#

この機能の実装はカメラによって異なります。

racer 2 XLカメラ#

racer 2 XLカメラにはTDI センサー。 TDI センサーは、ステージと呼ばれる複数のピクセル列で構成されており、それらは配列状に配置されています。

物体がセンサーの視野内を移動すると、その像は第1段の露光領域から最終段の露光領域へと投影されます。各段は個別に露光されるのではなく、ブロック全体として露光されます。そのため、センサーは各段で同じ物体を露光し、電荷を蓄積・転送して読み出し線に到達させます。

以下の図は、センサー内部における電荷移動を4段階で視覚化したものである。

TDI センサー電荷転送

電荷転送は、被写体の動きと完全に同期して行われなければなりません。これにより、連続的な露光と電荷積分が保証されます。被写体の露光は、カメラの視野内にある間続きます。使用するステージ数が多いほど、実効露光時間と積分時間は長くなります。

次の図は、 TDI センサーとその電荷移動原理:

TDI カメラの電荷シフト原理

ステージ数#

ステージ数は、電荷が蓄積され、最終ステージに到達するまで次のステージへと移動する頻度を決定します。ステージ数が多いほど、画像の感度が高くなります。例えば、ステージ数が256の場合、カメラは256倍の感度で画像を取得します。ステージ数は、結果として得られる露光時間にも影響します。

センサーは、4段階から最大256段階まで、さまざまな段階数で動作するように設定できます。使用可能な段階数は、使用するセンサーによって異なります。

ステージ数を設定するには、 BslTDINumberOfStages パラメータ値を、例えば、 Stages4 または Stages256.

情報

エリアセンサー取得モードでは、ステージ数によって画像の高さが決まります。例えば、ステージ数を128に設定すると、 r2T16416-500cmカメラはエリアセンサー取得モードで16416×128ピクセルの「エリア」画像を取得します。

スキャン方向#

のTDI センサーのスキャン方向は、カメラを通過する物体の動きと同期させる必要があります。連続的な露光と電荷の積分を確保するためには、スキャン方向は物体の移動方向と同じでなければなりません。

情報

スキャン方向の​​設定方法の説明は、カメラにレンズを取り付けて使用することを前提としています。レンズは画像を反転させます。

スキャン方向を設定するには、 BslTDIScanDirection パラメーターを次のいずれかの値に設定します。

  • Forwardセンサーの視野を通過する物体は、 フォワード 走査方向。まずカメラの下部を通過し、次に上部を通過します。
  • Reverseセンサーの視野を通過する物体は、 逆行する 走査方向。まずカメラの上部を通過し、次に下部を通過します。

結果としてExposure Time#

でTDI センサー取得モード露光時間は設定されていません ExposureTime パラメータ。実際には、2つの取得パラメータの結果です。

  • ステージ数:電荷が蓄積および移動する間、対象物がセンサーの視野内に留まる時間を定義します。
  • ラインレート:電荷が1つのステージから次のステージへ移動する速度を定義します。また、各ステージごとの積分時間も決定します。

これら2つのパラメータを合わせて、総露光時間が決定されます。

$$ \text{露光時間} = \frac{\text{段数}}{\text{ラインレート}} $$

以下の表は、500kHzの固定ラインレートと異なるステージ数における露光時間の例を示しています。

ステージ数 回線速度 [kHz] Exposure Time [マイクロ秒]
4 500 8
64 500 128
128 500 256
256 500 512

以下の表は、128段の固定露光段数と、最大500kHzまでの異なるラインレートにおける露光時間の例を示しています。

回線速度 [kHz] ステージ数 Exposure Time [マイクロ秒]
100 128 1280
200 128 640
400 128 320
500 128 256

ステージ数とラインレートはどちらも露光時間に影響を与えるため、トリガーが被写体の動きと正しく同期され、ピクセル飽和限界が守られている限り、画像の明るさにも影響します。

  • 露光段階数を増やすと露光時間が長くなり、結果として蓄積される電荷​​量が増加します。そのため、画像はより明るくなります。
  • 露光段階数が少ないほど露光時間が短くなり、結果として蓄積される電荷​​量も少なくなる。そのため、画像は暗く写る。
  • ラインレートが高いほど、各ステージの露光時間が短くなり、結果として蓄積される電荷​​量が少なくなります。そのため、画像は暗く写ります。
  • ラインレートが低いほど、各ステージでの露光時間が長くなり、結果として蓄積される電荷​​量が増加します。そのため、画像はより明るく写ります。

設定中racer 2 XL カメラTDI#

設定するにはracer 2 XL カメラTDI :

  1. パラメーターを BslSensorAcquisitionMode パラメータを次のように設定: TDISingleLineセンサーは1本の読み出し線を使用します。
  2. システム設定に応じて、 BslTDIScanDirection 例えば、パラメータ Forward.
  3. パラメーターを BslTDINumberOfStages パラメータを、例えば128に設定します。

情報

  • センサーの読み出し手順が、対象物の移動速度と方向と完全に同期していることを確認してください。テスト目的で、取得ラインレートを適宜変更してください。これは、結果として得られる露光時間にも影響します。
  • トリガー一時停止後に再トリガーする場合、少なくとも最初の n 行の読み出し行は無効とみなされなければならない。ここで n は最小ステージ数を表す。

racer 2 L モノクロカメラ#

racer 2 Lモノクロカメラは、マルチラインセンサー(デュアルラインまたはクワッドラインセンサー)を搭載しています。センサーの各ピクセルラインは、それぞれ異なる露光時間で露光するように設定できます。撮影が開始されると、センサーのすべてのピクセルラインが同時に露光されます。1回の露光で、センサーの各ラインは、カメラを通過する物体に対して異なる視野を持つため、物体の異なる領域を撮影します。

以下の図は、モノクロ4線型センサーの視野を示しています。

モノクロクワッドラインセンサーの視野

この場合、対象物の特定領域に関する完全な情報を得るためには、4つの異なる取得データから得られたデータをバッファリングして結合する必要があります。これは空間補正によって行われます。現在の露光の最終行のデータは、過去の露光から得られた前の行のデータと結合されます。

ライン結合モードを使用すると、個々のラインのピクセル値をどのように組み合わせてHDR画像を作成するかを指定できます。

ライン結合モード#

ライン結合モードでは、結合されたセンサーラインのピクセル値を合計するか平均するかを定義できます。 BslLineCombinationMode パラメーターを次のいずれかの値に設定します。

  • Off: 行の組み合わせは無効になっています。
  • TDISum:複数のセンサーラインの画素値を合計することで、カメラの光に対する応答性と信号対雑音比が向上します。
  • TDIAverage:複数のセンサーラインの画素値を平均化することで、カメラの光応答性を損なうことなく信号対雑音比を向上させます。

設定中racer 2 L モノクロカメラTDI#

設定するにはracer 2 L モノクロカメラTDI :

  1. パラメーターを センサー取得モード デュアルラインまたはクワッドライン画像取得へ:
    パラメーターを BslSensorAcquisitionMode パラメータを次のように設定: DualLine または QuadLine 2行または4行を使用するかどうかに応じてTDI 。
  2. 各ライン(ステージ)の露光時間を指定してください。

    1. パラメーターを ExposureTimeMode パラメータを次のように設定: Individual.
    2. パラメーターを ExposureTimeSelector パラメータを次のように設定: Stage1.
    3. パラメーターを ExposureTime パラメータを希望するマイクロ秒単位の Exposure Time に設定します。
      注: お使いのカメラモデルの最小および最大露光時間値は、 特性 セクションで説明されているように、名前によってパラメータにアクセスするには、 Exposure Time トピック
    4. 他の段階についても、手順bとcを繰り返してください。
  3. 指定する 空間補正の歩幅 空間補正の開始線と方向を決定するため:
    パラメーターを BslSpatialCorrectionStride パラメータ、例えば2。

  4. パラメーターを ライン結合モード 結合されたラインのセンサーピクセル値が合計されるか平均されるかを判断するため:
    パラメーターを BslLineCombinationMode 例えば、パラメータ TDIAverage.

外部の後処理プログラムを使用して、線情報を合成し、高ダイナミックレンジ画像を生成する。

サンプルコード#

racer 2 XLカメラ#
// Set the sensor acquisition mode to TDI Single Line
camera.BslSensorAcquisitionMode.SetValue(BslSensorAcquisitionMode_TDISingleLine);
// Set the sensor scan direction to Forward
camera.BslTDIScanDirection.SetValue(BslTDIScanDirection_Forward);
// Set the number of stages to 128
camera.BslTDINumberOfStages.SetValue(BslTDINumberOfStages_128);
INodeMap& nodemap = camera.GetNodeMap();
// Set the sensor acquisition mode to TDI Single Line
CEnumParameter(nodemap, "BslSensorAcquisitionMode").SetValue("TDISingleLine");
// Set the sensor scan direction to Forward
CEnumParameter(nodemap, "BslTDIScanDirection").SetValue("Forward");
// Set the number of stages to 128
CEnumParameter(nodemap, "BslTDINumberOfStages").SetValue("");
// Set the sensor acquisition mode to TDI Single Line
camera.Parameters[PLCamera.BslSensorAcquisitionMode].SetValue(PLCamera.BslSensorAcquisitionMode.TDISingleLine);
// Set the sensor scan direction to Forward
camera.Parameters[PLCamera.BslTDIScanDirection].SetValue(PLCamera.BslTDIScanDirection.Forward);
// Set the number of stages to 128
camera.Parameters[PLCamera.BslTDINumberOfStages].SetValue(PLCamera.BslTDINumberOfStages.);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the sensor acquisition mode to TDI Single Line */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorAcquisitionMode", "TDISingleLine");
CHECK(errRes);
/* Set the sensor scan direction to Forward */
errRes = PylonDeviceFeatureFromString(hdev, "BslTDIScanDirection", "Forward");
CHECK(errRes);
/* Set the number of stages to 128 */
errRes = PylonDeviceFeatureFromString(hdev, "BslTDINumberOfStages", "");
CHECK(errRes);
# Set the sensor acquisition mode to TDI Single Line
camera.BslSensorAcquisitionMode.Value = "TDISingleLine"
# Set the sensor scan direction to Forward
camera.BslTDIScanDirection.Value = "Forward"
# Set the number of stages to 128
camera.BslTDINumberOfStages.Value = ""
racer 2 L モノクロカメラ#
// Set the sensor acquisition mode to Dual Line
camera.BslSensorAcquisitionMode.SetValue(BslSensorAcquisitionMode_DualLine);
// Set the exposure time for both lines (stages)
// Select stage 1
camera.ExposureTimeSelector.SetValue(ExposureTimeSelector_Stage1);
// Set the exposure time to 1000 microseconds
camera.ExposureTime.SetValue(1000.0);
// Select stage 2
camera.ExposureTimeSelector.SetValue(ExposureTimeSelector_Stage2);
// Set the exposure time to 1000000 microseconds
camera.ExposureTime.SetValue(1000000.0);
// Set the spatial correction stride to 2
camera.BslSpatialCorrectionStride.SetValue(BslSpatialCorrectionStride_2);
// Set the line combination mode to TDI Sum
camera.BslLineCombinationMode.SetValue(BslLineCombinationMode_TDISum);
INodeMap& nodemap = camera.GetNodeMap();
// Set the sensor acquisition mode to Dual Line
CEnumParameter(nodemap, "BslSensorAcquisitionMode").SetValue("DualLine");
// Set the exposure time for both lines (stages)
// Select stage 1
CEnumParameter(nodemap, "ExposureTimeSelector").SetValue("Stage1");
// Set the exposure time to 1000 microseconds
CFloatParameter(nodemap, "ExposureTime").SetValue(1000.0);
// Select stage 2
CEnumParameter(nodemap, "ExposureTimeSelector").SetValue("Stage2");
// Set the exposure time to 1000000 microseconds
CFloatParameter(nodemap, "ExposureTime").SetValue(1000000.0);
// Set the spatial correction stride to 2
CEnumParameter(nodemap, "BslSpatialCorrectionStride").SetValue("");
// Set the line combination mode to TDI Sum
CEnumParameter(nodemap, "BslLineCombinationMode").SetValue("TDISum");
// Set the sensor acquisition mode to Dual Line
camera.Parameters[PLCamera.BslSensorAcquisitionMode].SetValue(PLCamera.BslSensorAcquisitionMode.DualLine);
// Set the exposure time for both lines (stages)
// Select stage 1
camera.Parameters[PLCamera.ExposureTimeSelector].SetValue(PLCamera.ExposureTimeSelector.Stage1);
// Set the exposure time to 1000 microseconds
camera.Parameters[PLCamera.ExposureTime].SetValue(1000.0);
// Select stage 2
camera.Parameters[PLCamera.ExposureTimeSelector].SetValue(PLCamera.ExposureTimeSelector.Stage2);
// Set the exposure time to 1000000 microseconds
camera.Parameters[PLCamera.ExposureTime].SetValue(1000000.0);
// Set the spatial correction stride to 2
camera.Parameters[PLCamera.BslSpatialCorrectionStride].SetValue(PLCamera.BslSpatialCorrectionStride.);
// Set the line combination mode to TDI Sum
camera.Parameters[PLCamera.BslLineCombinationMode].SetValue(PLCamera.BslLineCombinationMode.TDISum);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the sensor acquisition mode to Dual Line */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorAcquisitionMode", "DualLine");
CHECK(errRes);
/* Set the exposure time for both lines (stages) */
/* Select stage 1 */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureTimeSelector", "Stage1");
CHECK(errRes);
/* Set the exposure time to 1000 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "ExposureTime", 1000.0);
CHECK(errRes);
/* Select stage 2 */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureTimeSelector", "Stage2");
CHECK(errRes);
/* Set the exposure time to 1000000 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "ExposureTime", 1000000.0);
CHECK(errRes);
/* Set the spatial correction stride to 2 */
errRes = PylonDeviceFeatureFromString(hdev, "BslSpatialCorrectionStride", "");
CHECK(errRes);
/* Set the line combination mode to TDI Sum */
errRes = PylonDeviceFeatureFromString(hdev, "BslLineCombinationMode", "TDISum");
CHECK(errRes);
# Set the sensor acquisition mode to Dual Line
camera.BslSensorAcquisitionMode.Value = "DualLine"
# Set the exposure time for both lines (stages)
# Select stage 1
camera.ExposureTimeSelector.Value = "Stage1"
# Set the exposure time to 1000 microseconds
camera.ExposureTime.Value = 1000.0
# Select stage 2
camera.ExposureTimeSelector.Value = "Stage2"
# Set the exposure time to 1000000 microseconds
camera.ExposureTime.Value = 1000000.0
# Set the spatial correction stride to 2
camera.BslSpatialCorrectionStride.Value = ""
# Set the line combination mode to TDI Sum
camera.BslLineCombinationMode.Value = "TDISum"

pylon Viewerを使用して、パラメーターを簡単に設定することもできます。