Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
4Activity
0 of .
Results for:
No results containing your search query
P. 1
Template Matching based on SAD and Pyramid

Template Matching based on SAD and Pyramid

Ratings: (0)|Views: 494|Likes:
Published by ijcsis
Template matching is one of the important topic in pattern recognition, and it is used in many applications related to computer vision and image processing. In this paper, we propose a fast pattern matching algorithm namely SADP based on sum of absolute difference (SAD) as a measure of similarity and pyramid structure. First SADP apply pyramid concept to obtain a number of levels of original and template image. Secondly, SAD measure is applied for each level of image from bottom to up to obtain the correct match in the original image. In comparison to
some template matching algorithms, the SADP is computationally inexpensive and more robust against noise. The experimental results showed that the proposed algorithm was efficient and faster than the conventional image template matching algorithms and more robust in some real intervals.
Template matching is one of the important topic in pattern recognition, and it is used in many applications related to computer vision and image processing. In this paper, we propose a fast pattern matching algorithm namely SADP based on sum of absolute difference (SAD) as a measure of similarity and pyramid structure. First SADP apply pyramid concept to obtain a number of levels of original and template image. Secondly, SAD measure is applied for each level of image from bottom to up to obtain the correct match in the original image. In comparison to
some template matching algorithms, the SADP is computationally inexpensive and more robust against noise. The experimental results showed that the proposed algorithm was efficient and faster than the conventional image template matching algorithms and more robust in some real intervals.

More info:

Published by: ijcsis on May 17, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/13/2013

pdf

text

original

 
1
Template Matching based on SAD and Pyramid
Y. M. FoudaCollege of Computer Science and Information TechnologyKing Faisal UniversityAl-Ahsa, Saudi Arabiayfoudah@kfu.edu.saAbstract:
Template matching is one of the importanttopic in pattern recognition, and it is used in manyapplications related to computer vision and imageprocessing. In this paper, we propose a fast patternmatching algorithm namely SADP based on sum of absolute difference (SAD) as a measure of similarityand pyramid structure. First SADP apply pyramidconcept to obtain a number of levels of original andtemplate image. Secondly, SAD measure is applied foreach level of image from bottom to up to obtain thecorrect match in the original image. In comparison tosome template matching algorithms, the SADP iscomputationally inexpensive and more robust againstnoise. The experimental results showed that theproposed algorithm was efficient and faster than theconventional image template matching algorithms andmore robust in some real intervals.
Keywords
: Template matching, SAD, image pyramid.
1.
 
Introduction
Template matching is a technique in digitalimage processing for finding the position of subimage inside a large image. The subimage iscalled the template and the large image is called thesource image. The template matching processinvolves shifting the template over the source imageand computing the similarity between the templateand the window in the source area over which thetemplate lies. The next step is determining the shift position where the largest similarity measure isobtainable. This is the position in the source imagewhere the template is most likely to be located [1].Template matching is used in manyapplications, such as object recognition, computer vision, video compression, and feature tracking. For some applications, such as the block motionestimation in video compression and disparity mapsfor stereo images, sum of absolute difference (SAD),and the sum of squared differences (SSD) measureshave been widely used. For practical applications, anumber of approximate block matching methodshave been proposed [2]-[4] and some optimal block matching solutions have been proposed [5]-[7],which have the same solution as that of full search but with fewer operations by using the earlytermination in the computation of SAD.Major similarity measures which are used intemplate matching are SAD, SSD, and thenormalized cross correlation (NCC). SAD and SSDas a measures are computationally fast, andalgorithms are available which make the templatesearch process even faster [8]. Computing similarity by NCC measure is more accurate [1], but iscomputationally slow. From a maximum likelihood perspective, it is well known the SSD is justifiedwhen the additive noise distribution is Gaussian.Meanwhile, The SAD measure is justified when theadditive noise distribution is exponential [9]. Thecommon assumption is that the real noise distributionshould fit either the Gaussian or the Exponential.A variety of template matching algorithmshave been developed based on SAD and SSDmeasures. Essannouni, et al [10] proposed a fastfrequency algorithm to speed up the process of SADmatching. They used an approach to approximate theSAD metric by cosine series which can be expressedin correlation terms. Hel-Or and Hel-Or [11] proposed a fast template matching method based onaccumulating the distortion on the Walsh-Hadamarddomain in the order of the associated frequency usingSSD. Chen et al [12] proposed a fast block matchingalgorithm based on the winner-update strategy usingSAD measure, which can significantly reduce thecomputation and guarantee to find the optimalsolution.
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 10, No. 4, April 201211http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
2
In addition to SAD and SSD, NCC is also popular similarity measure. NCC measure is morerobust than SAD and SSD under uniformillumination changes, so the NCC measure has beenwidely used in object recognition and industrialinspection. The correlation-like approach is very popular for image registration [13]. The traditional NCC needs to compute the numerator anddenominator, which is very time-consuming. Lewis[14] employed the sum table scheme to reduce thecomputation in the denominator. After building thesum table for the source image, the block squaredintensity sum for a candidate at the position (x,y) inthe source image can be calculated very efficientlywith four simple operations. Although the sum tablescheme can reduce the computation of thedenominator in NCC, it is strongly demanded tosimplify the computation involved in the numerator of NCC. Shou and Shang-Hong [15] proposed a fast pattern matching algorithm based on NCC criterion by combining adaptive multilevel partition with thewinner update scheme to achieve very efficientsearch. This winner update scheme is applied inconjunction with an upper bound for the crosscorrelation derived from Cauchy-Schwarz inequality.Maclean and Tsotsos [16] introduced a techniques for fast pattern recognition using normalized grey-scalecorrelation (NCC). While NCC has traditionally beenslow due to computational intensity issues, theyintroduced both a pyramid structure and localestimate of the correlation surface gradient allows for recognition in 10-50 ms using modest microcomputer hardware. They proved that the execution time of your technique was faster than NCC technique.In this paper, we introduce a fast templatematching technique. In this technique we use the pyramid structure through compressing both sourceimage and template image a predefined number of levels. Then the SAD measure is applied for eachlevel to obtain the approximate value for the correctmatch. Finally, we can reach the correct match for template in the source. The rest of the paper isstructured as follows. Section 2 provides details of the proposed schemes. Section 3 describes theexperimental investigations, and the overallconclusions are presented in Section 4.
2. The proposed method
In this section we introduce the problemformulation and some basic solutions to solve that problem. Also we introduce the image pyramidconcept which is used in the proposed methodfollowed by description of our proposed method.
2.1 Problem formulation
The simple definition of template image isthe following:
Given a source image S and a templateimage T ,figure (1), where the dimension of S areboth larger than T, output whether S contains a subset image I where I and T are suitably similar in pattern and if such I exists, output the location of I inS. The location of I in S, will be referred to as thelocation of the closest match, and will be defined asthe pixel index of the top-left corner of I in S.
 For the actual implementation of anytemplate matching algorithm, there are two basicsteps: the model registration step, and the searchingstep. During model registration, the template image isstored in memory and any required preprocessing isdone prior to any searching. In the search step, thesearch image is inputted, the template pattern issearch, and the resulting values are outputted. Theexecution time for a template search excludes theexecution time for model registration.
