csse463: image recognition day 25 today: introduction to object recognition: template matching...
DESCRIPTION
Template matching (Sonka, 6.4) Algorithm: Algorithm: Evaluate a match criterion at every image location (and size, reflection, and rotation, if those variations are expected) Evaluate a match criterion at every image location (and size, reflection, and rotation, if those variations are expected) A “match” is a local maximum of the criterion above a threshold A “match” is a local maximum of the criterion above a threshold Q1TRANSCRIPT
CSSE463: Image Recognition CSSE463: Image Recognition Day 25Day 25 Today: introduction to object recognition: Today: introduction to object recognition:
template matchingtemplate matching
Template matching: a simple method for object Template matching: a simple method for object detectiondetection
Questions?Questions?
Template matching (Sonka, 6.4)Template matching (Sonka, 6.4) Idea: you are looking for an exact match of Idea: you are looking for an exact match of
an object (described by a sub-image, a an object (described by a sub-image, a templatetemplate) in an image) in an image
Ideal world: it matches exactlyIdeal world: it matches exactly
Template matching (Sonka, 6.4)Template matching (Sonka, 6.4) Algorithm:Algorithm:
Evaluate a match Evaluate a match criterion at every image criterion at every image location (and size, location (and size, reflection, and rotation, if reflection, and rotation, if those variations are those variations are expected)expected)
A “match” is a local A “match” is a local maximum of the criterion maximum of the criterion above a thresholdabove a threshold
Q1
Template matching (Sonka, 6.4)Template matching (Sonka, 6.4)One match criterion:One match criterion:
Correlation between the template and the Correlation between the template and the image.image.
We are just using the template as a filter!We are just using the template as a filter!Simplistic implementationSimplistic implementationSmarter implementationSmarter implementation
CorrelationCorrelation Just the dot product between Just the dot product between
the template and a the template and a neighborhood in the image. neighborhood in the image.
Idea: high correlation when Idea: high correlation when the template matches.the template matches.
Demo Demo
CorrelationCorrelation Just the dot product between Just the dot product between
the template and a the template and a neighborhood in the image. neighborhood in the image.
Idea: high correlation when Idea: high correlation when the template matches. the template matches.
Problem: Problem: alwaysalways high high correlation when matching correlation when matching with a plain bright regionwith a plain bright region
Q2-3
CorrelationCorrelation Just the dot product between Just the dot product between
the template and a the template and a neighborhood in the image. neighborhood in the image.
Idea: high correlation when Idea: high correlation when the template matches. the template matches.
Problem: Problem: alwaysalways high high correlation when matching correlation when matching with a plain bright regionwith a plain bright region
Solution: Normalize the Solution: Normalize the template and each region by template and each region by subtracting each’s mean from subtracting each’s mean from itself itself before before taking dot producttaking dot product
Q4-5
Other matching algorithmsOther matching algorithmsChamfering (Hausdorff distance):Chamfering (Hausdorff distance):
http://www.cs.cornell.edu/~dph/hausdorff/hausdorff1.htmlhttp://www.cs.cornell.edu/~dph/hausdorff/hausdorff1.html
Springs and templates (Crandall and Springs and templates (Crandall and Huttenlocher)Huttenlocher) http://www.cs.cornell.edu/~dph/papers/cvpr07.pdfhttp://www.cs.cornell.edu/~dph/papers/cvpr07.pdf
Watershed segmentation (Sonka 6.3.4)Watershed segmentation (Sonka 6.3.4)