|
Hello, Last couple days I have made a photomosaic web application. I kept is pretty basic. I have a DB with pictures and their mean colors. I divide my main picture in to a set number of squares. I’ll calculate the mean of these squares and compare them to my DB, the closest match will be placed on this square. II want to improve this process.
Let’s say the number of pictures in my DB is always between 1000 & 2000. And I want to find the 15 closest matches. |
|
You should look at (approximate) nearest neghbour search algorithms. There are 2 main types of appraches: locality sensitive hashing and various kinds of metric trees (M-tree, KD-ree, spill tree, ball tree, ...). Apart from the links from the wikipedia page, there are implementations for python in scikit & for R on CRAN. However, if you only have <2000 vectors to search through in 27 dimesions, then linear search may be competitive as long as you precompute the 27dim vectors for the images. |