Image hashing with OpenCV and Python