跳转到内容
STAGING SERVER
DEVELOPMENT SERVER

TDI (Time Delay Integration)#

The TDI (Time Delay Integration) camera feature is a line scan feature that allows you to acquire HDR (High Dynamic Range) images of moving objects, especially in low-light conditions.

TDI increases the light sensitivity, reduces blur and helps to produce sharp, high-resolution images.

信息

This feature is only available on Basler racer 2 L mono cameras.

该功能的使用#

运作原理#

The camera is equipped with a multi-line sensor and typically acquires images of moving objects. Each pixel line of the sensor can be set to be exposed with a different exposure time. Whenever an acquisition is triggered, all pixel lines of the sensor are exposed simultaneously. For a single exposure, each line in the sensor acquires a different area on the object since each line has a different field of view on any object passing the camera.

The following illustration shows the field of view of a mono quad line sensor.

Field of View of Mono Quad Line Sensor

In this case, the data from four different acquisitions must be combined to get the full information for a certain area on an object. This is done by spatial correction. The data of the last line of the current exposure is combined with the data of the previous lines, taken from exposures in the past.

Using the Line Combination Mode you can finally specify the way the pixel values of the individual lines should be combined to get your HDR image.

Line Combination Mode#

The line combination mode allows you to define whether the pixel values of the combined sensor lines are summed or averaged. You can set the BslLineCombinationMode parameter to one of the following values:

  • Off: Line combination is disabled.
  • TDISum: The pixel values of the combined sensor lines are summed. This increases the camera's response to light and the signal-to-noise ratio.
  • TDIAverage: The pixel values of the combined sensor lines are averaged. This increases the signal-to-noise ratio without affecting the camera's response to light.

Configuring the Camera for TDI#

To configure the camera for TDI:

  1. Set the sensor acquisition mode to Dual or Quad Line image acquisition:
    Set the BslSensorAcquisitionMode parameter to DualLine or QuadLine depending on whether you want to use two or four lines for TDI.
  2. Specify the exposure time for each line (stage):

    1. Set the ExposureTimeMode parameter to Individual.
    2. ExposureTimeSelector 参数设置为 Stage1
    3. Set the ExposureTime parameter to the desired exposure time in microseconds.
      Note: You can find the minimum and maximum exposure time values of your camera model in the Specifics section of the Exposure Time topic.
    4. Repeat steps b and c for the other stages.
  3. Specify the spatial correction stride to determine the starting line and direction of spatial correction:
    Set the BslSpatialCorrectionStride parameter to, e.g., 2.

  4. Set the line combination mode to determine whether the sensor pixel values of the combined lines are summed or averaged:
    Set the BslLineCombinationMode parameter to, e.g., TDIAverage.

Use an external post-processing program to combine the line information to generate a high dynamic range image.

示例代码#

// 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 轻松设置参数。