Statistics for Self-Similarity of Images and Non-local Image Processing