title: Census transform in python openCV
body: <p>I am starting to work with openCV and python in a project related with stereovision. I found this page of documentation about the Census Transform in C++ with openCV.
  <a href="http://docs.opencv.org/3.1.0/d2/d7f/namespacecv_1_1stereo.html#a939dfbb1a0d1a3255749629343247bd5" rel="nofollow">link</a></p>
  
  <p>Does anyone know if there are similar functions for python implementation? </p>
  
  <p>(e.g. cv2.nameofthefunction)</p>
  
  <p>Thank you all!  </p>
  
  <p>EDIT: the excellent solution of PM 2Ring (thank you again) can work with openCV with this little change: instead of using Image.open </p>
  
  <pre><code>img = cv2.imread(img.png)
  #some minor changes I needed like select some ROI and store them in img2[j] 
  #then a for cycle in which I wrote
  src_img = img2[j] 
  h, w = src_img.shape
  </code></pre>
  
  <p>where the "shape" instruction seems to switch the order of w and h compared to "size" command. Then I paste the rest of the code of PM 2Ring and it worked wonderfully</p>