Cross Correlation Matrix
If you look around for "image patch self-similarity" there are some things that are along those lines, for example the work of Eli Shechtman and Michal Irani

http://www.wisdom.weizmann.ac.il/~vision/SelfSimilarities.html

or the Calvin research centre:

http://www.vision.ee.ethz.ch/~calvin/software.html

(see Global and Efficient Self-Similarity for Object Classification and Detection)