Object Batches seem not to work

Hi everybody!

I was curious about the object batching that was announced with the 3.5.0 release and wanted to try it out. So I took the Sample code (object detection / birds eye viewer) from GitHub - stereolabs/zed-examples: ZED SDK Example projects as well as Street and Runners files from this post: Sample or test videos - #3 by nizaguilar

Compiling and running the code works fine, however, it always tells me that there are 0 objects detected. No matter how long I let the program run (as I understand, there’s a delay). I’ve set
#define USE_BATCHING 1
in the main.cpp file, so I guess it uses batches then.

Am I missing something important here? Are there any restrictions on how to use the object batches.

In case this is relevant: I used the C++ version on a Windows 10 PC.

Hi @Arthur5
sorry for the very late reply.
Can you provide a snippet code to understand if there is something wrong with your configuration?


As mentioned, I used the code from GitHub - stereolabs/zed-examples: ZED SDK Example projects and the ZED2_HD2K_Runners_H264.svo linked above.
I used the C++ version of the birds eye viewer from the object detection example. I.e. the whole code is inside `object detection/birds eye viewer/cpp/.

I generated a Visual Studio solution with cmake 3.20.2 and compiled the code with Visual Studio 16.10.

My only change to the code is that in main.cpp line 40 I changed #define USE_BATCHING 0 to #define USE_BATCHING 1.

With #define USE_BATCHING 0 everything is fine. I set the video in the GUI.
With #define USE_BATCHING 1 I don’t even see anything in the GUI and checking the size of objectsBatch in line 200 in main.cpp always returns 0.

can you please check what is the return value of the getObjectsBatch function here:

and here



If I change the lines you suggested to the following code:

auto err_code = zed.getObjectsBatch(objectsBatch);
std::cout << "Error Code: " << err_code << std::endl;

then I get as output:


I’ve tried with
#define ENABLE_GUI 1
as well as with
#define ENABLE_GUI 0
to trigger both places. The output is always the same.

Hi @Arthur5
that’s what we expected. It seems a compatibility problem with your GPU or installed libraries.
Can you please run the ZED Diagnostic tool and send it to support@stereolabs.com?
We will provide you with direct support.