fixes for R2014b

Tested against 2014b and optimized progress window in templatematch
using texturemap.