Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Detection Overlay on Both Camera Images #40

Open
2 tasks done
keli95566 opened this issue Apr 6, 2022 · 7 comments
Open
2 tasks done

Object Detection Overlay on Both Camera Images #40

keli95566 opened this issue Apr 6, 2022 · 7 comments
Labels
feature_request New feature or request

Comments

@keli95566
Copy link

keli95566 commented Apr 6, 2022

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, bug report, or anything other than a feature request directly related to this project.

Proposal

Having the object detection or skeleton overlay on both camera image streams. The current version only supports overlay on a single image.

Use-Case

No response

Anything else?

No response

@keli95566 keli95566 added the feature_request New feature or request label Apr 6, 2022
@keli95566 keli95566 changed the title Object Detection Overlay on Both Camera Images and Connection to Gst-inference pipeline Object Detection Overlay on Both Camera Images Apr 6, 2022
@keli95566
Copy link
Author

@Myzhar Hi there! Is there a fast way that I could get this to work on my own?

@obraun-sl
Copy link
Member

Hi @keli95566

You can recontruct the 2D points from skeleton or object detection by calculating the 2D points in the right image from the 2D point in the left image + the disparity (can be extracted from the depth map).

If you have a 2D point in the left image (uL,vL), and the 3D coordinate of this point (X,Y,Z)

the 2D point in the right image (uR,vR) will be :

vR = vL;
uR = uL - (focale * baseline) / Z ; 

focale can be extracted from zed.getCameraInformation().calibration_parameters.left_cam.fx
baseline can be extracted from zed.getCameraInformation().calibration_parameters.getCameraBaseline();

( basically disparity = focale x Baseline / Depth. )

@keli95566
Copy link
Author

keli95566 commented Apr 10, 2022

Hi there! Just some update, the following pipeline using zeddemux works for adding overlay to both eyes without having to add new scripts. One additional small question: now the maximum framerate is only 15fps even for only HD720 resolution, is it possible to scale up the resolution to 30 fps?

gst-launch-1.0 zedsrc stream-type=2 od-enabled=true od-detection-model=0 camera-resolution=2 camera-fps=30 ! queue ! zeddemux is-depth=false name=demux demux.src_left! queue ! zedodoverlay ! autovideoconvert ! omxh264enc! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay config-interval=-1 pt=96 ! queue ! udpsink clients=[IP] max-bitrate=30000000 sync=false async=false demux.src_aux ! queue ! zedodoverlay ! autovideoconvert ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay config-interval=-1 pt=96 ! queue ! udpsink clients=[IP] max-bitrate=30000000 sync=false async=false

@Myzhar
Copy link
Member

Myzhar commented Apr 10, 2022

The maximum framerate for 720p is 60 Hz.
If you cannot get more than 15 FPS it means that you r system cannot handle it, or the network bandwidth is not enough.

@keli95566
Copy link
Author

I am wondering what is the object detection based on? Is it YOLO? is there any way we could customize the model/label based on gstreamer? Thank you very much!

@Myzhar
Copy link
Member

Myzhar commented Apr 12, 2022

The Object Detection module uses internal models optimized to take advantage of the depth information.
The models cannot be retrained to add support for custom objects, but the ZED SDK can track objects detected with custom detectors:
https://www.stereolabs.com/docs/object-detection/custom-od/

@keli95566
Copy link
Author

I see, thank you! However, I see that there is also a ZED Plugin for Yolo ( both c++ and Python) : https://www.stereolabs.com/docs/yolo/
Is it worth a try to connect GStreamer to the ZED Yolo plugin? Is real-time inference possible, and has the performance for ZED Yolo been benchmarked for the Jetson TX2 Zed box?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request New feature or request
Development

No branches or pull requests

3 participants