10/13/2018

Python opencv, get ROI Mat (cropping)

Please refer to this function..

def getROImat(inMat, x1, y1, x2, y2):
# Crop image
imCrop = inMat[int(y1):int(y2), int(x1):int(x2)]
return imCrop