Exercises

  1. Use Figure 11-2 to derive the equations x = fx · (X/Z) + cx and y – fy · (Y/Z) + cy using similar triangles with a center-position offset.

  2. Will errors in estimating the true center location (cx, cy) affect the estimation of other parameters such as focus?

    Hint: See the q = MQ equation.
  3. Draw an image of a square:

    1. Under radial distortion.

    2. Under tangential distortion.

    3. Under both distortions.

  4. Refer to Figure 11-13. For perspective views, explain the following.

    1. Where does the "line at infinity" come from?

    2. Why do parallel lines on the object plane converge to a point on the image plane?

    3. Assume that the object and image planes are perpendicular to one another. On the object plane, starting at a point p1, move 10 units directly away from the image plane to p2. What is the corresponding movement distance on the image plane?

  5. Figure 11-3 shows the outward-bulging "barrel distortion" effect of radial distortion, which is especially evident in the left panel of Figure 11-12. Could some lenses generate an inward-bending effect? How would this be possible?

  6. Using a cheap web camera or cell phone, create examples of radial and tangential distortion in images of concentric squares or chessboards.

  7. Calibrate the camera in exercise 6. Display the pictures before and after undistortion.

  8. Experiment with numerical stability and noise by collecting many images of chessboards and doing a "good" calibration on all of them. Then see how the calibration parameters change as you reduce the number of chessboard images. Graph your results: camera parameters as a function of number of chessboard images.

  9. With reference to exercise 8, how do calibration parameters change when you use (say) 10 images of a 3-by-5, a 4-by-6, and a 5-by-7 chessboard? Graph the results.

  10. High-end cameras typically have systems of lens that correct physically for distortions in the image. What might happen if you nevertheless use a multiterm distortion model for such a camera?

    Hint: This condition is known as overfitting.
  11. Three-dimensional joystick trick. Calibrate a camera. Using video, wave a chessboard around and use cvFindExtrinsicCameraParams2() as a 3D joystick. Remember that cvFindExtrinsicCameraParams2() outputs rotation as a 3-by-1 or 1-by-3 vector axis of rotation, where the magnitude of the vector represents the counterclockwise angle of rotation along with a 3D translation vector.