correlate an image after dividing it into patches