SlideShare ist ein Scribd-Unternehmen logo
1 von 17
1. INTRODUCTION 
Template matching is a technique in computer vision used for finding a sub-image 
of a target image which matches a template image. This technique is 
widely used in object detection fields such as vehicle tracking, robotics , 
medical imaging, and manufacturing . 
The crucial point is to adopt an appropriate “measure” to quantify similarity 
or matching. However, this method also requires extensive computational 
cost since the matching process involves moving the template image to all 
possible positions in a larger target image and computing a numerical index 
that indicates how well the template matches the image in that position. This 
problem is thus considered as an optimization problem. 
A reasonable first step to approaching such a task is to define a measure or 
a cost measuring the“distance”or the“similarity”between the (known) 
reference patterns and the (unknown) test pattern, in order to perform the 
matching operation known as template matching. 
Pattern Recognition – TM Page | 2
2. Template Matching Types 
Template matching has been performed at the pixel level and also on higher 
level. 
A. Pixel Level Template Matching: 
Pixel templates come in four types: 
a) Total templates: Template is the same size as the input image. 
There is no rotation or translation invariance. 
b) Partial templates: Template is free from the background. Multiple 
matches are allowed. Partial matches may also be allowed. Care 
must be taken in this case -- an F template could easily match to 
an E. 
Template 
Image 
Pattern Recognition – TM Page | 3
c) Piece templates : Templates that match one feature of a figure. 
These templates break a pattern into its component segments so, 
for example, "A" can be broken down into "/", "" and "-". The 
order in which templates are compared to the scene is important: 
the largest templates must be tried first, since they contain the 
most information and may subsume smaller templates. 
d) Flexible templates: These templates can handle stretching, 
misorientation and other possible deviations. A good prototype of 
a known object is first obtained and represented parametrically. 
Pattern Recognition – TM Page | 4
B. High Level Template Matching 
A problem with pixel based is that although fairly cheap and simple to 
implement; rotation and translation is a problem, also images are rarely 
perfect suffering from blurring, stretched and other distortions and 
peppered with noise. 
High level template matching methods operate on an image that has 
typically been segmented into regions of interest. Regions can be described 
in terms of area, average intensity, rate of change of intensity, curvature and 
also compared -- bigger than, adjacent to, above, distance between. 
Templates are described in relationships between regions. Production rules 
and other linguistic representations have been used. Also statistical methods 
(relaxation based techniques) have been applied to perform the matching. 
a) Feature-based Matching: When the template image has strong 
features, a feature-based approach may be considered; the approach 
may prove further useful if the match in the search image might be 
transformed in some fashion. Since this approach does not consider 
the entirety of the template image, it can be more computationally 
efficient when working with source images of larger resolution. 
Pattern Recognition – TM Page | 5
b) Template-based Matching: For templates without strong features, or 
for when the bulk of the template image constitutes the matching 
image, a template-based approach may be effective. Template-based 
template matching may potentially require sampling of a large 
number of points, it is possible to reduce the number of sampling 
points by reducing the resolution of the search and template images 
by the same factor and performing the operation on the resultant 
downsized images (multi-resolution, or pyramid, image processing). 
 Image Pyramid 
Image Pyramid is a series of images, each image being a result of 
downsampling (scaling down, by the factor of two in this case) of the 
previous element. 
 Pyramid Processing 
 At each level of the pyramid, we will need appropriately downsampled 
picture of the reference template, i.e. both input image pyramid and 
template image pyramid (Pyramid Processing) should be computed. 
Pattern Recognition – TM Page | 6
 Grayscale-based Matching 
Although in some of the applications the orientation of the objects is 
uniform and fixed (as we have seen in the plug example), it is often the 
case that the objects that are to be detected appear rotated. In Template 
Matching algorithms the classic pyramid search is adapted to allow multi-angle 
matching, i.e. identification of rotated instances of the template. 
This is achieved by computing not just one template image pyramid, but a 
set of pyramids - one for each possible rotation of the template. During the 
pyramid search on the input image the algorithm identifies the 
pairs (template position, template orientation) rather than sole template 
positions. Similarly to the original schema, on each level of the search the 
algorithm verifies only those (position, orientation)pairs that scored well on 
the previous level (i.e. seemed to match the template in the image of lower 
resolution). 
The technique of pyramid matching together with multi-angle search 
constitute the Grayscale-based Template Matching method. 
Pattern Recognition – TM Page | 7
 Edge-based Matching 
