Given two bitmap images (two arbitrarily sized two-dimensional matrices of integer values ranging from 0 to some maximum number), I want to determine their maximum overlaps.
An overlap is a relative positioning of the images (a translation of the second image) producing a nonempty intersection on which both images are the same.
For instance, the images $\left\langle \begin{bmatrix}0 & 1\\0 & 1\end{bmatrix}, \begin{bmatrix}1 & 1\\1 & 1\end{bmatrix} \right\rangle$ have overlaps $\{ (1,-1), (1,0), (1,1) \}$, with intersection sizes $1,2,1$, respectively, so only $(1,0)$ is maximal.
It seems to me we can create a fast algorithm based on generalizing suffix trees to "subimage trees", built with a floodfill algorithm.
Is this a viable approach? Is it better than alternatives?
Is this problem discussed in the literature? What is its time complexity?
(My apologies for asking several related questions at once.)