Reducing the expected computational cost of template matching using run length representation

Abstract Template matching of two digital images, represented as arrays of pixels, is computationally expensive, because it requires a pixel-by-pixel comparison of the pixels in the image and in the template for every location in the image. In this paper we present an algorithm to reduce the computational cost of template matching by using run length representation of the image and the template. Using this technique we compare only locations in the image and the template where the total mismatch accumulation may change. This method works best for images and templates with long runs. In the paper we present the algorithm, discuss conditions for its being efficient, and show experimental results on both randomly generated and real images. We present some results in which using this method yields more than 20-fold speedup.

[1]  V AhoAlfred,et al.  Efficient string matching , 1975 .

[2]  Alfred V. Aho,et al.  Efficient string matching , 1975, Commun. ACM.

[3]  Azriel Rosenfeld,et al.  Two-Stage Template Matching , 1977, IEEE Transactions on Computers.

[4]  Gad M. Landau,et al.  Efficient string matching in the presence of errors , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[5]  Ernest L. Hall,et al.  Computer Image Processing and Recognition , 1980, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[6]  Azriel Rosenfeld,et al.  Digital Picture Processing , 1976 .

[7]  Robert S. Boyer,et al.  A fast string searching algorithm , 1977, CACM.

[8]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[9]  Thomas S. Huang Coding of Two-Tone Images , 1977, IEEE Trans. Commun..

[10]  Steven L. Tanimoto,et al.  Template matching in pyramids , 1981 .

[11]  Harvey F. Silverman,et al.  A Class of Algorithms for Fast Digital Image Registration , 1972, IEEE Transactions on Computers.