Safe Haskell | None |
---|---|
Language | Haskell2010 |
- hammingDistance :: PHash -> PHash -> Int
- imagesSimilar :: FilePath -> FilePath -> Int -> IO (Maybe Bool)
- module Data.PHash.Image
- module Data.PHash.Types
Documentation
hammingDistance :: PHash -> PHash -> Int Source
Calculate the distance between two hashes. This can be used to detect how similar two images are.
>>>
import Data.PHash
>>>
hammingDistance (PHash 15243782418149777067) (PHash 17549625427362946731)
2
>>>
hammingDistance (PHash 15243782418149777067) (PHash 15243782418149777067)
0
:: FilePath | |
-> FilePath | |
-> Int | Threshold for similarity. If the hamming distance exceeds this number, it will return False. 15 seems to be a reasonable default. |
-> IO (Maybe Bool) |
Determine if two images are similar by a user-defined threshold
module Data.PHash.Image
module Data.PHash.Types