Camera Model Visualizer
Run the Camera Model Visualizer Fullscreen
Edit the Camera Model Visualizer with the p5.js editor
About This MicroSim
This MicroSim demonstrates the pinhole camera model and how intrinsic parameters affect 3D-to-2D projection. See the relationship between focal length, principal point, and the projected image.
How to Use
- Adjust Focal Length: Change the "zoom" - higher = narrower FOV
- Move Principal Point: Shift the image center (Cx, Cy)
- Camera Distance: Move the camera closer or farther
- Show Projection Rays: Visualize rays from 3D points to camera
- Show Frustum: See the camera's viewing volume
- Drag to Rotate: Change the 3D view angle
Key Concepts
Camera Intrinsic Matrix K:
Perspective projection formula: \(\(u = f_x \cdot \frac{X}{Z} + c_x, \quad v = f_y \cdot \frac{Y}{Z} + c_y\)\)
| Parameter | Meaning | Typical Range |
|---|---|---|
| f_x, f_y | Focal length (pixels) | 200-2000 |
| c_x | Principal point x | image_width/2 |
| c_y | Principal point y | image_height/2 |
Learning Objectives
Students will be able to: - Understand intrinsic and extrinsic camera parameters - Apply the projection matrix to transform 3D points - Relate focal length to field of view - Visualize how camera position affects the image
Lesson Plan
Introduction (5 minutes)
The pinhole camera model is fundamental to computer vision. All 3D rays pass through a single point (the optical center).
Exploration (10 minutes)
- Start with default focal length - note the projected points
- Increase focal length - objects appear larger (zoom in)
- Move the principal point - image shifts
- Toggle projection rays to see the geometry
Key Insight
Depth information is lost in projection: all points along a ray project to the same 2D location.