Edge-based Matching enhances the previously discussed Grayscale-based 
Matching using one crucial observation - that the shape of any object is 
defined mainly by the shape of its edges. Therefore, instead of matching 
of the whole template, we could extract its edges and match only the 
nearby pixels, thus avoiding some unnecessary computations. In common 
applications the achieved speed-up is usually significant. 
3. Template Matching Measures 
Measure of match between two images is considered to be a metric that 
indicate the degree of similarity or dissimilarity between them. Unless it is 
specifically stated otherwise, this metric can be increasing or decreasing with 
degree of similarity. Where the metric is specifically stated to be a measure 
of mismatch, it is a quantity that is increasing with the degree of dissimilarity. 
Pattern Recognition – TM Page | 8
3.1 Measures of Match (similarity) 
1) MEASURES BASED ON OPTIMAL PATH SEARCHING TECHNIQUES 
Representation: Represent the template by a sequence of measurement 
vectors. 
Template: 
Test pattern: 
r(1), r(2),..., r(I ) 
t(1), t(2),..., t(J ) 
I  J 
 Form a grid with I points (template) in horizontal and J points (test) 
in vertical 
 Each point (i,j) of the grid measures the distance between r(i) and t(j) 
 Path: A path through the grid, from an initial node 
(i0, j0) to a final one (if, jf), is an ordered set of nodes 
(i0, j0), (i1, j1), (i2, j2) … (ik, jk) … (if, jf) 
 Each path is associated with a cost 
K  
1 
 
k k D d( i , j ) 
k  
0 
 
Where K is the number of nodes across the path 
Pattern Recognition – TM Page | 9
The optimal path (blue) is constructed by searching among all allowable 
paths. The optimal node correspondence, between the test and reference 
patterns, is unraveled by backtracking the optimal path. 
2) Euclidean Distance 
Let I be a gray level image and g be a gray-value template of size n X m. 
In this formula (r,c) denotes the top left corner of template g. 
3) The Edit Distance 
Deals with patterns that consist of sets of ordered symbols. For example,if 
these symbols are letters,then the patterns are words from a written text. 
Such problems arise in automatic editing and text retrieval applications. 
Other examples of symbol strings occur in structural pattern recognition. 
Once the symbols of a (test) pattern have been identified, for example, via a 
reading device, the task is to recognize the pattern, searching for the best 
match of it against a set of reference patterns. 
Pattern Recognition – TM Page | 10
■ Wrongly identified symbol (e.g.,“befuty” instead of “beauty”) 
■ Insertion error (e.g.,“bearuty”) 
■ Deletion error (e.g.,“beuty”) 
The similarity between two patterns is based on the “cost” associated with 
converting one pattern to the other. If the patterns are of the same length, 
then the cost is directly related to the number of symbols that have to be 
changed in one of them so that the other pattern results. 
The Edit distance between two string patterns A and B, denoted D(A, B), is 
defined as the minimum total number of changes C, insertions I ,and 
deletions R required to change pattern A into pattern B, 
D(A,B)  min[C( j)  I ( j)  
R( j)] 
j 
Where j runs over all possible variations of symbols, in order to convert A 
B. 
Computation of the Edit distance with (a) an insertion, (b) a change, (c) a 
deletion, and (d) an equality. 
Pattern Recognition – TM Page | 11
 Allowable predecessors and costs 
1. Diagonal transitions: 
t i r j 
0, if ( ) ( ) 
 
 
 
t i r j 
1, ( )  
( ) 
 
d i j i j 
( , 1, 1) 
   
2. Horizontal and vertical transitions: 
d(i, j i 1, j) 1 
d(i, j i, j 1) 1 
4) MEASURES BASED ON CORRELATIONS 
The major task here is to find whether a specific known reference pattern 
resides within a given block of data. Such problems arise in problems such as 
target detection, robot vision, video coding. There are two basic steps in 
such a procedure: 
 Step 1: Move the reference pattern to all possible positions within the 
block of data. For each position, compute the “similarity” between the 
reference pattern and the respective part of the block of data. 
Pattern Recognition – TM Page | 12
 Step 2: Compute the best matching value. 
  
N 
i i 
 
 
x x y y 
( ) 
   
 
 
 
1 
1 
N 
i 
2 2 
1 
0 
N 
    
 
x  x  y  
y 
i i 
 
 
0 
0 
i 
i 
cor 
  
