TDI (Time Delay Integration)#
TDIにより光感度が向上し、ダイナミックレンジが広く明るい画像が得られるため、低照度環境での使用に最適です。
情報
この機能は、Basler racer 2 XLおよびracer 2 L monoカメラでのみ使用できます。
機能を使用する#
この機能の実装は、カメラによって異なります。
racer 2 XLカメラ#
racer 2 XLカメラにはTDIセンサーが搭載されています。TDIセンサーは、ステージと呼ばれる複数のピクセル行で構成され、アレイ状に配置されています。
対象物がセンサーの視野を横切って移動すると、その画像は最初のステージの露光領域から最後のステージの露光領域へと投影されます。ステージは個別に順番に露光されるのではなく、ブロック全体として露光されます。つまり、センサーはすべてのステージで同じ対象物を露光し、電荷が読み出しラインに達するまで電荷の蓄積と転送を行います。
次の図は、4つのステージを持つセンサー内の電荷転送を示しています。
あるステージから次のステージへの電荷転送は、対象物の動きと完全に同期している必要があります。これにより、連続した露光と電荷積分が確実に行われます。対象物の露光は、それがカメラの視野内にある間継続します。使用するステージが多いほど、実効的なExposure Timeおよび積分時間が長くなります。
次の図は、TDIセンサーの視野とその電荷シフトの原理を示しています。
Number Of Stages#
ステージ数は、電荷が蓄積され、最後のステージに到達するまであるステージから次のステージへシフトされる頻度を決定します。ステージ数が多いほど、画像の感度が高くなります。たとえば、ステージ数が256の場合、カメラは256倍高い感度で画像を取得します。ステージ数は、結果として得られるExposure Timeにも影響します。
センサーは、4ステージや最大256ステージなど、さまざまなステージ数で動作するように設定できます。利用可能なステージ数は、使用するセンサーによって異なります。
ステージ数を設定するには、 BslTDINumberOfStages パラメーターの値を次のように設定します: Stages4 または Stages256.
情報
Area sensor acquisition modeでは、ステージ数が画像高さを決定します。たとえば、ステージ数が128に設定されている場合、r2T16416-500cmカメラはArea sensor acquisition modeで16416 x 128の「エリア」画像を取得します。
Scan Direction#
TDIセンサーのスキャン方向は、カメラの前を通過するオブジェクトの移動と同期させる必要があります。連続的なExposure Timeと電荷蓄積を確保するため、スキャン方向はオブジェクトの移動方向と同じでなければなりません。
情報
スキャン方向の設定方法についての説明は、カメラにレンズを使用していることを前提としています。レンズは画像を反転させます。
スキャン方向を設定するには、 BslTDIScanDirection パラメーターを次のいずれかの値に設定します。
Forward: センサーの視野を通過するオブジェクトは、 forward スキャン方向でスキャンされます。オブジェクトは最初にカメラの下部を通過し、次に上部を通過します。Reverse: センサーの視野を通過するオブジェクトは、 reverse スキャン方向でスキャンされます。オブジェクトは最初にカメラの上部を通過し、次に下部を通過します。
Resulting Exposure Time#
TDI センサー取得モードでは、Exposure Timeは ExposureTime パラメータを介して設定されません。代わりに、次の2つの取得パラメータから決まります。
- Number of stages: 電荷が蓄積およびシフトされている間、オブジェクトがセンサーの視野にとどまる時間を定義します。
- Line rate: あるステージから次のステージへ電荷がどれくらい素早くシフトされるかを定義します。また、個々のステージあたりの統合時間も決定します。
これら2つのパラメータを合わせて、合計Exposure Timeが決定されます。
$$ \text{Exposure time} = \frac{\text{Number of stages}}{\text{Line rate}} $$
次の表は、500 kHzの固定Line rateとさまざまなステージ数でのExposure Timeの例を示しています。
| Number of Stages | Line Rate [kHz] | Exposure Time [µs] |
|---|---|---|
| 4 | 500 | 8 |
| 64 | 500 | 128 |
| 128 | 500 | 256 |
| 256 | 500 | 512 |
次の表は、128ステージの固定数と、最大500 kHzまでのさまざまなLine rateにおけるExposure Timeの例を示しています。
| Line Rate [kHz] | Number of Stages | Exposure Time [µs] |
|---|---|---|
| 100 | 128 | 1280 |
| 200 | 128 | 640 |
| 400 | 128 | 320 |
| 500 | 128 | 256 |
ステージ数とLine rateの両方がExposure Timeに影響を与えるため、トリガーがオブジェクトの移動と正しく同期され、ピクセルの飽和限界が守られているという条件のもとで、画像の明るさにも影響を与えます。
- ステージ数が高くなると、Exposure Timeが長くなり、その結果、より多くの電荷が蓄積されます。画像はより明るくなります。
- ステージ数が低くなると、Exposure Timeが短くなり、その結果、蓄積される電荷が少なくなります。画像はより暗くなります。
- Line rateが高くなると、ステージあたりのExposure Timeが短くなり、その結果、蓄積される電荷が少なくなります。画像はより暗くなります。
- Line rateが低くなると、ステージあたりのExposure Timeが長くなり、その結果、より多くの電荷が蓄積されます。画像はより明るくなります。
TDI向けracer 2 XLカメラの設定#
racer 2 XL カメラを TDI 用に設定するには:
- パラメーターを
BslSensorAcquisitionModeパラメータをTDISingleLine。センサーは 1 つの読み出しラインを使用します。 - システム構成に応じて、
BslTDIScanDirectionパラメータを次のように設定します(例:Forward. - パラメーターを
BslTDINumberOfStagesパラメータを 128 などに設定します。
情報
- センサーの読み出し手順が、オブジェクトの移動速度および方向と正確に同期していることを確認してください。テスト目的で、それに応じて Acquisition Line Rate を変更します。これは、結果の Exposure Time にも影響します。
- トリガー休止後の再トリガー時には、少なくとも最初の n 個の読み出しラインが無効と見なされる必要があります(n はステージの最小数を表します)。
racer 2 L Monoカメラ#
racer 2 L mono cameras には、マルチラインセンサー(デュアルラインまたはクアッドラインセンサー)が搭載されています。センサーの各ピクセルラインは、異なる Exposure Time で露光されるように設定できます。取り込みがトリガーされると、センサーのすべてのピクセルラインが同時に露光されます。単一の露光の場合、カメラを通過するオブジェクト上の視野が各ラインで異なるため、センサー内の各ラインはオブジェクト上の異なる領域を取得します。
次の図は、モノクロクアッドラインセンサーの視野を示しています。
この場合、オブジェクト上の特定の領域の完全な情報を得るために、4 つの異なる取り込みからのデータをバッファリングして結合する必要があります。これは Spatial Correction によって実行されます。現在の露光の最後のラインのデータは、過去の露光から取得された前のラインのデータと結合されます。
Line Combination Mode を使用して、HDR 画像を取得するために個々のラインのピクセル値を結合する方法を指定できます。
Line Combination Mode#
ライン結合モードを使用すると、結合されたセンサーラインのピクセル値を加算するか平均化するかを定義できます。設定できるのは BslLineCombinationMode パラメーターを次のいずれかの値に設定します。
Off: ライン結合が無効になっています。TDISum: 結合されたセンサーラインのピクセル値が加算されます。これにより、カメラの光に対する感度とS/N比が向上します。TDIAverage: 結合されたセンサーラインのピクセル値が平均化されます。これにより、カメラの光に対する感度に影響を与えることなく、S/N比が向上します。
TDI向けracer 2 L Monoカメラの設定#
racer 2 L mono カメラを TDI 用に設定するには:
- パラメーターを センサー取得モード デュアルまたはクアッドライン画像取り込みに設定します:
パラメーターをBslSensorAcquisitionModeパラメータをDualLineまたはQuadLineTDI に 2 つまたは 4 つのラインのどちらを使用するかによって異なります。 -
各ライン(ステージ)の Exposure Time を指定します:
- パラメーターを
ExposureTimeModeパラメータをIndividual. - パラメーターを
ExposureTimeSelectorパラメータをStage1. - パラメーターを
ExposureTimeパラメータを目的のExposure Time(マイクロ秒)に設定します。
注: カメラモデルの最小および最大の Exposure Time の値は、以下で確認できます。 特性 セクションを参照してください。 Exposure Time トピックを参照してください。 - 他のステージについてもステップ b と c を繰り返します。
- パラメーターを
-
次を指定します Spatial Correction stride Spatial Correction の開始ラインと方向を決定します:
パラメーターをBslSpatialCorrectionStrideparameterを、たとえば2に設定します。 - パラメーターを line combination mode 結合されたラインのセンサーピクセル値の合計をとるか、平均をとるかを決定します。
パラメーターを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);
racer 2 L Monoカメラ#
// 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を使用して、パラメーターを簡単に設定することもできます。