An efficient algorithm for exhaustive template matching based on normalized cross correlation