x 
 
x  y  y x is the template gray level image 
2 2 
    
  i 
i Pattern Recognition – TM Page | 13 
 
 
 
 
 
 
 
   
1 
0 
1 
0 
1 
0 
) ( 
N 
i 
N 
i 
i 
N 
i i 
y y x x 
is the average grey level in the template image 
y is the source image section 
y is the average grey level in the source image 
N is the number of pixels in the section image 
(N= template image size = columns * rows) 
The value cor is between –1 and +1, 
with larger values representing a stronger relationship between the two images.
3.2 Measures of Mismatch (dissimilarity) 
These measures of match are based on the pixel-by-pixel intensity 
differences between the two images f and g. 
1) Root mean square distance (RMS): The RMS distance metric is a 
common measure of mismatch between two digital images. It is given 
by: 
2) Sum of absolute differences (SAD): compare the intensities of the 
pixels to handle translation problems on images, using template 
matching. 
A pixel in the search image with coordinates (xs, ys) has intensity Is(xs, ys) and 
a pixel in the template with coordinates (xt, yt) has intensity It(xt, yt ). Thus 
the absolute difference in the pixel intensities is defined as 
Diff(xs, ys, x t, y t) = | Is(xs, ys) – It(x t, y t) |. 
Pattern Recognition – TM Page | 14
4. Problems with template matching 
1) The template represents the object as we expect to find it in the image 
2) The object can indeed be scaled or rotated 
3) This technique requires a separate template for each scale and 
orientation 
4) Template matching become thus too expensive, especially for large 
templates 
5) Sensitive to: 
–noise 
–occlusions 
Pattern Recognition – TM Page | 15
5. Template Matching Applications: 
1) Template matching with various average face pyramid levels. 
2) 3D reconstruction. 
3) Motion detection. 
4) Object recognition. 
5) Panorama reconstruction. 
Pattern Recognition – TM Page | 16
Reference: 
1. G.s.cox,1995. “ template matching and measures of match in image 
processing”,July 12 . cape town university. 
2. https://www.adaptivevision.com/pl/dane_techniczne/dokumentacja 
/3.2/machine_vision_guide/TemplateMatching.html 
3. http://numerics.mathdotnet.com/docs/Distance.html 
4. http://www-cs-students. 
stanford.edu/~pdoyle/quail/notes/pdoyle/vision.html#Te 
mplate Matching 
5. http://en.wikipedia.org/wiki/Template_matching 
6. http://www.lira.dist.unige.it/teaching/SINA/slides-current/interest-points. 
pdf 
7. OpenCV 2.4.5.0 documentation.htm 
8. Jain. D, Tolga. H, and Meiyappan. S, “Face Detection using Template 
Matching”, , EE 368 – Digital Image Processing, Spring 2002-2003. 
Pattern Recognition – TM Page | 17

Weitere ähnliche Inhalte

Was ist angesagt?

Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perceptionDr INBAMALAR T M
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image FundamentalsA B Shinde
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compressionjeevithaelangovan
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptVikramBarapatre2
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processingVARUN KUMAR
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency DomainAmnaakhaan
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
 
Image representation
Image representationImage representation
Image representationRahul Dadwal
 

Was ist angesagt? (20)

Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perception
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
Image compression .
Image compression .Image compression .
Image compression .
 
Segmentation
SegmentationSegmentation
Segmentation
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compression
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).ppt
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Bit plane coding
Bit plane codingBit plane coding
Bit plane coding
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image representation
Image representationImage representation
Image representation
 

Andere mochten auch

Face detection using template matching
Face detection using template matchingFace detection using template matching
Face detection using template matchingBrijesh Borad
 
Face detection ppt by Batyrbek
Face detection ppt by Batyrbek Face detection ppt by Batyrbek
Face detection ppt by Batyrbek Batyrbek Ryskhan
 
Web Services-Enhanced Agile Modeling and Integrating Business Processes
Web Services-Enhanced Agile Modeling and Integrating Business ProcessesWeb Services-Enhanced Agile Modeling and Integrating Business Processes
Web Services-Enhanced Agile Modeling and Integrating Business ProcessesMustafa Salam
 
Template matching
Template matchingTemplate matching
Template matchingHasan Ijaz
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionzukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluationzukun
 
