A Template Analysis Methodology to Improve the Efficiency of Fast Matching Algorithms