Difference between revisions of "GStreamer DispTEC Tracker Plugin"

From RidgeRun Developer Connection
Jump to: navigation, search
(Installing Dttracker)
 
(33 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= Overview =
+
<seo title="GStreamer Object Tracking | GStreamer DispTEC | RidgeRun" titlemode="replace" keywords="Object Tracking, DispTEC, GStreamer DispTEC, GStreamer Object Tracking, GstDispTEC object tracker" description="Learn about GstDispTEC object tracking from the RidgeRun Developer Wiki, from description to implementation using kernelized correlation filters."></seo>
  
GstDispTEC object tracker is a GStreamer element which integrates DispTEC <ref>http://palvarado.ietec.org/pmwiki/index.php/Proyectos/DispTEC?userlang=en</ref> library's algorithms for object tracking, making it possible to incorporate their functionalities into GStreamer pipelines, such as showing where the object is located on a frame! This allows the user to strengthen image analysis, by connecting its own applications to the pipeline for receiving the analysis data and much more amazing things, as shown in the following demo.
+
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue=<center>''' <span style="color:red;font-size:150%;">NOTE: GstTracker is deprecated. Contact us for customized tracking solutions:</span></center>'''
 +
<center>
 +
[https://www.ridgerun.com/contact Contact us]
 +
</center>
 +
|style=width:unset;
 +
}}
 +
 
 +
<table cellspacing="0">
 +
<tr>
 +
<td><div class="clear; float:right"> __TOC__</div></td>
 +
<td>
 +
<html>
 +
