Photo mosaic, datastructure, process speed up?
-
Hello, Last couple days I have made a http://en.wikipedia.org/wiki/Photographic_mosaic. 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 of this square. II want to improve this process. - Iâm not comparing with only the mean of the square but Iâm going to dive it in to 3 x 3 so my vector changes from 3 to 27 dimensions. - Also I trying to figure out how to speed up the process. Now Iâm comparing all of the vectors with a linear search. I was told to look in to a KD tree but with 27 dimensions Iâm not sure it will be faster. Now I have 1000 pictures and Iâm looking for the 10 closest matches.
-
Answer:
This question sounds similar to Honestly, at your scale, anything you do should be relatively instantaneous. A KD tree is probably the "most correct" solution, however. I'm partially talking out of my butt here, but one other thing you might need to be concerned about is the "Curse of Dimensionality." As the number of dimensions increases, the probability of finding a match "close" to any query point in all dimensions exponentially decreases. While your method is likely to produce high quality results with a much (much, much, much) higher sample size.than the 1000 pictures you mention above, with only these many it will be rare for you to find the right picture for each of your 3x3 squares. In fact, I'd wager that you almost never find one that is a very close match. It could lead to better results if you instead subdivide your main image 3x3 additional times and merely search for matching whole images. Of course, this could cause you to repeat images, which might be a negative for you, but it will likely lead to a much more properly colored mosaic.
Michael Harris at Quora Visit the source
Related Q & A:
- How to create new process as its own parent process?Best solution by Stack Overflow
- What is the maximum speed of a boeing 747? (cruising speed?Best solution by Yahoo! Answers
- Does glossy photo paper use more ink than matte photo paper?Best solution by answers.yahoo.com
- How to place a photo besides another photo?Best solution by Yahoo! Answers
- Can I mosaic my guitar?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.