What is the easiest way to crop an image on the GPU?

Is there any example code out there for cropping a float4 RGBA image that’s already on the GPU?

I want to feed forward a TensorRT neural network and the inputs require cropped parts of an image that has already been loaded into the GPU.

I might add I’m actually using the Jetson TX2 and a modified jetson-inference example in c++.

Hi stangogh, here’s a simple example CUDA kernel of cropping image: https://github.com/dusty-nv/jetson-video/blob/master/cuda/cudaCrop.cu

NPP (NVIDIA Performance Primitives) library should also have a function for cropping available.

Thank you dusty_nv! Your jetson-inference github repo is amazing and has been super instrumental in getting my project off the ground and running :)