You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not an authoritative answer, but you can save your hash value as separate columns :
// Golang :
// DigitalAssetSrc data dbmodel (ex. a raw image)
type DigitalAssetSrc struct {
gorm.Model
AverageHash uint64
DifferenceHash uint64
PerceptionHash uint64
...
// compute thumbnail hashes for similarity indexing
averageHash, _ := goimagehash.AverageHash(thumbnail)
differenceHash, _ := goimagehash.DifferenceHash(thumbnail)
perceptionHash, _ := goimagehash.PerceptionHash(thumbnail)
asset.AverageHash = averageHash.GetHash()
asset.DifferenceHash = differenceHash.GetHash()
asset.PerceptionHash = perceptionHash.GetHash()
// DB :
CREATE TABLE digital_asset_srcs
(
id bigint NOT NULL DEFAULT nextval('digital_asset_srcs_id_seq'::regclass),
average_hash bigint,
difference_hash bigint,
perception_hash bigint,
...
Then you can either reload those image hashes for comparison, on you can try and use K-nearest neighbour search with Hamming distance if you backend database supports it.
After I get an image hashed:
I get
My problem is how to save
hash1
in database, so that later on I can retrive it and compare its distance with newly computedhash2
using:distance, _ := hash1.Distance(hash2)
The text was updated successfully, but these errors were encountered: