Real-Time Object Tracking with ZED 2i and GStreamer Metadata

Hi ,

I am currently working with the ZED 2i camera, both with and without object detection, and it is functioning as expected.

NOTE : I’M USING PYTHON AND CAN’T USE OTHER PROGRAMMING LANGUAGES

My objective now is to implement object tracking based on user-defined (x, y) coordinates. Specifically, I want to track a designated detected object while eliminating bounding boxes associated with all other objects.

However, I am facing two key challenges:

  1. I am unsure how to retrieve real-time tracking information (including x, y, and z coordinates) directly, without first storing the data in a CSV file.

  2. I need guidance on accessing ZED Metadata via GStreamer, particularly how to obtain the object array and other relevant information to facilitate object tracking.

@Myzhar, kindly assist

Hi @ashfaq,

If you are using Gstreamer, you can use the following script to retrieve and display Object detection bounding boxes on the image: https://github.com/stereolabs/zed-gstreamer?tab=readme-ov-file#local-leftright-stream–multiclass-object-detection-result-displaying

The object data is formatted in the following structure, which contains the position, velocity and class information (among other data): https://github.com/stereolabs/zed-gstreamer/blob/master/gst-zed-meta/gstzedmeta.h#L139

You can then filter the data based on the id or class id.

Thank u for replying.

I told u before , I checked this.

Ok, object detection working perfect. But when I want to track can’t retreive the metadata to use it in my code.

Can’t retreive the data which can make a filter depends on it, this is my main problem. Can u assist by simple example ?