Camera Calibration
Camera Calibration
(ME-4201)
Camera Calibration
Phung Thanh Huy
Department of Mechatronics
Ho Chi Minh City University of Technology
Vietnam National University Ho Chi Minh City
Ver2024.1
- Distance/ Position
- Distortion
Camera Calibration|2
Camera Calibration
Where to pick and place?
Camera Calibration|3
Camera Model
Pin hole model
• Camera obscura
Small hole in the wall of a dark room projects the outside world top-down
Camera Calibration|4
Camera Model
Pin hole model
• Light is envisioned as entering from the scene or a distant object
• A single ray enters the pinhole from any particular point in that scene
• The point is “projected” onto an imaging surface (image plane).
• For the idealized pinhole camera, the distance from the pinhole aperture to
the screen is precisely the focal length
𝑋
𝑥 = −𝑓 ∙
𝑍
𝑓: focal length.
Z: distance from the camera to the object.
X: object’s height.
Camera Calibration|5
Camera Model
Projection
• Swap the pinhole and the image plane.
• The point in the pinhole is reinterpreted as the center of projection.
• The point at the intersection of the image plane and the optical axis is
referred to as the principal point
• For a point 𝑄 𝑋, 𝑌, 𝑍 , the projected point on the image plane 𝑞(𝑥,
Ԧ 𝑦, 𝑓)
𝑋
𝑥 = −𝑓 ∙
𝑍
Camera Calibration|6
Camera Model
Projection
• If the projection axis is not identical to the imaging axis, 𝑐𝑥 and 𝑐𝑦 are used to
model a possible displacement (away from the optic axis) of the center of
coordinates on the projection screen.
• The projection of the real-world point 𝑄 𝑋, 𝑌, 𝑍 on the image screen is
𝑥𝑠𝑐𝑟𝑒𝑒𝑛 , 𝑦𝑠𝑐𝑟𝑒𝑒𝑛
𝑐𝑥 , 𝑐𝑦
Camera Calibration|7
Camera Model
Projection
• 𝑓 is focal length. In real world, 𝑓 is measured by mm, cm,…, denoted by F.
• In image, the points distance are pixels.
• The scale of 𝑥 direction and 𝑦 direction might be different. We use a notation:
𝑓𝑥 = 𝐹 ∙ 𝑠𝑥 , 𝑓𝑦 = 𝐹 ∙ 𝑠𝑦
𝑠𝑥 : pixel/mm by 𝑥 direction
𝑠𝑦 : pixel/mm by 𝑦 direction
𝑐𝑥 , 𝑐𝑦
Camera Calibration|8
Camera Model
Projective Geometry
• The points 𝑄𝑖 𝑋𝑖 , 𝑌𝑖 , 𝑍𝑖 are snapped to the image, represented by 𝑞Ԧ𝑖 𝑥, 𝑦 on
the image.
𝑋 𝑌
𝑥 = 𝑓𝑥 − 𝑓𝑥 cot 𝜃 + 𝑐𝑥
𝑍 𝑍
𝑓𝑦 𝑌
𝑦= + 𝑐𝑦
𝑠𝑖𝑛𝜃 𝑍
Camera Calibration|9
Camera Model
Projective Geometry
• To consider skewness
𝑓𝑥 𝑠 𝑐𝑥
𝑀→𝐾= 0 𝑓𝑦∗ 𝑐𝑦
0 0 1
𝑓𝑦
𝑓𝑦∗ =
sin 𝜃
Camera Calibration|10
Camera Model
Rotation and Translation of Cameras
𝑞Ԧ = 𝑀𝑄
𝑀=𝐾 𝑅𝑡
Camera Calibration|11
Camera Model
Rotation and Translation of Cameras
Camera Calibration|12
2D Calibration
2D camera calibration
Camera Calibration|13
2D Calibration
2D camera calibration
Multi plane
3D calibration tool
Camera Calibration|14
2D Calibration
Calculate K
Camera Calibration|15
2D Calibration
Calculate K
Camera Calibration|16
2D Calibration
2D camera calibration
Camera Calibration|17
2D Calibration
2D camera calibration
Get (x, y) in Image, what is X, Y in real world?
Camera Calibration|18
Distortion and undistortion
Lens distortion (Radial Distortion)
Camera Calibration|19
Distortion and undistortion
Tangential Distortion
Camera Calibration|20