# Deepstream save image with bounding box

**URL:** <https://forums.developer.nvidia.com/t/deepstream-save-image-with-bounding-box/123717>\
**Category:** DeepStream SDK\
**Created:** [May 19, 2020, 7:45am UTC](https://forums.developer.nvidia.com/t/deepstream-save-image-with-bounding-box/123717 "2020-05-19T07:45:08Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 24, 2020, 7:43am UTC](https://forums.developer.nvidia.com/t/deepstream-save-image-with-bounding-box/123717/9 "2020-08-24T07:43:34Z")

</div>

Hi,

> [@Mike](#):
>
> Can you suggest how to save the complete frame with bounding boxes instead of cropped objects. I am able to run deepstream-image-meta-test and generate the cropped images.

You may add prob function in source pad of _nvdsosd_ plugin. The buffer is in RGBA format and you can simply map it to _cv::Mat_.

Sample code of saving full frame:

> [@RTSP camera access frame issue](https://forums.developer.nvidia.com/t/rtsp-camera-access-frame-issue/80044/19):
>
> Hi, Adding the following code to tracking\_done\_buf\_prob() works fine. For your reference. #if 1 static int dump = 0; if (dump \< 150) { GstMapInfo in\_map\_info; NvBufSurface \*surface = NULL; memset (&in\_map\_info, 0, sizeof (in\_map\_info)); if (!gst\_buffer\_map (buf, &in\_map\_info, GST\_MAP\_READ)) { g\_print ("Error: Failed to map gst buffer\n"); gst\_buffer\_unmap (buf, &in\_map\_info); return GST\_PAD\_PROBE\_OK; } cudaError\_t cuda\_err; NvBufSurfTransform…

For your usecase, you may ignore NV12 to RGBA conversion.

---

_[View the full topic](https://forums.developer.nvidia.com/t/deepstream-save-image-with-bounding-box/123717)._
