1. A method for identifying a pattern in an image, comprising the steps of normalizing the image to a binary matrix, generating a binary vector from the binary matrix, filtering the binary vector with a sparse matrix using a matrix vector multiplication to a feature vector, creating with the feature vector a density of probability for a predetermined list of models, selecting the model with the highest density of probability as the best model, and classifying the best model as the pattern of the input image, wherein the matrix vector multiplication determines the values of the feature vector by applying program steps which are the result of transforming the sparse matrix in program steps including conditions on the values of the binary vector.