# There is an error occurring in the image cropping process

**URL:** <https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814>\
**Category:** DeepStream SDK\
**Created:** [January 23, 2024, 7:26am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814 "2024-01-23T07:26:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpernos9](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@kpernos9](https://forums.developer.nvidia.com/u/kpernos9)\
**Post date:** [January 23, 2024, 7:26am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814/1 "2024-01-23T07:26:37Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)** Orin NX  
**• DeepStream Version** 6.3  
**• JetPack Version (valid for Jetson only)** 5.1.2  
**• TensorRT Version** 8.5.2.2  
**• NVIDIA GPU Driver Version (valid for GPU only)** Orin NX  
**• Issue Type( questions, new requirements, bugs)** Questions  
**• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)**

I am using gstreamer to crop an image from sources and then saving the processed image with nvds\_obj\_enc\_process(). However, occasionally, I face errors in the image cropping, as shown in the following image.

![error](https://global.discourse-cdn.com/nvidia/original/4X/0/0/3/003237bafd22cab67e296dc25137a5c28c407933.jpeg) ![normal](https://global.discourse-cdn.com/nvidia/original/4X/c/a/3/ca33a86321e03fdce60f56fb860030bfa6043073.jpeg)

The image on the right is a properly cropped image, while the one on the left shows errors in the cropping process. Most of the time, the sources are cropped correctly.

Additionally, the following is the pipeline I used in the deepstream-app.

 ![0.00.03.920418363-ds-app-playing](https://global.discourse-cdn.com/nvidia/original/4X/a/e/e/aee1f15e01fdd1a507200da3f790c45a98e2946d.png)

---

<div class="post-metadata">

**Author:** ![yuweiw](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yuweiw/32/101255_2.png) [@yuweiw](https://forums.developer.nvidia.com/u/yuweiw)\
**Post date:** [January 23, 2024, 10:55am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814/3 "2024-01-23T10:55:23Z")

</div>

Could you attach the source code of cropping and saving the image?

---

<div class="post-metadata">

**Author:** ![kpernos9](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@kpernos9](https://forums.developer.nvidia.com/u/kpernos9)\
**Post date:** [January 24, 2024, 9:29am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814/4 "2024-01-24T09:29:56Z")

</div>

In the `create_camera_source_bin()` within the deepstream\_source\_bin.c, add` g_object_set (G_OBJECT (nvvidconv2), "gpu-id", config->gpu_id, "src-crop", "359:28:562:664", "nvbuf-memory-type", config->nvbuf_memory_type, NULL);` to handle image cropping.

Additionally, in the `gie_primary_processing_done_buf_prob()` function in deepstream\_app.c , use `nvds_obj_enc_process()` to save the processed images.

---

<div class="post-metadata">

**Author:** ![yuweiw](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yuweiw/32/101255_2.png) [@yuweiw](https://forums.developer.nvidia.com/u/yuweiw)\
**Post date:** [January 25, 2024, 2:48am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814/5 "2024-01-25T02:48:23Z")

</div>

**There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks**

Thanks for the clarify. What is the probability for this issue on your platform?  
Could you reproduce that with our demo code `sources\apps\sample_apps\deepstream-image-meta-test` ?  
Since our latest version DeepStream 6.4 has been released, could you reproduce that on the latest version too?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [February 24, 2024, 5:49am UTC](https://forums.developer.nvidia.com/t/there-is-an-error-occurring-in-the-image-cropping-process/279814/6 "2024-02-24T05:49:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
