Two "birds eye viewer" object detection visualizations at the same time


I am currently working on an object detection program using the Zed SDK and using the .cpp program birds eye viewer as a basis. I’m trying to get 2 object detections running at the same time and I am doing this by using a separate thread for each OD. For this I modified the OD program birds eye viewer and structured it similarly to the program under zed-examples/other/multi camera. I thnk it should work but I have problems with the visualization via GL Viewer.

I get the following error message:

[Sample] Object Detection: Loading Module... 
[Sample] Object Detection: Loading Module... 
freeglut (./ZED_Object_detection_birds_eye_viewer): illegal glutInit() reinitialization attempt
freeglut  ERROR:  Function <glutMainLoopEvent> called without first calling 'glutInit'.
Segmentation fault (core dumped)

It seems that the way the program is currently set up, only one GL object can be created for the visualization. However, I would like to have the 2 visualizations of the 2 OD’s at the same time. I turned off the Point Cloud visualization, I only want to do the visualization of the images (with the bounding boxes) on the left and the tracking visualization on the right hand side.

Therefore, my questions are:

  1. Is it possible to change the program code in the SDK in such a way that the visualization of 2 OD’s is possible with one or two GL Windows at the same time?

  2. If so, what are the core things that need to be changed in the program (an overall explaination would be enough)

  3. If not, what would be alternative options?

Thanks a lot in advance!

okay, my program now performs the desired object detection on both cameras (or on two SVO files) at the same time. Since I didn’t need the Point Cloud anyway, I didn’t need the GL Viewer either, just OpenCV for the images, the tracked objects on the images and the tracking. It is only important that the OpenCV functions for displaying the images etc. are called in the main thread.