Improvement in NCC calculation.
matchTemplate() is too slow.