(img1: I, img2: I)
| 101 | * ``` |
| 102 | */ |
| 103 | export function distance<I extends JimpClass>(img1: I, img2: I) { |
| 104 | const phash = new ImagePHash(); |
| 105 | const hash1 = phash.getHash(img1); |
| 106 | const hash2 = phash.getHash(img2); |
| 107 | |
| 108 | return phash.distance(hash1, hash2); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Calculates the hamming distance of two images based on their perceptual hash |
no test coverage detected
searching dependent graphs…