E7: Calibration

Calibrate your camera to correct for lens distortion.

Objective

Write code to capture a series of frames with a checkerboard, find the corners in all “good” frames, run the OpenCV camera calibration, print the main calibration parameters, then use the calibration parameters to undistort a live camera feed.

There is calibration sample code in the OpenCV distribution and this Python OpenCV tutorial is very helpful for this exercise. NOTE: there are some differences between OpenCV 3.x used in the tutorial and OpenCV 2.x: for example in OpenCV 2.x cv2.cornerSubPix alters the corner array passed in as a parameter and doesn’t return anything.

Steps

corners

corners

objective 1 output

Optional Experiments

Submit

Follow the submission instructions on the course information page. Include your code and at least one frame capture from each objective that clearly shows everything was working. In your solution notes, write about any problems you ran into, and the main resource(s) you used (blog posts, online tutorials, stackoverflow posts, papers, textbooks, etc.). These resources should include brief descriptions of what the resource is and how it helped you. The writeup can be short, bullet points are recommended.

You must combine your code, screen captures, and notes together into a single PDF. The best way to do this is by doing everything in a single Jupyter notebook using markdown cells for your notes and inline images for your output. Then just export as PDF.