TDI (Time Delay Integration)#
TDIは光感度を高め、より広いダイナミックレンジを持つ明るい画像を生成するため、低照度環境での使用に最適です。
情報
この機能は、Basler racer 2 XL および racer 2 L mono カメラでのみ利用可能です。
機能を使用する#
この機能の実装はカメラによって異なります。
racer 2 XLカメラ#
racer 2 XL カメラにはTDIセンサーが搭載されています。TDIセンサーは、アレイ状に配置されたステージと呼ばれる複数のピクセル行で構成されています。
対象物がセンサーの視野を横切って移動すると、最初のステージの露光領域から最後のステージの露光領域へと画像が投影されます。各ステージが1つずつ個別に露光されるのではなく、ブロック全体として露光されます。つまり、センサーはすべてのステージで同じ対象物を露光し、電荷が読み出しラインに達するまで電荷の蓄積と転送を行います。
次の図は、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センサーのスキャン方向は、カメラの前を通過する対象物の動きと同期させる必要があります。連続的な露光と電荷の積分を確実にするため、スキャン方向は対象物の移動方向と同じでなければなりません。
情報
スキャン方向の設定方法の説明では、カメラにレンズを使用していることを前提としています。レンズは画像を反転させます。
スキャン方向を設定するには、 BslTDIScanDirection パラメーターを次のいずれかの値に設定します。
Forward: センサーの視野を通過する対象物は、 forward スキャン方向でスキャンされます。対象物はまずカメラの下部を通過し、次に上部を通過します。Reverse: センサーの視野を通過する対象物は、 reverse スキャン方向。カメラの上部を最初に通過し、次に下部を通過します。
Resulting Exposure Time#
TDI センサー取得モードでは、Exposure Timeは次のパラメータを介して設定されません。 ExposureTime 代わりに、次の2つの取得パラメータによって決定されます。
- Number of stages:電荷の蓄積と転送が行われている間、オブジェクトがセンサーの視野内に留まる時間を定義します。
- Line rate:1つのステージから次のステージへ電荷がどれくらいの速さで転送されるかを定義します。また、個々のステージごとの統合時間も決定します。
これら2つのパラメータを合わせて、合計のExposure Timeを決定します。
$$ \text{Exposure time} = \frac{\text{Number of stages}}{\text{Line rate}} $$
次の表は、500 kHzの固定Line rateおよびさまざまなNumber of Stagesにおける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 |
Number of StagesとLine rateの両方がExposure Timeに影響を与えるため、トリガーがオブジェクトの動きと正しく同期され、ピクセルの飽和限界が守られているという条件の下で、画像全体の明るさにも影響を与えます。
- 高いNumber of StagesはExposure Timeを長くし、その結果、より多くの電荷が蓄積されます。画像は明るく表示されます。
- 低いNumber of Stagesは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 モノクロカメラ#
racer 2 L mono camerasは、デュアルラインまたはクアッドラインなどのマルチラインセンサーを搭載しています。センサーの各ピクセルラインは、異なる Exposure Time で露光するように設定できます。取り込み(アクイジション)がトリガーされると、センサーのすべてのピクセルラインが同時に露光されます。カメラの前を通過するオブジェクト上の異なる視野(フィールドオブビュー)を各ラインが捉えるため、1回の露光において、センサー内の各ラインはオブジェクト上の異なる領域を取得します。
次の図は、モノクロクアッドラインセンサーの視野を示しています。
この場合、オブジェクト上の特定の領域に関する完全な情報を得るために、4つの異なる取り込みからのデータをバッファリングして結合する必要があります。これを行うのが Spatial Correction です。現在の露光における最後のラインのデータは、過去の露光から取得された前回のラインのデータと結合されます。
Line Combination Modeを使用すると、HDR画像を取得するために個々のラインのピクセル値をどのように結合するかを最終的に指定できます。
Line Combination Mode#
ライン結合モードでは、結合されたセンサーラインのピクセル値を合計するか平均化するかを定義できます。次のように設定できます。 BslLineCombinationMode パラメーターを次のいずれかの値に設定します。
Off: ライン結合は無効です。TDISum: 結合されたセンサーラインのピクセル値が合計されます。これにより、カメラの光に対する感度(レスポンス)とS/N比が向上します。TDIAverage: 結合されたセンサーラインのピクセル値が平均化されます。これにより、カメラの光に対する感度に影響を与えることなく、S/N比が向上します。
TDI 用 racer 2 L モノクロカメラの設定#
racer 2 L mono cameraを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 の開始ラインと方向を決定します:
パラメーターをBslSpatialCorrectionStrideパラメータを例えば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 モノクロカメラ#
// 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を使用して、パラメーターを簡単に設定することもできます。