An indexing method for two-d pattern matching with applications to digital image searches

  • Authors:
  • Fei Shi;Ahmad AlShibli

  • Affiliations:
  • Computer Science Department, Suffolk University, Boston, MA;Computer Science Department, Suffolk University, Boston, MA

  • Venue:
  • APWeb'05 Proceedings of the 7th Asia-Pacific web conference on Web Technologies Research and Development
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

The two-dimensional pattern matching problem is to find all occurrences of a two-dimensional m × m matrix P (called the pattern) in another (larger) two-dimensional n × n matrix T (called the text). Most known algorithms for the problem first pre-process the pattern or patterns to make subsequent searches fast. Since each search still takes time proportional to the size of the text, such algorithms are inappropriate in applications in which the text is large and fixed and one will search for many different patterns in the text. We propose an algorithm that first processes the text into an index structure in such a way that subsequent searches with different patterns can be performed very quickly. The construction of the index takes O(n2log n) time and O(n2) space. The algorithm may produce false matches, in which the algorithm claims a “match” between P and some submatrix of T while they are actually not equal. However, as will be seen, the probability that a false match can occur is negligible. All occurrences of P in T, probably with a few false matches, can be found in O(m2) time in the worst case, regardless of the distribution of the elements in T and P. Under the assumption that both T and P are random matrices, the algorithm can find all (correct) occurrences of P in T in O(m + log n) expected time. We applied our algorithm to a digital image search problem and we will present experimental results.