Analyzing Frame Times

This guide shows how to analyze the frame times shown in NxView and determine how the frame time gets limited for your operation mode and parameters.

All examples on this page assume that capturing is done asynchronously as it is done in NxView when live mode is active. This means that we execute the Trigger command to trigger the acquisition of the next frame. While the acquisition runs, we execute e.g. the ComputeDisparityMap command to process the data of the previous frame. Finally, we wait for the new frame to arrive using the Retrieve command.

If your application uses a different operation mode, you can still use the information from this guide, but you need to keep in mind that some of the operations might not happen in parallel as they are in the examples.

Case 1: Frame Time Is Compute-Bound

When the computation of the disparity map takes longer than exposure and transmission of the next image, your frame time is bound by the computation time.

Schematic of frame times when it is compute-bound

In this case, the command times in NxView will show a relatively long time for the ComputeDisparityMap command. Since the images have already arrived at the time the Retrieve command gets executed, it doesn’t need to wait anymore and the time shown for the Retrieve command will be very short.

Screenshot of NxView command times when the frame time is compute-bound

To improve frame times in this case, you can investigate at the following options:

  • Tune the parameters for more performance as it is shown in this guide.

  • Transfer the computation to a GPU by using CUDA.

Case 2: Frame Time Is Network-Bound

When acquisition of the image takes longer than the computation, the frame time is limited by the network bandwidth.

Schematic of frame times when it is network-bound

In this case, the Retrieve command has to wait for the image to arrive and NxView will therefore show a long time for it. Note that the computation commands still take their normal execution time, you have to look at the execution time of the Retrieve command to distinguish the cases 1 and 2.

Screenshot of NxView command times when the frame time is network-bound

To improve the transmission times, take a look at the following options:

  • Tune the settings of your network card as described in this topic. NxView will also show warnings if the connection has problems with packet loss.

  • Connect multiple cameras over multiple network adapters, so that each of them can use the full bandwidth.

    • If you connect multiple cameras to the same network adapter and they need to transmit images at the same time, you have to limit the bandwidth they use with the BandwidthLimit node. This is not necessary anymore if each camera has its own adapter.

    • Note that you can connect the sensors of an X-series camera to different network adapters and increase the bandwidth limit of the stereo camera accordingly.

  • Reduce the transmitted image size by using binning or an area of interest in combination with the UseDisparityMapAreaOfInterest parameter.

Case 3: Frame Time Is Limited by Flash Time

When the camera’s projector reaches its maximum duty cycle it has to wait until it can capture the next frame. This can happen if the exposure times are high and you capture a lot of frames in quick succession (e.g. when using FlexView).

Schematic of frame times when it is limited by the available flash time

In this case, NxView will show an additional entry in the table of command times which show the time for which the affected cameras had to wait.

Screenshot of NxView command times when the frame time is limited by the available flash time

To reduce the waiting time, please check the following options:

  • Reduce the exposure time if the image quality stays acceptable. You might be able to compensate the shorter exposure time with more gain.

  • If you have an X-series camera which you assembled yourself, please check that the apertures of sensor and projector lenses are set up correctly.