Implemented extrapolation of image borders for regions cropped from outside of the original image.