Perceptual image distortion
Perceptual image distortionPerceptual image distortion
Perceptual image distortionPatrick Teo
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-softwarezukun
 
organisation behavior perception distortion
organisation behavior perception distortionorganisation behavior perception distortion
organisation behavior perception distortion9911755928
 
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...Gurbinder Gill
 
Machine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityMachine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityPier Luca Lanzi
 
Introduction to Digital Image Correlation (DIC)
Introduction to Digital Image Correlation (DIC)Introduction to Digital Image Correlation (DIC)
Introduction to Digital Image Correlation (DIC)Instron
 
Digital Image Correlation Presentation
Digital Image Correlation PresentationDigital Image Correlation Presentation
Digital Image Correlation Presentationtrilionqualitysystems
 
Speech recognition system seminar
Speech recognition system seminarSpeech recognition system seminar
Speech recognition system seminarDiptimaya Sarangi
 
Speech Recognition Technology
Speech Recognition TechnologySpeech Recognition Technology
Speech Recognition TechnologySeminar Links
 
Speech recognition final presentation
Speech recognition final presentationSpeech recognition final presentation
Speech recognition final presentationhimanshubhatti
 
Correlation coefficient
Correlation coefficientCorrelation coefficient
Correlation coefficientCarlo Magno
 

Andere mochten auch (20)

Face detection using template matching
Face detection using template matchingFace detection using template matching
Face detection using template matching
 
Face detection ppt by Batyrbek
Face detection ppt by Batyrbek Face detection ppt by Batyrbek
Face detection ppt by Batyrbek
 
Web Services-Enhanced Agile Modeling and Integrating Business Processes
Web Services-Enhanced Agile Modeling and Integrating Business ProcessesWeb Services-Enhanced Agile Modeling and Integrating Business Processes
Web Services-Enhanced Agile Modeling and Integrating Business Processes
 
Template matching
Template matchingTemplate matching
Template matching
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
 
Pattern Recognition
Pattern RecognitionPattern Recognition
Pattern Recognition
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
Perceptual image distortion
Perceptual image distortionPerceptual image distortion
Perceptual image distortion
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
organisation behavior perception distortion
organisation behavior perception distortionorganisation behavior perception distortion
organisation behavior perception distortion
 
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
Efficient Variable Size Template Matching Using Fast Normalized Cross Correla...
 
Machine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityMachine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and Credibility
 
Introduction to Digital Image Correlation (DIC)
Introduction to Digital Image Correlation (DIC)Introduction to Digital Image Correlation (DIC)
Introduction to Digital Image Correlation (DIC)
 
Digital Image Correlation Presentation
Digital Image Correlation PresentationDigital Image Correlation Presentation
Digital Image Correlation Presentation
 
Computer vision
Computer visionComputer vision
Computer vision
 
Speech recognition system seminar
Speech recognition system seminarSpeech recognition system seminar
Speech recognition system seminar
 
Speech Recognition Technology
Speech Recognition TechnologySpeech Recognition Technology
Speech Recognition Technology
 
Speech recognition final presentation
Speech recognition final presentationSpeech recognition final presentation
Speech recognition final presentation
 
Research Paper On Correlation
Research Paper On CorrelationResearch Paper On Correlation
Research Paper On Correlation
 
Correlation coefficient
Correlation coefficientCorrelation coefficient
Correlation coefficient
 

Ähnlich wie Template Matching - Pattern Recognition

Gavrila_ICCV99.pdf
Gavrila_ICCV99.pdfGavrila_ICCV99.pdf
Gavrila_ICCV99.pdfDeepdeeper
 
Based on correlation coefficient in image matching
Based on correlation coefficient in image matchingBased on correlation coefficient in image matching
Based on correlation coefficient in image matchingIJRES Journal
 
One dimensional vector based pattern
One dimensional vector based patternOne dimensional vector based pattern
One dimensional vector based patternijcsit
 
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGES
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGESTEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGES
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGESIJCI JOURNAL
 
Recovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contextsRecovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contextswolf
 
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVALA COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVALcscpconf
 
A comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrievalA comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrievalcsandit
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Recognition as Graph Matching
  Recognition as Graph Matching  Recognition as Graph Matching
Recognition as Graph MatchingVishakha Agarwal
 
