title: How to fix "TypeError: function takes exactly 2 arguments (3 given)" in cv2.calibrateCamera method
body: <p>I have a problem with the code below. After compilation, the message "ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera (objectpoints, framepoints, fsize, None, None) appears
  TypeError: function takes exactly 2 arguments (3 given) ". I want the image to be taken in real time from my webcam</p>
  
  <pre><code>import numpy as np
  import cv2
  
  
  objp = np.zeros((9 * 6, 3), np.float32)
  objp[:, :2] = np.mgrid[0:6, 0:9].T.reshape(-1, 2)
  size = (9, 6)
  
  objectpoints = []
  framepoints = []
  
  cv2.namedWindow("video preview")
  vc = cv2.VideoCapture(0)
  
  fourcc = cv2.VideoWriter_fourcc(*'XVID')
  out = cv2.VideoWriter('output.avi', fourcc, 20.0, (1080, 720))
  
  if vc.isOpened():
      rval, frame = vc.read()
  else:
  rval = False
  
  while rval:
      cv2.imshow("preview", frame)
      rval, frame = vc.read()
      ret, corners = cv2.findChessboardCorners(frame, size, None)
      cv2.drawChessboardCorners(frame, (9, 6), corners, ret)
      print(ret)
      print(frame.shape[::-1])
      fsize = frame.shape[::-1]
  
      if ret == True:
          criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
      objectpoints.append(objp)
      corners2 = cv2.cornerSubPix(frame, corners, (11, 11), (-1, -1), criteria)
      framepoints.append(corners2)
  
  ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objectpoints, framepoints, fsize, None, None)
  print('ret:', ret)
  print('mtx:', mtx)
  print('dist:', dist)
  print('rvecs:', rvecs)
  print('tvecs:', tvecs)
  
  out.write(frame)
  
  key = cv2.waitKey(20)
  if key == 27:
      break
  
  vc.release()
  out.release()
  cv2.destroyWindow("preview")`
  </code></pre>