- Open Access
- Total Downloads : 345
- Authors : Bhavika K. Desai, Manoj Pandya, Manish P. Patel, Dr. M. B. Potdar, Paru Thakkar
- Paper ID : IJERTV3IS051604
- Volume & Issue : Volume 03, Issue 05 (May 2014)
- Published (First Online): 28-05-2014
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License: This work is licensed under a Creative Commons Attribution 4.0 International License
Template Matching Technique using Enhanced SAD Technique
Bhavika K. Desai
M. E. Student
B. H. Gardi College Of Engineering. &
Technology-Rajkot Rajkot,Gujarat,India
DR. M. B. Potdar Project Director BISAG,
.
Gandhinagar. Gujarat, India
Manoj Pandya Project Manager BISAG,
Gandhinagar, Gujarat, India
Manish P. Patel
Assistant Professor
-
H. Gardi College Of Engineering. &
Technology-Rajkot Rajkot,Gujarat,India
Paru Thakkar Project Manager BISAG,
Gandhinagar, Gujarat, India
Abstract Translational template matching addresses the registration problem and has long been a problem of interest in such areas as video compression, robot vision, and biomedical engineering. Fast Fourier transforms (FFTs) have been called one of the ten most important algorithms of the twentieth century. Using some substitutions and complex arithmetic, computation of sum absolute difference derived is to be correlation functions of substituting functions. The former can be computed using the fast Fourier transform (FFT) approach, which is greatly less computationally expensive than the direct computation. The performance of the proposed methods, as well as some illustrative comparisons with other matching algorithms in the literature, is verified through simulations.
The NCC metric is always suffering to locate the face especially in the images with illumination variations. In this paper we proposed a fast template matching technique based on similarity measurement metrics namely: Enhanced Sum of Absolute Difference (E-SAD) to overcome the drawback of NCC. NCC is affected by illumination and clutter background problems because sometimes there are non-face blocks that have almost the same value of the average face template matrix. This problem can be solved by using Sum of Absolute Differences algorithm (SAD) which is widely used for image compressing and object tracking but still SAD needs more optimization to give more accurate positions for face in the input image. Moreover, SAD can give high localization rate for facial where the image is with high illumination variation but it may be affected by variation in background [4].
Keywords Convolution, Normalized Cross Correlation, Sum of Absolute Difference, Pattern Matching, Template Matching Fast Fourier Transform.
INTRODUCTION
Template matching is a common tool in many applications, including object recognition, video compression, stereo matching, and feature tracking. It has been used for video applications other than sequence coding such as motion compensated spatial temporal interpolation motion compensated enhancement. The SAD (sum of absolute differences) is another commonly used similarity metric. The algorithms which have been developed to speed up the process of sum of absolute difference (SAD) matching are designed
exclusively in the spatial domain. Although there are many approaches whose objective is to speed up the process of SAD matching, they can only give the position of the SAD minimum. When the distance SAD should be calculated for every location in the image, the direct SAD computation requires more much time. Authors have proposed to expedite this naive approach using the FFT transform while exploiting the Fourier correlation theorem [2].
-
METHADOLOGY
-
-
CONVOLUTION METHOD
Fig. 1 Template convolution process [5].
-
NORMALIZED CROSS CORRELATION (NCC)
Normalized cross correlation (NCC) has been commonly used as a metric to evaluate the degree of similarity (or dissimilarity) between two compared images. The position of a given image pattern in a two dimensional image I. Let I(x, y) denote the intensity value of the image I of the size M x N at the point (x, y), x {0,M-1}, y {0,N-1}. The pattern is represented by a given template T of P x Q. A common way to calculate the position (i, j) of the pattern in the image I is to evaluate the normalized cross correlation value at each point (i, j) for I and the template T, which has
been shifted by I steps in the x direction and by j steps in the y direction. Equation gives a basic definition for the normalized cross correlation coefficient [4].
M N
(i, j)
[I (x, y) (I (x, y))][T (x i, y i) (T )]i1 j1
M N M N
[I (x, y) (I (i, j))]i1 j1
[T (x i, y j) (T )]i1 j1
iP1 jQ1
I (x, y)
(1)
(I (x, y))
xi
y j
P Q
(2)
With similar notation µ(T) is the mean value of the template
T. The denominator in Equation (1) is the variance of the zero mean value image function I(x, y) – µ(I(x, y) and the shifted zero mean template function T(x-i, y-j) – µ(T). Due to this normalization, (i, j) is independent to changes in brightness to contrast of the image, which are related t the mean value and the standard deviation.
C. SUM OF ABSOLUTE DIFFERENCE (SAD) METHOD
Sum of absolute differences (SAD) is a widely used as simple algorithm for measuring the similarity between image blocks. It works by taking the absolute difference between each pixel in the original block and the corresponding pixel in the block being used for comparison. These differences are summed to create a simple metric of block similarity. The sum of absolute differences may be used for a variety of purposes, such as object recognition, the generation of disparity maps for stereo images, and motion estimation for video compression [3].
PROPOSED METHOD
The measure used in this paper is the sum of absolute value of differences one: we give a faster algorithm to perform the basic template matching computation for this measure using the frequency domain. In this paper, we propose to expedite this naive approach using the FFT transform while exploiting the Fourier correlation theorem.
Fig. 2 Proposed algorithm of Sum of Absolute Difference (SAD) using FFT
II EXPERIMENTAL RESULT
Fig. 3: Sample for the dataset of Image
TABLE 1 Re.sult of The Original Image Match With The Template Image
Image |
Template Image |
Normalized Cross Correlation (%) |
Convolution (%) |
Enhanced Sum of Absolute Difference (ESAD) (%) |
1 |
70.8560 |
63.2885 |
65.53 |
|
2 |
60.4207 |
73.6661 |
59.2465 |
|
3 |
36.7889 |
34.7366 |
44.2646 |
|
4 |
66.2081 |
66.6496 |
72.7173 |
|
5 |
59.3471 |
62.07 |
62.5865 |
|
6 |
82.6203 |
72.3577 |
78.9071 |
|
7 |
72.4517 |
78.8588 |
62.261 |
|
8 |
73.1622 |
68.2921 |
72.8487 |
|
9 |
66.7623 |
67.6781 |
69.2173 |
|
10 |
53.0195 |
53.702 |
60.979 |
|
11 |
57.1568 |
49.4729 |
71.8775 |
|
12 |
99.999 |
90.1407 |
100 |
|
53.6270 |
51.8441 |
68.4027 |
||
14 |
61.0301 |
63.5435 |
67.4977 |
|
15 |
69.4749 |
75.7408 |
68.8115 |
TABLE 2 Result of The Original Image Match with the Different Noise level
Image |
Template Image |
Normalized Cross Correlation (%) |
Convolution (%) |
Enhanced Sum of Absolute Differenc (ESAD) (%) |
1 |
Noise level 0.02 |
63.4500 |
48.9044 |
63.6862 |
2 |
54.1626 |
58.8944 |
57.2902 |
|
3 |
32.7851 |
40.5082 |
42.5719 |
|
4 |
61.8450 |
48.4054 |
70.9065 |
|
5 |
53.5855 |
33.4846 |
60.8617 |
|
6 |
75.3941 |
47.0841 |
76.7215 |
|
7 |
66.8403 |
56.936 |
60.6179 |
|
8 |
66.8001 |
40.2287 |
71.011 |
|
9 |
61.3848 |
45.2591 |
67.3781 |
|
10 |
47.3347 |
39.603 |
59.3413 |
|
11 |
53.4797 |
42.9207 |
69.7898 |
|
12 |
92.0831 |
45.0069 |
97.5308 |
|
13 |
49.0040 |
41.9301 |
66.4173 |
|
14 |
56.4253 |
41.5104 |
65.6663 |
|
15 |
63.6880 |
57.4282 |
66.8173 |
Blurring Image |
Normalized Cross Correlation (NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
1×1 |
100 |
87.7672 |
100 |
100 |
2×2 |
94.6881 |
39.2029 |
91.3869 |
94.4827 |
3×3 |
95.8576 |
39.0438 |
92.9623 |
94.8471 |
4×4 |
92.0206 |
39.5053 |
87.9713 |
91.5062 |
5×5 |
90.5066 |
39.7647 |
86.3542 |
90.2046 |
TABLE 3 Result of Blurring Template Image 1 with Original Image
Fig. 4: Chart of Template Image 1
Blurring Image |
Normalized Cross Correlation (NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Differen ce (SAD) |
1×1 |
100 |
57.638 |
100 |
100 |
2×2 |
96.879 |
57.648 |
91.914 |
94.6796 |
3×3 |
97.167 |
57.297 |
93.036 |
95.1000 |
4×4 |
95.005 |
57.293 |
88.671 |
92.0237 |
5×5 |
93.635 |
57.379 |
87.2 |
9.104 |
TABLE 4 Result of Blurring Template Image 2 with Original Image
Fig.5: Chart of Template Image 2
TABLE 5 Result of Blurring Template Image 3 with Original Image
Blurring Image |
Normali zed Cross Correlati on(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
1×1 |
100 |
60.829 |
100 |
100 |
2×2 |
95.903 |
61.225 |
90.975 |
94.5442 |
3×3 |
97.056 |
61.865 |
93.026 |
95.1021 |
4×4 |
94.29 |
62.593 |
88.21 |
92.0223 |
5×5 |
93.55 |
41.557 |
87.175 |
91.0373 |
Fig 6: Chart of Template Image 3
Blurring Image |
Normalized Cross Correlation(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
1×1 |
100 |
45.58 |
100 |
100 |
2×2 |
96.038 |
45.904 |
90.541 |
94.5529 |
3×3 |
97.407 |
45.596 |
92.417 |
95.449 |
4×4 |
93.848 |
45.407 |
87.73 |
92.4202 |
5×5 |
92.325 |
45.08 |
86.064 |
91.3023 |
TABLE 6 Result of Blurring Template Image 4 with Original Image
Fig 7: Chart of Template Image 4
TABLE 7 Result of Blurring Template Image 5 with Original Image
Fig 8: Chart of Template Image 5
The charts as shown in the above figure represent that by blurring image, the correlation of images reduces. The comparison among NCC, Convolution base and ESAD show that the correlation accuracy drastically reduces with respect to blurred images. Correlation for convolution remains almost constant and correlation for ESAD varies with blurred image. Hence E-SAD works properly for the images having less accuracy.
TABLE 8 Result of Noise Level Template Image 1 with Original Image
Noise level |
Normalized Cross Correlation(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
0 |
100 |
38.693 |
100 |
100 |
0.2 |
56.148 |
33.89 |
74.317 |
86.1113 |
0.4 |
36.41 |
32.359 |
49.214 |
71.161 |
0.6 |
21.3 |
28.226 |
24.03 |
58.1798 |
0.8 |
10.914 |
25.838 |
0 |
43.9358 |
1 |
3.9639 |
23.781 |
0 |
28.9442 |
Blurring Image |
Normalized Cross Correlation(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
1×1 |
100 |
46.87 |
100 |
100 |
2×2 |
90.604 |
46.827 |
91.607 |
95.2079 |
3×3 |
93.736 |
47.909 |
93.498 |
95.5471 |
4×4 |
86.811 |
48.075 |
88.732 |
92.7087 |
5×5 |
85.183 |
48.115 |
87.769 |
91.5948 |
Fig. 9: Chart of the Template Image 1 for different noise level
TABLE 9 Result of Noise Level Template Image 2 with Original Image
Noise level |
Normalized Cross Correlation(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
0 |
100 |
85.053 |
100 |
100 |
0.2 |
61.126 |
40.768 |
74.6 |
88.9685 |
0.4 |
36.524 |
36.965 |
47.778 |
77.0338 |
0.6 |
22.892 |
34.046 |
22.731 |
67.2171 |
0.8 |
11.849 |
30.906 |
0 |
53.8542 |
1 |
5.0795 |
28.545 |
0 |
43.3508 |
Noise level |
Normalized Cross Correlation( NCC) |
Convolutio n |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Differenc e (SAD) |
0 |
100 |
45.58 |
100 |
100 |
0.2 |
63.275 |
31.418 |
75.035 |
88.5779 |
0.4 |
38.981 |
26.959 |
48.722 |
97.9062 |
0.6 |
21.246 |
18.394 |
22.698 |
64.2587 |
0.8 |
10.159 |
24.096 |
0 |
52.9165 |
1 |
4.3442 |
18.138 |
0 |
42.9787 |
Fig. 10: Chart of the Template Image 2 for different noise level TABLE 10 Result of Noise Level Template Image 4 with Original Image
Fig. 11: Chart of the Template Image 3 for different noise level
TABLE 11 Result of Noise Level Template Image 4 with Original Image
Noise level |
Normalized Cross Correlation(NCC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
0 |
100 |
46.724 |
100 |
100 |
0.2 |
45.281 |
33.026 |
73.812 |
85.7656 |
0.4 |
27.412 |
31.138 |
48.541 |
70.3246 |
0.6 |
14.113 |
29.537 |
24.976 |
56.8212 |
0.8 |
7.9375 |
21.993 |
0 |
41.0825 |
1 |
5.0512 |
17.952 |
0 |
27.4662 |
Fig. 12: Chart of the Template Image 4 for different noise level
TABLE 12 Result of Noise Level Template Image 4 with Original Image
Noise level |
Normalized Cross Correlation(N CC) |
Convolution |
Enhanced Sum of Absolute Difference (ESAD) |
Sum of Absolute Difference (SAD) |
0 |
100 |
34.0809 |
100 |
100 |
0.2 |
56.1212 |
26.9102 |
75.3673 |
88.045 |
0.4 |
33.3689 |
22.8653 |
49.4115 |
77.2869 |
0.6 |
18.9207 |
19.6579 |
22.9208 |
62.5998 |
0.8 |
9.145 |
20.8433 |
0 |
52.026 |
1 |
5.4637 |
18.2268 |
0 |
40.8365 |
Fig. 13: Chart of the Template Image 2 for different noise level
As shown in the above figure 9, 10, 11, 12 and 13, we can interpret that after adding the different level noise in Normalized Cross Correlation method and Convolution method, correlation value decreases gradually. While there is a drastic change in Enhance sum of absolute difference method while adding different noise levels. Hence variation in image helps to differentiate the objects from the template.
CONCLUSION
In this paper authors have proposed a modified enhanced SAD technique (E-SAD) to improve the performance of SAD. Enhanced SAD proved superiority compared with the other similarity measurements like NCC and Convolution based techniques. Maximum accuracy achieved by E-SAD is 97.5% with noise level 0.02. Template can be restored even from the blurred images. This technique is sensitive to noise.
ACKNOWLEDGMENT
Authors would like to thanks T. P. Singh, Director, Bhaskaracharya Institute for Space Applications & Geo- informatics (Gandhinagar) and B. H. Gardi College of Engineering & Technology-Rajkot for constant encouragement to our research work.
REFERENCES
-
]. F. Essannouni Æ R. Oulad Haj Thami Æ,D. Aboutajdine Æ A. Salam,
» Adjustable SAD matching algorithm using frequency domain in J Real-Time Image Proc (2007) 1:257265 DOI 10.1007/s11554-007- 0026-0.
-
Driss Aboutajdine and Fedwa Essannouni, Fast block matching algorithms using frequency Domain in LRIT, Laboratoire associ´e au CNRST, Facult´e des Sciences, Universit´e Mohamed V-Agdal, B.P. 1014 Rabat, Morocco.
-
Nadir Nourain Dawoud , Brahim Belhaouari Samir , Josefina Janier
,Fast Template Matching Method Based Optimized Sum of Absolute Difference Algorithm for Face Localization International Journal of Computer Applications (0975 8887) Volume 18 No.8, March 2011
-
C. Saravanan, M. Surender,Algorithm for Face Matching Using Normalized Cross- Correlation in. International Journal of Engineering and Advanced Technology (IJEAT) ISSN: 2249 8958, Volume- 2, Issue-4, April 2013.
-
Mark Nixon & Alberto Aguado,feature extraction & image processing,second edition.
-
Mikhail J. Atallah, Faster Image Template Matching in the Sum of the Absolute Value of Differences Measure in IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 10, NO. 4, APRIL 2001.