G'evening Monks!
Alright, so my title is a bit misleading, my apologies. I've been reading the article
here on comparing images for similarities, deconstructing it, etc. Now, this script actually works pretty well for comparing images on my local filesystem. However, I'd like to grab the data from an image (whatever that data may be, a hash, etc), and find similar images in a database.
Now, from reading the article on Stonehenge, I would need to store the 48 vectors for each image. Then, when I want to compare an image to images stored in the database, I would need to loop over the 48 vectors of the image from I am comparing, against 48 vectors for each image in my database (i.e., $val += abs($image_to_compare
1 .. 48 - $image_from_db
1 .. 48). Obviously that is not an efficient way of doing this. I thought about just summing all the values for the vectors for each image, and storing that value in the database; However, the issue is that it's not the sum total of vectors from image A - the sum total of vectors from image B. Rather, it's the absolute value difference of each corresponding vectors in the two images.
Wow, so a long road to my question: What is the best way, using Perl, to take an image and find
similar images in a database given a threshold. I'd like to store some sort of value in the database, calculate the value from the image to be compared, and then search for any value in the database that matches within a certain threshold.
P.S., Sorry if I was incoherent. My eyes are trying closing on me as I type this. Must get sleep! :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.