Text this: Application and optimization of cross-correlation algorithm for image registration