Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-12-03 09:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found