title: How to import cv.StereoRectify() in newer versions of OpenCV-Python
body: <p>I am currently setting up a code to get 3d points from 2d points from stero camera setup with two cameras (do comment my code if it is wrong, but that is not the matter of the question) in my computer. I want to import cv.StereoRectify in order to get the projection matrices, but I get the error that this function cannot be found in the package.</p>
  
  <p>I am thinking that I may be using the wrong package. I have downloaded both the normal, and the contrib version of opencv 4.1. I run Python 3.7 64-bit</p>
  
  <p>The link to the function that I am trying to import: <a href="https://docs.opencv.org/4.1.0/d9/d0c/group__calib3d.html#ga617b1685d4059c6040827800e72ad2b6" rel="nofollow noreferrer">https://docs.opencv.org/4.1.0/d9/d0c/group__calib3d.html#ga617b1685d4059c6040827800e72ad2b6</a></p>
  
  <p>There are examples where cv is exchanged with cv2, I have tried that too:
  <a href="https://www.programcreek.com/python/example/89312/cv2.stereoRectify" rel="nofollow noreferrer">https://www.programcreek.com/python/example/89312/cv2.stereoRectify</a></p>
  
  <pre><code>import cv2
  
  
  left_cam = [
      [523.767345904798, 0.0, 268.20033902081417],
      [0.0, 550.2332063123357, 232.55503628081783],
      [0.0, 0.0, 1.0]
  ]
  
  left_dist = [0.18999914119422034, -1.1006674853253424, -0.0037412308565715193, 0.023153597402935818, 1.7303232709773213]
  
  right_cam = [
      [538.1299316757662, 0.0, 349.4715067576933],
      [0.0, 544.3638349123668, 240.18753969060498],
      [0.0, 0.0, 1.0]
  ]
  
  right_dist = [0.12126236480318829, -0.14032072749598928, -0.006271304663061128, 0.01641265601395131, -0.02049471257256062]
  
  tx = 286.07359237108625
  
  proj = cv2.StereoRectify(
      left_cam,
      right_cam,
      left_dist,
      right_dist,
      (1920, 1080)
  )
  </code></pre>
  
  <p>The package should in theory include this function, but I get the error that the attribute doesn't exist:</p>
  
  <pre><code>File ".\get_projection_matrix.py", line 23, in &lt;module&gt;
      proj = cv.StereoRectify(
  AttributeError: module 'cv2.cv2' has no attribute 'StereoRectify'
  </code></pre>
  
  <p>I have discretely tried these imports:</p>
  
  <pre><code>import cv2
  import cv2 as cv (this should definitely not work)
  from cv2 import cv
  </code></pre>