(a)
 
(b)Figure (1) Cat image: (a) Source image containing the template pattern (b) Template image
NCC-Algorithm
The NCC computes the likeliness of a match by performing a discrete 2-D correlation of thetemplate image matrix at every possible location inthe source image matrix. Let S(x,y) denote theintensity value of the source image of the size p×q atthe point (x,y). The pattern is represented by a giventemplate T of the size m×n. A common way tocalculate the position (i
 pos
, j
 pos
) of the pattern in theimage S is to evaluate the normalized crosscorrelation value λ(i,j) at each point (i,j) for S and thetemplate T, which has been shifted by i steps in the xdirection and by j steps in the y direction. Equation(1) gives a basic definition for the normalized crosscorrelation coefficient.
,= +, + ̅ ,,
,,
  +, + ̅ ,
,
,,,,
,
 
0 ≤  <,0 ≤  <  − 
(1)
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 10, No. 4, April 201212http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
3
Where,
 ̅ ,=
×
+, +
,,
 
(2)
 And,
=
×
,
,.
 
(3)
 (i
 pos
, j
 pos
) be such that λ(i
 pos
, j
 pos
) is the highestobtained correlation coefficient (maximum possiblevalue for λ(i
 pos
, j
 pos
) is 1). Return (i
 pos
, j
 pos
) as the“closest match” in S.
SAD-Algorithm
Sum of absolute difference (SAD) is asimple algorithm for measuring the similarity between template image T and subimages in sourceimage S. It works by taking the absolute difference between each pixel in T and the corresponding pixelin the subimages being used for comparison in S.These differences are summed to create a simplemetric of similarity. Assume a 2-D m×n template,T(x,y) is to be matched within an source image S(x,y)of size p×q where (p>m and q>n). For each pixellocation (x,y) in the image, the SAD distance iscalculated as follows:SAD(x,y)=
|+, +−,|

 
(4)
 The smaller the distance measure SAD at particular location, the more similar is the local subimage foundis the searched template. If the distance SAD is zero,the local subimage is identical to the template.
2.2 Image pyramid
Image pyramid consists of sequence of copies of an original image in which both sampledensity and resolution are decreased in regular steps.The reduced resolution levels of the pyramid arethemselves obtained through an efficient iterativealgorithm. Consider, for example, the followingalgorithm which reduces the dimensions of the image by a factor of 
 f 
, a predefined positive integer, at eachlevel. Assume we start with an image
 I(x,y)
of dimension
w×h
, and let
 I 
(x,y)
be the image at the kthlevel of the pyramid (
 I 
0
= I 
). Each pixel in level k isthe average value of 
 f×f 
pixels at level (k-1), then for 
 f=2
the new image in the pyramid can be constructed by the following equation:
,=


2,2+

2+ 1,2+

2,2 +1+

2 +,2 +1
 
(5)
 An example of pyramid with 3 levels for sourceimage and template image are given in figure 2 andfigure 3 respectively.
Figure (2) Letter image: The pyramid representation for the sourceimage. The pyramid has three levels, with level 0 being theoriginal image (UP) and level 2 being the smallest (DOWN).Figure (2) Letter image: The pyramid representation for thetemplate image. The pyramid has three levels, with level 0 beingthe original image (left) and level 2 being the smallest (right).
2.3 Proposed method description
The proposed technique for locatingtemplate in source has two major components. Thefirst is a pyramid representation used for both thesource and template image. The second is using theSAD similarity measure. The method works asfollows. Creating the image pyramid for both the
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 10, No. 4, April 201213http://sites.google.com/site/ijcsis/ISSN 1947-5500

Activity (4)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Neeraj Arya liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->