title: Stereo Camera calibration using different camera types
body: <p>I'm trying to perform stereo camera calibration, rectification and disparity map generation. It's working fine with normal sample data. However, I'm trying to use the dual cameras on an iPhone 7+, which have different zoom. The telephoto lens has 2X zoom compared to the wide angle camera. I ran the images through the algorithm, and it is succeeding, although with a high error rate. However, when I open up the rectified images, they have a weird spherical look to the edges. The center looks fine. I'm assuming this is due to the cameras having different zoom levels. Is there anything special I need to do to deal with this? Or do I just need to crop any output to the usable undistorted area? Here is what I'm seeing:</p>
  <p><a href="https://i.stack.imgur.com/PnWfY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PnWfY.jpg" alt="Distorted rectified image" /></a></p>
  <h3>EDIT:</h3>
  <p>I tried using the calibration result from these checkerboard images to rectify an image of some objects, and the rectification was way off, not even close. If I rectify one of my checkerboard images, they are spot on. Any ideas why that happens?</p>
  <h3>EDIT2:</h3>
  <p>These are what my input images look like that result in the spherical looking output image. They are both taken from the exact same position, the iPhone was mounted to a tripod and I used a bluetooth device to trigger the shutter so the image wouldn't get shaken, my code automatically takes one image with each lens. I took 19 such images from different angles, all images show the full checkerboard. The more zoomed in image is the one that rectified to the top spherical looking image.
  <a href="https://i.stack.imgur.com/5uVyu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5uVyu.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/88lzW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/88lzW.jpg" alt="enter image description here" /></a></p>
  <h3>EDIT3:</h3>
  <p>Here is the disparity map using the calibration I got.</p>
  <p><a href="https://i.stack.imgur.com/fqHJb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fqHJb.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/tX1hO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tX1hO.jpg" alt="enter image description here" /></a></p>