title: What is m1type parameter in OpenCV's UndistortRectifyMap()
body: <p>I am trying to use OpenCV's <code>initUndistortRectifyMap()</code> function to create a map that undistorts a fish-eye image, as outlined in <a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_calib3d/py_calibration/py_calibration.html" rel="nofollow noreferrer">this tutorial</a></p>
  
  <p>The tutorial has this line of code:</p>
  
  <pre><code>mapx,mapy = cv2.initUndistortRectifyMap(mtx,dist,None,newcameramtx,(w,h),5)
  </code></pre>
  
  <p>But when my script reaches that line, the following error is thrown:</p>
  
  <blockquote>
    <p>OpenCV errror: Assertion failed (m1type == CV_16SC2 || m1type ==
    CV_32FC1 || m1type == CV32FC2) in initUndistortedRectifyMap, file
    /hdd/buildbot/slave_jetson_tx_3/35-04T-L4T-R24/opencv/modules/imgproc/src/undistort.cpp</p>
  </blockquote>
  
  <p>The source of the error appears to be the '5' in the last argument, which, according to the <a href="http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#initundistortrectifymap" rel="nofollow noreferrer">documentation</a>, is the "<strong>m1type</strong> – Type of the first output map that can be CV_32FC1 or CV_16SC2." What do these different types mean, and how do I know what the correct value is for my program?</p>
  
  <p>(Note: I am aware of the cv2.undistort() function, but it does not work for my purposes.)</p>