Custom Detectector: Same Output for width and length?

I use the Custom Object Detector to determine the dimensions of objects.

for object in objects.object_list:
    width, height, length = object.dimensions

I noticed that the length and width always return the same values?! Can someone tell me if this is normal or a bug?

Im using pyzed==3.8

It is normal, the object.dimensions returns 3D object dimensions. Since you are using a 2D object detector, it can only return width and height.
To get the correct 3D values, you will need to cross the data with the depth map. Here is more information here : Using the Object Detection API with a Custom Detector | Stereolabs

Hello, thanks for the answer!
Unfortunately I don’t quite understand that.
Does this mean I have to write myself a function for the depth values of the object? So to speak, to get the depth values of the mask and thereby calculate the depth of the object.

To be more precise, the depth is made equal to the width due to the lack of information (by running a 2D detector on one image, you can only get the width and height of the bounding box, the depth is supposed).
You will have to make a custom function that filters the depth values of your object pixels, to compute the depth of the object.
Stereolabs Support

1 Like

Alright, now I got it, thanks!