How to filter L_ObjectDetection_3D?

Hello!
I try to figure out how to filter objects so only, for example people get tracked?
If I set Object Class Filter to 1, it tracks person only as it should but only in editor, if I pack project it tracks other objects too (bags, cars etc.). I can’t find class list in documentation, so maybe I have set wrong Class filter?

Hi @OneStudio

Can you try setting a filter for every class? (Making an array of size 7 and setting other values to 0)

The documentation is really not extended on this one indeed, I’ll fix that shortly.
In the meanwhile, the ordered list of classes is available in the API reference: OBJECT_CLASS. (so 0 is PERSON and 6 is SPORT).

Explanation on usage:

For the filter, the array needs to be sized to the number of available classes and acts like a dictionary whose key is the index, translated to the int value of the classes enum element, and the value 0 or not 0 (let’s say 1) if the class should be filtered out (0) or enabled (1).

So you need an array with 7 elements, the index 0 for person and the index 6 for sport. The value should be 0 if you want to filter the class out, and 1 if you want to enable it.

Please note two things:

  • The array is initialized to 0 in the back-end, so by default, every filter is 0. If you only put one filter like you did, it will enable the PERSON and disable the other classes.
  • If every filter is set to 0, it will ignore all filters and enable everything.
1 Like