How it works

The camera calibration procedures for both fisheye and pinhole cameras are basically the same, so it's strongly recommended to go through the Pinhole camera model calibration recipe, because all the main steps and recommendations from the pinhole camera case are applicable for the fisheye camera too.

Let's review the key difference. To calibrate the fisheye model camera, you need to use the cv2.fisheye.calibrate function. It accepts the same arguments as cv2.calibrateCamera, but this function supports only its own values for flags. Fortunately, this argument has a default value.

As a result of executing this code, you will see an image similar to the following:

Get OpenCV 3 Computer Vision with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.