A Fast Algorithm for Template Matching

  • A. Kohandani
  • O. Basir
  • M. Kamel
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4142)


This paper presents a template matching technique to identify the location and orientation of an object by a fast algorithm. The fundamental principle in template matching is to minimize a potential energy function, which is a quantitative representation of the ’closeness’ of a defined object (template) relative to a portion of an image. However, the computation of potential energy suffers a major drawback in efficiency. A significant amount of the processing time is dedicated to match the information from the template to the image. This work proposes an alternative way to match the template and the image that reduces the number of operations from O(nm) to O(n) in calculating the potential energy of a template and an image that have n and m number of edge pixels, respectively. This work illustrates this approach by template edge matching which uses the edge information to perform the template matching. The experimental results show that while the proposed method produces a slightly larger error in the resulting template location, the processing time is decreased by a factor of 4.8 on average.


Template Match Edge Point Potential Energy Function Edge Pixel Deformable Template 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Jain, A.K., Zhong, Y., Dubuisson-Jolly, M.-P.: Deformable Template Models: A Review. Signal Processing 71(2), 109–129 (1998)MATHCrossRefGoogle Scholar
  2. 2.
    Jain, A.K., Zhong, Y., Lakshmanan, S.: Object Matching Using Deformable Templates. IEEE transactions on pattern analysis and machine intelligence 18(3), 267–278 (1996)CrossRefGoogle Scholar
  3. 3.
    Gavrila, D.M.: Multi-feature Hierarchical Template Matching Using Distance Transforms. In: Proc. of the International Conference on Pattern Recognition, pp. 439–444. Brisbane (1998)Google Scholar
  4. 4.
    Ford, G.E., Paglieroni, D.W., Tsujimoto, E.M.: The position-orientation masking approach to parametric search for template matching. IEEE Transactions on Pattern Analysis and Machine Intelligence 16(7), 740–747 (1994)CrossRefGoogle Scholar
  5. 5.
    Huttenlocher, D.: Monte carlo comparison of distance transform based matching measures. In: ARPA Image Understanding Workshop, pp. 1179–1183 (1997)Google Scholar
  6. 6.
    Huttenlocher, D., Klanderman, G., Rucklidge, W.J.: Comparing images using the hausdorff distance. IEEE Transactions on Pattern Analysis and Machine Intelligence 15(9), 850–863 (1993)CrossRefGoogle Scholar
  7. 7.
    Rucklidge, W.: Locating objects using the hausdorf distance. In: International Conference on Computer Vision, pp. 457–464 (1995)Google Scholar
  8. 8.
    Gastaldo, P., Zunino, R.: Hausdorff distance for target detection. In: IEEE International Symposium on Circuits and Systems, vol. 5(26-29), pp. 661–664 (2002)Google Scholar
  9. 9.
    Hutterlocher, D.P., Klanderman, G.A., Rucklidge, W.J.: Comparing images using the Hausdorff Distance. IEEE Transactions on Pattern Analysis and Machine Intelligence 15(9), 850–863 (1993)CrossRefGoogle Scholar
  10. 10.
    Lalonde, M., Beaulieu, M., Gagnon, L.: Fast and robust optic disc detection using pyramidal decomposition and Hausdorff-based template matching. IEEE Transactions on Medical Imaging 20(11), 1193–1200 (2001)CrossRefGoogle Scholar
  11. 11.
    Brown, L.G.: A survey of image registration techniques. ACM Computing Surveys 24(4), 325–376 (1992)CrossRefGoogle Scholar
  12. 12.
    Schonfeld, D.: On the relation of order-statistics filters and template matching: optimal morphological pattern recognition. IEEE Transactions on Image Processing 9(5), 945–949 (2000)CrossRefGoogle Scholar
  13. 13.
    Darrell, T., Essa, I.A., Pentland, A.P.: Task-Specific Gesture Analysis in Real-Time Using Interpolated Views. IEEE Transactions on Pattern Analysis and Machine Intelligence 18(12), 1236–1242 (1996)CrossRefGoogle Scholar
  14. 14.
    Brunelli, R., Poggio, T.: Template Matching: Matched Spatial Filter and Beyond, A.I. Memo 1549, Massachusetts Inst. of Technology (1995)Google Scholar
  15. 15.
    Fredriksson, K., Ukkonen, E.: Faster template matching without FFT. In: International Conference on Image Processing, vol. 1(7–10), pp. 678–681 (2001)Google Scholar
  16. 16.
    Olson, C.F.: Maximum-likelihood image matching. IEEE Transactions on Pattern Analysis and Machine Intelligence 24(6), 853–857 (2002)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Wang, X.W., Wang, Z., Sun, J.T., Zhang, H.M.: The correlation template matching algorithm based TD filter and ESO filter. In: International Conference on Machine Learning and Cybernetics, vol. 9(18-21), pp. 5361–5365 (2005)Google Scholar
  18. 18.
    Farag, A., El-Baz, A., Gimelfarb, G., Falk, R.: Detection and recognition of lung nodules in spiral CT images using deformable templates and Bayesian post-classification. In: International Conference on Image Processing, vol. 5(24-27), pp. 2921–2924 (2004)Google Scholar
  19. 19.
    Farag, A.A., El-Baz, A., Gimelfarb, G., Falk, R.: Detection and recognition of lung abnormalities using deformable templates. In: International Conference on Pattern Recognition, vol. 3(23-26), pp. 738–741 (2004)Google Scholar
  20. 20.
    Huggins, J.E., Levine, S.P., Fessler, J.A., Sowers, W.M., Pfurtscheller, G., Graimann, B., Scholegl, A., Minecan, D.N., Kushwaha, R.K., BeMent, S.L., Sagher, O., Schuh, L.A.: Electrocorticogram as the basis for a direct brain interface: Opportunities for improved detection accuracy. In: First International IEEE EMBS Conference on Neural Engineering, vol. 20-22, pp. 587–590 (2003)Google Scholar
  21. 21.
    Kim, S.H., Tizhoosh, H.R., Kamel, M.: Choquet integral-based aggregation of image template matching algoritms. In: 22nd International Conference of the North American Fuzzy Information Processing Society, vol. 24-26, pp. 143–148 (2003)Google Scholar
  22. 22.
    Amir, A., Butman, A., Crochemore, M., Landau, G.M., Schaps, M.: Two-dimensional pattern matching with rotations. In: Baeza-Yates, R., Chávez, E., Crochemore, M. (eds.) CPM 2003. LNCS, vol. 2676, pp. 17–31. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  23. 23.
    Fredriksson, K., Ukkonen, E.: Combinatorial methods for approximate image matching under translations and rotations. Patt. Rec. Lett. 20(11-13), 1249–1258 (1999)CrossRefGoogle Scholar
  24. 24.
    Torczon, V., Lewis, M., Trosset, M.: Direct Search Methods: Then and now. Journal of computational and applied Mathematics 124(1-2), 191–207 (2000)MATHMathSciNetCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • A. Kohandani
    • 1
  • O. Basir
    • 2
  • M. Kamel
    • 2
  1. 1.Department of Systems Design EngineeringUniversity of WaterlooWaterlooCanada
  2. 2.Department of Electrical and Computer EngineeringUniversity of WaterlooWaterlooCanada

Personalised recommendations