<div id='product-component-0904c5f574e'></div>
 +
    <script type="text/javascript">
 +
    /*<![CDATA[*/
 +
 
 +
    (function () {
 +
      var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
 +
      if (window.ShopifyBuy) {
 +
        if (window.ShopifyBuy.UI) {
 +
          ShopifyBuyInit();
 +
        } else {
 +
          loadScript();
 +
        }
 +
      } else {
 +
        loadScript();
 +
      }
 +
 
 +
      function loadScript() {
 +
        var script = document.createElement('script');
 +
        script.async = true;
 +
        script.src = scriptURL;
 +
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
 +
        script.onload = ShopifyBuyInit;
 +
      }
 +
 
 +
      function ShopifyBuyInit() {
 +
        var client = ShopifyBuy.buildClient({
 +
          domain: 'ridgerun1.myshopify.com',
 +
          storefrontAccessToken: 'b0ca98633a82de5d2f63cd51f5af30ac',
 +
        });
 +
 
 +
        ShopifyBuy.UI.onReady(client).then(function (ui) {
 +
          ui.createComponent('product', {
 +
            id: [1718592077895],
 +
            node: document.getElementById('product-component-0904c5f574e'),
 +
            moneyFormat: '%24%7B%7Bamount%7D%7D',
 +
            options: {
 +
  "product": {
 +
    "variantId": "all",
 +
    "width": "240px",
 +
    "contents": {
 +
      "imgWithCarousel": false,
 +
      "variantTitle": false,
 +
      "description": false,
 +
      "buttonWithQuantity": false,
 +
      "quantity": false
 +
    },
 +
    "text": {
 +
      "button": "BUY NOW"
 +
    },
 +
    "styles": {
 +
      "product": {
 +
        "@media (min-width: 601px)": {
 +
          "max-width": "100%",
 +
          "margin-left": "0",
 +
          "margin-bottom": "50px"
 +
        }
 +
      },
 +
      "button": {
 +
        "background-color": "#007493",
 +
        "font-size": "18px",
 +
        "padding-top": "17px",
 +
        "padding-bottom": "17px",
 +
        ":hover": {
 +
          "background-color": "#006884"
 +
        },
 +
        ":focus": {
 +
          "background-color": "#006884"
 +
        }
 +
      },
 +
      "quantityInput": {
 +
        "font-size": "18px",
 +
        "padding-top": "17px",
 +
        "padding-bottom": "17px"
 +
      },
 +
      "compareAt": {
 +
        "font-size": "12px"
 +
      }
 +
    }
 +
  },
 +
  "cart": {
 +
    "contents": {
 +
      "button": true
 +
    },
 +
    "styles": {
 +
      "button": {
 +
        "background-color": "#007493",
 +
        "font-size": "18px",
 +
        "padding-top": "17px",
 +
        "padding-bottom": "17px",
 +
        ":hover": {
 +
          "background-color": "#006884"
 +
        },
 +
        ":focus": {
 +
          "background-color": "#006884"
 +
        }
 +
      },
 +
      "footer": {
 +
        "background-color": "#ffffff"
 +
      }
 +
    }
 +
  },
 +
  "modalProduct": {
 +
    "contents": {
 +
      "img": false,
 +
      "imgWithCarousel": true,
 +
      "variantTitle": false,
 +
      "buttonWithQuantity": true,
 +
      "button": false,
 +
      "quantity": false
 +
    },
 +
    "styles": {
 +
      "product": {
 +
        "@media (min-width: 601px)": {
 +
          "max-width": "100%",
 +
          "margin-left": "0px",
 +
          "margin-bottom": "0px"
 +
        }
 +
      },
 +
      "button": {
 +
        "background-color": "#007493",
 +
        "font-size": "18px",
 +
        "padding-top": "17px",
 +
        "padding-bottom": "17px",
 +
        ":hover": {
 +
          "background-color": "#006884"
 +
        },
 +
        ":focus": {
 +
          "background-color": "#006884"
 +
        }
 +
      },
 +
      "quantityInput": {
 +
        "font-size": "18px",
 +
        "padding-top": "17px",
 +
        "padding-bottom": "17px"
 +
      }
 +
    }
 +
  },
 +
  "toggle": {
 +
    "styles": {
 +
      "toggle": {
 +
        "background-color": "#007493",
 +
        ":hover": {
 +
          "background-color": "#006884"
 +
        },
 +
        ":focus": {
 +
          "background-color": "#006884"
 +
        }
 +
      },
 +
      "count": {
 +
        "font-size": "18px"
 +
      }
 +
    }
 +
  },
 +
  "productSet": {
 +
    "styles": {
 +
      "products": {
 +
        "@media (min-width: 601px)": {
 +
          "margin-left": "-20px"
 +
        }
 +
      }
 +
    }
 +
  }
 +
}
 +
          });
 +
        });
 +
      }
 +
    })();
 +
    /*]]>*/
 +
</script>
 +
</html>
 +
<td>
 +
{{GStreamer debug}}
 +
<td>
 +
<center>
 +
{{ContactUs Button}}
 +
</center>
 +
</td>
 +
</table>
 +
</center>
 +
</td></tr></table>
 +
 
 +
== GstDispTEC Object Tracking Overview ==
 +
 
 +
