Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Comparing images to find similar images in a database

by jonadab (Parson)
on Dec 03, 2014 at 11:11 UTC ( #1109100=note: print w/replies, xml ) Need Help??


in reply to Comparing images to find similar images in a database

If you only have 48 images to compare against, or 480 for that matter, you could indeed just loop through them all, calculating a total-difference statistic, sort them by that, and take the one with the lowest total difference.

The problem arises when you have more like 48 million images in your database, at which point looping through all of them becomes prohibitive.

The solution I can think of is going to be more SQL than Perl, though you could use Perl to build the SQL you want. The idea would be to develop a query that looks for images with some of their statistics being very similar to the ones for the current image. Since you can set up the database to pre-emptively index these fields, you can thus avoid the need to do all the difference calculations for every image in the database every time.

  • Comment on Re: Comparing images to find similar images in a database

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1109100]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-12-06 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?