title: Using OpenCV's Image Hashing Module from Python
body: <p>I want to use OpenCV's <a href="https://docs.opencv.org/3.4/d4/d93/group__img__hash.html" rel="noreferrer">perceptual hashing functions</a> from Python. </p>
  
  <p>This isn't working. </p>
  
  <pre><code>import cv2
  a_1 = cv2.imread('a.jpg')
  cv2.img_hash_BlockMeanHash.compute(a_1)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>TypeError: descriptor 'compute' requires a 'cv2.img_hash_ImgHashBase' object but received a 'numpy.ndarray'
  </code></pre>
  
  <p>And this is failing too</p>
  
  <pre><code>a_1_base = cv2.img_hash_ImgHashBase(a_1) 
  cv2.img_hash_BlockMeanHash.compute(a_1_base)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>TypeError: Incorrect type of self (must be 'img_hash_ImgHashBase' or its derivative)
  </code></pre>
  
  <p>Colab notebook showing this:</p>
  
  <p><a href="https://colab.research.google.com/drive/1x5ZxMBD3wFts2WKS4ip3rp4afDx0lGhi" rel="noreferrer">https://colab.research.google.com/drive/1x5ZxMBD3wFts2WKS4ip3rp4afDx0lGhi</a></p>