5. The method of claim 3 , wherein the computing of the affinity matrix includes: increasing sparseness of the affinity matrix by setting a representation of a vector distance to zero based on the representation falling below a minimum threshold value.
3. The method of claim 2 , wherein the computing of the affinity matrix includes: calculating a feature vector of an image that depicts the visual pattern; calculating vector distances between the visual pattern and other visual patterns in the reference set based on the feature vector; and including representations of the vector distances in the affinity matrix as quantifiers of similarity between the visual pattern and the other visual patterns.