# How to obtain the bounding box?

**URL:** <https://forum.opencv.org/t/how-to-obtain-the-bounding-box/7536>\
**Category:** Python\
**Tags:** medical\
**Created:** [February 11, 2022, 7:56pm UTC](https://forum.opencv.org/t/how-to-obtain-the-bounding-box/7536 "2022-02-11T19:56:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![color\_less](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/color_less/32/4473_2.png) [@color\_less](https://forum.opencv.org/u/color_less)\
**Post date:** [February 11, 2022, 7:56pm UTC](https://forum.opencv.org/t/how-to-obtain-the-bounding-box/7536/1 "2022-02-11T19:56:15Z")

</div>

How do I make a Region of Interest image with a bounding box like the one in the third image? both images are in Nifti format  
 ![Figure](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/e/ebd4fd19d4a529a35949005728bdb561bc2720d3.png)

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [February 12, 2022, 9:56am UTC](https://forum.opencv.org/t/how-to-obtain-the-bounding-box/7536/2 "2022-02-12T09:56:40Z")

</div>

forgive me for being “mr. obvious” here, but shouldnt you be reading about  
“Graph Cut Segmentation and morphological operations” now ?

> <https://github.com/opencv/opencv/blob/4.x/samples/python/grabcut.py>

[https://docs.opencv.org/4.x/d9/d61/tutorial\_py\_morphological\_ops.html](https://docs.opencv.org/4.x/d9/d61/tutorial_py_morphological_ops.html)

also, your illustration sems to be from some paper – you have a link for us ?
