Added image resize function to speed up OpenCV computations