Overview
Template matching slides a template over an image and scores each location with correlation or a distance measure.
Finds image regions that resemble a smaller template patch.
Compact metadata for implementation and discovery.
Template matching slides a template over an image and scores each location with correlation or a distance measure.
Quick facts
Runtime and memory behavior at a glance.
Best
O(pixels * template)
Average
O(pixels * template)
Worst
O(pixels * template)
Space
O(score map)
score = dot(patch, template) / (||patch|| * ||template||)Scores how closely a patch matches the template independent of scale.
Show the source image beside masks, filters, or motion vectors produced by the algorithm.
Template Matching should be used with the assumptions and tradeoffs of image Matching in mind.
What each reference supports for this entry.
Computer-vision textbook support for Template Matching's feature, matching, flow, or multiscale image-analysis workflow.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Template matching is commonly implemented as correlation or convolution over image windows.