title: Undistorting/rectify images with OpenCV
body: <p>I took the example of code for calibrating a camera and undistorting images from this book: <a href="http://shop.oreilly.com/product/9780596516130.do" rel="nofollow noreferrer">shop.oreilly.com/product/9780596516130.do</a></p>
  
  <p>As far as I understood the usual camera calibration methods of OpenCV work perfectly for "normal" cameras.
  When it comes to Fisheye-Lenses though we have to use a vector of 8 calibration parameters instead of 5 and also the flag <code>CV_CALIB_RATIONAL_MODEL</code> in the method <code>cvCalibrateCamera2</code>.
  At least, that's what it says in the <a href="http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=cvcalibrate#double%20cvCalibrateCamera2%28const%20CvMat*%20object_points,%20const%20CvMat*%20image_points,%20const%20CvMat*%20point_counts,%20CvSize%20image_size,%20CvMat*%20camera_matrix,%20CvMat*%20distortion_coeffs,%20CvMat*%20rotation_vectors,%20CvMat*%20translation_vectors,%20int%20flags,%20CvTermCriteria%20term_crit%29" rel="nofollow noreferrer">OpenCV documentary</a></p>
  
  <p>So, when I use this on an array of images like this (<a href="https://sites.google.com/site/scarabotix/_/rsrc/1323887262350/ocamcalib-toolbox/image015.jpg" rel="nofollow noreferrer">Sample images from OCamCalib</a>) I get the following results using <code>cvInitUndistortMap</code>: <a href="http://abload.de/img/rastere4u2w.jpg" rel="nofollow noreferrer">abload.de/img/rastere4u2w.jpg</a></p>
  
  <p>Since the resulting images are cut out of the whole undistorted image, I went ahead and used <code>cvInitUndistortRectifyMap</code> (like it's described here <a href="https://stackoverflow.com/questions/8837478/opencv-cvremap-cropping-image">stackoverflow.com/questions/8837478/opencv-cvremap-cropping-image</a>). So I got the following results: <a href="http://abload.de/img/rasterxisps.jpg" rel="nofollow noreferrer">abload.de/img/rasterxisps.jpg</a></p>
  
  <p>And now my question is: Why is not the whole image undistorted? In some pics of my later results you can recognize that the laptop for example is still totally distorted. How can I acomplish even better results using the standard OpenCV methods?</p>
  
  <p>I'm new to stackoverflow and I'm new to OpenCV as well, so please excuse any of my shortcomings when it comes to expressing my problems.</p>