# Object Detection example drawing 2D mask over image

**URL:** <https://community.stereolabs.com/t/object-detection-example-drawing-2d-mask-over-image/673>\
**Category:** Python\
**Tags:** python, jetson\
**Created:** [November 15, 2021, 9:34pm UTC](https://community.stereolabs.com/t/object-detection-example-drawing-2d-mask-over-image/673 "2021-11-15T21:34:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![quythao.truong](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@quythao.truong](https://community.stereolabs.com/u/quythao.truong)\
**Post date:** [November 16, 2021, 1:06pm UTC](https://community.stereolabs.com/t/object-detection-example-drawing-2d-mask-over-image/673/2 "2021-11-16T13:06:53Z")

</div>

Hi @ChealsieBains01,

There is unfortunately no example on our github showing how to draw the 2D mask over a detected object yet, but we’ll log your request and will add an example online as soon as possible.  
In the meantime, I attached a small python script showing you how it can be done in Python.

For information, in the C++ sample, you can change [L.99](https://github.com/stereolabs/zed-examples/blob/b0ad7a91de4b64dbe3296a5bb5ae802ec1913a20/object%20detection/birds%20eye%20viewer/cpp/src/main.cpp#L99) to `true` to draw the 2D mask over detected objects. This can also help you understand how it works.

Hope this helps !

[ZED\_Mask.py](https://community.stereolabs.com/uploads/short-url/uSnzo76GTwd4XsRdWGQeGQuhuxT.py) (5.5 KB)

---

_[View the full topic](https://community.stereolabs.com/t/object-detection-example-drawing-2d-mask-over-image/673)._