GstDispTEC object tracker is a [https://www.ridgerun.com/gstreamer GStreamer] element which integrates DispTEC <ref> http://www.ie.tec.ac.cr/palvarado/pmwiki/index.php/Proyectos/DispTEC2?userlang=en</ref> library's algorithms for object tracking, making it possible to incorporate their functionalities into GStreamer pipelines, such as showing where the object is located on a frame. This allows the user to strengthen image analysis by connecting its own applications to the pipeline for receiving the analysis data and much more amazing things, as shown in the following demo.
  
  
Line 8: Line 206:
 
</center>
 
</center>
  
= Description =
+
== Object Tracking Description ==
  
Object tracking has been implemented based on Kernelized Correlation Filters (KCF). Each tracker element is initialized with the coordinates of the object in the current frame, snipping the object from the frame and taking it as a template. Afterwards, the tracker element updates the filter every time that there is an object hit, adapting itself to the possible changes which an object might have during the video, making it robust enough to cope with potential perspective changes.
+
Object tracking is implemented based on Kernelized Correlation Filters (KCF). Each tracker element is initialized with the coordinates of the object in the current frame, snipping the object from the frame and taking it as a template. Afterward, the tracker element updates the filter every time that there is an object hit, adapting itself to the possible changes which an object might have during the video, making it robust enough to cope with potential perspective changes.
  
 
This object tracking technique gives the following features:
 
This object tracking technique gives the following features:
  
 
* Non-stationary camera resilient.
 
* Non-stationary camera resilient.
* Tolerates object scaling, rotation and transformation.
+
* Tolerates object scaling, rotation, and transformation.
* Resilient to changes in colour and light.
+
* Resilient to changes in color and light.
  
GstDispTEC object tracker goes even further, making possible to reset the object position at run-time, even if the pipeline is in ''Play'' state. Let's look nearer:
+
GstDispTEC object tracker goes even further, making it possible to reset the object position at run-time, even if the pipeline is in the ''Play'' state. This includes:
  
 
* Possibility of tracker cascading.
 
* Possibility of tracker cascading.
Line 27: Line 225:
  
  
The tracker element gets some parameters to surround the object to get a template and start tracking. Also, it is possible to enable the visual feedback overlaid on the frame highlighting the current position. These parameters are described below:
+
The object tracker element gets some parameters to surround the object to get a template and start tracking. Also, it is possible to enable the visual feedback overlaid on the frame highlighting the current position. These parameters are described below:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 41: Line 239:
 
| height || (Unsigned int) Object height in pixels. Range: 0 - 4294967295. Default: 100
 
| height || (Unsigned int) Object height in pixels. Range: 0 - 4294967295. Default: 100
 
|-
 
|-
| render-bbox || (Boolean) Render a bounding box which gives a visual representation where the object is currently located. Default: TRUE
+
| render-bbox || (Boolean) Render a bounding box that gives a visual representation of where the object is currently located. Default: TRUE
 
|}
 
|}
  
 
The tracker element also generates a signal for third-party applications for retrieving the current object position (''coordinates''), whose coordinates are expressed as ''integers'' in the following sequence: x, y, width, and height.
 
The tracker element also generates a signal for third-party applications for retrieving the current object position (''coordinates''), whose coordinates are expressed as ''integers'' in the following sequence: x, y, width, and height.
= Architecture =
+
== Object Tracker Architecture ==
  
 
GstDispTEC object tracker has been created based on the DispTEC library. However, it is independent of the DispTEC's dependencies and it can be easily integrated whichever library that DispTEC is based on (OpenCV, LTI-lib, etc). This is achieved by an ''Abstraction layer'' just on the base of the plug-in, which can adapt it to several DispTEC variations.  
 
GstDispTEC object tracker has been created based on the DispTEC library. However, it is independent of the DispTEC's dependencies and it can be easily integrated whichever library that DispTEC is based on (OpenCV, LTI-lib, etc). This is achieved by an ''Abstraction layer'' just on the base of the plug-in, which can adapt it to several DispTEC variations.  
  
By using DispTEC as the base, it is possible to perform and run Computer Vision algorithms easily on CPU, accelerating the performance and delivery time of video analyses. Nevertheless, joining DispTEC with GStreamer, we offer the best of both worlds: the powerful algorithms available in DispTEC and the flexibility of GStreamer to process videos, allowing live-streaming, pipelining and more.
+
By using DispTEC as the base, and joining it with GStreamer, we offer the best of both worlds: the powerful algorithms available in DispTEC and the flexibility of GStreamer to process videos, allowing live-streaming, pipelining, and more.
  
  
 
[[File:Diagram.png|frame|center|GstDispTEC architecture diagram.]]  
 
[[File:Diagram.png|frame|center|GstDispTEC architecture diagram.]]  
''GstDispTEC Arquitecture Description'' illustrates the general architecture of the plug-in and what makes it one of the best solutions for image analysis for GStreamer.
+
''GstDispTEC Architecture Description'' illustrates the general architecture of the plug-in and what makes it one of the best solutions for image analysis for GStreamer.
  
= Supported platforms =
+
== Supported platforms ==
  
