ROS Deep Learning cropping image

Hi,

I want to write a node in python which takes objects coords input from object detection node and publishs coord of ROI.
This ROI is the ROI of the next frame. which means model will look only this region. so object detection result will be better.

But i dont know how to give a ROI input to model. in detecnet node it takes whole frame and height and width parameters, if i give width and height parameters different will it crop the image? and if i shift the pointed point of the image array will it shift the ROI?
Sorry for bad explenation, I can not even explain it in my 1. language.

But the general question is this: How can i crop image and detect object on this image.

The example code that written in python is this:

thanks

Hi @muhammedsezer12, you could modify the detectnet node to use the cudaCrop() function from jetson-inference:

https://github.com/dusty-nv/jetson-utils/blob/ebf55857d60ba0be5c655cacf8eb8e9348ace714/cuda/cudaCrop.h

1 Like

I looked all the cuda* functions. But i guess i missed it, sorry. Thanks so much!
Ill be more careful next time

No worries, good luck with your project!