The figure shows an irregular pattern $P$. It fits in a $3\times 3$ box and has 2 occurrences in $T$, one of them is shown.
Let $P$ be a given (potentially) irregular two-dimensional (2D) pattern. By irregular is meant that $P$ is not necessarily a rectangle, it can be of any shape. The aim is to find all occurrences of $P$ in a 2D $n\times n'$ text $T$ of total size $N=n n'$.