As far as I understand expanding this to 2 and 3 dimensions is non trivial. Consider that video compression techniques perform this type of task. They try to find as large areas of similar color as possible. So you probably want to look into algortihms used for that. Also look in a book that has a lot of algorithm coverage of pattern matching. If the number of symbols is low then I believe there are a few useful techniques that are reasonably understandable. But unfortunately the book im thinking of isnt here. Sorry.
--- demerphq
my friends call me, usually because I'm late....