Skip to content

maccman/dhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dhash

Dhash's (or difference hashes) are a way of calculating similarity between images. If two images have a similar dhash, then the likelihood is that they both are depicting the same image (albeit slightly cropped compressed etc).

For more information, check out the links below.

Installation

gem 'dhash'

Usage

hash1 = Dhash.calculate('face-high.jpg')
hash2 = Dhash.calculate('face-low.jpg')

if Dhash.hamming(hash1, hash2) < 10
  puts "Images are very similar"
else
  puts "No match"
end

About

Compare image similarity with a dhash

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages