Get a representative vector from a large set, and compare it with samples We're a small team of programmers and we're trying to solve a little problem, but we think we need some advices from professional mathematicians.
We want to know if a picture of a card is an Identity Card or not, so we've implemented this algorithm (I've simplified a lot so we can be focused in the maths problems).


*

*Take a sample of a lot of Id Cards and make a color map of each one of them. This map is a 360 dimensional vector of decimal values (An array of 360 elements).  

*With the previous data, we calculate one representative vector. Actually, we make this representative vector calculating the arithmetic mean for each dimension.  

*We take the image that we want to identify, calculate the color map vector and compare it with the representative vector. (We're using the Pearson correlation coefficient)  

*If the coefficient is near 1, our image is an Id Card.  


We're obtaining reasonable results, but this are our questions:


*

*Are there any method better than the arithmetic mean to construct the representative vector?  

*Are there any method better than then Pearson correlation coefficient to compare both vectors?


Edited: Our plan is to have a representative vector of a lot of documents: IdCards, Driver licenses, passports, Residence cards, etc, and try to identify in wich category the card that we're comparing fits better.
Each dimension in the vector (that we call color map) represents the percentage of pixels of the image that have that color. The sum of all the values of the vector is allways 100%
The main reason because we're using Pearson it's because we thought that with it, the result is not affected by the number of pixels of the image, and the empiric results seems to confirms that fact. (we obtain the exactly the same results using percentages or simply using the count of colors) but we've to admit that we've a limited knowledge of statistics, so we could have take a wrong decision (in this decision, or in others).
 A: As you have described it, you have a problem which is extremely general. So general that almost every classification problem in machine learning can be expressed in this fashion. Your algorithm seems ok, but the field of machine learning isn't just that algorithm. Just about every single technique can also be applied to your problem. 
I think you should check whether the ID cards break up into clusters, say driver's licenses and company ID cards. Your current method essentially assumes that IDs form one spherically symmetric cluster about the average, but if the data naturally breaks up into 2 or more clusters then you could do better by checking membership in each cluster separately. If there are a few outliers, you might want to use a median instead of a mean.
It's not clear to me why you are using Pearson correlation instead of Euclidean distance. Perhaps it makes sense if you expect the inputs to be scaled by some brightness factor, and you want to assign the same likelihood value to brighter or darker versions of the same image. Either way, you can also scale the dimensions separately from each other, and I think a reasonable scaling would be by the standard deviation of the training set.
