# Object Batches seem not to work

**URL:** <https://community.stereolabs.com/t/object-batches-seem-not-to-work/287>\
**Category:** Software\
**Created:** [June 15, 2021, 6:22am UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287 "2021-06-15T06:22:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur5](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@Arthur5](https://community.stereolabs.com/u/Arthur5)\
**Post date:** [June 15, 2021, 6:22am UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/1 "2021-06-15T06:22:48Z")

</div>

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](https://github.com/stereolabs/zed-examples) as well as Street and Runners files from this post: [Sample or test videos - #3 by nizaguilar](https://community.stereolabs.com/t/sample-or-test-videos/219/3)

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.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [July 9, 2021, 1:28pm UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/2 "2021-07-09T13:28:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Arthur5](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@Arthur5](https://community.stereolabs.com/u/Arthur5)\
**Post date:** [August 2, 2021, 6:52am UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/3 "2021-08-02T06:52:35Z")

</div>

Hi!

As mentioned, I used the code from [GitHub - stereolabs/zed-examples: ZED SDK Example projects](https://github.com/stereolabs/zed-examples) 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.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [August 3, 2021, 1:25pm UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/4 "2021-08-03T13:25:29Z")

</div>

@Arthur5  
can you please check what is the return value of the [`getObjectsBatch` function](https://www.stereolabs.com/docs/api/classsl_1_1Camera.html#a8507f576e84e2d9d3cf0f7a9edd82dc1) here:

> <https://github.com/stereolabs/zed-examples/blob/master/object%20detection/birds%20eye%20viewer/cpp/src/main.cpp#L198>

and here

> <https://github.com/stereolabs/zed-examples/blob/master/object%20detection/birds%20eye%20viewer/cpp/src/main.cpp#L219>

?

---

<div class="post-metadata">

**Author:** ![Arthur5](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@Arthur5](https://community.stereolabs.com/u/Arthur5)\
**Post date:** [August 4, 2021, 9:16am UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/5 "2021-08-04T09:16:35Z")

</div>

Hi!

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:

```
Error Code: INVALID FUNCTION CALL

```

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.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [August 4, 2021, 9:47am UTC](https://community.stereolabs.com/t/object-batches-seem-not-to-work/287/6 "2021-08-04T09:47:36Z")

</div>

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](mailto:support@stereolabs.com)?  
We will provide you with direct support.