Object Elimination and Reconstruction Using an Effective Inpainting Method
Object Elimination and Reconstruction Using an Effective Inpainting MethodObject Elimination and Reconstruction Using an Effective Inpainting Method
Object Elimination and Reconstruction Using an Effective Inpainting MethodIOSR Journals
 
Exploiting Dissimilarity Representations for Person Re-Identification
Exploiting Dissimilarity Representations for Person Re-IdentificationExploiting Dissimilarity Representations for Person Re-Identification
Exploiting Dissimilarity Representations for Person Re-IdentificationRiccardo Satta
 
Learning from similarity and information extraction from structured documents...
Learning from similarity and information extraction from structured documents...Learning from similarity and information extraction from structured documents...
Learning from similarity and information extraction from structured documents...Infrrd
 
Surface Data Capture Image Matching
Surface Data Capture Image MatchingSurface Data Capture Image Matching
Surface Data Capture Image MatchingRASHID JAVED
 
clinic_poster_final_3
clinic_poster_final_3clinic_poster_final_3
clinic_poster_final_3Danny Taller
 
A Mat Lab built software application for similar image retrieval
A Mat Lab built software application for similar image retrievalA Mat Lab built software application for similar image retrieval
A Mat Lab built software application for similar image retrievalIOSR Journals
 
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로 모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로 r-kor
 

Ähnlich wie Template Matching - Pattern Recognition (20)

Gavrila_ICCV99.pdf
Gavrila_ICCV99.pdfGavrila_ICCV99.pdf
Gavrila_ICCV99.pdf
 
Based on correlation coefficient in image matching
Based on correlation coefficient in image matchingBased on correlation coefficient in image matching
Based on correlation coefficient in image matching
 
One dimensional vector based pattern
One dimensional vector based patternOne dimensional vector based pattern
One dimensional vector based pattern
 
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGES
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGESTEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGES
TEMPLATE MATCHING TECHNIQUE FOR SEARCHING WORDS IN DOCUMENT IMAGES
 
Pca analysis
Pca analysisPca analysis
Pca analysis
 
Recovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contextsRecovering 3D human body configurations using shape contexts
Recovering 3D human body configurations using shape contexts
 
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVALA COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
 
A comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrievalA comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrieval
 
20151130
2015113020151130
20151130
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
A04570106
A04570106A04570106
A04570106
 
Recognition as Graph Matching
  Recognition as Graph Matching  Recognition as Graph Matching
Recognition as Graph Matching
 
Object Elimination and Reconstruction Using an Effective Inpainting Method
Object Elimination and Reconstruction Using an Effective Inpainting MethodObject Elimination and Reconstruction Using an Effective Inpainting Method
Object Elimination and Reconstruction Using an Effective Inpainting Method
 
Mscs discussion
Mscs discussionMscs discussion
Mscs discussion
 
Exploiting Dissimilarity Representations for Person Re-Identification
Exploiting Dissimilarity Representations for Person Re-IdentificationExploiting Dissimilarity Representations for Person Re-Identification
Exploiting Dissimilarity Representations for Person Re-Identification
 
Learning from similarity and information extraction from structured documents...
Learning from similarity and information extraction from structured documents...Learning from similarity and information extraction from structured documents...
Learning from similarity and information extraction from structured documents...
 
Surface Data Capture Image Matching
Surface Data Capture Image MatchingSurface Data Capture Image Matching
Surface Data Capture Image Matching
 
clinic_poster_final_3
clinic_poster_final_3clinic_poster_final_3
clinic_poster_final_3
 
A Mat Lab built software application for similar image retrieval
A Mat Lab built software application for similar image retrievalA Mat Lab built software application for similar image retrieval
A Mat Lab built software application for similar image retrieval
 
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로 모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로
모듈형 패키지를 활용한 나만의 기계학습 모형 만들기 - 회귀나무모형을 중심으로
 

Mehr von Mustafa Salam

Switch-based Interconnection Networks 2
Switch-based Interconnection Networks 2Switch-based Interconnection Networks 2
Switch-based Interconnection Networks 2Mustafa Salam
 
Interconnection Networks 1
Interconnection Networks 1Interconnection Networks 1
Interconnection Networks 1Mustafa Salam
 
Arabic Handwritten Text Recognition and Writer Identification
Arabic Handwritten Text Recognition and Writer IdentificationArabic Handwritten Text Recognition and Writer Identification
Arabic Handwritten Text Recognition and Writer IdentificationMustafa Salam
 
