I need an OpenCV function for python which allows cropping an image for given dimensions.
I am using cv2.UMat() for loading images onto GPU and processing there itself. So, below index slicing option won't work on UMat objects.
image[CROP_DIMS[0]:-CROP_DIMS[1], CROP_DIMS[2]:-CROP_DIMS[3]])
To optimize and take full benefits of GPU, I need OpenCV function to crop an image using OpenCV Function, else I will have to get the image from GPU and again load onto GPU once cropped.
Versions : Python - 3.6.4 OpenCV - 3.4.1
I have already searched on stack overflow and google for same but didn't find any suitable matching answer. Either everyone is pointing to index slicing or functions from previous old opencv versions.