Camera Calibration Visualizer
Run the Camera Calibration Visualizer Fullscreen
Edit the Camera Calibration Visualizer with the p5.js editor
About This MicroSim
This visualization demonstrates camera calibration - the process of determining camera intrinsic parameters (focal length, principal point, distortion coefficients) needed for accurate computer vision and autonomous systems.
Embedding
You can embed this MicroSim in your website using:
1 2 | |
Features
- Distortion Simulation: Adjust k1 and k2 to see barrel (k1 < 0) and pincushion (k1 > 0) distortion
- Side-by-Side Comparison: Distorted image on left, ideal/corrected image on right
- Corner Detection: See detected checkerboard corners as green markers
- Reprojection Error: After calibration, red vectors show residual errors
- Interactive Calibration: Click "Calibrate" to compute and store distortion parameters
Key Concepts
Camera Matrix (Intrinsics)
The intrinsic calibration matrix K relates 3D points to 2D image pixels:
Where: - \(f_x, f_y\) are focal lengths in pixels - \(c_x, c_y\) is the principal point (image center)
Radial Distortion
Real camera lenses introduce radial distortion, modeled as:
Where: - k1 < 0: Barrel distortion (lines curve outward) - k1 > 0: Pincushion distortion (lines curve inward) - k2: Higher-order distortion correction
Checkerboard Calibration
The standard calibration process: 1. Capture images of a checkerboard pattern at various poses 2. Detect corner points in each image 3. Solve for camera parameters that minimize reprojection error 4. Use calibrated parameters to undistort new images
Lesson Plan
Learning Objectives
- Understand the camera intrinsic matrix and its parameters
- Recognize barrel and pincushion distortion effects
- Apply the calibration process to correct lens distortion
Activities
- Explore Distortion: Move k1 slider to see barrel vs pincushion distortion
- Calibrate: Apply some distortion, click Calibrate, then observe the corrected view
- Reprojection Error: Toggle "Show Errors" to see calibration accuracy
- Focal Length Effect: Adjust focal length to see how it affects distortion appearance
Assessment Questions
- What type of distortion does a negative k1 value produce?
- Why is a checkerboard pattern commonly used for calibration?
- How does reprojection error measure calibration quality?
References
- OpenCV Camera Calibration Tutorial
- Zhang's Camera Calibration Method
- Chapter 15: Autonomous Systems and Sensor Fusion