The Burrows-Wheeler Algorithm
The Burrows-Wheeler AlgorithmThe Burrows-Wheeler Algorithm
The Burrows-Wheeler AlgorithmMustafa Salam
 
Link analysis .. Data Mining
Link analysis .. Data MiningLink analysis .. Data Mining
Link analysis .. Data MiningMustafa Salam
 
IP Addressing & subnetting strategy
IP Addressing & subnetting strategyIP Addressing & subnetting strategy
IP Addressing & subnetting strategyMustafa Salam
 
Cuckoo Search & Firefly Algorithms
Cuckoo Search & Firefly AlgorithmsCuckoo Search & Firefly Algorithms
Cuckoo Search & Firefly AlgorithmsMustafa Salam
 
Cloud technology (Mashup) + Case Study
Cloud technology (Mashup) + Case StudyCloud technology (Mashup) + Case Study
Cloud technology (Mashup) + Case StudyMustafa Salam
 

Mehr von Mustafa Salam (10)

Switch-based Interconnection Networks 2
Switch-based Interconnection Networks 2Switch-based Interconnection Networks 2
Switch-based Interconnection Networks 2
 
Interconnection Networks 1
Interconnection Networks 1Interconnection Networks 1
Interconnection Networks 1
 
Parallel Processing
Parallel ProcessingParallel Processing
Parallel Processing
 
Arabic Handwritten Text Recognition and Writer Identification
Arabic Handwritten Text Recognition and Writer IdentificationArabic Handwritten Text Recognition and Writer Identification
Arabic Handwritten Text Recognition and Writer Identification
 
The Burrows-Wheeler Algorithm
The Burrows-Wheeler AlgorithmThe Burrows-Wheeler Algorithm
The Burrows-Wheeler Algorithm
 
Link analysis .. Data Mining
Link analysis .. Data MiningLink analysis .. Data Mining
Link analysis .. Data Mining
 
IP Addressing & subnetting strategy
IP Addressing & subnetting strategyIP Addressing & subnetting strategy
IP Addressing & subnetting strategy
 
Cuckoo Search & Firefly Algorithms
Cuckoo Search & Firefly AlgorithmsCuckoo Search & Firefly Algorithms
Cuckoo Search & Firefly Algorithms
 
Cloud technology (Mashup) + Case Study
Cloud technology (Mashup) + Case StudyCloud technology (Mashup) + Case Study
Cloud technology (Mashup) + Case Study
 
Color Models
Color ModelsColor Models
Color Models
 

