Bugfix for an overlapping size of image and template for matchTemplate.

Example: img of size 10x10 and templ of size 11x9.
In subsequent code this will results in either width or height of
corrSize to be zero (0).
Line 261 will call crossCorr which will then have a zero size of either
blocksize.width or blocksize.height resulting in a division by zero
crach in lines 137 or 138.

Note: sorry for closing and reopening a pull request, but this is a bug which also affects 2.4 so it is better to apply it there.