title: python cv2.calibrateCamera throws error: objectPoints should contain vector of vectors of points of type Point3f
body: <p>I have the code </p>
  
  <pre><code>img = cv2.imread("poolPictures\chessboard3.jpg", cv2.IMREAD_COLOR)
  chessboardImage = cv2.imread("poolPictures\chessboardActual.jpg", cv2.IMREAD_COLOR)
  
  ret, corners = cv2.findChessboardCorners(img, (9,6), None)
  cv2.drawChessboardCorners(img, (9,6), corners, ret)
  
  chessRet, chessCorners = cv2.findChessboardCorners(chessboardImage, (9,6), None)
  ret, matrix, dist, rvecs, tvecs = cv2.calibrateCamera(corners, chessCorners, chessboardImage.shape[::-1][1:3], None, None)`
  </code></pre>
  
  <p>Running the code throws the error: </p>
  
  <p><code>ret, matrix, dist, rvecs, tvecs = cv2.calibrateCamera(corners, chessCorners, chessboardImage.shape[::-1][1:3], None, None)
  cv2.error: C:\projects\opencv-python\opencv\modules\calib3d\src\calibration.cpp:3110: error: (-210) objectPoints should contain vector of vectors of points of type Point3f in function cv::collectCalibrationData</code></p>
  
  <p>chessboard3.jpg:</p>
  
  <p><a href="https://i.stack.imgur.com/XXitT.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/XXitT.jpg" alt="chessboard3.jpg"></a></p>
  
  <p>chessboardActual.jpg:</p>
  
  <p><a href="https://i.stack.imgur.com/Fs7Nh.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Fs7Nh.jpg" alt="chessboardActual.jpg"></a></p>
  
  <p>results of draw chessboard:</p>
  
  <p><a href="https://i.stack.imgur.com/5NJJG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5NJJG.png" alt="results of draw chessboard"></a></p>
  
  <p>I have tried converting the objectpoints to a 3 dimensional vector instead of 2 by by introducing a dummy 3rd dimension - I could not find the python version for Point3f(). </p>
  
  <p>I also saw from here <a href="https://github.com/opencv/opencv/issues/6002" rel="noreferrer">https://github.com/opencv/opencv/issues/6002</a> that sometimes the error might be misleading, and that the real problem is that one of the vectors inside imagePoints is empty - I have tried printing the vectors and none are empty.</p>
  
  <p>Hopefully someone can help, might just be a case of taking more pictures...</p>
  
  <p>Cheers,</p>