[Digikam-devel] Reusing the "fuzzy search" algorithm

Henry de Valence hdevalence at gmail.com
Wed Jan 14 22:12:40 GMT 2009


Note: this is only tangentially related to Digikam, but it was suggested that 
I send a mail here, so feel free to stop reading if you're not interested.

Basically I'm working on a program which is mostly inspired by the blog post 
here: http://tinyurl.com/5rm8af which basically builds representations of an 
image using coloured polygons. But I wanted to make my own that used a real 
genetic algorithm.

Anyways, I need a way to determine how close the images that are created by 
painting coloured polygons are to the original image, in order to be able to 
select and crossover the "best" patterns of polygons. Right now I basically 
convert the coordinates to Y-I-Q colour space and then use the Pythagorean 
theorem to find the distance and add up the total, but I want a better way, 
like how Digikam's fuzzy search works. So, I'm wondering if it would be 
possible to reuse Digikam's implementation of the search in my program (which 
would be Free software of course).

However I looked at the paper and though I don't fully understand a lot of the 
math (I am only in highschool right now, not at a university, so I hope it's 
forgivable), I noticed some things that might cause problems: e.g. the 
algorithm in the paper is optimised for matching an ill-defined query image to  
well-defined target images, whereas I have a well-defined query image [1] and 
I'm trying to rank a series of ill-defined targets (like [2]). Also, I don't 
really need to store a searchable index of the images since I am only using 
the computed value once. 

Would it be possible to adapt the Digikam implementation to my needs or would 
I be better off to attempt to reimplement a modified version of the algorithm in 
the paper (e.g. drop the condition in section 2.3 "we only consider terms in 
which the query has a non-zero wavelet coefficient ~Q[i,j]. A potential benefit 
(…) however it does not allow a detailed query to match a target that does not 
contain that same detail" ) ?

Henry de Valence

[1] Source image: http://imagebin.ca/view/3JL760.html
[2] After 229 generations: http://imagebin.ca/view/3fKx7IT.html



More information about the Digikam-devel mailing list