Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I’m trying to make a photo mosaic web application. I split the main picture in to a number of squares. I split this square up in to 9 squares (See picture) Then I calculate the mean color (RGB) of the entire square and the mean color of the 9 little squares. So I will get the following vector.

Vector: Mean R; mean G; mean B; cell 1 R; cell 1 G; cell 1 B; cell 2 R; cell 2 G; cell 2 B; cell 3 R; cell 3 G; cell 3 B; cell 4 R; cell 4 G; cell 4 B; cell 5 R; cell 5 G; cell 5 B; cell 6 R; cell 6 G; cell 6 B; cell 7 R; cell 7 G; cell 7 B; cell 8 R; cell 8 G; cell 8 B; cell 9 R; cell 9 G; cell 9 B

This will all be number between 0 and 255. And the mean RGB is more important than the other elements.

I make the same vector for all pictures in my DB. So now I want to compare a square of the original too my DB and want to find the 10 closest pictures.

My question is how do I compare these vectors??

share|cite|improve this question
Maybe this helps: – Simon S Jan 3 '13 at 0:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.