GstDispTEC object tracker currently supports platforms capable to run Open Computer Vision Library (OpenCV). Some of the platforms already tested are:
+
GstDispTEC object tracker currently supports platforms that are able to run the Open Computer Vision Library (OpenCV). Some of the platforms already tested are:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 69: Line 267:
  
 
Both platforms were running OpenCV 3.3.
 
Both platforms were running OpenCV 3.3.
 +
<br>
 +
== Getting the code ==
 +
Please visit [https://www.ridgerun.com/contact RidgeRun Contact] if you are interested in purchasing the GstDispTEC object tracker plugin, with full source code.
  
= Building GstDispTEC =
+
== Building GstDispTEC ==
  
== Dependencies ==
+
=== Dependencies ===
  
 
Before trying to install, make sure of having the following dependencies already installed on the target platform:
 
Before trying to install, make sure of having the following dependencies already installed on the target platform:
Line 82: Line 283:
 
* Autotools
 
* Autotools
  
== Installing dependencies ==
+
=== Installing dependencies ===
  
'''DispTEC'''
+
====DispTEC====
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 94: Line 295:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''OpenCV'''
+
====OpenCV====
  
 
For installing OpenCV, please, follow the steps in the link: [https://docs.opencv.org/3.3.0/d7/d9f/tutorial_linux_install.html OpenCV Installation]
 
For installing OpenCV, please, follow the steps in the link: [https://docs.opencv.org/3.3.0/d7/d9f/tutorial_linux_install.html OpenCV Installation]
  
'''GStreamer'''
+
====GStreamer====
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 107: Line 308:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Autotools'''
+
====Autotools====
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 115: Line 316:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Installing GstDispTEC object tracker ==
+
=== Installing GstDispTEC Object Tracker Plugin===
  
When you purchase the dtmotion plugin, you will get a Gitlab repository with the source code inside. You need it to build it in your system and add it to your GStreamer plug-ins catalogue. So, in a temporary path, clone the repository using:
+
When you purchase the gst-dttracker plugin, you will get a Gitlab repository with the source code inside. You need it to build it in your system and add it to your GStreamer plug-ins catalogue. So, in a temporary path, clone the repository using:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 153: Line 354:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Test installation ==
+
=== Test installation ===
  
 
For testing if everything is properly installed, run:
 
For testing if everything is properly installed, run:
Line 163: Line 364:
 
It should show:
 
It should show:
  
<pre>
+
<syntaxhighlight lang="bash">
 
Factory Details:
 
Factory Details:
 
   Rank                    none (0)
 
   Rank                    none (0)
Line 259: Line 460:
  
  
</pre>
+
</syntaxhighlight>
  
= Examples =
+
== Object Tracking Examples ==
 
'''Example 1: Ball pattern with visual feedback'''
 
'''Example 1: Ball pattern with visual feedback'''
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! dttracker name=tracker x=130 y=90 width=50 height=50 ! videoconvert ! xvimagesink
+
gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! dttracker name=tracker x=130 y=90 width=50 height=50 enable=true ! videoconvert ! xvimagesink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 274: Line 475:
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
 
INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
gst-launch-1.0 filesrc location=$PATH_TO_FILE ! videoconvert ! dttracker name=tracker $INITIAL_OBJ_POSITION ! videoconvert ! xvimagesink
+
gst-launch-1.0 filesrc location=$PATH_TO_FILE ! videoconvert ! dttracker name=tracker $INITIAL_OBJ_POSITION enable=true ! videoconvert ! xvimagesink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 283: Line 484:
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
 
INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
gst-launch v4l2src device=$CAPTURE_DEVICE ! $CAPS ! dttracker name=tracker $INITIAL_OBJ_POSITION ! videoconvert ! xvimagesink
+
gst-launch v4l2src device=$CAPTURE_DEVICE ! $CAPS ! dttracker name=tracker $INITIAL_OBJ_POSITION enable=true ! videoconvert ! xvimagesink
 
</syntaxhighlight>
 
</syntaxhighlight>
  
= References =
+
==References==
 +
<references />
 +
 
 +
{{ContactUs}}
 +
 
 +
[[Category:Jetson]][[Category:GStreamer]][[Category:Whitepaper]][[Category:RidgeRunTechnology‏‎]][[Category:GStreamer Motion Detection]][[Category:DispTEC]]

Latest revision as of 09:23, 16 January 2023

Error something wrong.jpg Problems running the pipelines shown on this page?
Please see our GStreamer Debugging guide for help.

RR Contact Us.png

GstDispTEC Object Tracking Overview

GstDispTEC object tracker is a GStreamer element which integrates DispTEC [1] library's algorithms for object tracking, making it possible to incorporate their functionalities into GStreamer pipelines, such as showing where the object is located on a frame. This allows the user to strengthen image analysis by connecting its own applications to the pipeline for receiving the analysis data and much more amazing things, as shown in the following demo.


Object Tracking Description

Object tracking is implemented based on Kernelized Correlation Filters (KCF). Each tracker element is initialized with the coordinates of the object in the current frame, snipping the object from the frame and taking it as a template. Afterward, the tracker element updates the filter every time that there is an object hit, adapting itself to the possible changes which an object might have during the video, making it robust enough to cope with potential perspective changes.

This object tracking technique gives the following features:

  • Non-stationary camera resilient.
  • Tolerates object scaling, rotation, and transformation.
  • Resilient to changes in color and light.

GstDispTEC object tracker goes even further, making it possible to reset the object position at run-time, even if the pipeline is in the Play state. This includes:

  • Possibility of tracker cascading.
  • Tracker reinitialization at run-time.
  • Application integrability.
  • Visual feedback of object position overlaid to frames.
  • Multi-tracker deployment in the same element (coming soon).


The object tracker element gets some parameters to surround the object to get a template and start tracking. Also, it is possible to enable the visual feedback overlaid on the frame highlighting the current position. These parameters are described below:

Parameter Description
x (Unsigned int) Object x coordinate at the top-left corner in pixels. Range: 0 - 4294967295. Default: 0
y (Unsigned int) Object y coordinate at the top-left corner in pixels. Range: 0 - 4294967295. Default: 0
width (Unsigned int) Object width in pixels. Range: 0 - 4294967295. Default: 100
height (Unsigned int) Object height in pixels. Range: 0 - 4294967295. Default: 100
render-bbox (Boolean) Render a bounding box that gives a visual representation of where the object is currently located. Default: TRUE

The tracker element also generates a signal for third-party applications for retrieving the current object position (coordinates), whose coordinates are expressed as integers in the following sequence: x, y, width, and height.

Object Tracker Architecture

GstDispTEC object tracker has been created based on the DispTEC library. However, it is independent of the DispTEC's dependencies and it can be easily integrated whichever library that DispTEC is based on (OpenCV, LTI-lib, etc). This is achieved by an Abstraction layer just on the base of the plug-in, which can adapt it to several DispTEC variations.

By using DispTEC as the base, and joining it with GStreamer, we offer the best of both worlds: the powerful algorithms available in DispTEC and the flexibility of GStreamer to process videos, allowing live-streaming, pipelining, and more.


Error creating thumbnail: Unable to save thumbnail to destination
GstDispTEC architecture diagram.

GstDispTEC Architecture Description illustrates the general architecture of the plug-in and what makes it one of the best solutions for image analysis for GStreamer.

Supported platforms

GstDispTEC object tracker currently supports platforms that are able to run the Open Computer Vision Library (OpenCV). Some of the platforms already tested are:

Platform Operating System
Nvidia Jetson TX1 Ubuntu 16.04 64 bits
Personal Computer (PC) Ubuntu 16.04 64 bits

Both platforms were running OpenCV 3.3.

Getting the code

Please visit RidgeRun Contact if you are interested in purchasing the GstDispTEC object tracker plugin, with full source code.

Building GstDispTEC

Dependencies

Before trying to install, make sure of having the following dependencies already installed on the target platform:

  • OpenCV Core >= 3.3
  • OpenCV Contribution Modules >= 3.3
  • DispTEC >= 0.2
  • GStreamer >= 1.8.1
  • Autotools

Installing dependencies

DispTEC

sudo apt install cmake
git clone https://github.com/RidgeRun/dispTEC_2017
cmake .
make
sudo make install

OpenCV

For installing OpenCV, please, follow the steps in the link: OpenCV Installation

GStreamer

sudo apt-get install \
gstreamer1.0-x \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev

Autotools

sudo apt install \
autotools-dev \
autoconf

Installing GstDispTEC Object Tracker Plugin

When you purchase the gst-dttracker plugin, you will get a Gitlab repository with the source code inside. You need it to build it in your system and add it to your GStreamer plug-ins catalogue. So, in a temporary path, clone the repository using:

git clone git://git@gitlab.com/RidgeRun/orders/${CUSTOMER_DIRECTORY}/gst-disptec.git

Where ${CUSTOMER_DIRECTORY} contains the name of your customer directory given after the purchase.

Afterwards, find the path where GStreamer looks for plug-ins and libraries (LIBDIR). Take as a reference to the following table:

Platform LIBDIR path
PC 32-bits/x86 /usr/lib/i386-linux-gnu/
PC 64-bits/x86 /usr/lib/x86_64-linux-gnu/
Nvidia Jetson /usr/lib/aarch64-linux-gnu/

According to the table, define an environment variable which stores the path accordingly to your system. For example, for an x64 PC, it will be:

LIBDIR=/usr/lib/x86_64-linux-gnu/

Then, do the installation using:

./autogen.sh
./configure --libdir $LIBDIR
make
sudo make install

Test installation

For testing if everything is properly installed, run:

gst-inspect-1.0 dttracker

It should show:

Factory Details:
  Rank                     none (0)
  Long-name                DispTEC tracker element
  Klass                    Generic
  Description              DispTEC object tracking element over a video stream
  Author                   <luis.leon@ridgerun.com, carolina.trejos@ridgerun.com>

Plugin Details:
  Name                     disptec
  Description              DispTEC Image processing library plugin
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstdisptec.so
  Version                  0.3.0
  License                  Proprietary
  Source module            gst-disptec
  Binary package           RidgeRun
  Origin URL               https://www.ridgerun.com

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstVideoFilter
                               +----GstDttracker

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: BGR
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: BGR
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_element_change_state_func

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "dttracker0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: true
  x                   : Initial left corner X position
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  y                   : Initial left corner Y position
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  width               : Initial object width
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 4294967295 Default: 100 
  height              : Initial object height
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 4294967295 Default: 100 
  render-bbox         : Enables or disables the bounding box around the tracked object
                        flags: readable, writable
                        Boolean. Default: true

Element Signals:
  "coordinates" :  void user_function (GstElement* object,
                                       guint arg0,
                                       guint arg1,
                                       guint arg2,
                                       guint arg3,
                                       gpointer user_data);

Object Tracking Examples

Example 1: Ball pattern with visual feedback

gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! dttracker name=tracker x=130 y=90 width=50 height=50 enable=true ! videoconvert ! xvimagesink

For this case, the ball always starts at x=130, y=90 and has a width around 50x50 px.

Example 2: Video loaded from a file

INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
gst-launch-1.0 filesrc location=$PATH_TO_FILE ! videoconvert ! dttracker name=tracker $INITIAL_OBJ_POSITION enable=true ! videoconvert ! xvimagesink

Set the object initial position into INITIAL_OBJ_POSITION

Example 3: Capturing from camera

INITIAL_OBJ_POSITION="x=100 y=100 width=100 height=100"
gst-launch v4l2src device=$CAPTURE_DEVICE ! $CAPS ! dttracker name=tracker $INITIAL_OBJ_POSITION enable=true ! videoconvert ! xvimagesink

References


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png