rivo / duplo

Detect duplicate (or similar) images. Written in Go.
http://rentafounder.com/find-similar-images-with-duplo/
MIT License
392 stars 23 forks source link

Is sthere a way to retrieve the hash for an ID from a store? #3

Closed mohangk closed 4 years ago

mohangk commented 4 years ago

Hello, apologies if this is not the best way to reach out, was just wondering if there is a suggested way to retrieve a Hash that had been added to a Store.

The use case is for comparing images in 2 separate directories. I hope to create a store of all images in dir1 as store1 and images in dir2 as store2. The stores are then compared by iterating over all the IDs of one store1 , retrieving the Hash for an ID and Querying it against store2. And then doing it the other way around. Hope this makes sense. Any input is greatly appreciated.

rivo commented 4 years ago

Currently, there isn't such a function. The hashes are not saved directly in the store, at least not in one piece. Each part of the hash determines the search path in the tree. I suppose one could re-engineer the hash from that search path but it would be difficult.

I would suggest that when you generate the stores, you also save the hashes in a separate map for later.

mohangk commented 4 years ago

Thanks, for the information and useful suggestion.