Statistics for Document Image Coding and Clustering for Script Discrimination