GstCUDA - Example - opencvwarp

From RidgeRun Developer Connection
Revision as of 10:59, 4 September 2020 by Acampos (talk | contribs) (Element properties)
Jump to: navigation, search


Previous: Example: opencv Index Next: Example - opencvfilter


Nvidia-preferred-partner-badge-rgb-for-screen.png



Introduction

The opencvwarp element will modify an image given a 3x3 transformation matrix. If the demo property of the element is enabled, it will apply a transformation that involves a rotation of the image in a 3D space and then a projection back to the image plane like this:

Error creating thumbnail: Unable to save thumbnail to destination
Figure 1. Opencvwarp demo transformation

Element properties

  • demo

Put the element in demo mode to showcase it's capabilities. In this mode the incoming image will be rotated in the 3D space and projected back to the image plane. Will override the transformation matrix.
Type: Boolean
Flags: readable, writable
Default: false

  • m00-m22

The 9 coefficients of the 3x3 perspective transformation matrix.
Type: Double
Range: -1,797693e+308 - 1,797693e+308 Flags: readable, writable
Default: identity matrix

Examples

The following two examples will provide an introduction to the element and its capabilities. Both examples were tested on Nvidia Jetson TX1 and TX2 connected to a display via HDMI and using a webcam as input video source.

Demo example

This example is meant to show the element capabilities. The image will be rotated in three-dimensional space and projected back to the image plane.

By running the following pipeline:

gst-launch-1.0 v4l2src ! nvvidconv ! opencvwarp demo=true ! queue ! nvvidconv ! autovideosink

you should obtain the result shown in Figure 1.

Custom example

Previous: Example: opencv Index Next: Example - opencvfilter