Kürzlich hochgeladen

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Kürzlich hochgeladen (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Template Matching - Pattern Recognition

  • 1.
  • 2. 1. INTRODUCTION Template matching is a technique in computer vision used for finding a sub-image of a target image which matches a template image. This technique is widely used in object detection fields such as vehicle tracking, robotics , medical imaging, and manufacturing . The crucial point is to adopt an appropriate “measure” to quantify similarity or matching. However, this method also requires extensive computational cost since the matching process involves moving the template image to all possible positions in a larger target image and computing a numerical index that indicates how well the template matches the image in that position. This problem is thus considered as an optimization problem. A reasonable first step to approaching such a task is to define a measure or a cost measuring the“distance”or the“similarity”between the (known) reference patterns and the (unknown) test pattern, in order to perform the matching operation known as template matching. Pattern Recognition – TM Page | 2
  • 3. 2. Template Matching Types Template matching has been performed at the pixel level and also on higher level. A. Pixel Level Template Matching: Pixel templates come in four types: a) Total templates: Template is the same size as the input image. There is no rotation or translation invariance. b) Partial templates: Template is free from the background. Multiple matches are allowed. Partial matches may also be allowed. Care must be taken in this case -- an F template could easily match to an E. Template Image Pattern Recognition – TM Page | 3
  • 4. c) Piece templates : Templates that match one feature of a figure. These templates break a pattern into its component segments so, for example, "A" can be broken down into "/", "" and "-". The order in which templates are compared to the scene is important: the largest templates must be tried first, since they contain the most information and may subsume smaller templates. d) Flexible templates: These templates can handle stretching, misorientation and other possible deviations. A good prototype of a known object is first obtained and represented parametrically. Pattern Recognition – TM Page | 4
  • 5. B. High Level Template Matching A problem with pixel based is that although fairly cheap and simple to implement; rotation and translation is a problem, also images are rarely perfect suffering from blurring, stretched and other distortions and peppered with noise. High level template matching methods operate on an image that has typically been segmented into regions of interest. Regions can be described in terms of area, average intensity, rate of change of intensity, curvature and also compared -- bigger than, adjacent to, above, distance between. Templates are described in relationships between regions. Production rules and other linguistic representations have been used. Also statistical methods (relaxation based techniques) have been applied to perform the matching. a) Feature-based Matching: When the template image has strong features, a feature-based approach may be considered; the approach may prove further useful if the match in the search image might be transformed in some fashion. Since this approach does not consider the entirety of the template image, it can be more computationally efficient when working with source images of larger resolution. Pattern Recognition – TM Page | 5
  • 6. b) Template-based Matching: For templates without strong features, or for when the bulk of the template image constitutes the matching image, a template-based approach may be effective. Template-based template matching may potentially require sampling of a large number of points, it is possible to reduce the number of sampling points by reducing the resolution of the search and template images by the same factor and performing the operation on the resultant downsized images (multi-resolution, or pyramid, image processing).  Image Pyramid Image Pyramid is a series of images, each image being a result of downsampling (scaling down, by the factor of two in this case) of the previous element.  Pyramid Processing  At each level of the pyramid, we will need appropriately downsampled picture of the reference template, i.e. both input image pyramid and template image pyramid (Pyramid Processing) should be computed. Pattern Recognition – TM Page | 6
  • 7.  Grayscale-based Matching Although in some of the applications the orientation of the objects is uniform and fixed (as we have seen in the plug example), it is often the case that the objects that are to be detected appear rotated. In Template Matching algorithms the classic pyramid search is adapted to allow multi-angle matching, i.e. identification of rotated instances of the template. This is achieved by computing not just one template image pyramid, but a set of pyramids - one for each possible rotation of the template. During the pyramid search on the input image the algorithm identifies the pairs (template position, template orientation) rather than sole template positions. Similarly to the original schema, on each level of the search the algorithm verifies only those (position, orientation)pairs that scored well on the previous level (i.e. seemed to match the template in the image of lower resolution). The technique of pyramid matching together with multi-angle search constitute the Grayscale-based Template Matching method. Pattern Recognition – TM Page | 7
  • 8.  Edge-based Matching Edge-based Matching enhances the previously discussed Grayscale-based Matching using one crucial observation - that the shape of any object is defined mainly by the shape of its edges. Therefore, instead of matching of the whole template, we could extract its edges and match only the nearby pixels, thus avoiding some unnecessary computations. In common applications the achieved speed-up is usually significant. 3. Template Matching Measures Measure of match between two images is considered to be a metric that indicate the degree of similarity or dissimilarity between them. Unless it is specifically stated otherwise, this metric can be increasing or decreasing with degree of similarity. Where the metric is specifically stated to be a measure of mismatch, it is a quantity that is increasing with the degree of dissimilarity. Pattern Recognition – TM Page | 8
  • 9. 3.1 Measures of Match (similarity) 1) MEASURES BASED ON OPTIMAL PATH SEARCHING TECHNIQUES Representation: Represent the template by a sequence of measurement vectors. Template: Test pattern: r(1), r(2),..., r(I ) t(1), t(2),..., t(J ) I  J  Form a grid with I points (template) in horizontal and J points (test) in vertical  Each point (i,j) of the grid measures the distance between r(i) and t(j)  Path: A path through the grid, from an initial node (i0, j0) to a final one (if, jf), is an ordered set of nodes (i0, j0), (i1, j1), (i2, j2) … (ik, jk) … (if, jf)  Each path is associated with a cost K  1  k k D d( i , j ) k  0  Where K is the number of nodes across the path Pattern Recognition – TM Page | 9
  • 10. The optimal path (blue) is constructed by searching among all allowable paths. The optimal node correspondence, between the test and reference patterns, is unraveled by backtracking the optimal path. 2) Euclidean Distance Let I be a gray level image and g be a gray-value template of size n X m. In this formula (r,c) denotes the top left corner of template g. 3) The Edit Distance Deals with patterns that consist of sets of ordered symbols. For example,if these symbols are letters,then the patterns are words from a written text. Such problems arise in automatic editing and text retrieval applications. Other examples of symbol strings occur in structural pattern recognition. Once the symbols of a (test) pattern have been identified, for example, via a reading device, the task is to recognize the pattern, searching for the best match of it against a set of reference patterns. Pattern Recognition – TM Page | 10
  • 11. ■ Wrongly identified symbol (e.g.,“befuty” instead of “beauty”) ■ Insertion error (e.g.,“bearuty”) ■ Deletion error (e.g.,“beuty”) The similarity between two patterns is based on the “cost” associated with converting one pattern to the other. If the patterns are of the same length, then the cost is directly related to the number of symbols that have to be changed in one of them so that the other pattern results. The Edit distance between two string patterns A and B, denoted D(A, B), is defined as the minimum total number of changes C, insertions I ,and deletions R required to change pattern A into pattern B, D(A,B)  min[C( j)  I ( j)  R( j)] j Where j runs over all possible variations of symbols, in order to convert A B. Computation of the Edit distance with (a) an insertion, (b) a change, (c) a deletion, and (d) an equality. Pattern Recognition – TM Page | 11
  • 12.  Allowable predecessors and costs 1. Diagonal transitions: t i r j 0, if ( ) ( )    t i r j 1, ( )  ( )  d i j i j ( , 1, 1)    2. Horizontal and vertical transitions: d(i, j i 1, j) 1 d(i, j i, j 1) 1 4) MEASURES BASED ON CORRELATIONS The major task here is to find whether a specific known reference pattern resides within a given block of data. Such problems arise in problems such as target detection, robot vision, video coding. There are two basic steps in such a procedure:  Step 1: Move the reference pattern to all possible positions within the block of data. For each position, compute the “similarity” between the reference pattern and the respective part of the block of data. Pattern Recognition – TM Page | 12
  • 13.  Step 2: Compute the best matching value.   N i i   x x y y ( )       1 1 N i 2 2 1 0 N      x  x  y  y i i   0 0 i i cor   x  x  y  y x is the template gray level image 2 2       i i Pattern Recognition – TM Page | 13           1 0 1 0 1 0 ) ( N i N i i N i i y y x x is the average grey level in the template image y is the source image section y is the average grey level in the source image N is the number of pixels in the section image (N= template image size = columns * rows) The value cor is between –1 and +1, with larger values representing a stronger relationship between the two images.
  • 14. 3.2 Measures of Mismatch (dissimilarity) These measures of match are based on the pixel-by-pixel intensity differences between the two images f and g. 1) Root mean square distance (RMS): The RMS distance metric is a common measure of mismatch between two digital images. It is given by: 2) Sum of absolute differences (SAD): compare the intensities of the pixels to handle translation problems on images, using template matching. A pixel in the search image with coordinates (xs, ys) has intensity Is(xs, ys) and a pixel in the template with coordinates (xt, yt) has intensity It(xt, yt ). Thus the absolute difference in the pixel intensities is defined as Diff(xs, ys, x t, y t) = | Is(xs, ys) – It(x t, y t) |. Pattern Recognition – TM Page | 14
  • 15. 4. Problems with template matching 1) The template represents the object as we expect to find it in the image 2) The object can indeed be scaled or rotated 3) This technique requires a separate template for each scale and orientation 4) Template matching become thus too expensive, especially for large templates 5) Sensitive to: –noise –occlusions Pattern Recognition – TM Page | 15
  • 16. 5. Template Matching Applications: 1) Template matching with various average face pyramid levels. 2) 3D reconstruction. 3) Motion detection. 4) Object recognition. 5) Panorama reconstruction. Pattern Recognition – TM Page | 16
  • 17. Reference: 1. G.s.cox,1995. “ template matching and measures of match in image processing”,July 12 . cape town university. 2. https://www.adaptivevision.com/pl/dane_techniczne/dokumentacja /3.2/machine_vision_guide/TemplateMatching.html 3. http://numerics.mathdotnet.com/docs/Distance.html 4. http://www-cs-students. stanford.edu/~pdoyle/quail/notes/pdoyle/vision.html#Te mplate Matching 5. http://en.wikipedia.org/wiki/Template_matching 6. http://www.lira.dist.unige.it/teaching/SINA/slides-current/interest-points. pdf 7. OpenCV 2.4.5.0 documentation.htm 8. Jain. D, Tolga. H, and Meiyappan. S, “Face Detection using Template Matching”, , EE 368 – Digital Image Processing, Spring 2002-2003. Pattern Recognition – TM Page | 17