1 Replies - 3484 Views - Last Post: 13 November 2012 - 09:55 AM

#1 PHPeter  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 12-November 12

Photo mosaic, best data-structure

Posted 12 November 2012 - 11:47 AM

My goal is to make a photomosaic. I already have made a script which makes a photomosaic (PHP). But it very slow because of the linear search through all images. Iím trying to make this process much quicker.

At the moment the bottleneck is matching the best picture with a part of the main picture. For example: I have to search which 3 images are closest to the color 34.234.128. (RGB). So I determine the distance between this color and the mean color of all images.

Now Iím searching how to improve this process, this is the reason Iím here. Iíve got some questions and maybe you got some suggestions/answers.

ē What data-structure should I use and why? After searching online I found a solution called KD-tree. But Iím not sure this is the most efficient way. Maybe there are other methods more suited for my problem.
ē Which language should I use with this data-structure. And what sort of database do you guys suggest?

Is This A Good Question/Topic? 1
  • +

Replies To: Photo mosaic, best data-structure

#2 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1985
  • View blog
  • Posts: 4,119
  • Joined: 11-December 07

Re: Photo mosaic, best data-structure

Posted 13 November 2012 - 09:55 AM

Kd trees are great for this kind of thing. They are a bit like binary searches for multidimensional data. However, their performance degrades if you have too many dimensions. I think triangulations are better for high dimensions but. Don't think that's an issue for you.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1