Combined mask from body tracking module

Is there any method or way to get combined mask?
From the body tracking model, we can get the mask of individual humans in the frame.
How can I get a complete mask of all humans in the frame as a single mask?

Hi @Gopi-htic

I don’t think there is a method to generate this mask in the ZED SDK, but you could merge the generated masks for all BodyData objects together.
The masks for the BodyData are 2D arrays with values being either 0 (not mask) or 255 (mask). Their dimensions are the ones of the bounding_box_2d attribute. They are located in the frame following the bounding_box_2d origin.

I think you can create a 2D array the size of your frame and merge these masks together using this info.

I hope this is helpful :slight_smile:

1 Like

I can confirm I have done this successfully in Unity. All the independent 2D blob masks are in the same coordinate space, and this seems to be shared across the 2D image frame and even e.g. the 3D pointcloud data. I will advise keeping everything GPU-side as long as possible for performance. Unity can do this with one or two custom shaders and Graphics.Blit; wouldn’t know where to point you on Python.