问题
I'm trying to compare one dog image with a bucket full of dog images and get their similarity, does anybody have some clue to do that?
回答1:
You could try out Vision API's ProductSearch: https://cloud.google.com/vision/product-search/docs/
You build a ProductSet of Products. You add reference images to each Product. Later, you send a query image in and it will return the most visually similar results in your ProductSet.
回答2:
You can use my Ruby gem that implementes two perceptual image hashing to calculate the image similarity.
require "dhash-vips"
hash0 = DHashVips::IDHash.fingerprint "dog.jpg"
hash1 = DHashVips::IDHash.fingerprint "dog1.jpg"
hash2 = DHashVips::IDHash.fingerprint "dog2.jpg"
puts "dog1 is this much different: #{DHashVips::IDHash.distance hash0, hash1}"
puts "dog2 is this much different: #{DHashVips::IDHash.distance hash0, hash2}"
来源:https://stackoverflow.com/questions/58401906/is-it-possible-to-compare-an-image-with-a-list-of-images-google-cloud-vision