CUDA Accelerated GStreamer Camera Undistort - Performance - Nano

From RidgeRun Developer Connection
Jump to: navigation, search



Previous: Performance Index Next: Contact Us





The performance of the cuda unidstort element depends mainly on the input image resolution.

The following sections show the measurements of the cuda-undistort (FPS and Latency) for multiple image resolutions; as well as the impact of changing the distortion model.

Platform Setup

The performance measurements were done with a Jetson Nano board in 10W mode, which is the default and can be activated with

sudo nvpmodel -m 0

The following sections show a comparison between using the platform at a maximum frequency (With jetson_clocks) and in base mode. This mode can be set as follows:

sudo /usr/bin/jetson_clocks

Framerate

The average Frames per Second measurements are shown in the following charts, for multiple image resolutions. Also, the impact of executing or not the jetson_clocks script is shown in the results.

Undistort FPS on multiple resolution images using Fisheye model with and without jetson_clocks.sh
Undistort FPS on multiple resolution images using Brown-Conrady model with and without jetson_clocks.sh

Pipeline structure

The general structure of the pipeline used for the framerate measurements is shown below, for the Fisheye model.

CAMERA_MATRIX="{\"fx\":9.5211633874478218e+02, \"fy\":9.4946222068253201e+02, \"cx\":6.8041416457132573e+02, \"cy\":3.1446117133659988e+02}"
DISTORTION_PARAMETERS="{\"k1\":3.8939572818197948e-01, \"k2\":-5.5685725182648649e-01, \"k3\":2.3785352925072494e+00, \"k4\":-1.2037220289124213e+00}"

INPUT=image_1.jpg

gst-launch-1.0 filesrc location=$INPUT \
! nvjpegdec !  imagefreeze ! nvvidconv\
! cudaundistort distortion-model=fisheye \
camera-matrix="$CAMERA_MATRIX" distortion-parameters="$DISTORTION_PARAMETERS" \
! perf print-cpu-load=true ! fakesink

Latency

For the purpose of this performance evaluation, Latency is measured as the time difference between the src of the element before the undistort and the src of the undistort itself, effectively measuring the time between input and output pads. For multiple inputs, the largest time difference is taken.

These latency measurements were taken using the GstShark interlatency tracer.

The pictures below show the latency of the cuda-undistort element, for both models and multiple resolutions, as well as using and not using the jetson_clocks script.

Latency on multiple resolution images using Fisheye model with and without jetson_clocks.sh
Latency on multiple resolution images using Brown-Conrady model with and without jetson_clocks.sh

Pipeline structure

The general structure of the pipeline used for the latency measurements is shown below, for the Fisheye model.

CAMERA_MATRIX="{\"fx\":9.5211633874478218e+02, \"fy\":9.4946222068253201e+02, \"cx\":6.8041416457132573e+02, \"cy\":3.1446117133659988e+02}"
DISTORTION_PARAMETERS="{\"k1\":3.8939572818197948e-01, \"k2\":-5.5685725182648649e-01, \"k3\":2.3785352925072494e+00, \"k4\":-1.2037220289124213e+00}"

INPUT=image_1.jpg

GST_DEBUG="3,GST_TRACER:7" GST_TRACERS="interlatency" GST_SHARK_CTF_DISABLE=1 \
gst-launch-1.0 filesrc location=$INPUT \
! nvjpegdec ! imagefreeze ! nvvidconv \
! cudaundistort distortion-model=fisheye \
camera-matrix="$CAMERA_MATRIX" distortion-parameters="$DISTORTION_PARAMETERS" \
! perf print-cpu-load=true ! fakesink


Previous: Performance Index Next: Contact Us