Optimize Settings for Performance/Quality

This topic provides an overview of the parameters affecting performance and quality of the stereo camera point cloud.

General Settings

Parameter

Performance Setting

Opposite setting

Threads

Set the number of threads as high as possible, but not higher than the number of actual CPU cores. This should already be the default setting, but you might verify if NxLibs autodetection methods for the CPU architecture set this value correctly.

None

CUDA

With many graphics cards using CUDA to perform computations on the GPU will speed up stereo matching and other operations.

Disable CUDA when your PC has no CUDA compatible GPU, or a GPU with very poor performance. NxLib will use the CPU-based implementations instead.

Capture Parameters

Parameter

Performance Setting

Opposite setting

FlexView

Operate the camera in one-shot mode by disabling multi pattern acquisition (i.e. set the FlexView node to false)

Setting the FlexView node to a number of 2 or higher will acquire multiple image pairs with shifted patterns, leading to higher X, Y and Z resolution (only available on camera models with FlexView).

Exposure

(also see Exposure Limitations)

Setting lower exposures will improve the frame rate when the selected exposure/frame rate exceeds the allowable LED duty cycle. You might compensate for the lower exposure by using analog Gain or GainBoost.

Long exposures will cause wait times in software triggered mode to ensure that the LED duty cycle is not exceeded by the projector flash time. This ensures that the LED will be switched on for the entire image exposure time. The wait times are especially noticeable when using FlexView.

PixelClock

Higher values result in shorter image transfer times.

Lower values require less bus bandwidth and lead to more stable image transfers (eliminating transfer errors).

InitialTrigger

When running the camera untriggered, the frame rate might increase when doing a software trigger for

By default, each Capture command triggers the acquisition of a fresh image.

FinalTrigger

“Untriggered” and FinalTrigger to “All”. Please refer to the definition of the capture phases.

AutoExposure

Disabling automatic exposure and gain adjustment might save a few (≤5) milliseconds that are used

AutoGain

UseDisparityMapAreaOfInterest

Setting this parameter to true will reduce the image transfer time by only retrieving the minimal rectangular areas of each sensor necessary for the current stereo matching settings.

DownloadImages

XR-series only

ImageDownloadLimit

If you don’t need the images, you can use these parameters to avoid downloading them from the camera

Stereo Matching Parameters

Parameter

Performance Setting

Opposite setting

Method

In general the PatchMatch medthod will result in better runtime performance compared to the Sgm* and Correlation methods, especially when the necessary measurement depth range is large.

PatchMatch will generate very high quality disparity maps, but for high FlexView image count the “Correlation” method might deliver slightly more details and increase the effective XY resultion and subpixel depth precision.

Method

(when using PatchMatch)

Reduce the number of iterations. Disable tilted matching, coupled propagation and right view validation.

Increase the number of iterations. Enable tilted matching, coupled propagation and right view validation.

Method

(when using Sgm* and Correlation)

Setting “SgmAligned” or “SgmDiagonal” for the global stereo matching optimization only uses 4 instead of 8 optimization paths for stereo matching, resulting in faster runtime of ComputeDisparityMap. Alternatively you can use “Correlation” which might run faster when using FlexView many (> 8) images, especially when using CUDA.

Setting “SgmAlignedAndDiagonal” uses 8 optimization paths and yields better disparity map results. When using FlexView with many images (> 8) we recommend to use the “Correlation” method which will also generate more detailed disparity maps.

NumberOfDisparities

(only applies to Method Sgm* and Correlation)

Setting smaller values for NumberOfDisparities reduces the correspondence search range for the stereo matcher. This results in (linearly) faster runtime of ComputeDisparityMap, but also reduces the measurable depth range in z-direction of the camera.

Larger values enlarge the measurement volume.

Filling

Disabling as many post processing steps as possible results in faster runtime of

Post processing of the disparity map might enhance the data quality for your specific application.

Speckle Removal

Median Filtering

AreaOfInterest

The stereo matching algorithm can be resticted to run only on a smaller image region. The smaller the specified AOI is, the more computation time will be saved in the ComputeDisparityMap command.

Scaling

With the scaling parameter the resolution of the rectified images and the resulting 3D data can be reduced by an arbitrary scale factor. This can significantly reduce the runtime of ComputeDisparityMap.