示例#1
0
// HammingDistanceForHashes returns a Hamming Distance between two images' DCT pHashes.
func HammingDistanceForHashes(hasha uint64, hashb uint64) (int, error) {
	d, err := C.ph_hamming_distance(C.ulong64(hasha), C.ulong64(hashb))

	return int(d), err
}
示例#2
0
文件: phash.go 项目: dahernan/phash
// for benchmarks
func hammingDistanceC(h1, h2 uint64) int {
	return int(C.ph_hamming_distance(C.ulong64(h1), C.ulong64(h2)))
}